summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* desktop-file: fix stat() raceLennart Poettering2009-10-179-426/+415
| | | | | | | | | | | | | | _dbus_desktop_file_load() used to stat the desktop file before reading it, to verify its size. This is both racy and unnecessary since _dbus_file_get_contents() which it uses stats the file anyway -- does that however in a race-free fashion with fstat() instead of stat(). This patch gets rid of the redundant stat(). Also, since the desktop file change logic requires the mtime of the file it read we now export that in _dbus_file_get_contents(). This patch probably breaks Win32 builds, but afaik those are broken anyway.
* consolekit: cache ckit database fileLennart Poettering2009-10-171-9/+98
| | | | | Speed up ckit database checks a little by keeping the parsed database in memory and mantaining an extra hashtable-based cache.
* desktop-file: implement _dbus_desktop_file_changed()Lennart Poettering2009-10-172-0/+17
| | | | | _dbus_desktop_file_changed() can be used if the file changed since it was read. (by comparing the mtime back then and now)
* check ConsoleKit database for detecting if user is on consoleLennart Poettering2009-10-173-100/+210
| | | | | | | | | In addtion to Solaris style /dev/console permission checking and pam_console style /var/run/console file existance checking add support for checking console status via the ConsoleKit database. This adds very basic support and will read the console database on every single read. These needs optimization.
* desktop-file: implement _dbus_desktop_file_get_section()Lennart Poettering2009-10-172-0/+15
| | | | This allows us to iterate through the sections of a desktop file.
* desktop-file: relax validity checks a bitLennart Poettering2009-10-171-3/+5
| | | | | Mnimally change the validity checks for deskto files so that the ConsoleKit database can pass as valid.
* Enable automake 1.11 silent mode by defaultLennart Poettering2009-10-171-41/+42
| | | | Silent mode yay!
* move desktop file parser from bus/ to dbus/Lennart Poettering2009-10-178-493/+488
| | | | | | We want to make use of it for reading the ConsoleKit database which will need to be implemented in dbus/dbus-userdb-util.c, so let's move this to dbus/.
* dbus-monitor: get rid of SIGINT madnessLennart Poettering2009-10-171-17/+7
| | | | | | | | | | | | | The current SIGINT handling of dbus-monitor ain't making too many people happy since it defers the exit to the next msg received -- which might be quite some time away often enough. This patch replaces the SIGINT handling by simply enabling line-buffered IO for STDOUT so that even if you redirect dbus-monitor into a file no lines get accidently lost and the effect of C-c is still immediate. halfline came up with the great idea to use setvbuf here instead of fflush()ing after each printf().
* Correct timeout handlingJames Westby2009-10-011-8/+6
| | | | | | | | | | | | The timeout handling code subtracts the elapsed time from the timeout each time a message is received, which drastically reduces the timeout in circumstances such as service activation. Correct so that the timeout is never modified, and the elapsed time instead subtracted where necessary. Signed-off-by: James Westby <jw+debian@jameswestby.net> Signed-off-by: Scott James Remnant <scott@ubuntu.com>
* Fix compilation on non-Linux: the F_DUPFD_CLOEXEC check was reversedBenjamin Reed2009-07-291-1/+1
| | | | Signed-off-by: Thiago Macieira <thiago@kde.org>
* missing HAVE_UNIX_FD_PASSING checkBenjamin Reed2009-07-291-0/+4
| | | | Signed-off-by: Thiago Macieira <thiago@kde.org>
* Update D-Bus version number to 1.3.1Thiago Macieira2009-07-291-2/+2
|
* Getting ready for D-Bus 1.3Thiago Macieira2009-07-293-57/+86
|
* Fix the configure-check again: must use b.Thiago Macieira2009-07-251-1/+1
| | | | | Otherwise, when compiling with optimisation, the compiler will detect that b was unused, then use the instructions that i386 supports.
* Long live D-Bus 1.3.x / 1.4.x.Thiago Macieira2009-07-161-4/+4
| | | | | Library Age = 5 / Current = 8 indicates this development series. Revision will increase from 0 after 1.4.0 is released.
* Fix running tests when builddir != srcdir.Thiago Macieira2009-07-161-1/+1
| | | | | This script is not deployed to the builddir, so it cannot be run with relative paths.
* Merge branch 'fd-passing'Thiago Macieira2009-07-1655-354/+2375
|\ | | | | | | | | | | | | Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
| * Fix detection of the GCC __sync intrinsics.Thiago Macieira2009-07-161-1/+1
| | | | | | | | | | | | We have to use the return value, otherwise GCC optimises the code by using instructions that don't return anything. That won't match what we actually use in dbus-sysdeps-unix.c
| * bus: don't forward messages with unix fds on connections that don't support itLennart Poettering2009-05-214-1/+30
| | | | | | | | | | | | This simply verifies that we forward unix fds only on connection that support it. We willr eturn an error if a client attempts to send a message with unix fds to another client that cannot do it.
| * doxygen: document that we don't support reading/writing arrays of unix fds ↵Lennart Poettering2009-05-201-32/+61
| | | | | | | | in once piece right now
| * doc: document Unix FD passing in the specificationLennart Poettering2009-05-201-16/+125
| |
| * bus: make use of new unix fd limitsLennart Poettering2009-05-205-2/+46
| | | | | | | | | | Create configuration settings and enforce message unix fd limits the same way we do for allocated message memory.
| * unix-fd: add logic to count unix fds the same way as allocated memoryLennart Poettering2009-05-2011-107/+353
| | | | | | | | This make all counters count both bytes of memory and unix fds.
| * 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'Colin Walters2009-07-152-7/+100
|\ \ | | | | | | | | | | | | Conflicts: configure.in
| * | Bug 22788 - Fix detection of getpwnam_r on SolarisBrian Cameron2009-07-151-7/+7
| | | | | | | | | | | | | | | | | | Define POSIX_PTHREAD_SEMANTICS earlier so more things use it. Signed-off-by: Colin Walters <walters@verbum.org>
| * | Update the HACKING file to contain instructions on how we develop with GitThiago Macieira2009-07-141-6/+92
| | |
| * | Release 1.2.16Colin Walters2009-07-141-1/+1
| | |