- New upstream 1.2.2

- Drop patches that were upstreamed
This commit is contained in:
Colin Walters 2008-08-06 20:24:23 +00:00
parent adaaccf0d6
commit 344df7dbbd
8 changed files with 9 additions and 940 deletions

View File

@ -1,5 +1 @@
dbus-1.1.2.tar.gz
dbus-1.1.3.tar.gz
dbus-1.1.4.tar.gz
dbus-1.1.20.tar.gz
dbus-1.2.1.tar.gz
dbus-1.2.3.tar.gz

View File

@ -1,766 +0,0 @@
diff -up dbus-1.2.1/bus/activation.c.activation-env dbus-1.2.1/bus/activation.c
--- dbus-1.2.1/bus/activation.c.activation-env 2008-07-18 19:53:24.000000000 -0400
+++ dbus-1.2.1/bus/activation.c 2008-07-18 19:56:13.000000000 -0400
@@ -51,6 +51,7 @@ struct BusActivation
* activations per se
*/
DBusHashTable *directories;
+ DBusHashTable *environment;
};
typedef struct
@@ -671,6 +672,69 @@ update_directory (BusActivation *a
return retval;
}
+static dbus_bool_t
+populate_environment (BusActivation *activation)
+{
+ DBusString key;
+ DBusString value;
+ int i;
+ char **environment;
+ dbus_bool_t retval;
+
+ environment = _dbus_get_environment ();
+
+ if (environment == NULL)
+ return FALSE;
+
+ if (!_dbus_string_init (&key))
+ {
+ dbus_free_string_array (environment);
+ return FALSE;
+ }
+
+ if (!_dbus_string_init (&value))
+ {
+ _dbus_string_free (&key);
+ dbus_free_string_array (environment);
+ return FALSE;
+ }
+
+ for (i = 0; environment[i] != NULL; i++)
+ {
+ if (!_dbus_string_append (&key, environment[i]))
+ break;
+
+ if (_dbus_string_split_on_byte (&key, '=', &value))
+ {
+ char *hash_key, *hash_value;
+
+ if (!_dbus_string_steal_data (&key, &hash_key))
+ break;
+
+ if (!_dbus_string_steal_data (&value, &hash_value))
+ break;
+
+ if (!_dbus_hash_table_insert_string (activation->environment,
+ hash_key, hash_value))
+ break;
+ }
+ _dbus_string_set_length (&key, 0);
+ _dbus_string_set_length (&value, 0);
+ }
+
+ if (environment[i] != NULL)
+ goto out;
+
+ retval = TRUE;
+out:
+
+ _dbus_string_free (&key);
+ _dbus_string_free (&value);
+ dbus_free_string_array (environment);
+
+ return retval;
+}
+
BusActivation*
bus_activation_new (BusContext *context,
const DBusString *address,
@@ -779,6 +843,22 @@ bus_activation_new (BusContext *c
link = _dbus_list_get_next_link (directories, link);
}
+ activation->environment = _dbus_hash_table_new (DBUS_HASH_STRING,
+ (DBusFreeFunction) dbus_free,
+ (DBusFreeFunction) dbus_free);
+
+ if (activation->environment == NULL)
+ {
+ BUS_SET_OOM (error);
+ goto failed;
+ }
+
+ if (!populate_environment (activation))
+ {
+ BUS_SET_OOM (error);
+ goto failed;
+ }
+
return activation;
failed:
@@ -813,41 +893,51 @@ bus_activation_unref (BusActivation *act
_dbus_hash_table_unref (activation->pending_activations);
if (activation->directories)
_dbus_hash_table_unref (activation->directories);
-
+ if (activation->environment)
+ _dbus_hash_table_unref (activation->environment);
+
dbus_free (activation);
}
-static void
-child_setup (void *data)
+static dbus_bool_t
+add_bus_environment (BusActivation *activation,
+ DBusError *error)
{
- BusActivation *activation = data;
const char *type;
- /* If no memory, we simply have the child exit, so it won't try
- * to connect to the wrong thing.
- */
- if (!_dbus_setenv ("DBUS_STARTER_ADDRESS", activation->server_address))
- _dbus_exit (1);
+ if (!bus_activation_set_environment_variable (activation,
+ "DBUS_STARTER_ADDRESS",
+ activation->server_address,
+ error))
+ return FALSE;
type = bus_context_get_type (activation->context);
if (type != NULL)
{
- if (!_dbus_setenv ("DBUS_STARTER_BUS_TYPE", type))
- _dbus_exit (1);
+ if (!bus_activation_set_environment_variable (activation,
+ "DBUS_STARTER_BUS_TYPE", type,
+ error))
+ return FALSE;
if (strcmp (type, "session") == 0)
{
- if (!_dbus_setenv ("DBUS_SESSION_BUS_ADDRESS",
- activation->server_address))
- _dbus_exit (1);
+ if (!bus_activation_set_environment_variable (activation,
+ "DBUS_SESSION_BUS_ADDRESS",
+ activation->server_address,
+ error))
+ return FALSE;
}
else if (strcmp (type, "system") == 0)
{
- if (!_dbus_setenv ("DBUS_SYSTEM_BUS_ADDRESS",
- activation->server_address))
- _dbus_exit (1);
+ if (!bus_activation_set_environment_variable (activation,
+ "DBUS_SYSTEM_BUS_ADDRESS",
+ activation->server_address,
+ error))
+ return FALSE;
}
}
+
+ return TRUE;
}
typedef struct
@@ -1389,6 +1479,95 @@ activation_find_entry (BusActivation *ac
return entry;
}
+static char **
+bus_activation_get_environment (BusActivation *activation)
+{
+ char **environment;
+ int i, length;
+ DBusString entry;
+ DBusHashIter iter;
+
+ length = _dbus_hash_table_get_n_entries (activation->environment);
+
+ environment = dbus_new0 (char *, length + 1);
+
+ if (environment == NULL)
+ return NULL;
+
+ i = 0;
+ _dbus_hash_iter_init (activation->environment, &iter);
+
+ if (!_dbus_string_init (&entry))
+ {
+ dbus_free_string_array (environment);
+ return NULL;
+ }
+
+ while (_dbus_hash_iter_next (&iter))
+ {
+ const char *key, *value;
+
+ key = (const char *) _dbus_hash_iter_get_string_key (&iter);
+ value = (const char *) _dbus_hash_iter_get_value (&iter);
+
+ if (!_dbus_string_append_printf (&entry, "%s=%s", key, value))
+ break;
+
+ if (!_dbus_string_steal_data (&entry, environment + i))
+ break;
+ i++;
+ }
+
+ _dbus_string_free (&entry);
+
+ if (i != length)
+ {
+ dbus_free_string_array (environment);
+ environment = NULL;
+ }
+
+ return environment;
+}
+
+dbus_bool_t
+bus_activation_set_environment_variable (BusActivation *activation,
+ const char *key,
+ const char *value,
+ DBusError *error)
+{
+ char *hash_key;
+ char *hash_value;
+ dbus_bool_t retval;
+
+ retval = FALSE;
+ hash_key = NULL;
+ hash_value = NULL;
+ hash_key = _dbus_strdup (key);
+
+ if (hash_key == NULL)
+ goto out;
+
+ hash_value = _dbus_strdup (value);
+
+ if (hash_value == NULL)
+ goto out;
+
+ if (!_dbus_hash_table_insert_string (activation->environment,
+ hash_key, hash_value))
+ goto out;
+
+ retval = TRUE;
+out:
+ if (retval == FALSE)
+ {
+ dbus_free (hash_key);
+ dbus_free (hash_value);
+ BUS_SET_OOM (error);
+ }
+
+ return retval;
+}
+
dbus_bool_t
bus_activation_activate_service (BusActivation *activation,
DBusConnection *connection,
@@ -1688,20 +1867,38 @@ bus_activation_activate_service (BusActi
}
_dbus_string_free (&command);
+ if (!add_bus_environment (activation, error))
+ {
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ dbus_free_string_array (argv);
+ return FALSE;
+ }
+
+ envp = bus_activation_get_environment (activation);
+
+ if (envp == NULL)
+ {
+ BUS_SET_OOM (error);
+ dbus_free_string_array (argv);
+ return FALSE;
+ }
+
_dbus_verbose ("Spawning %s ...\n", argv[0]);
if (!_dbus_spawn_async_with_babysitter (&pending_activation->babysitter, argv,
envp,
- child_setup, activation,
+ NULL, activation,
error))
{
_dbus_verbose ("Failed to spawn child\n");
_DBUS_ASSERT_ERROR_IS_SET (error);
dbus_free_string_array (argv);
+ dbus_free_string_array (envp);
return FALSE;
}
dbus_free_string_array (argv);
+ envp = NULL;
_dbus_assert (pending_activation->babysitter != NULL);
diff -up dbus-1.2.1/bus/activation.h.activation-env dbus-1.2.1/bus/activation.h
--- dbus-1.2.1/bus/activation.h.activation-env 2008-07-18 19:53:32.000000000 -0400
+++ dbus-1.2.1/bus/activation.h 2008-07-18 19:56:13.000000000 -0400
@@ -34,6 +34,11 @@ BusActivation* bus_activation_new
DBusError *error);
BusActivation* bus_activation_ref (BusActivation *activation);
void bus_activation_unref (BusActivation *activation);
+
+dbus_bool_t bus_activation_set_environment_variable (BusActivation *activation,
+ const char *key,
+ const char *value,
+ DBusError *error);
dbus_bool_t bus_activation_activate_service (BusActivation *activation,
DBusConnection *connection,
BusTransaction *transaction,
diff -up dbus-1.2.1/bus/dbus-daemon.1.in.activation-env dbus-1.2.1/bus/dbus-daemon.1.in
--- dbus-1.2.1/bus/dbus-daemon.1.in.activation-env 2008-07-18 19:53:43.000000000 -0400
+++ dbus-1.2.1/bus/dbus-daemon.1.in 2008-07-18 19:56:13.000000000 -0400
@@ -138,7 +138,21 @@ Root element.
The well-known type of the message bus. Currently known values are
"system" and "session"; if other values are set, they should be
either added to the D-Bus specification, or namespaced. The last
-<type> element "wins" (previous values are ignored).
+<type> element "wins" (previous values are ignored). This element
+only controls which message bus specific environment variables are
+set in activated clients. Most of the policy that distinguishes a
+session bus from the system bus is controlled from the other elements
+in the configuration file.
+
+.PP
+If the well-known type of the message bus is "session", then the
+DBUS_STARTER_BUS_TYPE environment variable will be set to "session"
+and the DBUS_SESSION_BUS_ADDRESS environment variable will be set
+to the address of the session bus. Likewise, if the type of the
+message bus is "system", then the DBUS_STARTER_BUS_TYPE environment
+variable will be set to "system" and the DBUS_SESSION_BUS_ADDRESS
+environment variable will be set to the address of the system bus
+(which is normally well known anyway).
.PP
Example: <type>session</type>
diff -up dbus-1.2.1/bus/driver.c.activation-env dbus-1.2.1/bus/driver.c
--- dbus-1.2.1/bus/driver.c.activation-env 2008-07-18 19:53:54.000000000 -0400
+++ dbus-1.2.1/bus/driver.c 2008-07-18 19:56:13.000000000 -0400
@@ -811,6 +811,133 @@ send_ack_reply (DBusConnection *connecti
}
static dbus_bool_t
+bus_driver_handle_update_activation_environment (DBusConnection *connection,
+ BusTransaction *transaction,
+ DBusMessage *message,
+ DBusError *error)
+{
+ dbus_bool_t retval;
+ BusActivation *activation;
+ DBusMessageIter iter;
+ DBusMessageIter dict_iter;
+ DBusMessageIter dict_entry_iter;
+ int msg_type;
+ int array_type;
+ int key_type;
+ DBusList *keys, *key_link;
+ DBusList *values, *value_link;
+
+ _DBUS_ASSERT_ERROR_IS_CLEAR (error);
+
+ activation = bus_connection_get_activation (connection);
+
+ dbus_message_iter_init (message, &iter);
+
+ /* The message signature has already been checked for us,
+ * so let's just assert it's right.
+ */
+ msg_type = dbus_message_iter_get_arg_type (&iter);
+
+ _dbus_assert (msg_type == DBUS_TYPE_ARRAY);
+
+ dbus_message_iter_recurse (&iter, &dict_iter);
+
+ retval = FALSE;
+
+ /* Then loop through the sent dictionary, add the location of
+ * the environment keys and values to lists. The result will
+ * be in reverse order, so we don't have to constantly search
+ * for the end of the list in a loop.
+ */
+ keys = NULL;
+ values = NULL;
+ while ((array_type = dbus_message_iter_get_arg_type (&dict_iter)) == DBUS_TYPE_DICT_ENTRY)
+ {
+ dbus_message_iter_recurse (&dict_iter, &dict_entry_iter);
+
+ while ((key_type = dbus_message_iter_get_arg_type (&dict_entry_iter)) == DBUS_TYPE_STRING)
+ {
+ char *key;
+ char *value;
+ int value_type;
+
+ dbus_message_iter_get_basic (&dict_entry_iter, &key);
+ dbus_message_iter_next (&dict_entry_iter);
+
+ value_type = dbus_message_iter_get_arg_type (&dict_entry_iter);
+
+ if (value_type != DBUS_TYPE_STRING)
+ break;
+
+ dbus_message_iter_get_basic (&dict_entry_iter, &value);
+
+ if (!_dbus_list_append (&keys, key))
+ {
+ BUS_SET_OOM (error);
+ break;
+ }
+
+ if (!_dbus_list_append (&values, value))
+ {
+ BUS_SET_OOM (error);
+ break;
+ }
+
+ dbus_message_iter_next (&dict_entry_iter);
+ }
+
+ if (key_type != DBUS_TYPE_INVALID)
+ break;
+
+ dbus_message_iter_next (&dict_iter);
+ }
+
+ if (array_type != DBUS_TYPE_INVALID)
+ goto out;
+
+ _dbus_assert (_dbus_list_get_length (&keys) == _dbus_list_get_length (&values));
+
+ key_link = keys;
+ value_link = values;
+ while (key_link != NULL)
+ {
+ const char *key;
+ const char *value;
+
+ key = key_link->data;
+ value = value_link->data;
+
+ if (!bus_activation_set_environment_variable (activation,
+ key, value, error))
+ {
+ _DBUS_ASSERT_ERROR_IS_SET (error);
+ _dbus_verbose ("bus_activation_set_environment_variable() failed\n");
+ break;
+ }
+ key_link = _dbus_list_get_next_link (&keys, key_link);
+ value_link = _dbus_list_get_next_link (&values, value_link);
+ }
+
+ /* FIXME: We can fail early having set only some of the environment variables,
+ * (because of OOM failure). It's sort of hard to fix and it doesn't really
+ * matter, so we're punting for now.
+ */
+ if (key_link != NULL)
+ goto out;
+
+ if (!send_ack_reply (connection, transaction,
+ message, error))
+ goto out;
+
+ retval = TRUE;
+
+ out:
+ _dbus_list_clear (&keys);
+ _dbus_list_clear (&values);
+ return retval;
+}
+
+static dbus_bool_t
bus_driver_handle_add_match (DBusConnection *connection,
BusTransaction *transaction,
DBusMessage *message,
@@ -1467,6 +1594,10 @@ struct
DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_UINT32_AS_STRING,
DBUS_TYPE_UINT32_AS_STRING,
bus_driver_handle_activate_service },
+ { "UpdateActivationEnvironment",
+ DBUS_TYPE_ARRAY_AS_STRING DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_DICT_ENTRY_END_CHAR_AS_STRING,
+ "",
+ bus_driver_handle_update_activation_environment },
{ "NameHasOwner",
DBUS_TYPE_STRING_AS_STRING,
DBUS_TYPE_BOOLEAN_AS_STRING,
diff -up dbus-1.2.1/bus/system.conf.in.activation-env dbus-1.2.1/bus/system.conf.in
--- dbus-1.2.1/bus/system.conf.in.activation-env 2008-07-18 19:54:03.000000000 -0400
+++ dbus-1.2.1/bus/system.conf.in 2008-07-18 19:56:13.000000000 -0400
@@ -56,6 +56,10 @@
<!-- valid replies are always allowed -->
<allow send_requested_reply="true"/>
<allow receive_requested_reply="true"/>
+ <!-- disallow changing the activation environment of system services -->
+ <deny send_destination="org.freedesktop.DBus"
+ send_interface="org.freedesktop.DBus"
+ send_member="UpdateActivationEnvironment"/>
</policy>
<!-- Config files are placed here that among other things, punch
diff -up dbus-1.2.1/dbus/dbus-spawn.c.activation-env dbus-1.2.1/dbus/dbus-spawn.c
--- dbus-1.2.1/dbus/dbus-spawn.c.activation-env 2008-07-18 19:54:18.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-spawn.c 2008-07-18 19:56:13.000000000 -0400
@@ -880,6 +880,7 @@ write_status_and_exit (int fd, int statu
static void
do_exec (int child_err_report_fd,
char **argv,
+ char **envp,
DBusSpawnChildSetupFunc child_setup,
void *user_data)
{
@@ -910,8 +911,17 @@ do_exec (int child
_dbus_warn ("Fd %d did not have the close-on-exec flag set!\n", i);
}
#endif
+
+ if (envp == NULL)
+ {
+ extern char **environ;
+
+ _dbus_assert (environ != NULL);
+
+ envp = environ;
+ }
- execv (argv[0], argv);
+ execve (argv[0], argv, envp);
/* Exec failed */
write_err_and_exit (child_err_report_fd,
@@ -1190,6 +1200,7 @@ _dbus_spawn_async_with_babysitter (DBusB
{
do_exec (child_err_report_pipe[WRITE_END],
argv,
+ env,
child_setup, user_data);
_dbus_assert_not_reached ("Got to code after exec() - should have exited on error");
}
@@ -1218,6 +1229,8 @@ _dbus_spawn_async_with_babysitter (DBusB
else
_dbus_babysitter_unref (sitter);
+ dbus_free_string_array (env);
+
_DBUS_ASSERT_ERROR_IS_CLEAR (error);
return TRUE;
diff -up dbus-1.2.1/dbus/dbus-string.c.activation-env dbus-1.2.1/dbus/dbus-string.c
--- dbus-1.2.1/dbus/dbus-string.c.activation-env 2008-07-18 19:54:42.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-string.c 2008-07-18 19:56:13.000000000 -0400
@@ -1677,6 +1677,48 @@ _dbus_string_replace_len (const DBusStri
return TRUE;
}
+/**
+ * Looks for the first occurance of a byte, deletes that byte,
+ * and moves everything after the byte to the beginning of a
+ * separate string. Both strings must be initialized, valid
+ * strings.
+ *
+ * @param source the source string
+ * @param byte the byte to remove and split the string at
+ * @param tail the split off string
+ * @returns #FALSE if not enough memory or if byte could not be found
+ *
+ */
+dbus_bool_t
+_dbus_string_split_on_byte (DBusString *source,
+ unsigned char byte,
+ DBusString *tail)
+{
+ int byte_position;
+ char byte_string[2] = "";
+ int head_length;
+ int tail_length;
+
+ byte_string[0] = (char) byte;
+
+ if (!_dbus_string_find (source, 0, byte_string, &byte_position))
+ return FALSE;
+
+ head_length = byte_position;
+ tail_length = _dbus_string_get_length (source) - head_length - 1;
+
+ if (!_dbus_string_move_len (source, byte_position + 1, tail_length,
+ tail, 0))
+ return FALSE;
+
+ /* remove the trailing delimiter byte from the head now.
+ */
+ if (!_dbus_string_set_length (source, head_length))
+ return FALSE;
+
+ return TRUE;
+}
+
/* Unicode macros and utf8_validate() from GLib Owen Taylor, Havoc
* Pennington, and Tom Tromey are the authors and authorized relicense.
*/
diff -up dbus-1.2.1/dbus/dbus-string.h.activation-env dbus-1.2.1/dbus/dbus-string.h
--- dbus-1.2.1/dbus/dbus-string.h.activation-env 2008-07-18 19:54:53.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-string.h 2008-07-18 19:56:13.000000000 -0400
@@ -201,6 +201,9 @@ dbus_bool_t _dbus_string_replace_len
DBusString *dest,
int replace_at,
int replace_len);
+dbus_bool_t _dbus_string_split_on_byte (DBusString *source,
+ unsigned char byte,
+ DBusString *tail);
void _dbus_string_get_unichar (const DBusString *str,
int start,
dbus_unichar_t *ch_return,
diff -up dbus-1.2.1/dbus/dbus-string-util.c.activation-env dbus-1.2.1/dbus/dbus-string-util.c
--- dbus-1.2.1/dbus/dbus-string-util.c.activation-env 2008-07-18 19:54:31.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-string-util.c 2008-07-18 19:56:13.000000000 -0400
@@ -846,6 +846,31 @@ _dbus_string_test (void)
_dbus_string_free (&str);
}
+
+ {
+ const char two_strings[] = "one\ttwo";
+
+ if (!_dbus_string_init (&str))
+ _dbus_assert_not_reached ("no memory");
+
+ if (!_dbus_string_init (&other))
+ _dbus_assert_not_reached ("no memory");
+
+ if (!_dbus_string_append (&str, two_strings))
+ _dbus_assert_not_reached ("no memory");
+
+ if (!_dbus_string_split_on_byte (&str, '\t', &other))
+ _dbus_assert_not_reached ("no memory or delimiter not found");
+
+ if (strcmp (_dbus_string_get_data (&str), "one") != 0)
+ _dbus_assert_not_reached ("left side after split on tab is wrong");
+
+ if (strcmp (_dbus_string_get_data (&other), "two") != 0)
+ _dbus_assert_not_reached ("right side after split on tab is wrong");
+
+ _dbus_string_free (&str);
+ _dbus_string_free (&other);
+ }
return TRUE;
}
diff -up dbus-1.2.1/dbus/dbus-sysdeps.c.activation-env dbus-1.2.1/dbus/dbus-sysdeps.c
--- dbus-1.2.1/dbus/dbus-sysdeps.c.activation-env 2008-07-18 19:55:06.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-sysdeps.c 2008-07-18 19:56:13.000000000 -0400
@@ -200,6 +200,48 @@ _dbus_clearenv (void)
return rc;
}
+/**
+ * Gets a #NULL-terminated list of key=value pairs from the
+ * environment. Use dbus_free_string_array to free it.
+ *
+ * @returns the environment or #NULL on OOM
+ */
+char **
+_dbus_get_environment (void)
+{
+ int i, length;
+ extern char **environ;
+ char **environment;
+
+ _dbus_assert (environ != NULL);
+
+ for (length = 0; environ[length] != NULL; length++);
+
+ /* Add one for NULL */
+ length++;
+
+ environment = dbus_new0 (char *, length);
+
+ if (environment == NULL)
+ return NULL;
+
+ for (i = 0; environ[i] != NULL; i++)
+ {
+ environment[i] = _dbus_strdup (environ[i]);
+
+ if (environment[i] == NULL)
+ break;
+ }
+
+ if (environ[i] != NULL)
+ {
+ dbus_free_string_array (environment);
+ environment = NULL;
+ }
+
+ return environment;
+}
+
/*
* init a pipe instance.
*
diff -up dbus-1.2.1/dbus/dbus-sysdeps.h.activation-env dbus-1.2.1/dbus/dbus-sysdeps.h
--- dbus-1.2.1/dbus/dbus-sysdeps.h.activation-env 2008-07-18 19:55:15.000000000 -0400
+++ dbus-1.2.1/dbus/dbus-sysdeps.h 2008-07-18 19:56:13.000000000 -0400
@@ -101,6 +101,7 @@ const char* _dbus_getenv (const char *va
dbus_bool_t _dbus_setenv (const char *varname,
const char *value);
dbus_bool_t _dbus_clearenv (void);
+char ** _dbus_get_environment (void);
/** A process ID */
typedef unsigned long dbus_pid_t;
diff -up dbus-1.2.1/doc/dbus-specification.xml.activation-env dbus-1.2.1/doc/dbus-specification.xml
--- dbus-1.2.1/doc/dbus-specification.xml.activation-env 2008-07-18 19:55:30.000000000 -0400
+++ dbus-1.2.1/doc/dbus-specification.xml 2008-07-18 19:56:13.000000000 -0400
@@ -3678,6 +3678,40 @@
</sect3>
+ <sect3 id="bus-messages-update-activation-environment">
+ <title><literal>org.freedesktop.DBus.UpdateActivationEnvironment</literal></title>
+ <para>
+ As a method:
+ <programlisting>
+ UpdateActivationEnvironment (in ARRAY of DICT&lt;STRING,STRING&gt; environment)
+ </programlisting>
+ Message arguments:
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Argument</entry>
+ <entry>Type</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>0</entry>
+ <entry>ARRAY of DICT&lt;STRING,STRING&gt;</entry>
+ <entry>Environment to add or update</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ Normally, session bus activated services inherit the environment of the bus daemon. This method adds to or modifies that environment when activating services.
+ </para>
+ <para>
+ Some bus instances, such as the standard system bus, may disable access to this method for some or all callers.
+ </para>
+
+ </sect3>
+
<sect3 id="bus-messages-get-name-owner">
<title><literal>org.freedesktop.DBus.GetNameOwner</literal></title>
<para>

View File

@ -1,41 +0,0 @@
From ff997dd113565bb281c01b10d468e183992630df Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 24 Apr 2008 16:00:16 +0100
Subject: [PATCH] * dbus/dbus-userdb-util.c, dbus/dbus-userdb.c: Correct name of
macro used in #ifdef block to match that defined by configure,
otherwise the userdb cache will never be enabled.
---
dbus/dbus-userdb-util.c | 2 +-
dbus/dbus-userdb.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c
index 30d5083..d03a7c7 100644
--- a/dbus/dbus-userdb-util.c
+++ b/dbus/dbus-userdb-util.c
@@ -223,7 +223,7 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db,
gid = n;
}
-#ifdef DBUS_ENABLE_USER_CACHE
+#ifdef DBUS_ENABLE_USERDB_CACHE
if (gid != DBUS_GID_UNSET)
info = _dbus_hash_table_lookup_ulong (db->groups, gid);
else
diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c
index 0e430b2..03d263f 100644
--- a/dbus/dbus-userdb.c
+++ b/dbus/dbus-userdb.c
@@ -143,7 +143,7 @@ _dbus_user_database_lookup (DBusUserDatabase *db,
uid = n;
}
-#ifdef DBUS_ENABLE_USER_CACHE
+#ifdef DBUS_ENABLE_USERDB_CACHE
if (uid != DBUS_UID_UNSET)
info = _dbus_hash_table_lookup_ulong (db->users, uid);
else
--
1.5.4.3

View File

@ -1,49 +0,0 @@
From cdf570506b77eca62ac8e5a5bfe2a1db0fbb1123 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 24 Apr 2008 15:58:34 +0100
Subject: [PATCH] * dbus/dbus-connection.c (connection_forget_shared_unlocked):
Remove shared connections which lack a GUID from the list that
caches those, otherwise references to them will remain after
they have been freed.
---
dbus/dbus-connection.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 3a1670c..5b25534 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -1671,21 +1671,26 @@ connection_forget_shared_unlocked (DBusConnection *connection)
if (!connection->shareable)
return;
+ _DBUS_LOCK (shared_connections);
+
if (connection->server_guid != NULL)
{
_dbus_verbose ("dropping connection to %s out of the shared table\n",
connection->server_guid);
- _DBUS_LOCK (shared_connections);
-
if (!_dbus_hash_table_remove_string (shared_connections,
connection->server_guid))
_dbus_assert_not_reached ("connection was not in the shared table");
dbus_free (connection->server_guid);
connection->server_guid = NULL;
- _DBUS_UNLOCK (shared_connections);
}
+ else
+ {
+ _dbus_list_remove (&shared_connections_no_guid, connection);
+ }
+
+ _DBUS_UNLOCK (shared_connections);
/* remove our reference held on all shareable connections */
_dbus_connection_unref_unlocked (connection);
--
1.5.4.3

View File

@ -1,37 +0,0 @@
From d6ab6476e0986340ea43c1383ff8153ac224a4c9 Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 24 Apr 2008 16:02:11 +0100
Subject: [PATCH] * dbus/dbus-connection.c (_dbus_connection_read_write_dispatch):
Reference the D-Bus connection during the function call since we
call other functions that may free the last reference and we
still expect to be able to check the connection after they return
to decide our own return value.
---
dbus/dbus-connection.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index 5b25534..517deac 100644
--- a/dbus/dbus-connection.c
+++ b/dbus/dbus-connection.c
@@ -3410,6 +3410,8 @@ _dbus_connection_read_write_dispatch (DBusConnection *connection,
{
DBusDispatchStatus dstatus;
dbus_bool_t no_progress_possible;
+
+ dbus_connection_ref (connection);
dstatus = dbus_connection_get_dispatch_status (connection);
@@ -3450,6 +3452,7 @@ _dbus_connection_read_write_dispatch (DBusConnection *connection,
else
no_progress_possible = _dbus_connection_get_is_connected_unlocked (connection);
CONNECTION_UNLOCK (connection);
+ dbus_connection_unref (connection);
return !no_progress_possible; /* TRUE if we can make more progress */
}
--
1.5.4.3

View File

@ -1,27 +0,0 @@
From 7d257984d77cd6eba2ccb7c211e5a6466876ec1c Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Thu, 24 Apr 2008 15:50:11 +0100
Subject: [PATCH] * dbus/dbus-bus.c (addresses_shutdown_func): Reset initialized back
to FALSE after cleaning up the address list so that it will be
reinitialized again if D-Bus is used after dbus_shutdown()
---
dbus/dbus-bus.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c
index e159dae..f97cce6 100644
--- a/dbus/dbus-bus.c
+++ b/dbus/dbus-bus.c
@@ -124,6 +124,8 @@ addresses_shutdown_func (void *data)
}
activation_bus_type = DBUS_BUS_STARTER;
+
+ initialized = FALSE;
}
static dbus_bool_t
--
1.5.4.3

View File

@ -7,8 +7,8 @@
Summary: D-BUS message bus
Name: dbus
Version: 1.2.1
Release: 7%{?dist}
Version: 1.2.3
Release: 1%{?dist}
URL: http://www.freedesktop.org/software/dbus/
Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz
Source1: doxygen_to_devhelp.xsl
@ -39,13 +39,7 @@ Conflicts: cups < 1:1.1.20-4
Patch0: start-early.patch
Patch1: dbus-1.0.1-generate-xml-docs.patch
Patch2: dbus-reinit-addr-after-shutdown.patch
Patch3: dbus-fix-guidless-conn-segfault.patch
Patch4: dbus-compile-userdb-cache.patch
Patch5: dbus-hold-ref-during-dispatch.patch
Patch6: dbus-1.2.1-increase-timeout.patch
# from upstream git
Patch7: activation-env.patch
%description
@ -101,12 +95,7 @@ in this separate package so server systems need not install X.
%patch0 -p1 -b .start-early
%patch1 -p1 -b .generate-xml-docs
%patch2 -p1 -b .reinit-addr-after-shutdown
%patch3 -p1 -b .fix-guidless-conn-segfault
%patch4 -p1 -b .compile-userdb-cache
%patch5 -p1 -b .hold-ref-during-dispatch
%patch6 -p1 -b .increase-timeout
%patch7 -p1 -b .activation-env
autoreconf -f -i
@ -183,7 +172,7 @@ fi
%files
%defattr(-,root,root)
%doc COPYING ChangeLog NEWS
%doc COPYING
%dir %{_sysconfdir}/dbus-1
%config(noreplace) %{_sysconfdir}/dbus-1/*.conf
@ -238,6 +227,10 @@ fi
%{_includedir}/*
%changelog
* Wed Aug 06 2008 Colin Walters <walters@redhat.com> - 1.2.3-1
- New upstream 1.2.2
- Drop patches that were upstreamed
* Wed Jul 23 2008 Matthias Clasen <mclasen@redhat.com> - 1.2.1-7
- Own /usr/share/dbus-1/interfaces

View File

@ -1 +1 @@
b57aa1ba0834cbbb1e7502dc2cbfacc2 dbus-1.2.1.tar.gz
f71641385768e99361bd298568207cee dbus-1.2.3.tar.gz