summaryrefslogtreecommitdiffstats
path: root/dbus
Commit message (Collapse)AuthorAgeFilesLines
* 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-202-1/+258
| | | | | | | | | | | | 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-151-0/+4
| | | | 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-04-281-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix typo in docs.Xan Lopez2009-02-021-1/+1
| |
| * 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>
| * Bug 18446: Keep umask for session busMatt McCutchen2009-01-063-6/+14
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
| * Various compiler warning fixesColin Walters2009-01-064-5/+6
| |
| * Add uid, pid, and command to security logsColin Walters2008-12-182-0/+101
| | | | | | | | | | | | | | | | Extend the current security logs with even more relevant information than just the message content. This requires some utility code to look up and cache (as a string) the data such as the uid/pid/command when a connection is authenticated.
| * Add syslog of security denials and configuration file reloadsColin Walters2008-12-123-1/+36
| | | | | | | | | | We need to start logging denials so that they become more easily trackable and debuggable.
| * 2008-08-24 Peter McCurdy <pmccurdy@skeptopotamus>Peter McCurdy2008-10-011-1/+1
| | | | | | | | | | | | | | | | * dbus/dbus-marshal-recursive.c: A stray comma between two string literals caused incorrect output and a compiler warning. Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 17280: Add a prototype for _dbus_credentials_add_adt_audit_data()Peter McCurdy2008-10-011-0/+3
| | | | | | | | | | | | | | * dbus/dbus-credentials.h: Add a prototype for _dbus_credentials_add_adt_audit_data() Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 17803: Panic from dbus_signature_validateColin Walters2008-10-012-0/+2
| | | | | | | | | | | | * dbus/dbus-marshal-validate.c: Ensure we validate a basic type before calling is_basic on it. * dbus-marshal-validate-util.c: Test.
| * Bug 17061: Handle error return from sysconf correctlyJoe Marcus Clarke2008-10-012-2/+10
| | | | | | | | | | | | | | | | | | * dbus/dbus-sysdeps-unix.c: * dbus/dbus-sysdeps-util-unix.c: Cast return from sysconf temporarily so we actually see -1. Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 13387: Fix compilation failure with AI_ADDRCONFIGJens Granseuer2008-10-011-2/+2
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
| * Bug 17352: synchronize the file before renamingArtem Bityutskiy2008-10-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Dbus is doing atomic file updates by copying them, changing the copy, and re-naming them. However, it does not synchronize the file before re-naming, which results in corruption in case of unclean reboots. The reason for this is that file-systems have write-back cache and they postpone writing data to the media. This patch adds the missed fsync() for the Unix part. I do not have windows so cannot provide a windows port fix. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Colin Walters <walters@verbum.org>
* | bfo20738 - Return a useful error message from dbus_signature_validate()Federico Mena Quintero2009-04-211-3/+9
| | | | | | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* | bfo20738 - Translate DBusValidity into error messageFederico Mena Quintero2009-04-212-0/+73
| | | | | | | | Signed-off-by: Federico Mena Quintero <federico@novell.com>
* | Bug 19567 - Make marshaling code usable without DBusConnectionWilliam Lachance2009-04-217-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-04-211-1/+1
| |
* | Bug 19502 - Sparse warning cleanupsKjartan Maraas2009-04-215-7/+8
| | | | | | | | | | | | | | 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>
* | Bug 17803 - Fix both test case and validation logicColin Walters2009-04-172-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.
* | Bug 20494 - Fix signed confusion for dbus_message_get_reply_serial returnJohan Gyllenspetz2009-03-171-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-03-171-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>.
* | Fix typo in docs.Xan Lopez2009-02-021-1/+1
| |
* | Bug 19307: Add missing syslog includeColin Walters2009-01-061-0/+1
| |
* | Various compiler warning fixesColin Walters2008-12-195-6/+7
| |
* | Add uid, pid, and command to security logsColin Walters2008-12-172-0/+101
| | | | | | | | | | | | | | | | Extend the current security logs with even more relevant information than just the message content. This requires some utility code to look up and cache (as a string) the data such as the uid/pid/command when a connection is authenticated.
* | Add syslog of security denials and configuration file reloadsColin Walters2008-12-123-1/+36
| | | | | | | | | | We need to start logging denials so that they become more easily trackable and debuggable.
* | Bug 18064 - more efficient validation for fixed-size type arraysJon Gosting2008-11-101-11/+60
| | | | | | | | | | | | | | * dbus/dbus-marshal-validate.c: If an array is fixed size, skip validation Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 18446: Keep umask for session busMatt McCutchen2008-11-103-6/+14
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 17803: Panic from dbus_signature_validateColin Walters2008-10-012-0/+2
| | | | | | | | | | | | * dbus/dbus-marshal-validate.c: Ensure we validate a basic type before calling is_basic on it. * dbus-marshal-validate-util.c: Test.
* | Bug 16755: Ensure we use the correct errnoTor Lillqvist2008-09-181-11/+17
| | | | | | | | | | | | | | | | * dbus/dbus-sysdeps-unix.c: Save errno across cleanup and use it for errors to ensure we display the right error message. Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 17061: Handle error return from sysconf correctlyJoe Marcus Clarke2008-09-042-2/+10
| | | | | | | | | | | | | | | | | | * dbus/dbus-sysdeps-unix.c: * dbus/dbus-sysdeps-util-unix.c: Cast return from sysconf temporarily so we actually see -1. Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 17352: synchronize the file before renamingArtem Bityutskiy2008-09-041-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Dbus is doing atomic file updates by copying them, changing the copy, and re-naming them. However, it does not synchronize the file before re-naming, which results in corruption in case of unclean reboots. The reason for this is that file-systems have write-back cache and they postpone writing data to the media. This patch adds the missed fsync() for the Unix part. I do not have windows so cannot provide a windows port fix. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 17280: Add a prototype for _dbus_credentials_add_adt_audit_data()Peter McCurdy2008-08-251-0/+3
| | | | | | | | | | | | | | * dbus/dbus-credentials.h: Add a prototype for _dbus_credentials_add_adt_audit_data() Signed-off-by: Colin Walters <walters@verbum.org>
* | 2008-08-24 Peter McCurdy <pmccurdy@skeptopotamus>Peter McCurdy2008-08-251-1/+1
| | | | | | | | | | | | | | | | * dbus/dbus-marshal-recursive.c: A stray comma between two string literals caused incorrect output and a compiler warning. Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 13387: Fix compilation failure with AI_ADDRCONFIGJens Granseuer2008-08-071-2/+2
|/ | | | Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 15646: Remove spurious debugging fprintf(stderrColin Walters2008-07-281-1/+0
|
* Bug 16727: Handle ERANGE for getgr; fixes user in many groupsMarc Brockschmidt2008-07-282-27/+96
| | | | | | | | | | Patch originally from Noèl Köthe. Modified by Colin Walters <walters@verbum.org> * dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-unix-utils.c: Use a while() loop to reallocate buffer if we get ERANGE return. This fixes the case where a user is in a large number of groups.
* When spawning processes, don't ignore the passed in environmentRay Strode2008-07-121-1/+14
| | | | | | | | Previously, we'd always call execv() and unconditionally use the environment of the parent. Now we call execve() with the passed in environment. For compatibility, we detect if the passed in environment is NULL and for that case, use the environment from the parent instead.
* Add new function _dbus_string_split_on_byteRay Strode2008-07-113-0/+70
| | | | | It allows you to turn a string like KEY=VALUE into two strings key and value.