2007-07-24 Richard Hughes <richard@hughsie.com>
authorRichard Hughes <richard@hughsie.com>
Tue, 24 Jul 2007 12:19:59 +0000 (12:19 +0000)
committerRichard Hughes <richard@hughsie.com>
Tue, 24 Jul 2007 12:19:59 +0000 (12:19 +0000)
* bus/bus.c: (process_config_first_time_only),
(process_config_every_time), (bus_context_unref),
(bus_context_get_servicehelper):
* bus/bus.h:
Add the concept of a service-helper and allow it's value to be read.

ChangeLog
bus/bus.c
bus/bus.h

index 56c0f8d..0f83d79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2007-07-24  Richard Hughes  <richard@hughsie.com>
 
+       * bus/bus.c: (process_config_first_time_only),
+       (process_config_every_time), (bus_context_unref),
+       (bus_context_get_servicehelper):
+       * bus/bus.h:
+       Add the concept of a service-helper and allow it's value to be read.
+
+2007-07-24  Richard Hughes  <richard@hughsie.com>
+
        * bus/activation.c: (bus_activation_entry_unref),
        (update_desktop_file_entry):
        Add the concept of, and read the value of user from the desktop file.
index cd1628c..627e49d 100644 (file)
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -41,6 +41,7 @@ struct BusContext
   DBusGUID uuid;
   char *config_file;
   char *type;
+  char *servicehelper;
   char *address;
   char *pidfile;
   char *user;
@@ -262,7 +263,7 @@ process_config_first_time_only (BusContext      *context,
 {
   DBusList *link;
   DBusList **addresses;
-  const char *user, *pidfile;
+  const char *user, *pidfile, *servicehelper;
   char **auth_mechanisms;
   DBusList **auth_mechanisms_list;
   int len;
@@ -298,6 +299,11 @@ process_config_first_time_only (BusContext      *context,
   /* keep around the pid filename so we can delete it later */
   context->pidfile = _dbus_strdup (pidfile);
 
+  /* we need to configure this so we can test the service helper */
+  servicehelper = bus_config_parser_get_servicehelper (parser);
+  if (servicehelper != NULL)
+    context->servicehelper = _dbus_strdup (servicehelper);
+
   /* Build an array of auth mechanisms */
   
   auth_mechanisms_list = bus_config_parser_get_mechanisms (parser);
@@ -402,6 +408,7 @@ process_config_every_time (BusContext      *context,
 {
   DBusString full_address;
   DBusList *link;
+  DBusList **dirs;
   BusActivation *new_activation;
   char *addr;
 
@@ -467,10 +474,12 @@ process_config_every_time (BusContext      *context,
       goto failed;
     }
 
+  /* get the service directories */
+  dirs = bus_config_parser_get_service_dirs (parser);
+
   /* Create activation subsystem */
   new_activation = bus_activation_new (context, &full_address,
-                                      bus_config_parser_get_service_dirs (parser),
-                                      error);
+                                       dirs, error);
   if (new_activation == NULL)
     {
       _DBUS_ASSERT_ERROR_IS_SET (error);
@@ -941,6 +950,7 @@ bus_context_unref (BusContext *context)
       dbus_free (context->type);
       dbus_free (context->address);
       dbus_free (context->user);
+      dbus_free (context->servicehelper);
 
       if (context->pidfile)
        {
@@ -973,6 +983,12 @@ bus_context_get_address (BusContext *context)
   return context->address;
 }
 
+const char*
+bus_context_get_servicehelper (BusContext *context)
+{
+  return context->servicehelper;
+}
+
 BusRegistry*
 bus_context_get_registry (BusContext  *context)
 {
index cd18c10..ad23104 100644 (file)
--- a/bus/bus.h
+++ b/bus/bus.h
@@ -82,6 +82,7 @@ dbus_bool_t       bus_context_get_id                             (BusContext
                                                                   DBusString       *uuid);
 const char*       bus_context_get_type                           (BusContext       *context);
 const char*       bus_context_get_address                        (BusContext       *context);
+const char*       bus_context_get_servicehelper                  (BusContext       *context);
 BusRegistry*      bus_context_get_registry                       (BusContext       *context);
 BusConnections*   bus_context_get_connections                    (BusContext       *context);
 BusActivation*    bus_context_get_activation                     (BusContext       *context);