| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
_dbus_desktop_file_load() used to stat the desktop file before reading
it, to verify its size. This is both racy and unnecessary since
_dbus_file_get_contents() which it uses stats the file anyway -- does
that however in a race-free fashion with fstat() instead of stat().
This patch gets rid of the redundant stat(). Also, since the desktop
file change logic requires the mtime of the file it read we now export
that in _dbus_file_get_contents().
This patch probably breaks Win32 builds, but afaik those are broken
anyway.
|
|
|
|
| |
Signed-off-by: Thiago Macieira <thiago@kde.org>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
dbus/dbus-connection.c
dbus/dbus-message-util.c
dbus/dbus-sysdeps-unix.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Newer gccs and intel ccs support a __sync extension for making use of
atomic operations. This patch replaces the handcrafted x86 atomic
operation support with usage of __sync.
__sync is supported by more processors and by more compilers than the
old assembler code. Also, this extension has been available on gcc for
quite a while now for x86, so replacing the old assembler code should
only be a loss when very old compiilers are used.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Since all socket users enable FD_CLOEXEC anyway we can just do that in
_dbus_open_socket() and be done with it for all cases. By side effect
this allows us to use SOCK_CLOEXEC and hence close the CLOEXEC race.
|
| |
| |
| |
| |
| | |
Instead of having everyone define _GNU_SOURCE and similar macros
seperately, simply do so centrally by using AC_USE_SYSTEM_EXTENSIONS
|
| |
| |
| |
| |
| |
| |
| | |
All users of full duplex pipes enable FD_CLOEXEC later anyway so let's
just do it as part of _dbus_full_duplex_pipe. By side effect this allows
to make use of SOCK_CLOEXEC which fixes a race when forking/execing from
a different thread at the same time as we ar in this function.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
This is a simple wrapper around dup()-like functionality.
Also handles CLOEXEC and makes sure we don't interfere with the standard
I/O file descriptors 0, 1 and 2.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On Linux send()/sendmsg() know the special flag MSG_NOSIGNAL which if
set makes sure that no SIGPIPE signal is raised when we write to a
socket that has been disconnected.
By using this flag we don't have to play games with SIGPIPE which is
pretty ugly stuff since it touches the global process context.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes dbus on FreeBSD and DragonFly systems.
The patch is obtained from FreeBSD ports tree.
Signed-off-by: Colin Walters <walters@verbum.org>
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
We don't get the number of groups, so allocate an arbitrary
larger array.
Signed-off-by: Colin Walters <walters@space-ghost.verbum.org>
|
| |
| |
| |
| |
| |
| | |
No comment.
Signed-off-by: Colin Walters <walters@verbum.org>
|
|/
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
We need to start logging denials so that they become more easily trackable
and debuggable.
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Colin Walters <walters@verbum.org>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* dbus/dbus-sysdeps-unix.c (_dbus_get_autolaunch_address):
Close file descriptors before exec.
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
| |
* dbus/dbus-sysdeps-unix.c: define _GNU_SOURCE
* bus/selinux.c: include limits.h
* Patch by Matthias Clasen <mclasen at redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* Add indent-tabs-mode: nil to all file headers.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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)
|
|
|
|
|
|
| |
* 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()
|
|
|
|
|
|
|
|
|
|
|
| |
* 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().
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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-unix.c (_dbus_open_socket): fix #10781 from
Tobias Nygren, checking pointer to fd vs. 0 rather than checking
the fd itself
|
|
|
|
|
|
| |
(_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, dbus/dbus-sysdeps-unix.c: moved platform independent DBusPipe function to dbus-sysdeps.c.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|