Commit graph

1918 commits

Author SHA1 Message Date
Scott James Remnant
f68efe1e80 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>
(cherry picked from commit 8f1d2a2fa8)
2009-07-14 15:38:25 -04:00
Scott James Remnant
ce326587c3 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>
(cherry picked from commit d672d03206)
2009-07-14 15:38:18 -04:00
Scott James Remnant
e296855e41 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>
(cherry picked from commit d33cfec625)
2009-07-14 15:38:11 -04:00
Scott James Remnant
5de455c0bb Remove 6 hour timeout restriction.
* dbus/dbus-pending-call.c (_dbus_pending_call_new_unlocked): Now that
  the timeout math won't overflow, don't clamp to six hours.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit 7398ad7374)
2009-07-14 15:38:02 -04:00
Scott James Remnant
fc7b4fc9ec Fix issue where timeouts can overflow.
* dbus/dbus-connection.c (_dbus_connection_block_pending_call): Rework
  the timeout math so instead of calculating an end time, which may
  overflow, we instead calculate the elapsed time which is always
  smaller than the boundaries.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit 1faa92114f)
2009-07-14 15:37:53 -04:00
Scott James Remnant
390aa03440 Update documentation now that INT_MAX means no timeout.
* dbus/dbus-connection.c (dbus_connection_send_with_reply): Fix
  documentation now that INT_MAX will not be clamped.
  (dbus_connection_send_with_reply_and_block): Update documentation too.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit ce0d932d9b)
2009-07-14 15:37:44 -04:00
Scott James Remnant
ecea18c7b2 Don't allocate DBusTimeout for pending call when passed INT_MAX
* dbus/dbus-pending-call.c (_dbus_pending_call_new_unlocked): When passed
  INT_MAX, do not clamp the value and do not allocate a timeout for the call
  (_dbus_pending_call_get_timeout_unlocked): Document that this may return
  NULL.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit 92dd55c903)
2009-07-14 15:37:32 -04:00
Scott James Remnant
1617081d91 Allow a pending call to block forever
* dbus/dbus-connection.c (_dbus_connection_block_pending_call): Allow the
  pending call to have no timeout, in which case we simply block until we
  complete, have data or get disconnected.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit e5eb472d11)
2009-07-14 15:36:25 -04:00
Scott James Remnant
dd63302d72 Make sure a pending call timeout isn't assumed.
* dbus/dbus-connection.c (_dbus_connection_attach_pending_call_unlocked):
  Don't assume that the pending call has a timeout.
  (connection_timeout_and_complete_all_pending_call_unlocked): check that
  the timeout was actually added before removing it; this safeguards us
  if the pending call doesn't have a timeout.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
(cherry picked from commit ba22606c3b)
2009-07-14 15:36:03 -04:00
Marc Mutz
6eddb6e122 configure.in: fail abstract socket test gracefully when cross-compiling
* configure.in: only run AC_CACHE_CHECK if enable_abstract_sockets=auto
 * configure.in: warn that, when cross-compiling, we're unable to detect
                 abstract sockets availability automatically

Signed-off-by: Thiago Macieira <thiago@kde.org>
2009-05-13 15:50:52 +02:00
Marc Mutz
f719d45432 configure.in: not all gccs support -Wno-pointer-sign
Signed-off-by: Thiago Macieira <thiago@kde.org>
2009-05-13 15:50:51 +02:00
Colin Walters
f76d17437e Release 1.2.14 2009-05-06 12:51:19 -04:00
Eamon Walsh
b38c433bf7 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-05-06 12:51:19 -04:00
Federico Mena Quintero
73ec6964d7 bfo20738 - Return a useful error message from dbus_signature_validate()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-05-06 12:51:18 -04:00
Federico Mena Quintero
0f19140b52 bfo20738 - Translate DBusValidity into error message
Signed-off-by: Federico Mena Quintero <federico@novell.com>
2009-05-06 12:51:18 -04:00
William Lachance
0cf4583b5a 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-05-06 12:51:18 -04:00
Colin Walters
86df8ad592 Followup Bug 19502 - Don't attempt to init va_list, not portable 2009-05-06 12:51:18 -04:00
Kjartan Maraas
eb3b99e7c6 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-05-06 12:51:18 -04:00
Eamon Walsh
da75989b39 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-05-06 12:51:17 -04:00
Johan Gyllenspetz
5b4ee5fb40 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-05-06 12:51:17 -04:00
Colin Walters
15f5183016 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-05-06 12:51:17 -04:00
Colin Walters
a709566edd Always append closing quote in log command
Patch suggested by Tomas Hoger <thoger@redhat.com>
2009-05-06 12:51:17 -04:00
Colin Walters
b5a1f3c54a 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-05-06 12:51:16 -04:00
Marc Mutz
b2f943e9c0 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-28 14:42:20 +02:00
Xan Lopez
5a3907f28f Fix typo in docs. 2009-02-02 15:15:23 -05:00
Colin Walters
c30270f182 Bump for unstable cycle 2009-01-06 19:36:11 -05:00
Colin Walters
1757a749c3 Release 1.2.12. 2009-01-06 19:35:55 -05:00
Colin Walters
be47457346 Add Scott to HACKING 2009-01-06 18:41:03 -05:00
Colin Walters
2895b793eb Bug 17060: Explicitly hard fail if expat is not available
* configure.in: Tweak libxml/expat detection and handling.
2009-01-06 18:27:27 -05:00
Lionel Landwerlin
1334ecb435 Bug 17969: Don't test for abstract sockets if explicitly disabled
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 18:26:39 -05:00
Jon Gosting
d437d9202e 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>
2009-01-06 18:26:04 -05: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
Michael Meeks
2f561c2fc5 Print serial in dbus-monitor
* tools/dbus-print-message.c: Print serial too.

Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 18:21:58 -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
Lawrence R. Steeger
fc08b432a3 Bug 15412: Add --address option to dbus-send
Signed-off-by: Colin Walters <walters@verbum.org>
2009-01-06 18:20:28 -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
Diego E. 'Flameeyes' Pettenò
9928648f16 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 17:43:42 -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
6413acafef 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.
2009-01-06 17:43:18 -05:00
Colin Walters
4e4f0de8cc Various compiler warning fixes 2009-01-06 17:38:32 -05:00
Colin Walters
eb1ba381f6 Bump for unstable cycle 2008-12-19 15:17:49 -05:00
Colin Walters
427a7be51f Release 1.2.10 2008-12-19 15:17:24 -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
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
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
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
8a80392667 Bump version for unstable cycle 2008-12-09 10:47:25 -05:00