summaryrefslogtreecommitdiffstats
path: root/bus
Commit message (Collapse)AuthorAgeFilesLines
...
* | Bug 18446: Keep umask for session busMatt McCutchen2008-11-107-2/+55
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
* | Initialize AVC earlier so we can look up service security contextsJames Carter2008-10-011-5/+5
| | | | | | | | | | | | | | * bus/bus.c: Initialize AVC earlier: http://lists.freedesktop.org/archives/dbus/2008-October/010493.html Signed-off-by: Colin Walters <walters@verbum.org>
* | [win32] Protect usage of SIGHUP with #ifdefTor Lillqvist2008-09-181-9/+14
|/ | | | Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 16294: Don't lose inotify watch when config fails to parseColin Walters2008-07-281-9/+12
| | | | | | * bus/dir-watch-inotify.c: Always drop the watch in handle_inotify_watch; this ensures we always readd it correctly in bus_drop_all_directory_watches.
* Fix leaks in bus_activation_get_environment error pathsRay Strode2008-07-151-2/+5
| | | | | | | | Commit 91306ef938873fce8f2ae2d4a6b3282d0379c65a introduced two memory leaks on OOM error paths. In one case the environment string array wasn't getting freed, and in the other case it was getting freed with dbus_free instead of dbus_free_string_array.
* Update man page to make the point of the <type> element more clearRay Strode2008-07-121-1/+15
| | | | | | | | There have been a number of patches in the past try to key system versus session bus policy off of the message bus type, when the policy should be distinguished from more fine-grained options in the individulal policy files. Hopefully, this man page update will make that more clear.
* Add new UpdateActivationEnvironment bus messageRay Strode2008-07-122-0/+135
| | | | | | | | It adjusts the environment of activated bus clients. This is important for session managers that get started after the session bus daemon and want to influence the environment of desktop services that are started by the bus.
* Store what environment to activate with on activation objectRay Strode2008-07-122-18/+217
| | | | | | | | We now keep the environment in a hash table member of the activation object and provide a method bus_activation_set_environment_variable to modify the hash table. This hash table is seeded initially with the environment of the bus daemon itself.
* Bug 15740: Solaris/ADT auditing support (simon zheng)Colin Walters2008-06-051-0/+79
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* fix expiration of pending repliesKimmo Hämäläinen2008-04-031-16/+25
| | | | | | | | | | * bus/expirelist.c (do_expiration_with_current_time): calculate correct min wait time and next interval (bus_expire_list_add, bus_expire_list_add_link): if the timeout is disabled when we add an item to the expire list, enable the timeout (do_expiration_with_current_time): only set timeout if there are items to expire
* Merge branch 'master' of git+ssh://johnp@git.freedesktop.org/git/dbus/dbusJohn (J5) Palmieri2008-04-031-3/+3
|\ | | | | | | | | | | Conflicts: ChangeLog
| * Fixes for the inotify configuration file monitor backend.Frederic Crozat2008-04-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-04-01 Timo Hoenig <thoenig@suse.de> Patch from Frederic Crozat <fcrozat@mandriva.com> * bus/dir-watch-inotify.c (bus_watch_directory): Only monitor IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This way, only atomic changes to configuration file are monitored. * bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in _dbus_verbose function call * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use _dbus_strerror instead of perror
* | Make BusExpireList an opaque data typeHavoc Pennington2008-03-043-53/+142
|/ | | | | | | | | | | | 2007-11-08 Havoc Pennington <hp@redhat.com> * bus/connection.c, bus/expirelist.c: Make the BusExpireList struct opaque, adding accessors for manipulating the list. In this commit there should be no change in functionality or behavior. The purpose of this change is to improve encapsulation prior to fixing some bugs Kimmo Hämäläinen found where the timeout is not properly updated, since we need to e.g. take some action whenever adding and removing stuff from the expire list.
* CVE-2008-0595 dbus security policy circumventionJohn (J5) Palmieri2008-02-261-6/+26
| | | | | | | | | | | | * CVE-2008-0595 - security policy of the type <allow send_interface= "some.interface.WithMethods"/> work as an implicit allow for messages sent without an interface bypassing the default deny rules and potentially allowing restricted methods exported on the bus to be executed by unauthorized users. This patch fixes the issue. * bus/policy.c (bus_client_policy_check_can_send, bus_client_policy_check_can_receive): skip messages without an interface when evaluating an allow rule, and thus pass it to the default deny rules
* 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 inotify supportJohn (J5) Palmieri2008-01-171-29/+36
| | | | | | | | | | | | 2008-01-17 Timo Hoenig <thoenig@suse.de> * fix inotify support * bus/dir-watch-inotify.c (_handle_inotify_watch): fix reading of the inotify events. Also, use ssize_t not size_t for 'ret'. * bus/dir-watch-inotify.c (bus_watch_directory): watch not only for IN_MODIFY but also for IN_CREATE and IN_DELETE * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): drop the inotify watches more elegantly by closing inotify:_fd, set inotify_fd to -1 after dropping the watches
* add lsb headers to init script (FDO Bug #11491)John (J5) Palmieri2008-01-151-0/+10
| | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * bus/messagebus.in: add lsb headers (FDO Bug #11491)
* check failed allocation (FDO Bug #12920)John (J5) Palmieri2008-01-151-3/+3
| | | | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * bus/bus.c (setup_server): check failed allocation (FDO Bug #12920)
* rewrite selinux error handling to not abort due to a NULL readJohn (J5) Palmieri2008-01-151-20/+16
| | | | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * bus/bus.c (bus_context_check_security_policy): rewrite selinux error handling to not abort due to a NULL read and to set the error only if it is not already set (Based off of FDO Bug #12430)
* remove dead codeJohn (J5) Palmieri2008-01-151-3/+0
| | | | | | | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * bus/config-parser.c (locate_attributes): remove dead code which always evaluated to TRUE * dbus/dbus-shell.c (_dbus_shell_quote): remove unused code
* plug a possible BusClientPolicy leak (FDO Bug #13242)John (J5) Palmieri2008-01-141-0/+2
| | | | | | | | | 2008-01-14 John (J5) Palmieri <johnp@redhat.com> * patch by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * bus/connection.c (bus_connection_complete): plug a possible BusClientPolicy leak (FDO Bug #13242)
* add inotify support (FDO Bz#13268)John (J5) Palmieri2008-01-142-0/+160
| | | | | | | | | | | | | | | | | | 2008-01-14 John (J5) Palmieri <johnp@redhat.com> * patch by Frederic Crozat <fcrozat at mandriva dot com> (FDO Bz# 13268) * add inotify support * bus/Makefile.am: add inotify module to the build * bus/dir-watch-inotify.c: inotify module based off the dnotify and kqueue modules * configure.in: add checks and switch for inotify also add a printout at the end of configure if inotify and kqueue support is being built in (dnotify already had this)
* watch for file creates in dnotifyJohn (J5) Palmieri2008-01-141-1/+1
| | | | | | | | | 2008-01-14 John (J5) Palmieri <johnp@redhat.com> * patch by Frederic Crozat <fcrozat at mandriva dot com> * bus/dir-watch-dnotify.c (bus_watch_directory): watch for file creates also
* 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-233-2/+4
| | | | | | | | | | | | 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
* add HAVE_SELINUX around call to audit_init() so things build without selinuxHavoc Pennington2007-10-191-1/+3
| | | | | | 2007-10-19 Havoc Pennington <hp@redhat.com> * bus/bus.c (bus_context_new): put audit_init() in HAVE_SELINUX
* do not call audit_init() from bus/ directory from files in dbus/Havoc Pennington2007-10-191-0/+2
| | | | | | | | | | | | 2007-10-19 Havoc Pennington <hp@redhat.com> * bus/bus.c (bus_context_new): put the audit_init() in here instead, which I believe ends up being the same as where it was before, though I'm not sure I understand why it goes here. * dbus/dbus-sysdeps-util-unix.c (_dbus_change_to_daemon_user): remove audit_init() from here, this file can't depend on code in bus/ directory
* Bring .gitignore files up to date; add *.o, *~ etc. to top-level .gitignoreSimon McVittie2007-10-101-0/+4
| | | | | CVS ignores these automatically, so they weren't in the .cvsignore when Ryan converted the repository.
* 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.
* Correctly implement -fPIC and -fPIEJohn (J5) Palmieri2007-10-031-2/+2
| | | | | | | | * For security reasons we want possition independent code for libraries and possition independent executable for executables * before we were just enabling -fPIC * now we correctly enable -fPIC and -PIE for libdbus and the bus respectively * propper LD_FLAGS are set for each also
* Add argument path matching support. Bug #11066.Ryan Lortie2007-09-202-37/+113
| | | | | | | | | | | | | | | | | | 2007-09-20 Ryan Lortie <desrt@desrt.ca> * dbus/signals.c (struct DBusMatchRule, bus_match_rule_new, bus_match_rule_set_arg, bus_match_rule_parse_arg_match, match_rule_matches): Add support for parsing and matching on arg0path='/some/path' type rules. * dbus/signals.h (bus_match_rule_set_arg): change to take const DBusString instead of const char * for the string to match against. * dbus/dbus-bus.c: add a quick note to dbus_bus_add_match documentation about the path matching. * doc/dbus-specification.xml: add a more detailed description of the changes here.
* migrate from cvs to git (cvs2svn -> git-svnimport).Ryan Lortie2007-09-131-0/+0
| | | | | | | | | | | 2007-09-13 Ryan Lortie <desrt@desrt.ca> migrate from cvs to git (cvs2svn -> git-svnimport). * HACKING: update release/branch/tag instructions * */.cvsignore: rename to .gitignore also, clean up tags and branch names to conform to HACKING
* 2007-08-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-08-172-73/+47
| | | | | | | | | | | | | | | * tools/dbus-launch-x11.c (set_address_in_x11): fix from Michael Lorenz to use long not int with XChangeProperty format 32 * dbus/dbus-sysdeps-util-unix.c (_dbus_write_pid_to_file_and_pipe): factor this out, and use the same code in _dbus_become_daemon (where the parent writes the pid file and to the pid pipe) and in bus_context_new (where the daemon writes its own pid file and to its own pid pipe) * bus/bus.c (bus_context_new): close the pid pipe after we print to it. Also, don't write the pid to the pipe twice when we fork, someone reported this bug a long time ago.
* 2007-07-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-301-4/+11
| | | | | | | * bus/activation-helper.c (check_bus_name): don't use _dbus_check_valid_bus_name() which is only around with --enable-checks, instead use _dbus_validate_bus_name(). Bug #11766 from Diego <diego@pemas.net>
* 2007-07-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-266-34/+42
| | | | | | | | | | | | | | | * bus/config-parser-trivial.c (check_return_values): disable a test that hardcoded the bus user's name * bus/dispatch.c (bus_dispatch_test_conf): remove the "if (!use_launcher)" around the tests, they were only failing because we didn't pass through all the expected errors from the helper. * bus/activation-exit-codes.h (BUS_SPAWN_EXIT_CODE_CHILD_SIGNALED): add a code for child segfaulting (BUS_SPAWN_EXIT_CODE_GENERIC_FAILURE): make "1" be a generic failure code, so if a third party launch helper were written it could just always return 1 on failure.
* Switch over to using getaddrinfo for TCP clients & servers to enable IPv6Daniel P. Berrange2007-07-251-5/+18
|
* 2007-07-24 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-247-29/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in: add AM_PROG_CC_C_O to allow per-target CPPFLAGS * bus/dispatch.c (bus_dispatch_test_conf): Fix up setting TEST_LAUNCH_HELPER_CONFIG to include the full path, and enable test shell_fail_service_auto_start when use_launcher==TRUE * bus/activation-helper-bin.c (convert_error_to_exit_code): pass through the INVALID_ARGS error so the test suite works * bus/activation.c (handle_activation_exit_error): return DBUS_ERROR_NO_MEMORY if we get BUS_SPAWN_EXIT_CODE_NO_MEMORY * dbus/dbus-spawn.c (_dbus_babysitter_get_child_exit_status): return only the exit code of the child, not the entire thingy from waitpid(), and make the return value indicate whether the child exited normally (with a status code) * bus/bus.c (process_config_first_time_only): _dbus_strdup works on NULL so no need to check (process_config_every_time): move servicehelper init here, so we reload it on HUP or config file change * bus/Makefile.am (install-data-hook): remove comment because Emacs make mode seems to be grumpy about it
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-242-1/+107
| | | | | | | | * bus/Makefile.am: * bus/test-system.c: (die), (check_memleaks), (test_pre_hook), (test_post_hook), (main): Add back the test-system.c file - not sure now this got ignored in the diff. I blame git.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-16/+523
| | | | | | | | | | | * bus/dispatch.c: (check_segfault_service_no_auto_start), (check_launch_service_file_missing), (check_launch_service_user_missing), (check_launch_service_exec_missing), (check_launch_service_service_missing), (bus_dispatch_test_conf), (bus_dispatch_test_conf_fail), (bus_dispatch_test): Add unit tests for system activation. Most are copied from the session activation tests, but some didn't apply when using a laucher.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-2/+56
| | | | | * bus/activation.c: (bus_activation_activate_service): If the bus uses a service-laucher, then use the setuid laucher.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+54
| | | | | | * bus/activation.c: (handle_activation_exit_error), (babysitter_watch_callback): Map the child exit status integer to a proper dbus error.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-242-3/+20
| | | | | | | | * bus/bus.c: (process_config_first_time_only), (process_config_every_time), (bus_context_unref), (bus_context_get_servicehelper): * bus/bus.h: Add the concept of a service-helper and allow it's value to be read.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-1/+34
| | | | | | | * bus/activation.c: (bus_activation_entry_unref), (update_desktop_file_entry): Add the concept of, and read the value of user from the desktop file. The user string is not required unless we are using system activation.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-242-4/+7
| | | | | | | * bus/activation.c: * bus/desktop-file.h: Move the defines into the header file, as we use these in the lauch helper as well as the desktop file parsing.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+2
| | | | | * bus/.cvsignore: Add the autogenerated binary files.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-242-3/+83
| | | | | | | * bus/Makefile.am: * bus/test.h: Add the build glue for the lauch helper, and also add the launch-helper OOM checks into make check. I've probably broken the build, give me 2.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+146
| | | | | | * bus/test-launch-helper.c: (die), (check_memleaks), (test_post_hook), (bus_activation_helper_oom_test), (main): Add a test wrapper to allow OOM checks on the launch helper.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-243-0/+679
| | | | | | | | | | | | | | * bus/activation-helper-bin.c: (convert_error_to_exit_code), (main): * bus/activation-helper.c: (desktop_file_for_name), (clear_environment), (check_permissions), (check_service_name), (get_parameters_for_service), (switch_user), (exec_for_correct_user), (check_bus_name), (get_correct_parser), (launch_bus_name), (check_dbus_user), (run_launch_helper): * bus/activation-helper.h: Add the initial launch-helper. This is split into a main section and a binary loader that allows us to lauch the main section in another test harness to do stuff like OOM testing. No build glue yet.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-243-96/+273
| | | | | | | | | | | | | | | * bus/Makefile.am: * bus/config-parser.c: (bus_config_parser_unref), (start_busconfig_child), (bus_config_parser_end_element), (servicehelper_path), (bus_config_parser_content), (bus_config_parser_finished), (bus_config_parser_get_servicehelper), (test_default_session_servicedirs), (test_default_system_servicedirs), (bus_config_parser_test): * bus/config-parser.h: Make the config-parser code use the common config code. Also add the session and systemdirs stuff, and make the config parser aware of the servicehelper field.
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+6
| | | | | * bus/system.conf.in: Add new servicehelper fields to the default system.conf file.