summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-unix.c
Commit message (Collapse)AuthorAgeFilesLines
* Cope with dbus-launch not being in DBUS_BINDIRColin Walters2009-07-141-11/+19
| | | | | | | | | This is a temporary hack for systems which use DBUS_BINDIR=/bin, but then move dbus-launch back into /usr/bin. Longer term, we should explicitly support this in upstream code, or even better figure out how to move dbus-launch into /bin (e.g. dynamically load libX11 if available), or have a --with-x11-tools configure option.
* Bug 19432 - Fix handling of HAVE_CMSGCRED case (FreeBSD)Hasso Tepper2009-07-131-15/+19
| | | | | | | | Fixes dbus on FreeBSD and DragonFly systems. The patch is obtained from FreeBSD ports tree. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 14259 - Refactor _dbus_get_autolaunch_addressColin Walters2009-07-131-70/+114
| | | | | | Split out the process-launching code, which can be reused for other applications; in particular, a forthcoming patch to parse output from launchd for MacOS X.
* Bug 14259 - Make session address lookup system-dependentColin Walters2009-07-131-0/+31
| | | | | | | On some platforms such as MacOS X and Windows, we can't depend on an environment variable to determine the address of the session bus. Create a sysdep function dbus_lookup_session_address which can be filled in with platform-specific code.
* Bug 14259 - Work around broken getgrouplist on MacOS XBenjamin Reed2009-07-131-11/+39
| | | | | | | We don't get the number of groups, so allocate an arbitrary larger array. Signed-off-by: Colin Walters <walters@space-ghost.verbum.org>
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
| | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 21347 - Don't fail autolaunching if process has SIGCHLD handlerKurt Miller2009-07-101-0/+13
| | | | | | | | | If other code in the process set a global SIGCHLD handler, it will make autolaunching fail spuriously due to waitpid() failing. This fix will temporarily block SIGCHLD delivery. Signed-off-by: Colin Walters <walters@verbum.org>
* Various compiler warning fixesColin Walters2008-12-191-1/+1
|
* Add syslog of security denials and configuration file reloadsColin Walters2008-12-121-1/+0
| | | | | We need to start logging denials so that they become more easily trackable and debuggable.
* Bug 16755: Ensure we use the correct errnoTor Lillqvist2008-09-181-11/+17
| | | | | | | | * dbus/dbus-sysdeps-unix.c: Save errno across cleanup and use it for errors to ensure we display the right error message. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 17061: Handle error return from sysconf correctlyJoe Marcus Clarke2008-09-041-1/+5
| | | | | | | | | * dbus/dbus-sysdeps-unix.c: * dbus/dbus-sysdeps-util-unix.c: Cast return from sysconf temporarily so we actually see -1. Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 17352: synchronize the file before renamingArtem Bityutskiy2008-09-041-0/+9
| | | | | | | | | | | | | | Dbus is doing atomic file updates by copying them, changing the copy, and re-naming them. However, it does not synchronize the file before re-naming, which results in corruption in case of unclean reboots. The reason for this is that file-systems have write-back cache and they postpone writing data to the media. This patch adds the missed fsync() for the Unix part. I do not have windows so cannot provide a windows port fix. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 13387: Fix compilation failure with AI_ADDRCONFIGJens Granseuer2008-08-071-2/+2
| | | | Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 15646: Remove spurious debugging fprintf(stderrColin Walters2008-07-281-1/+0
|
* Bug 16727: Handle ERANGE for getgr; fixes user in many groupsMarc Brockschmidt2008-07-281-15/+50
| | | | | | | | | | Patch originally from Noèl Köthe. Modified by Colin Walters <walters@verbum.org> * dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-unix-utils.c: Use a while() loop to reallocate buffer if we get ERANGE return. This fixes the case where a user is in a large number of groups.
* Bug 15740: Solaris/ADT auditing support (simon zheng)Colin Walters2008-06-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* Bug 15947: Close file descriptors before execing helper (Markus Rechberger)Colin Walters2008-05-281-4/+13
| | | | | * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Close file descriptors before exec.
* fix broken poll on Mac OSX - build patch by Benjamin ReedJohn (J5) Palmieri2008-03-041-1/+1
| | | | | | * configure.in: check for OSX's deadlocking poll * dbus/dbus-sysdeps-unix.c (_dbus_poll): if we have a broken poll don't use poll
* define _AI_ADDRCONFIG if not defined so that we can compile with an older glibcJohn (J5) Palmieri2008-02-281-0/+4
|
* fix build against the latest gcc/glibcJohn (J5) Palmieri2008-02-211-0/+2
| | | | | | * dbus/dbus-sysdeps-unix.c: define _GNU_SOURCE * bus/selinux.c: include limits.h * Patch by Matthias Clasen <mclasen at redhat.com>
* add OOM handling in various placesJohn (J5) Palmieri2008-01-151-1/+5
| | | | | | | | | | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patches by Kimmo Hämäläinen <kimmo dot hamalainen at nokia dot com> * dbus/dbus-sysdeps-unix (_dbus_get_autolaunch_address): handle OOM (FDO Bug #12945) * dbus/dbus-uuidgen.c (return_uuid): handle OOM (FDO Bug #12928) * dbus/dbus-misc.c (dbus_get_local_machine_id): handle OOM, fix return value to return NULL not FALSE (FDO Bug #12946)
* add _dbus_geteuid to fix EXTERNAL authentication in setuid applicationsJohn (J5) Palmieri2008-01-141-2/+11
| | | | | | | | | | | | | | | | | | | | | | 2008-01-14 John (J5) Palmieri <johnp@redhat.com> * Patch by Andrea Luzzardi <scox at sig11 dot org>: creates a _dbus_geteuid function to fix EXTERNAL authentication in setuid applications * dbus/dbus-sysdeps-unix.c (_dbus_geteuid): used to get the effective uid of the running program (_dbus_credentials_add_from_current_process): use geteuid instead of getuid (_dbus_append_user_from_current_process): use geteuid instead of getuid * dbus/dbus-sysdeps-util-unix.c (_dbus_change_to_daemon_user): use geteuid instead of getuid (_dbus_unix_user_is_at_console): use geteuid instead of getuid * dbus/dbus-sysdeps-win.c (_dbus_geteuid): add a windows equivilant that returns DBUS_UID_UNSET
* Fix detection of i486 atomic ops.Simon McVittie2007-10-111-3/+3
| | | | | | Previously, the attempts to determine support at compile-time on Darwin were causing the i486 atomic ops to be used on *all* i386 or x86-64 GCC builds (AH_VERBATIM can't be conditionalized like we were trying to).
* Switch over to using getaddrinfo for TCP clients & servers to enable IPv6Daniel P. Berrange2007-07-251-87/+214
|
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+67
| | | | | | | | | | | * dbus/dbus-sysdeps-unix.c: (_dbus_get_standard_system_servicedirs): * dbus/dbus-sysdeps-win.c: Provide a way to get the standard system servicedirs, just like we do for the session service dirs. These should be seporate, as there may be a security issue starting up some session stuff as root. The use-case for the same binary starting up per-system _and_ per-session is also not valid.
* 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-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-181-8/+24
| | | | | | | | * dbus/dbus-sysdeps-unix.c (_dbus_read_credentials_socket): clean this up a little bit, to try and understand why telnet'ing to a server and sending a non-nul byte didn't disconnect immediately; now it seems that it does disconnect immediately as it should, though I don't understand what has changed.
* 2007-06-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-151-0/+26
| | | | | | | | | | | * dbus/dbus-sysdeps-unix.c (_dbus_append_session_config_file) (_dbus_append_system_config_file): new functions * bus/main.c (main): use _dbus_append_system_config_file() and _dbus_append_session_config_file() * dbus/Makefile.am (INCLUDES): move DBUS_SYSTEM_CONFIG_FILE and DBUS_SESSION_CONFIG_FILE into this makefile
* 2007-06-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-151-1/+16
| | | | | | | | | | | | | | * 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-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-141-27/+0
| | | | | | * dbus/dbus-sysdeps-unix.c (_dbus_credentials_parse_and_add_user): delete this function since it was effectively the same as _dbus_credentials_add_from_username()
* 2007-06-14 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-141-6/+87
| | | | | | | | | | | * dbus/dbus-auth.c: adapt to keyring changes * dbus/dbus-keyring.c: change to avoid using user ID and home directory directly; instead use a keyring-location-from-credentials function in dbus-sysdeps * fix to use _dbus_append_user_from_current_process() instead of _dbus_username_from_current_process() or _dbus_append_desired_identity().
* 2007-06-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-131-22/+32
| | | | | | | | | | | | | * 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-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-091-0/+13
| | | | | | | | | | | | | | | | | | | * bus/policy.c (bus_policy_create_client_policy): gracefully continue if the connection has no unix user - just don't apply any unix user dependent rules. * bus/config-parser.c: remove dbus-userdb.h usage * bus/bus.c: remove dbus-userdb.h usage * dbus/dbus-transport.c (_dbus_transport_get_is_authenticated): support Windows user function; also, fix the logic for checking auth as root in the default auth code (broken in the previous commit) * dbus/dbus-connection.c (dbus_connection_set_windows_user_function): new function (dbus_connection_get_windows_user): new function
* 2007-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-091-46/+179
| | | | | | | | | | | | | | | | | | | * 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-04-27 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-04-271-3/+3
| | | | | | * dbus/dbus-sysdeps-unix.c (_dbus_open_socket): fix #10781 from Tobias Nygren, checking pointer to fd vs. 0 rather than checking the fd itself
* * dbus/dbus-sysdeps.h (_dbus_split_paths_and_append): new prototyp ↵Ralf Habacker2007-03-161-117/+3
| | | | | | (_DBUS_PATH_SEPARATOR): new macro. * dbus/dbus-sysdeps.c (_dbus_split_paths_and_append): merged from dbus/dbus-sysdeps-unix.c and dbus/dbus-sysdeps-win.c.
* * dbus/dbus-sysdeps-win.c: fixed broken DBusPipe on win32.Ralf Habacker2007-03-131-59/+0
| | | | * dbus/dbus-sysdeps-win.c, dbus/dbus-sysdeps-unix.c: moved platform independent DBusPipe function to dbus-sysdeps.c.
* 2007-03-11 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-03-121-19/+59
| | | | | | | | | | | | | | * tools/dbus-launch.c (do_close_stderr): fix C89 problem and formatting problem * Mostly fix the DBusPipe mess. - put line break after function return types - put space before parens - do not pass structs around by value - don't use dbus_strerror after calling supposedly cross-platform api - don't name pipe variables "fd" - abstract special fd numbers like -1 and 1
* * bus/bus.c, bus/bus.h, bus/main.c, bus/test.c, dbus/dbus-sysdeps-unix.c, ↵Ralf Habacker2007-03-101-2/+63
| | | | dbus/dbus-sysdeps-util-unix.c, dbus/dbus-sysdeps-util-win.c, bus/dbus-sysdeps-win.c,dbus/dbus-sysdeps.h: renamed _dbus_xxx_pipe to _dbus_pipe_xxx, completed _dbus_pipe support.
* * dbus/dbus-sysdeps.h (_dbus_listen_tcp_socket): changed type or port to ↵Ralf Habacker2007-03-101-5/+11
| | | | | | | | pointer, because the port is given back. * dbus/dbus-server-socket.c (_dbus_server_new_for_tcp_socket): implemented returning tcp port. Skipping port parameter and non integer port values in config <listen> statement needs more effort. * dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps-win.c (_dbus_listen_tcp_socket): return the real used tcp port. * bus/dbus-daemon.1.in: added <listen> tcp examples
* * bus/bus.c, dbus/dbus-sysdeps-unix.c, dbus/dbus-sysdeps.h: rename pipe ↵Ralf Habacker2007-03-081-0/+9
| | | | related write() function calls to _dbus_write_pipe().
* * dbus/dbus-sysdeps-unix.c: capture the dbus-launch stderrThiago Macieira2007-03-031-6/+47
| | | | | | | | output and add it to the DBusError message we return. * tools/dbus-launch.1: * tools/dbus-launch.c: Add option --close-stderr to, well, close stderr before starting dbus-daemon.
* * dbus/dbus-sysdeps-unix.c: unix compile fix, movedRalf Habacker2007-01-011-0/+18
| | | | | atomic_exchange_and_add() from dbus/dbus-sysdeps.c to here, it's used by _dbus_atomic_inc() and _dbus_atomic_dec().
* * dbus/dbus-sysdeps-unix.c: moved _dbus_atomic_inc/dec()Ralf Habacker2006-12-311-0/+47
| | | | | | | | from dbus/dbus-sysdeps.c, windows version of _dbus_atomic_inc/dec() is in dbus-sysdeps-win.c (not in this patch). * dbus/dbus-sysdeps.h: DBusAtomic::value is long on windows to fit with InterlockedInc/Decrement. - Patches from Christian Ehrlicher
* * configure.in: expose DBUS_DATADIRJohn (J5) Palmieri2006-11-011-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/config-parser.c: add the standard_session_servicedirs element to the parser (bus_config_parser_content): process the standard_session_servicedirs element by getting the standard directories from sysdeps and merging them into the service directory list (test_default_session_servicedirs): make sure we get what we expect * bus/session.conf.in: replace the servicedir tag with the standard_session_servicedirs tag * dbus/dbus-list.h: remove the typedef of DBusList and place it in dbus-sysdeps.h to avoid circular header dependencies * dbus/dbus-sysdeps.h: add the typedef of DBusList * dbus/dbus-sysdeps-unix.c (split_paths_and_append): utility function which takes a string of directories delimited by colons, parses them out, appends a suffix and puts them in a list ignoring empty elements (_dbus_get_standard_session_servicedirs): returns the standard directories for a session bus to look for service activation files on Unix which includes the XDG_DATA_HOME, XDG_DATA_DIRS and DBUS_DATADIR directories * test/data/valid-config-files/many-rules.conf: add the standard_session_servicedirs tag to the valid config file tests
* * dbus-sysdeps-unix.c (_dbus_set_local_creds): Clean up theJohn (J5) Palmieri2006-10-261-6/+7
| | | | | | | | LOCAL_CREDS vs CMSGCRED stuff a bit. Prefer CMSGCRED. This needs to be cleaned up more. * doc/TODO: Add a todo that *BSD hackers should look at cleaning up the CREDS issue.
* * dbus/dbus-sysdeps.h:Thiago Macieira2006-10-241-4/+30
| | | | | | | | | | | | * dbus/dbus-sysdeps-unix.c: Add function _dbus_make_file_world_readable that chmods a file to 0644. * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Avoid writing to the static "argv" array, thereby avoiding a COW on the child process. * dbus/dbus-internals.c (_dbus_create_uuid_file_exclusively): call _dbus_make_file_world_readable on the created file.
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-7/+0
| | | | | | | * Clean up Doxygen group markers for public API so Doxygen finds everything (not comprehensively fixed for private API). Means all remaining Doxygen warnings are just about missing docs and thus pretty simple to resolve.
* 2006-10-19 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-201-2/+52
| | | | * Fix a pile of Doxygen warnings and missing docs
* 2006-10-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-171-1/+1
| | | | | | * dbus/dbus-internals.c (_dbus_warn_check_failed): new function to be used for return_if_fail type warnings; prefixes the pid, and fatal by default.