summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* byteswap: make use of glibc specific bytswap primitivesLennart Poettering2009-05-202-0/+20
| | | | | | glibc knows three bswap_{16|32|64}() calls that internally make use of a gcc extension to implement faster byteswapping. We should make use of it if we can.
* atomic: implement atomic operations based on gcc's __sync extensionLennart Poettering2009-05-204-60/+30
| | | | | | | | | | | Newer gccs and intel ccs support a __sync extension for making use of atomic operations. This patch replaces the handcrafted x86 atomic operation support with usage of __sync. __sync is supported by more processors and by more compilers than the old assembler code. Also, this extension has been available on gcc for quite a while now for x86, so replacing the old assembler code should only be a loss when very old compiilers are used.
* git: enable whitespace checking commit hook during in autogen.shLennart Poettering2009-05-201-0/+6
| | | | | | Trailing whitespace sucks. This change modifies autogen.sh to activate the example pre-commit that ships with git. It will make sure that from then on no further commits with trailing whitespace can be made
* memset: replace memset() by _DBUS_ZERO where applicableLennart Poettering2009-05-205-9/+9
|
* auth: add fd passing negotiation supportLennart Poettering2009-05-206-31/+170
| | | | | | | | | | | | | | | | This adds two new directives to the auth protocol: NEGOTIATE_UNIX_FD is sent by the client after the authentication was sucessful, i.e. OK was received. AGREE_UNIX_FD is then sent by the server if it can do unix fd passing as well. ERROR is returned when the server cannot or is unwilling to do unix fd passing. This should be compatible with existing D-Bus implementations which will naturally return ERROR on NEGOTIATE_UNIX_FD.
* cloexec: set all sockets that are created with SOCK_CLOEXECLennart Poettering2009-05-206-17/+59
| | | | | | Since all socket users enable FD_CLOEXEC anyway we can just do that in _dbus_open_socket() and be done with it for all cases. By side effect this allows us to use SOCK_CLOEXEC and hence close the CLOEXEC race.
* cloexec: make use of pipe2(O_CLOEXEC) when availableLennart Poettering2009-05-202-5/+31
| | | | This should fix another CLOEXEC race.
* build-system: define _GNU_SOURCE centrallyLennart Poettering2009-05-203-2/+2
| | | | | Instead of having everyone define _GNU_SOURCE and similar macros seperately, simply do so centrally by using AC_USE_SYSTEM_EXTENSIONS
* cloexec: set FD_CLOEXEC for all full duplex pipesLennart Poettering2009-05-204-12/+26
| | | | | | | All users of full duplex pipes enable FD_CLOEXEC later anyway so let's just do it as part of _dbus_full_duplex_pipe. By side effect this allows to make use of SOCK_CLOEXEC which fixes a race when forking/execing from a different thread at the same time as we ar in this function.
* unix-fd: add test for passing unix fdsLennart Poettering2009-05-203-1/+164
| | | | | This adds a full test for passing multiple fds across a D-Bus connection.
* unix-fd: when sending a message with unix fds verify that the connection can ↵Lennart Poettering2009-05-201-7/+69
| | | | | | | | do it Not all of the send function flavours allow returning proper error codes. For the cases where this is not easily possible the client should call dbus_connection_can_send_type() first.
* unix-fd: introduce dbus_connection_can_send_type()Lennart Poettering2009-05-202-2/+50
| | | | | | | | This is just a wrapper around _dbus_transport_can_pass_unix_fd() however it is more generic. The reason for keeping this generic is to ease later addition of more types without having to add a new API for that.
* unix-fd: add message encoding/decoding for unix fdsLennart Poettering2009-05-209-43/+680
| | | | | | | | | | | | | | | | | | When appending unix fds to the message a new entry in the fd array will be allocated and the index to it will be written to the message payload. When parsing unix fds from the message the index will be read from the payload and then looked up in the fd array. When we read fds we put them in a queue first. Since each message knows how many fds are attached to it we will then pop enough fds from this queue each time we decode a message from the stream. This should make sending and receiving more portable since we don't make any strong requirements on the exact semantics of the SCM_RIGHTS implementation: as long as fds are recieved in order, none or lost and the arrive at the same time as at least one byte from the actual message dat we should be able to handle them correctly.
* unix-fd: add basic marshalling code for unix fdsLennart Poettering2009-05-206-2/+25
| | | | | This is actually pretty boring since we store our fds as indexes that are stored as uint32_t's.
* unix-fd: introduce basic protocol definitionsLennart Poettering2009-05-201-1/+22
| | | | | | | | | We introduce a new type code for the unix fds. The data stored in unix fd fields will be an integer index into the array of fds that are attached to a specific message. We also introduce a new header field that stores how many fds belong to the message. And finally we introduce a new error for messages where the payload and the meta data (i.e. unix fds read for it) don't match up.
* sysdeps-unix: add basic IO primitives for unix fd passingLennart Poettering2009-05-203-1/+268
| | | | | | | | | | | | This introduces three new functions: _dbus_read_socket_with_unix_fds _dbus_write_socket_with_unix_fds _dbus_read_socket_with_unix_fds_two These work exactly like their counterpart sans 'with_unix_fds' except that they also send/recieve file descriptors along with the actual payload data.
* sysdeps-unix: introduce _dbus_socket_can_pass_unix_fd()Lennart Poettering2009-05-202-0/+34
| | | | | | This function can be used to check if a socket can be used to pass file descriptors. On platforms that don't support this at all this is hardcoded to return FALSE.
* sysdeps-unix: introduce _dbus_dup()Lennart Poettering2009-05-202-1/+45
| | | | | | | This is a simple wrapper around dup()-like functionality. Also handles CLOEXEC and makes sure we don't interfere with the standard I/O file descriptors 0, 1 and 2.
* sysdeps-unix: if MSG_NOSIGNAL is available don't touch SIGPIPE by defaultLennart Poettering2009-05-152-0/+7
| | | | If we can use MSG_NOSIGNAL we don't have to play games with SIGPIPE
* sysdeps-unix: Use MSG_NOSIGNAL when availableLennart Poettering2009-05-151-0/+61
| | | | | | | | | On Linux send()/sendmsg() know the special flag MSG_NOSIGNAL which if set makes sure that no SIGPIPE signal is raised when we write to a socket that has been disconnected. By using this flag we don't have to play games with SIGPIPE which is pretty ugly stuff since it touches the global process context.
* memory: remove semicolons from macrosLennart Poettering2009-05-151-2/+2
| | | | | Due to some unknown reasons the dbus_new() macros had a semicolon at the end which makes it impossible to use them in some situations.
* build-system: get rid of config.h inclusion checksLennart Poettering2009-05-155-20/+0
| | | | | | | | | These header files include config.h explicitly anyway. These checks are hence pointless. Of course one could argue that including config.h from header files sucks, but D-Bus generally seems not to have a problem with that, so let's unify this.
* Merge branch 'dbus-1.2'Thiago Macieira2009-05-131-3/+14
|\
| * configure.in: fail abstract socket test gracefully when cross-compilingMarc Mutz2009-05-131-2/+10
| | | | | | | | | | | | | | | | * configure.in: only run AC_CACHE_CHECK if enable_abstract_sockets=auto * configure.in: warn that, when cross-compiling, we're unable to detect abstract sockets availability automatically Signed-off-by: Thiago Macieira <thiago@kde.org>
| * configure.in: not all gccs support -Wno-pointer-signMarc Mutz2009-05-131-1/+4
| | | | | | | | Signed-off-by: Thiago Macieira <thiago@kde.org>
* | Merge branch 'dbus-1.2'Thiago Macieira2009-05-131-1/+1
|\| | | | | | | | | Conflicts: dbus/dbus-sysdeps-util-unix.c
| * Release 1.2.14Colin Walters2009-05-061-1/+1
| |
| * libselinux behavior in permissive mode wrt invalid domainsEamon Walsh2009-05-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stephen Smalley wrote: > On Tue, 2009-04-21 at 16:32 -0400, Joshua Brindle wrote: > >> Stephen Smalley wrote: >> >>> On Thu, 2009-04-16 at 20:47 -0400, Eamon Walsh wrote: >>> >>>> Stephen Smalley wrote: >>>> >> <snip> >> >> >>> No, I don't want to change the behavior upon context_to_sid calls in >>> general, as we otherwise lose all context validity checking in >>> permissive mode. >>> >>> I think I'd rather change compute_sid behavior to preclude the situation >>> from arising in the first place, possibly altering the behavior in >>> permissive mode upon an invalid context to fall back on the ssid >>> (process) or the tsid (object). But I'm not entirely convinced any >>> change is required here. >>> >>> >> I just want to follow up to make sure we are all on the same page here. Was the >> suggestion to change avc_has_perm in libselinux or context_to_sid in the kernel >> or leave the code as is and fix the callers of avc_has_perm to correctly handle >> error codes? >> >> I prefer the last approach because of Eamon's explanation, EINVAL is already >> passed in errno to specify the context was invalid (and if object managers >> aren't handling that correctly now there is a good chance they aren't handling >> the ENOMEM case either). >> > > I'd be inclined to change compute_sid (not context_to_sid) in the kernel > to prevent invalid contexts from being formed even in permissive mode > (scenario is a type transition where role is not authorized for the new > type). That was originally to allow the system to boot in permissive > mode. But an alternative would be to just stay in the caller's context > (ssid) in that situation. > > Changing the callers of avc_has_perm() to handle EINVAL and/or ENOMEM > may make sense, but that logic should not depend on enforcing vs. > permissive mode. > > FWIW, the following patch to D-Bus should help: bfo21072 - Log SELinux denials better by checking errno for the cause Note that this does not fully address the bug report since EINVAL can still be returned in permissive mode. However the log messages will now reflect the proper cause of the denial. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Colin Walters <walters@verbum.org>
| * bfo20738 - Return a useful error message from dbus_signature_validate()Federico Mena Quintero2009-05-061-3/+9
| | | | | | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
| * bfo20738 - Translate DBusValidity into error messageFederico Mena Quintero2009-05-062-0/+73
| | | | | | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
| * Bug 19567 - Make marshaling code usable without DBusConnectionWilliam Lachance2009-05-067-21/+90
| | | | | | | | | | | | | | | | | | | | Some projects want to reuse the DBus message format, without actually going through a DBusConnection. This set of changes makes a few functions from DBusMessage public, and adds a new function to determine the number of bytes needed to demarshal a message. Signed-off-by: Colin Walters <walters@verbum.org>
| * Followup Bug 19502 - Don't attempt to init va_list, not portableColin Walters2009-05-061-1/+1
| |
| * Bug 19502 - Sparse warning cleanupsKjartan Maraas2009-05-0611-13/+14
| | | | | | | | | | | | | | This patch makes various things that should be static static, corrects some "return FALSE" where it should be NULL, etc. Signed-off-by: Colin Walters <walters@verbum.org>
| * dbus-launch: use InputOnly X windowEamon Walsh2009-05-061-3/+3
| | | | | | | | | | | | | | | | | | | | Working on SELinux policy for X, and came across this issue in dbus-launch: Windows created for use as property/selection placeholders should be of class InputOnly, since no drawing is ever done to them. Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov> Signed-off-by: Thiago Macieira <thiago@kde.org>
| * Bug 20494 - Fix signed confusion for dbus_message_get_reply_serial returnJohan Gyllenspetz2009-05-061-2/+2
| | | | | | | | | | | | | | We were incorrectly converting the serial to a signed integer and comparing it to -1. Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 20137 - Fix alignment usage when demarshaling basicsColin Walters2009-05-061-12/+28
| | | | | | | | | | | | | | | | | | | | | | We can't safely type-pun from e.g. char * to DBusBasicValue *, because the latter has higher alignment requirements. Instead, create an explicit pointer for each case. Also, we mark each one volatile to sidestep strict aliasing issues, for the future when we turn on strict aliasing support. Original patch and review from Jay Estabrook <jay.estabrook@hp.com>.
| * Always append closing quote in log commandColin Walters2009-05-061-6/+5
| | | | | | | | Patch suggested by Tomas Hoger <thoger@redhat.com>
| * Bug 17803 - Fix both test case and validation logicColin Walters2009-05-062-7/+8
| | | | | | | | | | | | | | | | | | | | | | The previous commit had errors in both the test case and the validation logic. The test case was missing a trailing comma before the previous one, so we weren't testing the signature we thought we were. The validation logic was wrong because if the type was not valid, we'd drop through the entire if clause, and thus skip returning an error code, and accept the signature.
* | Merge branch 'dbus-1.2'Thiago Macieira2009-04-284-25/+23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bus/bus.c bus/config-parser-common.c bus/config-parser-common.h bus/config-parser.c bus/connection.c bus/dbus-daemon.1.in dbus/dbus-marshal-validate-util.c dbus/dbus-marshal-validate.c dbus/dbus-sysdeps-util-unix.c test/name-test/tmp-session-like-system.conf
| * configure.in: fix help string alignmentMarc Mutz2009-04-281-1/+1
| | | | | | | | | | | | | | * AC_ARG_ENABLE(libaudit: use AS_HELP_STRING for aligned help messages Signed-off-by: Thiago Macieira <thiago@kde.org> (cherry picked from commit 660073925b03cad2f6e95ba9f25a81c2d9727185)
| * Fix typo in docs.Xan Lopez2009-02-021-1/+1
| |
| * Bump for unstable cycleColin Walters2009-01-061-1/+1
| |
| * Release 1.2.12.dbus-1.2.12Colin Walters2009-01-061-1/+1
| |
| * Add Scott to HACKINGColin Walters2009-01-061-2/+1
| |
| * Bug 17060: Explicitly hard fail if expat is not availableColin Walters2009-01-061-11/+8
| | | | | | | | * configure.in: Tweak libxml/expat detection and handling.
| * Bug 17969: Don't test for abstract sockets if explicitly disabledLionel Landwerlin2009-01-061-0/+2
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 18064 - more efficient validation for fixed-size type arraysJon Gosting2009-01-061-11/+60
| | | | | | | | | | | | | | * dbus/dbus-marshal-validate.c: If an array is fixed size, skip validation Signed-off-by: Colin Walters <walters@verbum.org>
| * Initialize AVC earlier so we can look up service security contextsJames Carter2009-01-061-5/+5
| | | | | | | | | | | | | | * bus/bus.c: Initialize AVC earlier: http://lists.freedesktop.org/archives/dbus/2008-October/010493.html Signed-off-by: Colin Walters <walters@verbum.org>
| * Print serial in dbus-monitorMichael Meeks2009-01-061-1/+2
| | | | | | | | | | | | * tools/dbus-print-message.c: Print serial too. Signed-off-by: Colin Walters <walters@verbum.org>
| * [win32] Protect usage of SIGHUP with #ifdefTor Lillqvist2009-01-062-9/+16
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>