| 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.
|
|
|
|
|
| |
Speed up ckit database checks a little by keeping the parsed database
in memory and mantaining an extra hashtable-based cache.
|
|
|
|
|
| |
_dbus_desktop_file_changed() can be used if the file changed since it
was read. (by comparing the mtime back then and now)
|
|
|
|
|
|
|
|
|
| |
In addtion to Solaris style /dev/console permission checking and
pam_console style /var/run/console file existance checking add support
for checking console status via the ConsoleKit database.
This adds very basic support and will read the console database on every
single read. These needs optimization.
|
|
|
|
| |
This allows us to iterate through the sections of a desktop file.
|
|
|
|
|
| |
Mnimally change the validity checks for deskto files so that the
ConsoleKit database can pass as valid.
|
|
|
|
| |
Silent mode yay!
|
|
|
|
|
|
| |
We want to make use of it for reading the ConsoleKit database which will
need to be implemented in dbus/dbus-userdb-util.c, so let's
move this to dbus/.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current SIGINT handling of dbus-monitor ain't making too many people
happy since it defers the exit to the next msg received -- which might
be quite some time away often enough.
This patch replaces the SIGINT handling by simply enabling line-buffered
IO for STDOUT so that even if you redirect dbus-monitor into a file no
lines get accidently lost and the effect of C-c is still immediate.
halfline came up with the great idea to use setvbuf here instead of
fflush()ing after each printf().
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timeout handling code subtracts the elapsed time from the timeout
each time a message is received, which drastically reduces the timeout
in circumstances such as service activation.
Correct so that the timeout is never modified, and the elapsed time
instead subtracted where necessary.
Signed-off-by: James Westby <jw+debian@jameswestby.net>
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
|
|
|
|
| |
Signed-off-by: Thiago Macieira <thiago@kde.org>
|
|
|
|
| |
Signed-off-by: Thiago Macieira <thiago@kde.org>
|
| |
|
| |
|
|
|
|
|
| |
Otherwise, when compiling with optimisation, the compiler will detect
that b was unused, then use the instructions that i386 supports.
|
|
|
|
|
| |
Library Age = 5 / Current = 8 indicates this development
series. Revision will increase from 0 after 1.4.0 is released.
|
|
|
|
|
| |
This script is not deployed to the builddir, so it cannot be
run with relative paths.
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
dbus/dbus-connection.c
dbus/dbus-message-util.c
dbus/dbus-sysdeps-unix.c
|
| |
| |
| |
| |
| |
| | |
We have to use the return value, otherwise GCC optimises the code
by using instructions that don't return anything. That won't
match what we actually use in dbus-sysdeps-unix.c
|
| |
| |
| |
| |
| |
| | |
This simply verifies that we forward unix fds only on connection that
support it. We willr eturn an error if a client attempts to send a
message with unix fds to another client that cannot do it.
|
| |
| |
| |
| | |
in once piece right now
|
| | |
|
| |
| |
| |
| |
| | |
Create configuration settings and enforce message unix fd limits the
same way we do for allocated message memory.
|
| |
| |
| |
| | |
This make all counters count both bytes of memory and unix fds.
|
| |
| |
| |
| |
| |
| | |
glibc knows three bswap_{16|32|64}() calls that internally make use of a
gcc extension to implement faster byteswapping. We should make use of it
if we can.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| | |
Trailing whitespace sucks. This change modifies autogen.sh to activate
the example pre-commit that ships with git. It will make sure that from
then on no further commits with trailing whitespace can be made
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds two new directives to the auth protocol:
NEGOTIATE_UNIX_FD is sent by the client after the authentication was
sucessful, i.e. OK was received.
AGREE_UNIX_FD is then sent by the server if it can do unix fd passing as
well.
ERROR is returned when the server cannot or is unwilling to do unix fd
passing.
This should be compatible with existing D-Bus implementations which will
naturally return ERROR on NEGOTIATE_UNIX_FD.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
This should fix another 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 adds a full test for passing multiple fds across a D-Bus
connection.
|
| |
| |
| |
| |
| |
| |
| |
| | |
do it
Not all of the send function flavours allow returning proper error
codes. For the cases where this is not easily possible the client should
call dbus_connection_can_send_type() first.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is just a wrapper around _dbus_transport_can_pass_unix_fd() however
it is more generic.
The reason for keeping this generic is to ease later addition of more
types without having to add a new API for that.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When appending unix fds to the message a new entry in the fd array will
be allocated and the index to it will be written to the message payload.
When parsing unix fds from the message the index will be read from the
payload and then looked up in the fd array.
When we read fds we put them in a queue first. Since each message knows
how many fds are attached to it we will then pop enough fds from this
queue each time we decode a message from the stream.
This should make sending and receiving more portable since we don't make
any strong requirements on the exact semantics of the SCM_RIGHTS
implementation: as long as fds are recieved in order, none or lost and
the arrive at the same time as at least one byte from the actual message
dat we should be able to handle them correctly.
|
| |
| |
| |
| |
| | |
This is actually pretty boring since we store our fds as indexes that
are stored as uint32_t's.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We introduce a new type code for the unix fds. The data stored in unix
fd fields will be an integer index into the array of fds that are
attached to a specific message. We also introduce a new header field
that stores how many fds belong to the message. And finally we introduce
a new error for messages where the payload and the meta data (i.e. unix
fds read for it) don't match up.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
If we can use MSG_NOSIGNAL we don't have to play games with SIGPIPE
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
Due to some unknown reasons the dbus_new() macros had a semicolon at the
end which makes it impossible to use them in some situations.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These header files include config.h explicitly anyway. These checks are
hence pointless.
Of course one could argue that including config.h from header files
sucks, but D-Bus generally seems not to have a problem with that, so
let's unify this.
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
configure.in
|
| | |
| | |
| | |
| | |
| | |
| | | |
Define POSIX_PTHREAD_SEMANTICS earlier so more things use it.
Signed-off-by: Colin Walters <walters@verbum.org>
|
| | | |
|
| | | |
|