summaryrefslogtreecommitdiff
path: root/bus/selinux.c
Commit message (Collapse)AuthorAgeFilesLines
* bus/selinux: Move vsnprintf call to avoid va_list reuseJeremi Piotrowski2023-01-091-3/+2
| | | | | | | | | | | | | | | In log_callback() the same va_list is reused for a call to vsnprintf and vsyslog. A va_list can't be reused in this manner, such use is undefined behavior that changes depending on glibc version. In current glibc versions a segfault can be observed from the callsite at bus/selinux.c:412. When trying to log a non-auditable event, the segfault happens in strlen inside vsyslog. Moving the call to vsnprintf closer to audit_log_user_avc_message (which is followed by a 'goto out') avoids the reuse and segfault. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
* Add SPDX license marker for the AFL-2.1 OR GPL-2.0-or-later licenseRalf Habacker2023-01-041-0/+2
| | | | | | | | | The full license texts are not added because they were already added in a previous commit. Signed-off-by: Ralf Habacker <ralf.habacker@freenet.de> see #394
* bus/selinux: Fix audit message types.Chris PeBenito2020-11-231-3/+27
| | | | | | | | | | | | | The SELinux log callback includes a message type. Not all messages are auditable and those that are have varying audit types. An audit message is a security-relevant event: security state changes, MAC permission denied, etc. A message that is auditable is not necessarily sensitive. Messages that are not auditable are not security-relevant, like messages about socket polling errors. Update the auditing accordingly. If the message is not auditable, fall through and write it to syslog. Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
* Stop using selinux_set_mapping() functionLaurent Bigonville2019-10-221-33/+42
| | | | | | | | | | | | | | | | | Currently, if the "dbus" security class or the associated AV doesn't exist, dbus-daemon fails to initialize and exits immediately. Also the security classes or access vector cannot be reordered in the policy. This can be a problem for people developing their own policy or trying to access a machine where, for some reasons, there is not policy defined at all. The code here copy the behaviour of the selinux_check_access() function. We cannot use this function here as it doesn't allow us to define the AVC entry reference. See the discussion at https://marc.info/?l=selinux&m=152163374332372&w=2 Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/198
* trivial: Remove trailing whitespace from copyright noticesSimon McVittie2018-12-171-2/+2
| | | | | | | | | | | | | | 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>
* Use SELINUX_CB_POLICYLOAD instead of AVC_CALLBACK_RESET callbackLaurent Bigonville2018-11-151-16/+4
| | | | | | | | | | Use SELINUX_CB_POLICYLOAD instead of AVC_CALLBACK_RESET callback as this only seems necessary on policy reload and not if the enforcing mode is changing. See discussion at https://marc.info/?l=selinux&m=152173501930182&w=2 https://gitlab.freedesktop.org/dbus/dbus/issues/134
* Stop using avc_init() which is deprecatedLaurent Bigonville2018-11-151-111/+108
| | | | | | | | Stop using avc_init() and use avc_open() instead. With this commit dbus-daemon will stop using a thread to monitor the avc netlink and will poll it instead. https://gitlab.freedesktop.org/dbus/dbus/issues/134
* Return the dbus-daemon SELinux context when asking about org.freedesktop.DBusLaurent Bigonville2017-06-121-0/+13
| | | | | | | | | | | | | | | | | | | Currently when asked the SELinux context of the owner of org.freedesktop.DBus, the dbus-daemon is returning an error. In the same situation when asked about the Unix user or the PID, the daemon would return its own user or pid. Do the same for the SELinux context by returning the daemon one. In particular this avoids an issue seen with systemd --user, where dbus-daemon responds to UpdateActivationEnvironment() by passing on the new environment to systemd with o.fd.systemd1.Manager.SetEnvironment(), but systemd cannot get the caller's SELinux context and so rejects the SetEnvironment() call. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101315 [smcv: Extend commit message to describe the symptom this fixes] Reviewed-by: Simon McVittie <smcv@collabora.com>
* Remove unnecessary cast, bus_sid is already of type security_id_tLaurent Bigonville2017-05-311-1/+1
| | | | Reviewed-by: Simon McVittie <smcv@collabora.com>
* Remove calls to sidget/sidputLaurent Bigonville2017-05-311-52/+1
| | | | | | | | | sidget and sidput functions are noop and deprecated since libselinux 2.0.86. Also use pkg-config to detect libselinux and force version >= 2.0.86 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100912 Reviewed-by: Simon McVittie <smcv@collabora.com>
* Do not auto-activate services if we could not send a messageSimon McVittie2016-11-281-1/+7
| | | | | | | | | | | | | | | | | | | | | | We specifically do not check recipient policies, because the recipient policy is based on properties of the recipient process (in particular, its uid), which we do not necessarily know until we have already started it. In this initial implementation we do not check LSMs either, because we cannot know what LSM context the recipient process is going to have. However, LSM support will need to be added to make this feature useful, because StartServiceByName is normally allowed in non-LSM environments, and is more powerful than auto-activation anyway. The StartServiceByName method does not go through this check, because if access to that method has been granted, then it's somewhat obvious that you can start arbitrary services. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98666
* Add missing format attributes suggested by -Wsuggest-attribute=formatSimon McVittie2016-10-131-1/+1
| | | | Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Remove trailing newlines from _dbus_warn, _dbus_warn_check_failedSimon McVittie2016-09-301-8/+8
| | | | | | | They used to be needed, but are not needed any more, and we were never completely consistent about including them in any case. Signed-off-by: Simon McVittie <smcv@debian.org>
* Avoid -Wunused-label when compiling with libselinux but no libauditSimon McVittie2015-12-021-0/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* bus: move shared libaudit code to a new audit.[ch]Simon McVittie2015-08-061-118/+18
| | | | | | | | | | | | | | | | | | | | | | This fixes various duplicated libaudit interactions in both SELinux and AppArmor code paths, including opening two audit sockets if both SELinux and AppArmor were enabled at compile time. In particular, audit.c is now the only user of libcap-ng. This commit is not intended to introduce any functional changes, except for the de-duplication. The actual audit_log_user_avc_message() call is still duplicated, because the SELinux and AppArmor code paths use different mechanisms to compose the audit message: the SELinux path uses a statically-sized buffer on the stack which might be subject to truncation, whereas the AppArmor path uses malloc() (via DBusString) and falls back to using syslog on a memory allocation failure. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225 Reviewed-by: Colin Walters <walters@verbum.org> [smcv: minor issues raised during review are subsequently fixed] Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* selinux: avoid leaking on systems where va_start allocates memorySimon McVittie2015-01-061-1/+3
| | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88087
* selinux: Use selinux_set_mapping() to avoid hardcoded constants for policyosmond sun2013-11-071-3/+27
| | | | | | | | | | | | | | | Previous to the introduction of selinux_set_mapping(), DBus pulled constants generated from the system's policy at build time. But this means it's impossible to replace the system policy without rebuilding userspace components. This patch maps from arbitrary class/perm indices used by D-Bus and the policy values and handles all the translation at runtime on avc_has_perm() calls. Bug: https://bugs.freedesktop.org/attachment.cgi?id=88719 Reviewed-By: Colin Walters <walters@verbum.org> Tested-By: Colin Walters <walters@verbum.org>
* bus/selinux: Fix previous commit for CAP_AUDIT_WRITE retentionColin Walters2013-11-011-1/+7
| | | | | | | | | | | | As soon as capng_clear() is called, we won't appear to have CAP_AUDIT_WRITE. Fix this by checking for it before resetting the libcap state. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49062 Tested-by: Laurent Bigonville <bigon@debian.org> Reviewed-by: Laurent Bigonville <bigon@debian.org> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
* selinux: when dropping capabilities only include AUDIT caps if we have themLennart Poettering2013-09-131-2/+3
| | | | | | | | | | | | | | | | When we drop capabilities we shouldn't assume we can keep CAP_AUDIT_WRITE unconditionally, since it will not be available when running in containers. This patch only adds CAP_AUDIT_WRITE to the list of caps we keep if we actually have it in the first place. This makes audit/selinux enabled D-Bus work in a Linux container. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49062 Acked-by: Thiago Macieira <thiago@kde.org> Acked-by: Colin Walters <walters@verbum.org> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix unused function when SELinux is not enabledSimon McVittie2013-08-301-3/+4
| | | | It must be one of the "only smcv tests this" configurations...
* Cleanup: polish verbose mode checkingChengwei Yang2013-08-231-14/+5
| | | | Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* capng: Drop supplemental groups when switching to daemon userSteve Grubb2011-08-011-1/+1
| | | | | | | | | | This patch ensures the daemon process doesn't inherit any supplemental groups for the root user from an administrator login via an init script. This is only an issue for pre-systemd systems. https://bugzilla.redhat.com/show_bug.cgi?id=726953
* process_config_first_time_only: initialize syslog as intended.Simon McVittie2011-05-251-2/+1
| | | | | | | | | | | | | | On Linux, we previously called openlog() (with different options!) while initializing SELinux; leave SELinux messages as LOG_USER|LOG_INFO in case anyone was relying on that, but let the rest of our log messages come out as LOG_DAEMON. Also enable LOG_PERROR (copy syslog messages to stderr) unconditionally; we can make this an autoconf check if anyone's pet Unix doesn't have LOG_PERROR. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=35358 Reviewed-by: Colin Walters <walters@verbum.org>
* Consistently include <config.h> in all C source files and never in header files.Marcus Brinkmann2010-03-191-0/+2
|
* Merge branch 'dbus-1.2'Colin Walters2010-03-161-4/+4
|\ | | | | | | | | | | Conflicts: bus/bus.c configure.in
| * Fix build when selinux is disabled but libaudit enabledFrederic Crozat2010-03-031-4/+4
| | | | | | | | https://bugs.freedesktop.org/show_bug.cgi?id=26859
| * Fix compilation in --disable-selinux caseColin Walters2010-02-021-32/+3
| | | | | | | | | | | | | | | | | | | | _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.
* | Fix compilation in --disable-selinux caseColin Walters2010-02-031-35/+2
| | | | | | | | | | | | | | | | | | | | _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.
* | _dbus_change_to_daemon_user() is platform related and commit ↵Ralf Habacker2010-01-291-0/+5
|/ | | | 0a3905d7f3b2ff43b09479863775939f9c8acad4 broke windows builds
* Switch to libcap-ng, avoid linking libdbus against libcap[-ng]Colin Walters2010-01-281-5/+113
| | | | | | | | | | | | | | | (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
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-141-1/+1
| | | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
* libselinux behavior in permissive mode wrt invalid domainsEamon Walsh2009-05-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* fix build against the latest gcc/glibcJohn (J5) Palmieri2008-02-211-0/+1
| | | | | | * dbus/dbus-sysdeps-unix.c: define _GNU_SOURCE * bus/selinux.c: include limits.h * Patch by Matthias Clasen <mclasen at redhat.com>
* Fix a problem where a nul byte was wrongly introduced into UUIDs, due to ↵Havoc Pennington2007-10-311-1/+14
| | | | | | | | | | | | | | | | | | _dbus_string_copy_to_buffer weird behavior. 2007-10-31 Havoc Pennington <hp@redhat.com> * bus/selinux.c (log_audit_callback): rewrite to use _dbus_string_copy_to_buffer_with_nul() * dbus/dbus-string.c (_dbus_string_copy_to_buffer): change to NOT nul-terminate the buffer; fail an assertion if there is not enough space in the target buffer. This fixes two bugs where copy_to_buffer was used to copy the binary bytes in a UUID, where nul termination did not make sense. Bug reported by David Castelow. (_dbus_string_copy_to_buffer_with_nul): new function that always nul-terminates the buffer, and fails an assertion if there is not enough space in the buffer.
* audit_init() was not declared in header, causing warnings; fix this and ↵Havoc Pennington2007-10-231-1/+1
| | | | | | | | | | | | namespace it 2007-10-23 Havoc Pennington <hp@redhat.com> * bus/bus.c (bus_context_new): use the new name here * bus/selinux.c (bus_selinux_audit_init): rename from audit_init() to avoid possible libc conflict, and declare it in .h file to avoid a warning
* fd.o bug #12429 Reverse check to setpcap and only init audit if we were rootJohn (J5) Palmieri2007-10-031-6/+2
| | | | | | | | | * patch by Dan Walsh <dwalsh@redhat.com> * https://bugs.freedesktop.org/show_bug.cgi?id=12429 * Reverse we_were_root check to setpcap if we were root. Also only init audit if we were root. So error dbus message will not show up when policy reload happens. dbus -session will no longer try to send audit message, only system will.
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* 2007-06-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-151-0/+2
| | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero) (_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr) (_dbus_strerror_from_errno): family of functions to abstract errno, though these are somewhat bogus (really we should make our socket wrappers not use errno probably - the issue is that any usage of errno that isn't socket-related probably is not cross-platform, so should either be in a unix-only file that can use errno directly, or is a bug - these general errno wrappers hide issues of this nature in non-socket code, while socket-specific API changes would not since sockets are allowed cross-platform)
* 2007-06-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-131-0/+3
| | | | | | | | | | | | | * dbus/dbus-server-socket.c (_dbus_server_listen_socket): support all_interfaces=true|false for tcp servers * dbus/dbus-sysdeps-unix.c (_dbus_listen_tcp_socket): support inaddr_any flag * bus/selinux.c: fix some missing includes * dbus/dbus-server-socket.c (_dbus_server_listen_socket): allow port to simply be omitted in addition to specifying 0
* 2007-06-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-131-2/+52
| | | | | | | | | | | * configure.ac, bus/selinux.c, dbus/dbus-sysdeps-unix-util.c: add libaudit support, no clue what this means really but now we have it. Patches from Fedora package. * bus/bus.c (bus_context_new): move selinux initialization after changing to daemon user, patch from Fedora package * dbus/dbus-transport.c (auth_via_unix_user_function): fix a typo
* These are all patches from Kjartan Maraas <kmaraas at gnome dot org>John (J5) Palmieri2006-08-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | with cleanups of bugs found from Coverity reports: * dbus/dbus-sysdeps-util.c (_dbus_write_pid_file): close the file on error to avoid a leak * bus/expirelist.c (bus_expire_list_test): Check for NULL on dbus_new0 * bus/activation.c (update_directory): remove dead code * bus/config-parser.c (merge_service_context_hash, start_selinux_child): Fix some leaks * bus/bus.c (process_config_every_time): Fixed a leak * bus/desktop-file.c (parse_key_value): Fixed leak * bus/selinux.c (bus_selinux_id_table_insert): Fixed leak
* * s/D-BUS/D-Bus/gJohn (J5) Palmieri2006-08-031-3/+3
|
* 2005-07-16 Colin Walters <walters@verbum.org>Colin Walters2005-07-161-16/+43
| | | | | | | | | | | | | | | | | | | * bus/driver.c (bus_driver_handle_get_connection_selinux_security_context): Renamed from bus_driver_handle_get_connection_unix_security_context. Update for error usage. (message_handlers): Update for renames. * bus/selinux.c (bus_selinux_allows_send): Handle OOM on _dbus_string_init failure correctly. (bus_selinux_append_context): Convert SID to context. Append it as a byte array. (bus_selinux_shutdown): Handle the case where bus_selinux_full_init hasn't been called. * bus/selinux.h: Update prototype. * dbus/dbus-protocol.h (DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN): Renamed from DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN.
* 2005-07-15 Colin Walters <walters@verbum.org>Colin Walters2005-07-151-0/+4
| | | | | * bus/selinux.c (bus_selinux_append_context): Wrap in HAVE_SELINUX.
* 2005-07-14 Colin Walters <walters@verbum.org>Colin Walters2005-07-141-0/+13
| | | | | | | | | | | | | * bus/driver.c (bus_driver_handle_get_connection_unix_security_context): New function. (message_handlers): Add. * bus/selinux.c (bus_selinux_append_context): New function; appends security context to message. * bus/selinux.h: Prototype. * dbus/dbus-protocol.h (DBUS_ERROR_UNIX_SECURITY_CONTEXT_UNKNOWN): New.
* 2005-04-13 David Zeuthen <davidz@redhat.com>David Zeuthen2005-04-131-57/+111
| | | | | | | | | | | | | | | | | | | * bus/selinux.c: Add c-file-style to top of file (log_audit_callback): Don't free the data here anymore (bus_selinux_check): Don't take spid and tpid since appending that to auxdata may OOM. (bus_selinux_allows_acquire_service): Handle OOM and signal back to the caller if we are OOM by taking an error object. (bus_selinux_allows_send): -do- * bus/selinux.h: Fix prototypes for bus_selinux_allows_acquire_service and bus_selinux_allows_send * bus/bus.c (bus_context_check_security_policy): Pass error and pass on OOM thrown by bus_selinux_allows_send() * bus/services.c (bus_registry_acquire_service): Pass error and pass on OOM thrown by bus_selinux_allows_acquire_service()
* 2005-02-07 Colin Walters <walters@verbum.org>Colin Walters2005-02-071-2/+2
| | | | | * bus/selinux.c (bus_selinux_allows_send): Handle NULL for sender or proposed_recipient.
* 2004-11-09 Colin Walters <walters@verbum.org>Colin Walters2004-11-091-9/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-string.c (_dbus_string_get_length): New function, writes DBusString to C buffer. * dbus/dbus-string.h: Prototype it. * dbus/dbus-message.c (dbus_message_type_to_string): New function, converts message type into C string. * dbus/dbus-message.h: Prototype it. * bus/selinux.c (bus_selinux_check): Take source pid, target pid, and audit data. Pass audit data to avc_has_perm. (log_audit_callback): New function, appends extra audit information. (bus_selinux_allows_acquire_service): Also take service name, add it to audit data. (bus_selinux_allows_send): Also take message type, interface, method member, error name, and destination, and add them to audit data. (log_cb): Initialize func_audit. * bus/selinux.h (bus_selinux_allows_acquire_service) (bus_selinux_allows_send): Update prototypes * bus/services.c (bus_registry_acquire_service): Pass service name to bus_selinux_allows_acquire_service. * bus/bus.c (bus_context_check_security_policy): Pass additional audit data. Move assignment of dest to its own line.
* 2004-11-07 Colin Walters <walters@verbum.org>Colin Walters2004-11-071-87/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/bus.c (load_config): Break into three separate functions: process_config_first_time_only, process_config_every_time, and process_config_postinit. (process_config_every_time): Move call of bus_registry_set_service_context_table into process_config_postinit. (process_config_postinit): New function, does any processing that needs to happen late in initialization (and also on reload). (bus_context_new): Instead of calling load_config, open config parser here and call process_config_first_time_only and process_config_every_time directly. Later, after we have forked but before changing UID, invoke bus_selinux_full_init, and then call process_config_postinit. (bus_context_reload_config): As in bus_context_new, load parse file inside here, and call process_config_every_time and process_config_postinit. * bus/services.h, bus/services.c (bus_registry_set_service_context_table): Rename from bus_registry_set_sid_table. Take string hash from config parser, and convert them here into SIDs. * bus/config-parser.c (struct BusConfigParser): Have config parser only store a mapping of service->context string. (merge_service_context_hash): New function. (merge_included): Merge context string hashes instead of using bus_selinux_id_table_union. (bus_config_parser_new): Don't use bus_selinux_id_table_new; simply create a new string hash. (bus_config_parser_unref): Unref it. (start_selinux_child): Simply insert strings into hash, don't call bus_selinux_id_table_copy_over. * bus/selinux.h, bus/selinux.c (bus_selinux_id_table_union) (bus_selinux_id_table_copy_over): Delete.
* *** empty log message ***Colin Walters2004-11-041-1/+1
|