Commit graph

1987 commits

Author SHA1 Message Date
Kimmo Hämäläinen
e28c0ece17 [dbus-spawn] Use correct sign values for variables
read() returns a signed value, whereas the byte count is unsigned.

Signed-off-by: Colin Walters <walters@verbum.org>
2010-03-16 13:55:13 -04:00
Kimmo Hämäläinen
922c6f3285 [dbus] Add missing va_end in dbus-errors.c 2010-03-16 13:50:30 -04:00
Colin Walters
322c116a53 [main] Handle OOM in reload watch
http://bugs.freedesktop.org/show_bug.cgi?id=12953

Wait for memory if we can't init the string.

Based on an original patch by Kimmo Hämäläinen <kimmo.hamalainen@nokia.com>
2010-03-16 13:11:44 -04:00
Simon McVittie
efc63e58da [doc/dbus-specification.xml] Explicitly specify lower-case hex must be used
https://bugs.freedesktop.org/show_bug.cgi?id=9486

When describing DBUS_COOKIE_SHA1, specify that lower-case hex encoding
must be used.
2010-03-16 12:40:08 -04:00
Colin Walters
8586e83a5c Support inotify on older kernels
https://bugs.freedesktop.org/show_bug.cgi?id=23957

Previously we detected glibc support at compile time and used
it unconditionally; better to try it and fall back, this way
we continue to run on older kernels when compiled for newer ones.
2010-03-16 12:21:52 -04:00
Marcus Brinkmann
3c657579a0 Fix double-free in error case.
Signed-off-by: Thiago Macieira <thiago@kde.org>
2010-03-15 17:08:40 +01:00
Colin Walters
f4da942cb4 [configure.in] Use AM_SILENT_RULES if available
By rough consensus, and to keep up with the cool kids.

Note to builders: you need to use V=1 to enable verbose mode.
2010-03-12 17:23:10 -05:00
Michael Meeks
ae95a0ff96 [DBusConnection] When handling a watch, return if another thread is doing I/O
http://lists.freedesktop.org/archives/dbus/2010-March/012337.html

Previously, the watch handler would block until the I/O path was available.
However, if another non-main thread was doing a synchronous call, this would
cause the main thread to block on that thread, a highly undesirable
thing because it's important for the main thread to remain responsive
for user interfaces.

Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Thiago Macieira <thiago@kde.org>
2010-03-12 11:50:27 -05:00
Frederic Crozat
008cd59ef7 Fix build when selinux is disabled but libaudit enabled
https://bugs.freedesktop.org/show_bug.cgi?id=26859
2010-03-03 08:19:35 -05:00
Colin Walters
fbeb13517e [dbus-string] Sync up UNICODE_VALID with glib, add documentation
See https://bugzilla.gnome.org/show_bug.cgi?id=107427 for rationale
behind the first change.

The documentation was derived from an IRC conversation with
Behdad Esfahbod.
2010-02-19 16:34:47 -05:00
Colin Walters
9c90fcd2dc Monitor service directories for changes
It's not expected to have to manually SIGHUP the bus after installing
a new .service file.  Since our directory monitoring is already set
up to queue a full reload which includes service activation, simply
monitor the servicedirs too.

https://bugs.freedesktop.org/show_bug.cgi?id=23846
2010-02-18 15:33:28 -05:00
Brian Cameron
8ca10fd4de Fix dummy file monitoring backend compilation
https://bugs.freedesktop.org/show_bug.cgi?id=26421
2010-02-18 10:38:42 -05:00
Cyril Brulebois
b429488739 Fix compilation of kqueue file monitoring on FreeBSD 2010-02-08 12:21:35 -05:00
Colin Walters
65be3cd5d9 Release 1.2.20 2010-02-03 12:13:38 -05:00
Colin Walters
3dac125d61 Fix compilation in --disable-selinux case
_dbus_change_to_daemon_user moved into selinux.c for the --with-selinux
(and audit) case because that's where all of the relevant libcap headers
were being used.  However in the --disable-selinux case this didn't
compile and wasn't very clean.

If we don't have libaudit, use the legacy direct setgid/setuid bits
we had before in dbus-sysdeps-util-unix.c.
2010-02-02 15:04:58 -05:00
Colin Walters
90fe96b187 Fix inotify shutdown
We were incorrectly passing NULL for a DBusList when the usage expected
is a pointer to a NULL DBusList pointer.  Also during dbus_shutdown
we need to actually close the inotify fd, and remove our watch.

Move the shutdown handler out of bus.c and into inotify where we
can do all of this cleanly.
2010-02-02 15:04:45 -05:00
Colin Walters
a7169e694c Release 1.2.18 2010-02-02 10:31:28 -05:00
Tom Hughes
1c6596eb52 Use monotonic clock for _dbus_get_current_time() if it's available.
_dbus_get_current_time() is used for timeouts, but uses gettimeofday(), which
relies on the wall clock time, which can change. If the time is changed forwards
or backwards, the timeouts are no longer valid, so the monotonic clock must be used.

https://bugs.freedesktop.org/show_bug.cgi?id=25624

Signed-off-by: Colin Walters <walters@verbum.org>
2010-02-02 10:29:03 -05:00
Colin Walters
0607bdb676 Don't crash when reloading if we haven't loaded user database yet
The user database is populated on-demand, but the cache dropping
code assumed it had been initialized.  Simply check for NULL.

https://bugs.freedesktop.org/show_bug.cgi?id=26182
2010-02-01 17:40:17 -05:00
Colin Walters
e59db9df47 Move system-activation.txt into non-conditional EXTRA_DIST
It doesn't depend on the XML doc generation.
2010-02-01 16:45:48 -05:00
Colin Walters
8a9880ffd2 Clean up inotify watch handling
Substantially based on a patch by Matthias Clasen <mclasen@redhat.com>
kqueue implementation by Joe Marcus Clarke <marcus@freebsd.org>

Previously, when we detected a configuration change (which included
the set of config directories to monitor for changes), we would
simply drop all watches, then readd them.

The problem with this is that it introduced a race condition where
we might not be watching one of the config directories for changes.

Rather than dropping and readding, change the OS-dependent monitoring
API to simply take a new set of directories to monitor.  Implicit
in this is that the OS-specific layer needs to keep track of the
previously monitored set.
2010-02-01 16:22:56 -05:00
Colin Walters
0705eb5c86 Update messagebus.in init script to start earlier
Patch from Fedora.
2010-01-28 17:31:36 -05:00
Colin Walters
2691b302aa [doc] diagram.[svg,png] to EXTRA_DIST
These files are part of the docs and should appear in tarballs.
2010-01-28 17:29:27 -05:00
Colin Walters
b93476ce07 Don't drop pending activations when reloading configuration
The reload handling for activation simply dropped all knowledge
of pending activations, which was clearly wrong.  Refactor things
so that reload only reloads directories, server address etc.

Based on a patch originally from Matthias Clasen <mclasen@redhat.com>
2010-01-28 17:01:24 -05:00
Colin Walters
0a3905d7f3 Switch to libcap-ng, avoid linking libdbus against libcap[-ng]
(Commit message written by Colin Walters <walters@verbum.org>)

A current Fedora goal is to convert projects to libcap-ng which
more easily allows dropping Linux capabilities.  For software
which also links to libdbus, it's problematic to link against
libcap as well.

Though really, libdbus should have never linked against libcap
in the first place, which is another thing this patch changes
by moving the libcap-using bits out of dbus/ and into bus/.

https://bugzilla.redhat.com/show_bug.cgi?id=518541
2010-01-28 17:01:24 -05:00
Colin Walters
5b2cf0d031 Add Will Thompson and Simon McVittie to reviewers, add emails to all
The reviewer list was sorely lacking actual email addresses; fix this.
Also add Will and Simon.
2010-01-28 17:01:24 -05:00
Colin Walters
b7e77c6b03 Ignore exit code zero from activated services
A variety of system components have migrated from legacy init into DBus
service activation.  Many of these system components "daemonize", which
involves forking.  The DBus activation system treated an exit as an
activation failure, assuming that the child process which grabbed the
DBus name didn't run first.

While we're in here, also differentiate in this code path between the
servicehelper (system) versus direct activation (session) paths.  In
the session activation path our error message mentioned a helper
process which was confusing, since none was involved.

Based on a patch and debugging research from Ray Strode <rstrode@redhat.com>
2010-01-28 17:01:24 -05:00
Will Thompson
a8e620a0ff Print all-printable-ASCII byte arrays as strings
In practice, ay seems to be used mostly for binary data (in which case,
hex output is fine) or for Unix file paths (because they may be
non-UTF-8) and similar human-readable strings. So let's print the latter
similarly to strings.
2010-01-28 17:01:24 -05:00
Will Thompson
1a33efb54b Print byte arrays as nicely-formatted hex. 2010-01-28 17:01:23 -05:00
Will Thompson
3171383ce9 Add an accessor for the loader's corruption reason 2010-01-28 17:01:23 -05:00
Will Thompson
7cf332d34e Include reason when reporting corrupt messages
It would have been much easier to diagnose fd.o#19723 if the error
message had said more than just "Message is corrupted".
2010-01-28 17:01:23 -05:00
Will Thompson
ce87333cac Forbid zero serial numbers 2010-01-28 17:01:23 -05:00
Will Thompson
7a8fcdee22 Make array-printing code easier to follow
Previously dbus_message_iter_get_arg_type() was called twice: once in
the loop condition to update 'current_type', and once to check if the
loop will run again. This patch moves updating current_type to the end
of the loop body.
2010-01-28 17:01:23 -05:00
James Westby
e2aee8bdeb Correct timeout handling
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>
2010-01-28 17:01:23 -05:00
Hendrik Buschmeier
6067f88afd Bug 23502 - corrected wrong verbose-output 2010-01-28 11:22:32 +01:00
Matthias Clasen
8343c971cd Bug 25697 - Fix memory leak in policy reload
Signed-off-by: Colin Walters <walters@verbum.org>
2009-12-18 14:29:40 -05:00
Sascha Silbe
9b2c196ef3 Bug 23977 - dbus-launch --exit-with-session not killing dbus-daemon on SIGINT
Handle SIGINT in the same way we handle SIGTERM.
2009-10-16 15:20:43 -04:00
Colin Watson
be89ffacc9 Fix link order: system libraries should come after libdbus-convenience
libdbus-convenience may use system libraries, but not the other way
round. Most platforms don't care, but on some platforms this means that
system libraries need to be listed after libdbus-convenience.la on the
link line.
2009-09-18 21:12:39 +02:00
Lennart Poettering
43b1f91865 dbus-monitor: use unbuffered stdout instead of handling SIGINT
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().

(Oh and the old signal handler was broken anyway, the flag should have
been of type sigatomic_t and be marked volatile)

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-31 12:27:48 -04:00
Colin Walters
1116f210aa Bug 22805 - Fix build with -Wl,--as-needed
Explicitly link dbus_convenience.la against DBUS_CLIENT_LIBS
because it uses $THREAD_LIBS, just like the main library does.
2009-07-31 11:03:57 -04:00
Aurelien Jarno
ffa322b80f Bug 19432 followup - Fix Debian/FreeBSD CMSGCRED compilation 2009-07-16 09:35:27 -04:00
Brian Cameron
c6992fc56c Bug 22788 - Fix detection of getpwnam_r on Solaris
Define POSIX_PTHREAD_SEMANTICS earlier so more things use it.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-15 17:35:38 -04:00
Thiago Macieira
bb189fdb75 Update the HACKING file to contain instructions on how we develop with Git 2009-07-14 22:46:20 +02:00
Colin Walters
557968d8d6 Release 1.2.16 2009-07-14 16:11:27 -04:00
Colin Walters
3028841a74 Cope with dbus-launch not being in DBUS_BINDIR
This is a temporary hack for systems which use DBUS_BINDIR=/bin,
but then move dbus-launch back into /usr/bin.  Longer term,
we should explicitly support this in upstream code, or even better
figure out how to move dbus-launch into /bin (e.g. dynamically
load libX11 if available), or have a --with-x11-tools configure
option.
(cherry picked from commit 70c5285eb4)
2009-07-14 15:42:38 -04:00
Hasso Tepper
5abb8aeb5e Bug 19432 - Fix handling of HAVE_CMSGCRED case (FreeBSD)
Fixes dbus on FreeBSD and DragonFly systems.

The patch is obtained from FreeBSD ports tree.

Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 7bf132c7d1)
2009-07-14 15:42:31 -04:00
Daniel Reed
fceaa7a153 Bug 2432 - Support --address option for dbus-monitor
Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit e4b271e242)
2009-07-14 15:42:25 -04:00
Grzegorz Dąbrowski
ddc553326e Bug 19446 - HaikuOS support
Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 97c58ace43)
2009-07-14 15:42:19 -04:00
Paul Bolle
3ee885f217 Bug 16688 - typo in dbus-monitor.1
s/dbus_bus_add_watch/dbus_bus_add_match/

Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 249f89181c)
2009-07-14 15:42:11 -04:00
Colin Walters
a96f2615c7 Bug 22415 - COYPING file should note we allow later versions of GPL
The canonical copyright information in the source file says we
allow later versions of the GPL.  So note that in COPYING too.
(cherry picked from commit f908daed82)
2009-07-14 15:42:05 -04:00