Commit graph

1900 commits

Author SHA1 Message Date
William Lachance
16a947eedb Bug 19567 - Make marshaling code usable without DBusConnection
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>
2009-04-21 13:51:46 -04:00
Colin Walters
ce09b82ec2 Followup Bug 19502 - Don't attempt to init va_list, not portable 2009-04-21 13:11:54 -04:00
Kjartan Maraas
3c89788fa4 Bug 19502 - Sparse warning cleanups
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>
2009-04-21 13:10:10 -04:00
Thiago Macieira
83d7da43c4 Merge branch 'dbus-1.2' 2009-04-21 13:00:50 +02:00
Marc Mutz
11f4aaa77f configure.in: fix help string alignment
* AC_ARG_ENABLE(libaudit: use AS_HELP_STRING for aligned help messages

Signed-off-by: Thiago Macieira <thiago@kde.org>
(cherry picked from commit 660073925b)
2009-04-21 13:00:41 +02:00
Marc Mutz
660073925b configure.in: fix help string alignment
* AC_ARG_ENABLE(libaudit: use AS_HELP_STRING for aligned help messages

Signed-off-by: Thiago Macieira <thiago@kde.org>
2009-04-20 18:22:58 +02:00
Colin Walters
e8f8c1c5a2 Bug 17803 - Fix both test case and validation logic
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.
2009-04-17 13:25:39 -04:00
Eamon Walsh
8f5c3e3c25 dbus-launch: use InputOnly X window
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>
2009-03-20 09:08:37 +01:00
Johan Gyllenspetz
387ccafb4d Bug 20494 - Fix signed confusion for dbus_message_get_reply_serial return
We were incorrectly converting the serial to a signed integer
and comparing it to -1.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-03-17 17:26:03 -04:00
Colin Walters
7de15965c2 Bug 20137 - Fix alignment usage when demarshaling basics
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>.
2009-03-17 16:42:43 -04:00
Colin Walters
3f3a531902 Always append closing quote in log command
Patch suggested by Tomas Hoger <thoger@redhat.com>
2009-03-12 10:31:54 -04:00
Xan Lopez
16e9289ca2 Fix typo in docs. 2009-02-02 15:14:45 -05:00
Colin Walters
510a307da0 Bug 19307: Add missing syslog include 2009-01-06 17:34:20 -05:00
Diego E. 'Flameeyes' Pettenò
597492c39d Fix cross-compiling with autotools.
The AC_CANONICAL_TARGET macro and the $target_os variables are used for the
target of compilers and other code-generation tools, and should not be used
during cross-compile of generic software. Replace them with
AC_CANONICAL_HOST and $host_os instead, as they should have been from the
start.

For a breakdown of what host, build and target machines are, please see
http://blog.flameeyes.eu/s/canonical-target .
2009-01-06 16:54:36 -05:00
Peter Breitenlohner
09222cd920 Avoid possible use of uninitialized variable
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 16:48:39 -05:00
Colin Walters
98495b896d Enable -Werror by default with --enable-maintainer-mode, and change warnings
Important compiler warnings were being lost in the noise from warnings
we know about but aren't problems, and moreover made using -Werror
difficult.  Now we expect *all* developers and testers to be using
-Werror.
2008-12-19 20:03:50 -05:00
Colin Walters
f8d2ef4aca Various compiler warning fixes 2008-12-19 20:03:47 -05:00
Colin Walters
dc77c21374 Clean up and clarify default system policy
The former was too reliant on old bugs and was generally unclear.
This one makes explicit exactly what is allowed and not.
2008-12-18 15:34:24 -05:00
Colin Walters
3af94cf250 Add requested_reply to send denials, and connection loginfo to "would deny"
The requested_reply field is necessary in send denials too because
it's used in the policy language.  The connection loginfo lack in
"would deny" was just an oversight.
2008-12-17 19:29:39 -05:00
Colin Walters
e6bbcbd903 Add uid, pid, and command to security logs
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.
2008-12-17 16:01:28 -05:00
Colin Walters
6053d2208e Add optional logging on allow rules
This lets us have a backwards compatibility allow rule but still easily
see when that rule is being used.
2008-12-16 11:57:27 -05:00
Colin Walters
b45440148a Add message type to security syslog entries
It's part of the security check, we should have it in the log.
2008-12-12 16:58:06 -05:00
Colin Walters
bb2a464067 Add syslog of security denials and configuration file reloads
We need to start logging denials so that they become more easily trackable
and debuggable.
2008-12-12 14:00:16 -05:00
Colin Walters
b4a75abf86 Another manpage update explicitly mentioning bare send_interface
We need to fix all of the bare send_interface rules; see:
https://bugs.freedesktop.org/show_bug.cgi?id=18961
2008-12-09 10:15:49 -05:00
Colin Walters
d29bd96c42 Add at_console docs to manpage, as well as brief <policy> foreward
We need some sort of general advice here.
2008-12-09 09:18:49 -05:00
Colin Walters
e43b917520 Merge branch 'manpage' 2008-12-09 09:17:14 -05:00
Colin Walters
920c3c0292 Bug 18229: Allow signals
Our previous fix went too far towards lockdown; many things rely
on signals to work, and there's no really good reason to restrict
which signals can be emitted on the bus because we can't tie
them to a particular sender.
2008-12-09 09:15:06 -05:00
Colin Walters
7f0990abc7 Bug 18229: Update manpage with better advice
See https://bugs.freedesktop.org/show_bug.cgi?id=18229
2008-12-08 20:25:02 -05:00
Tomas Hoger
70a0ac620a Bug 18229 - Change system.conf to correctly deny non-reply sends by default
The previous rule <allow send_requested_reply="true"/> was actually
applied to all messages, even if they weren't a reply.  This meant
that in fact the default DBus policy was effectively allow, rather
than deny as claimed.

This fix ensures that the above rule only applies to actual reply
messages.
Signed-off-by: Colin Walters <walters@verbum.org>
2008-12-05 11:30:56 -05:00
Colin Walters
4a436c3554 Infrastructure for testing a "system like" bus in test suite
The tmp-session-like-system.conf bus configuration has a security
policy intended to mirror that of the system bus.  This allows
testing policy rules.
2008-12-05 11:30:50 -05:00
Dennis Kaarsemaker
07a4ad4b04 Bug 15393 - support allow_anonymous config variable
* bus/bus.c: Set allow_anonymous if specified from
	parser.
	* bus/config-parser.c: Parse it.
	* bus/config-parser-common.h: Declare it.

Signed-off-by: Colin Walters <walters@verbum.org>
2008-11-12 08:51:00 -05:00
Jon Gosting
e61f13cf32 Bug 18064 - more efficient validation for fixed-size type arrays
* dbus/dbus-marshal-validate.c: If an array is fixed size,
	skip validation

Signed-off-by: Colin Walters <walters@verbum.org>
2008-11-10 23:29:05 -05:00
Matt McCutchen
0314e701c8 Bug 18446: Keep umask for session bus
Signed-off-by: Colin Walters <walters@verbum.org>
2008-11-10 08:55:27 -05:00
Lawrence R. Steeger
14afa0564e Bug 15412: Add --address option to dbus-send
Signed-off-by: Colin Walters <walters@verbum.org>
2008-10-18 14:50:49 -04:00
Lionel Landwerlin
7df72201cf Bug 17969: Don't test for abstract sockets if explicitly disabled
Signed-off-by: Colin Walters <walters@verbum.org>
2008-10-18 14:25:52 -04:00
James Carter
0b17cee84d Initialize AVC earlier so we can look up service security contexts
* bus/bus.c: Initialize AVC earlier:
	http://lists.freedesktop.org/archives/dbus/2008-October/010493.html

Signed-off-by: Colin Walters <walters@verbum.org>
2008-10-01 16:40:33 -04:00
Colin Walters
7b10b46c5c Bug 17803: Panic from dbus_signature_validate
* dbus/dbus-marshal-validate.c: Ensure we validate
	a basic type before calling is_basic on it.
	* dbus-marshal-validate-util.c: Test.
2008-10-01 13:49:48 -04:00
Colin Walters
3683bda27a Add Scott to HACKING 2008-09-23 14:56:41 -04:00
Tor Lillqvist
e2decdf0f1 [win32] Protect usage of SIGHUP with #ifdef
Signed-off-by: Colin Walters <walters@verbum.org>
2008-09-18 19:40:50 -04:00
Tor Lillqvist
99ccfb952a Bug 16755: Ensure we use the correct errno
* 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>
2008-09-18 18:51:01 -04:00
Joe Marcus Clarke
3564e5cbe4 Bug 17061: Handle error return from sysconf correctly
* 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>
2008-09-04 22:13:30 -04:00
Artem Bityutskiy
9680c28358 Bug 17352: synchronize the file before renaming
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>
2008-09-04 21:51:52 -04:00
Michael Meeks
1859c66351 Print serial in dbus-monitor
* tools/dbus-print-message.c: Print serial too.

Signed-off-by: Colin Walters <walters@verbum.org>
2008-08-29 08:48:45 -04:00
Peter McCurdy
2a9b0fbdee Bug 17280: Add a prototype for _dbus_credentials_add_adt_audit_data()
* dbus/dbus-credentials.h: Add a prototype for
	_dbus_credentials_add_adt_audit_data()

Signed-off-by: Colin Walters <walters@verbum.org>
2008-08-25 10:10:00 -04:00
Peter McCurdy
b6c786f312 2008-08-24 Peter McCurdy <pmccurdy@skeptopotamus>
* 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>
2008-08-25 10:00:09 -04:00
Colin Walters
213871d3dd Bug 17060: Explicitly hard fail if expat is not available
* configure.in: Tweak libxml/expat detection and handling.
2008-08-11 16:50:39 -04:00
Jens Granseuer
b8e24d6b9c Bug 13387: Fix compilation failure with AI_ADDRCONFIG
Signed-off-by: Colin Walters <walters@verbum.org>
2008-08-07 14:45:51 -04:00
Colin Walters
4fb1600945 Correctly dist 1.2.3 tarball with docs enabled 2008-08-06 15:58:41 -04:00
Colin Walters
78e3685c41 Bump configure.ac to 1.2.2 2008-08-06 13:21:54 -04:00
Colin Walters
dd6de35b4e Bug 15646: Remove spurious debugging fprintf(stderr 2008-07-28 16:31:09 -04:00