summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.c
Commit message (Collapse)AuthorAgeFilesLines
* 2005-06-16 Colin Walters <walters@verbum.org>Colin Walters2005-06-161-13/+39
| | | | | | | | | | | | * python/dbus_bindings.pyx.in: Import size_t, __int64_t, __uint64_t, and __signed. * dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (write_credentials_byte): Define cmsg struct, output it. (_dbus_read_credentials_unix_socket): Use cmsg struct. Patch from Joe Markus Clarke for FreeBSD support.
* 2005-06-15 Colin Walters <walters@verbum.org>Colin Walters2005-06-151-2/+2
| | | | | * dbus/dbus-sysdeps.c <HAVE_CMSGCRED> (_dbus_read_credentials_unix_socket): Fix call to dbus_set_error. (Patch from Michael Banck, #3461)
* * dbus/dbus-message.c:John (J5) Palmieri2005-06-151-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | (dbus_message_has_path): New method (dbus_message_has_interface): New method (dbus_message_has_member): New method * dbus/dbus/dbus-sysdeps.c (_dbus_check_dir_is_private_to_user): New method * dbus/dbus-keyring.c (_dbus_keyring_reload): Check to see that the keyring directory is private to the user * doc/TODO: - The convenience functions in dbus-bus.h should perhaps have the signatures that they would have if they were autogenerated stubs. e.g. the acquire service function. We should also evaluate which of these functions to include, in light of the fact that GLib/Qt native stubs will probably also exist.: Punted - add dbus_message_has_path(), maybe has_member/interface: fixed in this patch - in dbus-keyring.c, enforce that the keyring dir is not world readable/writable: Fixed in this patch
* 2005-03-05 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-03-051-7/+11
| | | | | | | | | | * dbus/dbus-sysdeps.c: (pseudorandom_generate_random_bytes_buffer): fix to have no return value (_dbus_generate_random_bytes_buffer): fix return value * dbus/dbus-sysdeps-util.c: s/GETPWNAME/GETPWNAM/ so configure checks actually work, from Tom Parker <fdo@tevp.net>
* 2005-02-25 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-02-251-12/+47
| | | | | | | | | | | | | | | | | | | | | | | | * doc/dbus-specification.xml: document the GUID thing * dbus/dbus-server.c (_dbus_server_init_base): initialize a globally unique ID for the server, and put a "guid=hexencoded" field in the address * dbus/dbus-bus.c: fix missing #include of dbus-threads-internal.h * dbus/dbus-message.c: ditto * dbus/dbus-dataslot.c: ditto * dbus/dbus-list.c: ditto * dbus/dbus-internals.h: wait, just include dbus-threads-internal.h here * dbus/dbus-string.c (_dbus_string_copy_to_buffer): move back for use in main library * dbus/dbus-sysdeps.c (_dbus_generate_random_bytes_buffer): new function
* 2005-01-20 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-2/+2
| | | | | * dbus/dbus-sysdeps.c (_dbus_poll): amazingly, trying to compile code can reveal bugs in it
* 2005-01-20 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-211-16/+17
| | | | | * dbus/dbus-sysdeps.c (_dbus_poll): fix several bugs in the select() version, patches from Tor Lillqvist
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-311/+63
| | | | | | | | | | | | | | | | | | | | | | | | This is about it on what can be disabled/deleted from libdbus easily, back below 150K anyhow. Deeper cuts are more work than just turning the code off as I've done here. * dbus/dbus-marshal-basic.c (_dbus_pack_int32): we don't need the signed int convenience funcs * dbus/dbus-internals.c (_dbus_verbose_real): omit when not in verbose mode * dbus/dbus-string-util.c, dbus/dbus-string.c: more breaking things out of libdbus * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-util.c: same * dbus/dbus-hash.c: purge the TWO_STRINGS crap (well, make it tests-enabled-only, though it should probably be deleted) * dbus/dbus-message-util.c: same stuff * dbus/dbus-auth-util.c: same stuff
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-171-0/+43
| | | | | | | | * dbus/dbus-userdb-util.c: split out part of dbus-userdb.c * dbus/dbus-sysdeps.c (_dbus_uid_from_string): move here to pave way for stripping down dbus-userdb.c stuff included in libdbus. Rename _dbus_parse_uid for consistency.
* 2005-01-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-161-553/+17
| | | | | | | | | | * test/unused-code-gc.py: hacky script to find code that's used only by the bus (not libdbus) or used only by tests or not used at all. It has some false alarms, but looks like we can clean up a lot of size from libdbus. * dbus/dbus-sysdeps.c, dbus/dbus-sysdeps-utils.c, dbus/Makefile.am: initially move 10K of binary size out of libdbus
* fix doh! in test for double parsingHavoc Pennington2005-01-111-2/+2
|
* 2005-01-03 Havoc Pennington <hp@redhat.com>Havoc Pennington2005-01-031-2/+2
| | | | | | | * dbus/dbus-sysdeps.c (_dbus_sysdeps_test): fix using == on floating point * dbus/dbus-string.c (_dbus_string_insert_alignment): new function
* 2004-11-25 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-11-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primary change here is to always write() once before adding the write watch, which gives us about a 10% performance increase. * dbus/dbus-transport-unix.c: a number of modifications to cope with removing messages_pending (check_write_watch): properly handle DBUS_AUTH_STATE_WAITING_FOR_MEMORY; adapt to removal of messages_pending stuff (check_read_watch): properly handle WAITING_FOR_MEMORY and AUTHENTICATED cases (unix_handle_watch): after writing, see if the write watch can be removed (unix_do_iteration): assert that write_watch/read_watch are non-NULL rather than testing that they aren't, since they aren't allowed to be NULL. check_write_watch() at the end so we add the watch if we did not finish writing (e.g. got EAGAIN) * dbus/dbus-transport-protected.h: remove messages_pending call, since it resulted in too much inefficient watch adding/removing; instead we now require that the transport user does an iteration after queueing outgoing messages, and after trying the first write() we add a write watch if we got EAGAIN or exceeded our max bytes to write per iteration setting * dbus/dbus-string.c (_dbus_string_validate_signature): add this function * dbus/dbus-server-unix.c (unix_finalize): the socket name was freed and then accessed, valgrind flagged this bug, fix it * dbus/dbus-message.c: fix several bugs where HEADER_FIELD_LAST was taken as the last valid field plus 1, where really it is equal to the last valid field. Corrects some message corruption issues. * dbus/dbus-mainloop.c: verbosity changes * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): handle OOM instead of aborting in one of the test codepaths * dbus/dbus-internals.c (_dbus_verbose_real): fix a bug that caused not printing the pid ever again if a verbose was missing the newline at the end (_dbus_header_field_to_string): add HEADER_FIELD_SIGNATURE * dbus/dbus-connection.c: verbosity changes; (dbus_connection_has_messages_to_send): new function (_dbus_connection_message_sent): no longer call transport->messages_pending (_dbus_connection_send_preallocated_unlocked): do one iteration to try to write() immediately, so we can avoid the write watch. This is the core purpose of this patchset (_dbus_connection_get_dispatch_status_unlocked): if disconnected, dump the outgoing message queue, so nobody will get confused trying to send them or thinking stuff is pending to be sent * bus/test.c: verbosity changes * bus/driver.c: verbosity/assertion changes * bus/dispatch.c: a bunch of little tweaks to get it working again because this patchset changes when/where you need to block.
* 2004-10-29 Colin Walters <walters@redhat.com>Colin Walters2004-10-291-0/+38
| | | | | | | | | | * dbus/dbus-sysdeps.h (_dbus_become_daemon): Also take parameter for fd to write pid to. * dbus/dbus-sysdeps.c (_dbus_become_daemon): Implement it. * bus/bus.c (bus_context_new): Pass print_pid_fd to _dbus_become_daemon (bug #1720)
* John (J5) Palmieri <johnp@redhat.com>John (J5) Palmieri2004-10-251-1/+0
| | | | | | | | | | | * dbus/dbus-sysdeps.c (fill_user_info): On errors do not free the DBusUserInfo structure since this is passed into the function. This would cause a double free when the function that allocated the structure would try to free it when an error occured. * (bus/session.conf.in, bus/Makefile.am, dbus/configure.in): use /usr/share/dbus-1/services instead of /usr/lib/dbus-1.0/services for service activation to avoid 32bit/64bit parallel install issues
* * dbus/dbus-sysdeps.c (_dbus_file_get_contents): fix an incorrect format string.Olivier Andrieu2004-10-071-1/+1
| | | | | * glib/dbus-dbus-gmain.c (dbus_g_bus_get): do not mangle NULL pointer (bug #1540, Leonardo Boiko).
* * dbus/dbus-sysdeps.c (_dbus_user_at_console): fix memleak in OOM.Olivier Andrieu2004-09-171-5/+8
| | | | | | | | | | | * doc/busconfig.dtd: update the DTD for the at_console attribute. * bus/driver.c (bus_driver_handle_hello): correctly handle Hello messages after the first one (bug #1389). * bus/dispatch.c (check_double_hello_message): add a test case for the double hello message bug. (check_existent_service_activation): fix check of spawning error.
* 2004-08-28 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-291-0/+2
| | | | | | | | | | | | * dbus/dbus-userdb.c (_dbus_is_console_user): remove unused variable More fixes from Steve Grubb * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix fd leak (_dbus_listen_tcp_socket): fix fd leak * dbus/dbus-spawn.c (read_pid, read_ints): move the "again:" for EINTR to a bit lower in the code
* Console user security policyJohn (J5) Palmieri2004-08-251-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/config-parser.c: (struct PolicyType): Add POLICY_CONSOLE (struct Element.d.policy): s/gid_or_uid/gid_uid_or_at_console (start_busconfig_child): Sets up console element when <policy at_console=""> is encountered in a policy file (append_rule_from_element): Convert console elements to console rules. * bus/policy.c: (bus_policy_create_client_policy): Add console rules to the client policy based on if the client is at the console (bus_policy_append_console_rule): New function for adding a console rule to a policy (bus_policy_merge): Handle console rule merging * dbus/dbus-sysdeps.h: Added the DBUS_CONSOLE_DIR constant where we check for console user files * dbus/dbus-sysdeps.c: (_dbus_file_exists): New function which checks if the given file exists (_dbus_user_at_console): New function which does the system specific process of checking if the user is at the console * dbus/dbus-userdb.c: (_dbus_is_console_user): New function converts a UID to user name and then calls the system specific _dbus_user_at_console to see if the user is at the console and therefor a console user
* might be nice if my patches compiled...Havoc Pennington2004-08-231-2/+2
|
* 2004-08-23 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-231-0/+10
| | | | | * dbus/dbus-sysdeps.c (_dbus_change_identity): add setgroups() to drop supplementary groups, suggested by Steve Grubb
* 2004-08-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-08-101-1/+1
| | | | | * COPYING: switch to Academic Free License version 2.1 instead of 2.0, to resolve complaints about patent termination clause.
* 2004-07-22 Olivier Andrieu <oliv__a@users.sourceforge.net>Olivier Andrieu2004-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (fill_user_info): fix inexistent label name, breaking build on Solaris, reported by Farhad Saberi on the ML. * dbus/dbus-message.c (dbus_message_append_args_valist): fix the va_arg invocation to account for integer promotion in the case of DBUS_TYPE_BYTE (unsigned char is promoted to int). (bug #901) * bus/services.c (bus_service_remove_owner): fix bug #902, use _dbus_list_get_first_link, not _dbus_list_get_first. * dbus/dbus-bus.c (dbus_bus_service_exists): plug a memory leak. * dbus/dbus-object-tree.c (free_subtree_recurse): always null handler functions so that the asserts in _dbus_object_subtree_unref do not fail. * dbus/dbus-transport-unix.c (do_reading): _dbus_transport_queue_messages return value is of type dbus_bool_t, not DBusDispatchStatus.
* 2004-06-20 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-06-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib-error-enum.h: autogenerate the GError enum codes from the dbus error names * glib/dbus-glib.h: move to subdir dbus/ since it's included as dbus/dbus-glib.h and that breakage is now visible due to including dbus/dbus-glib.h in dbus-glib-lowlevel.h * glib/dbus-glib.h: s/gproxy/g_proxy/ * dbus/dbus-shared.h: new header to hold stuff shared with binding APIs * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather than dbus-errors.h * glib/dbus-glib.h (dbus_set_g_error): move to dbus-glib-lowlevel.h * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch of stuff to enable this * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here * a bunch of other changes with the same basic "separate glib bindings from dbus.h" theme
* 2004-04-21 Kristian Høgsberg <krh@redhat.com>Kristian Høgsberg2004-04-211-3/+0
| | | | | | | | | | * dbus/dbus-server-unix.c (unix_finalize): Don't unref unix_server->watch here, it is unreffed in disconnect. (_dbus_server_new_for_tcp_socket): convert NULL host to "localhost" here so we don't append NULL to address. * dbus/dbus-server.c (_dbus_server_test): Add test case for various addresses, including tcp with no explicit host.
* 2004-04-19 Kristian Høgsberg <krh@redhat.com>Kristian Høgsberg2004-04-191-2/+0
| | | | | * dbus/dbus-transport-unix.c (unix_do_iteration): Rewrite to use _dbus_poll() instead of select().
* 2004-03-12 Mikael Hallendal <micke@imendio.com>Mikael Hallendal2004-03-121-0/+28
| | | | | | | | | | | | | | | | * bus/activation.c: - Added service file reloading. Each service files directory is kept in an hash table in BusActivation and each BusActivationEntry knows what .service-file it was read from. So when you try to activate a service the bus will check if it's been updated, removed or if new .service-files has been installed. - Test code at the bottom for the service file reloading. * bus/test-main.c: (main): * bus/test.h: - added service reloading test. * dbus/dbus-sysdeps.c: * dbus/dbus-sysdeps.h: (_dbus_delete_directory): Added.
* 2003-12-02 Richard Hult <richard@imendio.com>Richard Hult2003-12-021-1/+1
| | | | | * Update AFL version to 2.0 throughout the source files to reflect the update that was done a while ago.
* 2003-10-16 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-10-161-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/connection.c (bus_pending_reply_expired): either cancel or execute, not both (bus_connections_check_reply): use unlink, not remove_link, as we don't want to free the link; fixes double free mess * dbus/dbus-pending-call.c (dbus_pending_call_block): fix in case where no reply was received * dbus/dbus-connection.c (_dbus_pending_call_complete_and_unlock): fix a refcount leak * bus/signals.c (match_rule_matches): add special cases for the bus driver, so you can match on sender/destination for it. * dbus/dbus-sysdeps.c (_dbus_abort): print backtrace if DBUS_PRINT_BACKTRACE is set * dbus/dbus-internals.c: add pid to assertion failure messages * dbus/dbus-connection.c: add message type code to the debug spew * glib/dbus-gproxy.c (gproxy_get_match_rule): match rules want sender=foo not service=foo * dbus/dbus-bus.c (dbus_bus_get): if the activation bus is the session bus but DBUS_SESSION_BUS_ADDRESS isn't set, use DBUS_ACTIVATION_ADDRESS instead * bus/activation.c: set DBUS_SESSION_BUS_ADDRESS, DBUS_SYSTEM_BUS_ADDRESS if appropriate * bus/bus.c (bus_context_new): handle OOM copying bus type into context struct * dbus/dbus-message.c (dbus_message_iter_get_object_path): new function (dbus_message_iter_get_object_path_array): new function (half finished, disabled for the moment) * glib/dbus-gproxy.c (dbus_gproxy_end_call): properly handle DBUS_MESSAGE_TYPE_ERROR * tools/dbus-launch.c (babysit): support DBUS_DEBUG_OUTPUT to avoid redirecting stderr to /dev/null (babysit): close stdin if not doing the "exit_with_session" thing * dbus/dbus-sysdeps.c (_dbus_become_daemon): delete some leftover debug code; change DBUS_DEBUG_OUTPUT to only enable stderr, not stdout/stdin, so things don't get confused * bus/system.conf.in: fix to allow replies, I modified .conf instead of .conf.in again.
* 2003-10-11 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-10-111-0/+18
| | | | | | | | | | | | | | | | | | | | * dbus/dbus-message.c (_dbus_message_test): add more test coverage, but #if 0 for now since they uncover a bug not fixed yet; I think in re_align_field_recurse() (re_align_field_recurse): add FIXME about broken assertion * dbus/dbus-sysdeps.c (_dbus_sysdeps_test): add more test coverage * bus/connection.c: share a couple code bits with expirelist.c * bus/expirelist.h, bus/expirelist.c: implement a generic expire-items-after-N-seconds facility, was going to share between expiring connections and replies, decided not to use for expiring connections for now. * bus/connection.c: add tracking of expected replies * COPYING: include AFL 2.0 (still need to change all the file headers)
* 2003-09-07 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-09-071-1/+4
| | | | * Make Doxygen contented.
* 2003-06-15 Joe Shaw <joe@assbarn.com>Joe Shaw2003-06-151-0/+4
| | | | | | | | | | | * configure.in: Check for socklen_t. * dbus/dbus-sysdeps.c: Define socklen_t if it's not defined. * test/test-segfault.c: Add #include <sys/time.h> * tools/Makefile.am: Add DBUS_X_CFLAGS to the INCLUDES since dbus-launch needs it.
* 2003-06-09 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-06-091-9/+17
| | | | | | | | * dbus/dbus-sysdeps.c (_dbus_listen_unix_socket): don't use SUN_LEN, it breaks abstract socket usage * dbus/dbus-internals.c (_dbus_verbose_real): only print PID at starts of lines.
* 2003-06-04 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-06-041-26/+65
| | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-server.c (dbus_server_listen): allow abstract sockets using unix:abstract=/foo, and when listening in a tmpdir i.e. unix:tmpdir=/tmp, always use abstract sockets if we can. * dbus/dbus-transport.c (_dbus_transport_open): support unix:abstract=/foo * dbus/dbus-server-unix.c (_dbus_server_new_for_domain_socket): support abstract sockets * dbus/dbus-transport-unix.c (_dbus_transport_new_for_domain_socket): support abstract sockets * dbus/dbus-sysdeps.c (_dbus_connect_unix_socket): add "abstract" toggle as an argument, implement abstract namespace support (_dbus_listen_unix_socket): ditto * configure.in: add --enable-abstract-sockets and implement a configure check for autodetection of the right value.
* 2003-05-15 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-05-151-7/+6
| | | | | * dbus/dbus-sysdeps.c (_dbus_atomic_dec, _dbus_atomic_inc): work on non-x86. ifdef's are evil.
* 2003-05-11 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-05-121-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-marshal.c (_dbus_marshal_validate_arg): fix to avoid calling _dbus_marshal_validate_arg() for every byte in a byte array, etc. * dbus/dbus-message-handler.c: use atomic reference counting to reduce number of locks slightly; the global lock in here sucks * dbus/dbus-connection.c (_dbus_connection_update_dispatch_status_and_unlock): variant of update_dispatch_status that can be called with lock held; then use in a couple places to reduce locking/unlocking (dbus_connection_send): hold the lock over the whole function instead of acquiring it twice. * dbus/dbus-timeout.c (_dbus_timeout_new): handle OOM * bus/connection.c (bus_connections_setup_connection): fix access to already-freed memory. * dbus/dbus-connection.c: keep a little cache of linked list nodes, to avoid using the global linked list alloc lock in the normal send-message case. Instead we just use the connection lock that we already have to take. * dbus/dbus-list.c (_dbus_list_find_last): new function * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): change to use a struct for the atomic type; fix docs, they return value before increment, not after increment. * dbus/dbus-string.c (_dbus_string_append_4_aligned) (_dbus_string_append_8_aligned): new functions to try to microoptimize this operation. (reallocate_for_length): break this out of set_length(), to improve profile info, and also so we can consider inlining the set_length() part. * dbus/dbus-message.c (dbus_message_new_empty_header): init data strings with some preallocation, cuts down on our calls to realloc a fair bit. Though if we can get the "move entire string to empty string" optimization below to kick in here, it would be better. * dbus/dbus-string.c (_dbus_string_move): just call _dbus_string_move_len (_dbus_string_move_len): add a special case for moving an entire string into an empty string; we can just swap the string data instead of doing any reallocs. (_dbus_string_init_preallocated): new function
* 2003-05-11 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-05-111-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Write a "test-profile" that does echo client-server with threads; profile reveals lock contention, memcpy/realloc of buffers, and UTF-8 validation as hot spots. 20% of lock contention eliminated with dbus_atomic_inc/dec implementation on x86. Much remaining contention is global mempool locks for GList and DBusList. * dbus/dbus-sysdeps.c (_dbus_atomic_inc, _dbus_atomic_dec): add x86 implementation * dbus/dbus-connection.c (struct DBusConnection): use dbus_atomic_t for the reference count * dbus/dbus-message.c (struct DBusMessage): declare dbus_atomic_t values as volatile * configure.in: code to detect ability to use atomic integer operations in assembly, from GLib patch * dbus/dbus-internals.c (_dbus_verbose_real): call getpid every time, tired of it being wrong in threads and forked processes * glib/test-profile.c: a little program to bounce messages back and forth between threads and eat CPU * dbus/dbus-connection.c: add debug spew macros for debugging thread locks; include config.h at top; fix deadlock in dbus_connection_flush()
* 2003-05-04 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-05-051-0/+3
| | | | | | | | | | | | | | | | | | * dbus/dbus-message-handler.c (_dbus_message_handler_test): add unit test * dbus/dbus-marshal.c (_dbus_demarshal_string_array): fix this function, which assumed length was in # of strings, not bytes * dbus/dbus-message.c (_dbus_message_test): add tests for some missing coverage * dbus/dbus-connection.c (_dbus_connection_queue_received_message): disable function for now, we are only using it in test mode * dbus/dbus-message.c (_dbus_message_loader_queue_messages): remove a mistaken FIXME
* 2003-05-03 Colin Walters <walters@verbum.org>Colin Walters2003-05-031-2/+8
| | | | | | | * dbus/dbus-sysdeps.c (fill_user_info): Test against DBUS_UID_UNSET to determine whether to do a uid lookup or not. * Makefile.am: Update to use new .pc versioning scheme.
* 2003-04-19 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-191-2/+2
| | | | | | | | | | | | | | * bus/driver.c (bus_driver_handle_hello): check limits and return an error if they are exceeded. * bus/connection.c: maintain separate lists of active and inactive connections, and a count of each. Maintain count of completed connections per user. Implement code to check connection limits. * dbus/dbus-list.c (_dbus_list_unlink): export * bus/bus.c (bus_context_check_security_policy): enforce a maximum number of bytes in the message queue for a connection
* 2003-04-18 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-181-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-auth.c (record_mechanisms): memleak fixes * dbus/dbus-sysdeps.c (_dbus_string_save_to_file): fix some memleaks * dbus/dbus-keyring.c (add_new_key): fix a memleak, and on realloc be sure to update the pointer in the keyring * dbus/dbus-string.c (_dbus_string_zero): compensate for align offset to avoid writing to unallocated memory * dbus/dbus-auth.c (process_rejected): return FALSE if we fail to try the next mechanism, so we properly handle OOM * dbus/dbus-keyring.c (_dbus_keyring_new_homedir): fix double-free on OOM. (_dbus_keyring_new): fix OOM bug (_dbus_keyring_new_homedir): always set error; impose a maximum number of keys we'll load from the file, mostly to speed up the test suite and make its OOM checks more useful, but also for general sanity. * dbus/dbus-auth.c (process_error_server): reject authentication if we get an error from the client (process_cancel): on cancel, send REJECTED, per the spec (process_error_client): send CANCEL if we get an error from the server.
* 2003-04-18 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-181-1/+19
| | | | | | | | | | | | | | * glib/dbus-gmain.c: adapt to watch changes * bus/bus.c, bus/activation.c, etc.: adjust to watch changes * dbus/dbus-server.h: remove dbus_server_handle_watch * dbus/dbus-connection.h: remove dbus_connection_handle_watch * dbus/dbus-watch.c (dbus_watch_handle): change DBusWatch to work like DBusTimeout, so we don't need dbus_connection_handle_watch etc.
* 2003-04-17 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-04-171-418/+260
| | | | | * dbus/dbus-userdb.c, dbus/dbus-sysdeps.c: redo all the passwd database usage so it all goes via the DBusUserDatabase cache.
* 2003-04-13 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-141-25/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-mainloop.c: fix some reentrancy issues by refcounting callbacks * test/data/valid-config-files/debug-allow-all.conf.in: allow all users * dbus/dbus-transport.c (_dbus_transport_get_dispatch_status): fix to only recover unused bytes if we're already authenticated (_dbus_transport_get_is_authenticated): fix to still mark us authenticated if there are unused bytes. * bus/dispatch.c: implement security policy checking * bus/connection.c (bus_transaction_send_from_driver): new * bus/bus.c (bus_context_check_security_policy): new * bus/dispatch.c (send_service_nonexistent_error): delete this, now we just set the DBusError and it gets converted to an error reply. * bus/connection.c (allow_user_function): enable code using actual data from the config file * bus/policy.c (list_allows_user): handle wildcard rules for user/group connection perms
* 2003-04-13 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-131-0/+24
| | | | | | | | | | * bus/config-parser.c: Load up the BusPolicy and BusPolicyRules * dbus/dbus-sysdeps.c (_dbus_get_user_id): new function * bus/policy.c (bus_policy_append_mandatory_rule) (bus_policy_append_default_rule, bus_policy_append_user_rule) (bus_policy_append_group_rule): new functions
* 2003-04-12 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-131-25/+32
| | | | | | | | | | | * bus/config-parser.c (bus_config_parser_new): fix a memleak * dbus/dbus-sysdeps.c: change DBusCredentials to use longs for the pid/gid/uid, just for paranoia. * test/break-loader.c (randomly_do_n_things): find a byte containing a type code, and randomly change it to a different type code.
* 2003-04-08 Alexander Larsson <alexl@redhat.com>Alexander Larsson2003-04-081-7/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented recursive types, named types and new-style iters * bus/driver.c: * glib/test-thread-client.c: (thread_func): * glib/test-thread-server.c: (handle_test_message): * test/test-service.c: (handle_echo): Update to new api * dbus/Makefile.am: * dbus/dbus-dict.c: * dbus/dbus-dict.h: * dbus/dbus.h Remove DBusDict * dbus/dbus-internals.c: (_dbus_type_to_string): Update for new types. * dbus/dbus-marshal.[ch]: Implement recursive types and the new marshalling format. Remove hardcoded dict marshalling. Marshal named types. * dbus/dbus-message-builder.c: Add BYTE_ARRAY. Remove references to old types * dbus/dbus-message.[ch]: New non-refcounted iter API that supports recursive iters. Use iters for appending, including support for recursive iters. Add byte and named type support. Update everything to new marshalling formats. Add tests for new API. * dbus/dbus-protocol.h: Remove old array types. Add types: BYTE, ARRAY, DICT, NAMED * dbus/dbus-string.c: * dbus/dbus-sysdeps.c: Make parse_double locale safe. * dbus/dbus-test-main.c: Call setlocale. * dbus/dbus-test.c: Kill dict test * doc/dbus-specification.sgml: Update spec * test/data/incomplete-messages/missing-body.message: * test/data/invalid-messages/bad-boolean.message: * test/data/invalid-messages/bad-boolean-array.message: * test/data/invalid-messages/boolean-array-length-too-long.message-raw: * test/data/invalid-messages/boolean-has-no-value.message-raw: * test/data/invalid-messages/too-short-dict.message: * test/data/valid-messages/dict-simple.message: * test/data/valid-messages/dict.message: * test/data/valid-messages/emptiness.message: * test/data/valid-messages/lots-of-arguments.message: * test/data/valid-messages/no-padding.message: * test/data/valid-messages/recursive-types.message: Add missing NAME fields Fix up dicts & arrays * test/data/invalid-messages/dict-with-nil-value.message: Removed, this is not invalid anymore. * test/data/valid-messages/recursive-types.message: Add new test for deeply recursive types.
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-061-28/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile here in the parent process, so we can return an error if it fails. Also, move some of the code into the child so the parent is less hosed if we fail midway through. * bus/bus.c (bus_context_new): move pidfile detection further up in the function, before we start overwriting sockets and such. * bus/messagebus.in: adjust this a bit, not sure if it will work. * configure.in: add --with-system-pid-file and --with-system-socket 2003-04-06 Colin Walters <walters@verbum.org> * configure.in (DBUS_SYSTEM_PID_FILE): New variable. * bus/system.conf.in: Declare a pidfile. * bus/bus.c (bus_context_new): Test for an existing pid file, and create one (if appropriate). * bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New. (struct BusConfigParser) [pidfile]: New. (element_type_to_name, merge_included, start_busconfig_child) (bus_config_parser_end_element, bus_config_parser_content): Handle it. (bus_config_parser_unref): Free it. (bus_config_parser_get_pidfile): New function. * bus/config-parser.h (_dbus_write_pid_file): Prototype. * dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error. * dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function. * dbus/dbus-sysdeps.h: Prototype it.
* 2003-04-06 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-061-72/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bus/bus.c (bus_context_new): fix wrong handling of server_data_slot_unref() in the error case. * dbus/dbus-internals.h (_dbus_assert): change so it passes "(condition) != 0" to _dbus_real_assert so that "_dbus_assert (pointer)" doesn't cause a warning * bus/main.c (main): accept --print-address option to print out the message bus address * dbus/dbus-sysdeps.c (_dbus_generate_random_ascii): export this * dbus/dbus-transport.c (_dbus_transport_open): special error for "tmpdir" option to unix: address on client side * dbus/dbus-server.c (dbus_server_listen): handle "tmpdir" option to unix: address * configure.in (TEST_SOCKET_DIR): locate a temporary directory we can use to create sockets in the test suite. * bus/main.c (signal_handler): on SIGTERM, exit the daemon cleanly. To be used for testing. * dbus/dbus-spawn.c (babysit): use _dbus_set_signal_handler() * dbus/dbus-sysdeps.c (_dbus_set_signal_handler): new * dbus/dbus-server-debug-pipe.c (_dbus_transport_debug_pipe_new): handle trying to call this when there's no servers active
* 2003-04-05 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-04-051-2/+2
| | | | | | | | | | * Makefile.am (coverage-report.txt): add target "coverage-report.txt" * test/decode-gcov.c: hack up a little program to suck data out of gcov files. Yes this is sort of silly. * configure.in: define something in config.h and do an AM_CONDITIONAL when gcov is enabled