Commit graph

15 commits

Author SHA1 Message Date
Simon McVittie
39ea37b587 trivial: Remove trailing whitespace from copyright notices
We don't usually mass-remove trailing whitespace from the actual source
code because it would complicate cherry-picking bug fixes to older
branches, but that reasoning doesn't really apply to the comments
containing copyright and licensing notices.

Removing trailing whitespace makes it much easier to move code around:
we have a commit hook that rejects commits containing trailing
whitespace, but that commit hook counts moving a file as a delete + add
pair, so it objects to moving code that contains trailing whitespace.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-12-17 11:22:39 +00:00
Simon McVittie
fbc2a447c4 sysdeps: Document what _dbus_credentials_new_from_current_process has
It only has the most important credentials, not the full set.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737
2018-03-02 14:52:18 +00:00
Simon McVittie
de59791882 _dbus_credentials_to_string_append: Remove useless join = FALSE
It can't actually matter in practice, because we never know the
Unix uid and Unix groups but not pid, and we never have a Windows SID
and also a Linux security label; but resetting join to FALSE can only
ever result in us outputting something like "foo=123bar=456" instead
of the intended form with a space in the middle.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737
2018-03-02 14:51:44 +00:00
Simon McVittie
b6648ca655 sysdeps: Get complete group vector from Linux SO_PEERGROUPS if possible
Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737
Reviewed-by: Philip Withnall <withnall@endlessm.com>
2018-03-02 14:51:09 +00:00
Simon McVittie
21eb3317c5 Move defaults for some switches into a default case
This is clearly equivalent, and quiets -Wswitch-default.

Based on part of a patch by Thomas Zimmermann.

Signed-off-by: Simon McVittie <smcv@debian.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
2017-01-17 17:20:53 +00:00
Simon McVittie
96c3bcec77 Add LSM-agnostic support for LinuxSecurityLabel credential
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89041
Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov> (for SELinux)
Acked-by: John Johansen <john.johansen@canonical.com> (for AppArmor)
Acked-by: Casey Schaufler <casey@schaufler-ca.com> (for Smack)
Tested-by: Tyler Hicks <tyhicks@canonical.com>
2015-02-18 10:35:05 +00:00
Ralf Habacker
15b2d2bb25 Rename the term 'unix_pid' to 'pid' in variables and functions.
Windows also has numeric process IDs that fit in an unsigned long, so
there's no reason this has to be Unix-specific.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61787
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-03-08 23:29:22 +01:00
Colin Walters
3861cb42f4 [64 bit printf] Update to use DBUS_PID_FORMAT, print (omitted)
There were already defines for formatting pids and uids, so use those.

In the case where we don't have a format specifier for 64 bit, print
(omitted) in dbus-monitor.
2010-03-22 14:35:28 -04:00
Colin Walters
c93d3ec2ff Add DBUS_INT64_MODIFIER define, turn on -Wformat
https://bugs.freedesktop.org/show_bug.cgi?id=19195

We were previously using -Wno-format because we didn't have
a #define for DBUS_INT64_MODIFIER, which was really lame because
it easily hid problems.

For now, just define it if we're on glibc; this is obviously
not strictly correct but it's safe, because the formatting
is only used in DBUS_VERBOSE mode, and in tools/dbus-monitor.
Ideally we get the the glib code relicensed.
2010-03-22 13:58:56 -04:00
Colin Walters
e48b092849 Add _dbus_credentials_to_string_append
Convert the credentials to a string; useful for logging.
2010-03-16 15:57:27 -04:00
Tobias Mueller
dc33f4f774 Bug 21161 - Update the FSF address
No comment.

Signed-off-by: Colin Walters <walters@verbum.org>
(cherry picked from commit 5baf2f856a)
2009-07-14 15:39:47 -04:00
Colin Walters
ab1eb1fd5a Bug 15740: Solaris/ADT auditing support (simon zheng)
* bus/driver.c: Add GetAdtAuditSessionData method
	which returns audit data for a connection.
	* configure.in: Detect ADT auditing support
	* dbus/dbus-auth.c: Read ADT auditing creds.
	* dbus/dbus-connection.c: Implement
	dbus_connection_get_adt_audit_session_data.
	* dbus/dbus-connection.h: Export it.
	* dbus/dbus-credentials.c: Add support for
	gathering adt_audit_data and retrieving it
	via _dbus_credentials_get_adt_audit_data.
	* dbus/dbus-credentials.h: Add
	DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID.
	* dbus/dbus-protocol.h: New error
	DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN.
	* dbus/dbus-sysdeps.c: Support for reading
	audit credentials via ADT API.
	* dbus/dbus-transport.c: New function
	_dbus_transport_get_adt_audit_session_data
	to retrieve credentials.
	* dbus/dbus-transport.h: Export it.
2008-06-05 17:24:34 -04:00
Havoc Pennington
d012387afe 2007-07-13 Havoc Pennington <hp@redhat.com>
* Add indent-tabs-mode: nil to all file headers.
2007-07-14 02:44:01 +00:00
Havoc Pennington
94125e89b6 2007-06-12 Havoc Pennington <hp@redhat.com>
* dbus/dbus-auth.c (sha1_handle_second_client_response)
	(handle_server_data_anonymous_mech): add the process ID from
	socket credentials, if available, even if not using EXTERNAL

	* dbus/dbus-transport.c (auth_via_default_rules): support
	allow_anonymous flag

	* dbus/dbus-connection.c (dbus_connection_get_is_anonymous)
	(dbus_connection_set_allow_anonymous): new API for controlling
	anonymous access
2007-06-12 18:36:19 +00:00
Havoc Pennington
2383267226 2007-06-09 Havoc Pennington <hp@redhat.com>
* bus/dispatch.c (check_get_connection_unix_process_id): adapt
	since sysdeps-unix.h stuff isn't included anymore

	* bus/bus.c (bus_context_new): use more abstract functions to
	change user, so they can be no-ops on Windows

	* dbus/dbus-credentials.c, dbus/dbus-credentials.h,
	dbus/dbus-credentials-util.c: new files containing a fully opaque
	DBusCredentials data type to replace the old not opaque one.

	* configure.in (DBUS_UNIX): define DBUS_UNIX to match DBUS_WIN on
	windows

	* dbus/dbus-userdb.h: prohibit on Windows, next step is to clean
	up the uses of it in bus/*.c and factor out the parts of
	cookie auth that depend on it
2007-06-09 21:53:20 +00:00