Commit graph

433 commits

Author SHA1 Message Date
Nguyễn Thái Ngọc Duy
366ffe4478 bus/Makefile.am: make dbus-daemon and friends bin_PROGRAMS on Windows
On Linux, dbus-daemon and dbus-daemon-launch-helper are treated specially
because they need permission adjustment.

On Windows, all executables are stubs, created by libtool. The real
executables are in .libs. We need to use libtool to install them
properly. So let's make them bin_PROGRAMS on Windows.
(cherry picked from commit 7fb35992d67433ac3ba82e9e2e786e123323456d)
2009-12-01 08:38:06 +01:00
Marc Mutz
ae776f576a bus/Makefile.am: conditional compilation for W32, use EXEEXT in install hooks (cherry picked from commit 551a9c446b782167aa8b0a74a41a1b7ffb42c6eb) 2009-12-01 08:36:31 +01:00
Marc Mutz
a871d0f42e Makefile.am's: reorder libraries so static libs come first (fixes linking on W32) (cherry picked from commit f88bd88d6b4b318f9401fae595343c8b1bacf654) 2009-12-01 08:36:29 +01:00
Frank Osterfeld
7a4b9293f3 don't leak string list in error case (cherry picked from commit e4f39254976544781f1060c2051b10f32628408e) 2009-11-30 11:09:20 +01:00
Thiago Macieira
37019e9d27 Merge branch 'fd-passing'
Conflicts:
	dbus/dbus-connection.c
	dbus/dbus-message-util.c
	dbus/dbus-sysdeps-unix.c
2009-07-16 16:05:16 +02:00
Matthias Clasen
f4e15893e5 Bug 22516 - Ensure inotify fd is set close on exec
This prevents it leaking into spawned child processes.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-10 20:11:22 -04:00
Tobias Mueller
5baf2f856a Bug 21161 - Update the FSF address
No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-10 19:32:38 -04:00
Scott James Remnant
bd2063e17e Unrestrict session bus timeout.
* bus/session.conf.in: Remove the reply_timeout stanza, previously
  intended to increase the reply timeout, this now reduces it.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-28 11:47:37 +02:00
Scott James Remnant
8f1d2a2fa8 Change default reply timeout.
* bus/config-parser.c (bus_config_parser_new): change the default reply
  timeout to "never"

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-28 11:47:36 +02:00
Scott James Remnant
d672d03206 Expire list timeout may be negative for no expiry.
* bus/expirelist.c (do_expiration_with_current_time): Don't check for
  expiry if expire_after is negative, will just disable the expiry timer
  after the call.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-28 11:47:35 +02:00
Scott James Remnant
d33cfec625 Explicitly check for zero time fields.
* bus/expirelist.c (do_expiration_with_current_time): If the item added
  time fields are both zero, always expire.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2009-05-28 11:47:35 +02:00
Lennart Poettering
89f70b1949 bus: don't forward messages with unix fds on connections that don't support it
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.
2009-05-21 01:21:35 +02:00
Lennart Poettering
64ad844967 bus: make use of new unix fd limits
Create configuration settings and enforce message unix fd limits the
same way we do for allocated message memory.
2009-05-20 02:10:17 +02:00
Lennart Poettering
cbf0874f01 memset: replace memset() by _DBUS_ZERO where applicable 2009-05-20 02:09:31 +02:00
Lennart Poettering
c200e0304d auth: add fd passing negotiation support
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.
2009-05-20 02:09:31 +02:00
Lennart Poettering
18b08180aa build-system: define _GNU_SOURCE centrally
Instead of having everyone define _GNU_SOURCE and similar macros
seperately, simply do so centrally by using AC_USE_SYSTEM_EXTENSIONS
2009-05-20 02:09:31 +02:00
Lennart Poettering
44f3a1465a cloexec: set FD_CLOEXEC for all full duplex pipes
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.
2009-05-20 02:09:31 +02:00
Lennart Poettering
004f01fa45 unix-fd: add test for passing unix fds
This adds a full test for passing multiple fds across a D-Bus
connection.
2009-05-20 02:09:30 +02:00
Thiago Macieira
63196f69c4 Merge branch 'dbus-1.2'
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
2009-04-28 15:16:36 +02:00
Eamon Walsh
705b34f0a6 libselinux behavior in permissive mode wrt invalid domains
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>
2009-04-22 11:18:39 -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
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
James Carter
1f3bcd241e 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>
2009-01-06 18:22:39 -05:00
Tor Lillqvist
1000270072 [win32] Protect usage of SIGHUP with #ifdef
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 18:21:25 -05:00
Matt McCutchen
6663d1dd35 Bug 18446: Keep umask for session bus
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 18:20:13 -05:00
Peter Breitenlohner
eebad8668d Avoid possible use of uninitialized variable
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 17:43:32 -05:00
Colin Walters
4e4f0de8cc Various compiler warning fixes 2009-01-06 17:38:32 -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
f8d2ef4aca Various compiler warning fixes 2008-12-19 20:03:47 -05:00
Colin Walters
788e592b32 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-18 15:39:18 -05:00
Colin Walters
9a1657e8e1 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-18 15:39:04 -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
c224ba1861 Merge commit '3d6abf64d0abb2718e082e120f14f8f923a4af59' into dbus-1.2 2008-12-16 12:29:04 -05:00
Colin Walters
427ff01f9d 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 12:20:43 -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
8cbe86da90 Add message type to security syslog entries
It's part of the security check, we should have it in the log.
2008-12-12 17:07:01 -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
69ed32cbcc 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 15:18:12 -05:00
Colin Walters
3d6abf64d0 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-12 14:50:21 -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
df09db0d42 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:19:16 -05:00
Colin Walters
120604d272 Add at_console docs to manpage, as well as brief <policy> foreward
We need some sort of general advice here.
2008-12-09 10:19:01 -05:00
Colin Walters
d899734475 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 10:17:36 -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