summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'fd-passing'Thiago Macieira2009-07-161-0/+24
|\ | | | | | | | | | | | | Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
| * sysdeps-unix: add basic IO primitives for unix fd passingLennart Poettering2009-05-201-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | This introduces three new functions: _dbus_read_socket_with_unix_fds _dbus_write_socket_with_unix_fds _dbus_read_socket_with_unix_fds_two These work exactly like their counterpart sans 'with_unix_fds' except that they also send/recieve file descriptors along with the actual payload data.
| * sysdeps-unix: introduce _dbus_socket_can_pass_unix_fd()Lennart Poettering2009-05-201-0/+2
| | | | | | | | | | | | This function can be used to check if a socket can be used to pass file descriptors. On platforms that don't support this at all this is hardcoded to return FALSE.
* | Bug 19446 - HaikuOS supportGrzegorz Dąbrowski2009-07-131-0/+13
| | | | | | | | Signed-off-by: Colin Walters <walters@verbum.org>
* | Bug 896 - Avoid race conditions reading message from exited processColin Walters2009-07-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Patch based on extensive work from Michael Meeks <michael.meeks@novell.com>, thanks to Dafydd Harries <dafydd.harries@collabora.co.uk>, Kimmo Hämäläinen <kimmo.hamalainen@nokia.com> and others. The basic idea with this bug is that we effectively ignore errors on write. Only when we're done reading from a connection do we close down a connection. This avoids a race condition where if a process (such as dbus-send) exited while we still had data to read in the buffer, we'd miss that data.
* | Bug 14259 - Make session address lookup system-dependentColin Walters2009-07-131-0/+4
| | | | | | | | | | | | | | 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 21161 - Update the FSF addressTobias Mueller2009-07-101-1/+1
|/ | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org>
* Add uid, pid, and command to security logsColin Walters2008-12-171-0/+5
| | | | | | | | 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.
* Add syslog of security denials and configuration file reloadsColin Walters2008-12-121-0/+4
| | | | | We need to start logging denials so that they become more easily trackable and debuggable.
* Bug 18446: Keep umask for session busMatt McCutchen2008-11-101-1/+2
| | | | Signed-off-by: Colin Walters <walters@verbum.org>
* Add new _dbus_get_environment callRay Strode2008-07-111-0/+1
| | | | | | | | It's a wrapper around the environ external variable. It will be important in the future when we allow bus clients to modify the environment of future activated clients. Presently, we just always use the bus daemon environment wholesale.
* support for AIX poll implementation (FDO Bug #11666)John (J5) Palmieri2008-01-151-0/+27
| | | | | | | | | 2008-01-15 John (J5) Palmieri <johnp@redhat.com> * patch by Peter O'Gorman <pogma at thewrittenword dot com> * dbus/dbus-sysdeps.h: support for AIX poll implementation (FDO Bug #11666)
* Fix detection of i486 atomic ops.Simon McVittie2007-10-111-0/+10
| | | | | | 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).
* 2007-08-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-08-171-3/+6
| | | | | | | | | | | | | | | * 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.
* Switch over to using getaddrinfo for TCP clients & servers to enable IPv6Daniel P. Berrange2007-07-251-3/+6
|
* 2007-07-24 Richard Hughes <richard@hughsie.com>Richard Hughes2007-07-241-0/+2
| | | | | | * dbus/dbus-sysdeps.c: (_dbus_clearenv): * dbus/dbus-sysdeps.h: Add a wrapper for clearenv.
* 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/+3
| | | | | | | | | | | * 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-4/+7
| | | | | | | | | | | | | | * 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-3/+1
| | | | | | * 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-7/+4
| | | | | | | | | | | * 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().
* * reverted global rename of function _dbus_username_from_current_process.Ralf Habacker2007-06-141-1/+1
| | | | It needs to much tests to verify that the change does not break anything. I had overseen that the signatures are different (** to *) which requires non trivial changes. This is one *major* disadvantage of elumating oop functionality with c. You are responsible for cleaning every object on every function return point, which could be a nightmare if you are not working with dbus all the days.
* * global rename of function dbus_username_from_current_process to ↵Ralf Habacker2007-06-141-1/+1
| | | | _dbus_append_desired_identity
* 2007-06-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-06-131-0/+1
| | | | | | | | | | | | | * 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/+20
| | | | | | | | | | | | | | | | | | | * 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-75/+23
| | | | | | | | | | | | | | | | | | | * 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
* * dbus/dbus-sysdeps.h (_dbus_split_paths_and_append): new prototyp ↵Ralf Habacker2007-03-161-0/+10
| | | | | | (_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.
* 2007-03-11 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-03-121-13/+15
| | | | | | | | | | | | | | * 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-3/+14
| | | | 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-1/+1
| | | | | | | | 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/+6
| | | | related write() function calls to _dbus_write_pipe().
* * dbus/dbus-sysdeps-unix.c: moved _dbus_atomic_inc/dec()Ralf Habacker2006-12-311-0/+4
| | | | | | | | 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
* 2006-11-01 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-11-021-6/+8
| | | | * bus/dbus-daemon.1.in: document standard_session_servicedirs
* * configure.in: expose DBUS_DATADIRJohn (J5) Palmieri2006-11-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* 2006-10-26 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-271-0/+6
| | | | | | | | | | | | | * dbus/dbus-threads.[hc]: Documentation improvements. Clarify how condition variables relate to recursive mutexes. * dbus/dbus-sysdeps-pthread.c, dbus/dbus-sysdeps-win-thread.c, dbus/dbus-threads.c: Split the platforms-specific thread implementations into their own files. * dbus/dbus-sysdeps-pthread.c (_dbus_pthread_condvar_wait_timeout): invert the return value, it was backward. Not that anything uses it.
* * dbus/dbus-sysdeps.h:Thiago Macieira2006-10-241-0/+3
| | | | | | | | | | | | * 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-18/+49
| | | | | * Documentation! Whee! Doxygen now 100% silent. If you make it angry again, you will be punished.
* 2006-10-21 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-211-0/+8
| | | | | | | * 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-09-30 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-10-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.in (LT_CURRENT, LT_AGE): increment current and age to reflect addition of interfaces. * doc/dbus-specification.xml: describe a new org.freedesktop.DBus.Peer.GetMachineId method * dbus/dbus-string.c (_dbus_string_skip_white_reverse): new function (_dbus_string_skip_white, _dbus_string_skip_blank): use new DBUS_IS_ASCII_BLANK, DBUS_IS_ASCII_WHITE macros and fix assertion at end of skip_white (_dbus_string_chop_white): new function * bus/connection.c (bus_connections_setup_connection): call dbus_connection_set_route_peer_messages. * dbus/dbus-connection.c (_dbus_connection_peer_filter_unlocked_no_update): modify to support a GetMachineId method. Also, support a new flag to let the bus pass peer methods through to apps on the bus, which can be set with dbus_connection_set_route_peer_messages. Finally, handle and return an error for anything unknown on the Peer interface, which will allow us to extend the Peer interface in the future without fear that we're now intercepting something apps were wanting to see. * tools/dbus-uuidgen.c: a thin wrapper around the functions in dbus/dbus-uuidgen.c * dbus/dbus-uuidgen.c: implement the bulk of the dbus-uuidgen binary here, since most of the code is already in libdbus * dbus/dbus-sysdeps.c (_dbus_read_local_machine_uuid): read the uuid from the system config file * dbus/dbus-internals.c (_dbus_generate_uuid, _dbus_uuid_encode) (_dbus_read_uuid_file_without_creating) (_dbus_create_uuid_file_exclusively, _dbus_read_uuid_file): new uuid-related functions, partly factored out from dbus-server.c * dbus/dbus-sysdeps.c (_dbus_error_from_errno): convert EEXIST to DBUS_ERROR_FILE_EXISTS instead of EEXIST * dbus/dbus-protocol.h (DBUS_ERROR_FILE_EXISTS): add file exists error * tools/dbus-cleanup-sockets.1: explain what the point of this thing is a bit more * autogen.sh (run_configure): add --config-cache to default configure args * dbus/dbus-internals.h (_DBUS_ASSERT_ERROR_IS_SET): disable the error set/clear assertions when DBUS_DISABLE_CHECKS is defined * tools/dbus-launch.c (main): if xdisplay hasn't been opened, don't try to save address, fixes crash in make check
* * configure.in: add DBUS_BINDIR as a #define to C source code.Thiago Macieira2006-09-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | * tools/dbus-launch.c * tools/dbus-launch.h * tools/dbus-launch-x11.c: * tools/dbus-launch.1: Add the --autolaunch option to dbus-launch, which makes it scan for an existing session started with --autolaunch. With that option, it also creates an X11 window and saves the bus address and PID to it. * dbus/dbus-sysdeps.h: * dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address): Add a function that runs "dbus-launch --autolaunch" to retrieve the running D-Bus session address (or start one if none was running) * dbus/dbus-transport.c: Add the handler for the "autolaunch:" address protocol, which tries to get the running session from dbus-launch. * dbus/dbus-bus.c: * dbus/dbus-internals.h: Make "autolaunch:" be the default D-Bus session bus address. * dbus/dbus-connection.c: Fix horrible typo in error message.
* voc Pennington <hp@redhat.com>Havoc Pennington2006-09-161-11/+3
| | | | | | | | | | | | | | | | | | | | * dbus/dbus-server.c (dbus_server_listen): change how this works to be able to delegate to a set of handlers that can succeed, fail, or choose not to handle. Allows us to have dbus_server_listen_platform_specific. * dbus/dbus-server-socket.c (_dbus_server_new_for_tcp_socket): factor out the tcp socket stuff to be used on windows, leaving unix domain socket only in dbus-socket-unix.c * dbus/dbus-transport-socket.c (_dbus_transport_new_for_tcp_socket): factor out the tcp socket stuff to be used on windows, leaving unix domain socket only in dbus-transport-unix.c * dbus/dbus-connection.c (dbus_connection_get_unix_user): insert temporary hack to be sure this fails on windows (dbus_connection_get_unix_process_id): ditto
* 2006-09-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-09-161-4/+4
| | | | | | | | | | | | * dbus/dbus-sysdeps-unix.c (_dbus_open_tcp_socket) (_dbus_open_unix_socket, _dbus_open_socket): change API for _dbus_open_socket so the domain/type/protocol from system headers are not required. This is kind of pointless though unless we move part of _dbus_connect_tcp_socket into sysdeps.c instead of sysdeps-unix.c, which would mean adding a wrapper around bind/listen/etc. Also, add DBusError to the socket-opening functions so they don't require use of errno.
* 2006-09-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-09-161-27/+52
| | | | | | | | | | * dbus/dbus-sysdeps-unix.h: small change to Peter's patch to make dbus-sysdeps-unix-util.c build, add unix-specific sysdeps header. * dbus/dbus-sysdeps.h, dbus-sysdeps-unix.c: patch from Peter Kümmel bug #8249 to make the sysdeps.h read/write/open/close functions specifically for sockets only, and move generic read/write/open/close into unix-specific code.
* 2006-09-10 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-09-101-0/+2
| | | | | | | | | | | | patch mostly by Peter Kümmel, bug #8211 * dbus/dbus-sysdeps-unix.c: new file, which splits out unix-specific stuff in dbus-sysdeps.c * dbus/dbus-sysdeps.c: don't include any UNIX-only headers, and move unix-specific stuff to dbus-sysdeps-unix.c * configure.in: check HAVE_ERRNO_H
* 2006-08-29 Havoc Pennington <hp@redhat.com>Havoc Pennington2006-08-301-1/+1
| | | | | | | | | | * test/test-service.c (path_message_func): fix lack of return value * dbus/dbus-sysdeps.c (_dbus_printf_string_upper_bound): fix formatting, remove #ifdef, and fix docs. #ifdef doesn't make any more sense than on anything else in this file. (_dbus_get_tmpdir): add const to return value, and keep the results of the various getenv around in a static variable.
* Patches by Kjartan Maraas <kmaraas at gnome dot org>John (J5) Palmieri2006-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/services.c (bus_service_list_queued_owners): Add a pointer cast to fix compiler warning * dbus/dbus-dataslot.c (_dbus_data_slot_list_get): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-marshal-basic.c (_dbus_marshal_test): Remove unused variable * dbus/dbus-marshal-recursive-util.c (node_new): return a NULL instead of FALSE since the return type is not expecting a boolean * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * dbus/dbus-sysdeps-util.c (_dbus_get_tmpdir): add void as the parameter so some compilers don't complain * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket, _dbus_transport_new_for_tcp_socket): Send a NULL into _dbus_transport_new_for_fd instead of a FALSE because we are expecting a pointer not a boolean * test/shell-test.c (test_command_line): cast the second argument to _dbus_list_append to avoid compiler warnings * test/test-names.c (main): remove unused variable * test/test-service.c (check_hello_from_self_reply): Initialize echo_message and echo_reply to NULL * test/test-shell-service.c (handle_echo): Remove unused variable and cast the third parameter passed to dbus_connection_get_object_path_data to avoid compiler warrnings * test/name-test/test-names.c (clear_message_queue): Remove unused function * test/name-test/test-pending-call-dispatch.c: Fix format string in printf
* * dbus/dbus-sysdeps.c:John (J5) Palmieri2006-08-101-0/+1
| | | | | | | | * dbus/dbus-address.c: * bus/activation.c: * test/shell-test.c: don't hardcode tmp directory (patch from Dave Meikle <dmk at davemeikle dot co dot uk>)
* * dbus/dbus-sysdeps.h:John (J5) Palmieri2006-08-081-2/+4
| | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c: * dbus/dbus-string.c: s/_dbus_printf_length/_dbus_printf_string_upper_bound to comform with GLib's function which does the same thing * configure.in: * bus/Makefile.am: * bus/dir-watch-default.c: * bus/dir-watch-dnotify.c: * bus/dir-watch-kqueue.c: Add kqueue directory watching for freebsd and split the directory watching code into seperate files per method/arch (patches from Timothy Redaelli <drizzt at gufi dotorg>)
* * dbus/dbus-sysdeps.h:John (J5) Palmieri2006-08-081-0/+4
| | | | | | * dbus/dbus-sysdeps.c: add _dbus_printf_length (patch from Peter Kümmel <syntheticpp at gmx dot net>)
* * s/D-BUS/D-Bus/gJohn (J5) Palmieri2006-08-031-1/+1
|