]> arthur.barton.de Git - netatalk.git/commitdiff
Fix dbus session config to allow any user to connnect
authorRalph Boehme <sloowfranklin@gmail.com>
Wed, 27 Feb 2013 09:50:48 +0000 (10:50 +0100)
committerRalph Boehme <sloowfranklin@gmail.com>
Wed, 27 Feb 2013 09:50:48 +0000 (10:50 +0100)
config/dbus-session.conf.tmpl
etc/spotlight/slmod_rdf.c
etc/spotlight/slmod_sparql.c

index aa132fd27c9fa044a70bd27c0b32b5d213da4de7..e933380ba3e00892aa22c758ed6a904576a68bf3 100644 (file)
@@ -9,33 +9,17 @@
   <keep_umask/>
 
   <listen>unix:path=/tmp/spotlight.ipc</listen>
-  <allow_anonymous />
 
   <standard_session_servicedirs />
 
   <policy context="default">
-    <!-- Allow everything to be sent -->
+    <allow user="*"/>
+    <allow own="*"/>
     <allow send_destination="*" eavesdrop="true"/>
-    <!-- Allow everything to be received -->
+    <allow receive_sender="*"/>
     <allow eavesdrop="true"/>
-    <!-- Allow anyone to own anything -->
-    <allow own="*"/>
   </policy>
 
-  <!-- raise the service start timeout to 40 seconds as it can timeout
-       on the live cd on slow machines -->
-  <limit name="service_start_timeout">60000</limit>
-
-  <!-- Config files are placed here that among other things, 
-       further restrict the above policy for specific services. -->
-  <includedir>/etc/dbus-1/session.d</includedir>
-
-  <!-- This is included last so local configuration can override what's 
-       in this standard file -->
-  <include ignore_missing="yes">session-local.conf</include>
-
-  <include if_selinux_enabled="yes" selinux_root_relative="yes">contexts/dbus_contexts</include>
-
   <!-- For the session bus, override the default relatively-low limits 
        with essentially infinite limits, since the bus is just running 
        as the user anyway, using up bus resources is not something we need 
index a09d5ae1fc636dc5031b1c68bf69b828e5d5c7a5..6863a349ffea59e0f31b02b801fbea4e72d25809 100644 (file)
@@ -45,9 +45,7 @@ static int sl_mod_init(void *p)
     g_type_init();
     setenv("DBUS_SESSION_BUS_ADDRESS", "unix:path=/tmp/spotlight.ipc", 1);
 
-    become_root();
     client = tracker_connect(FALSE);
-    unbecome_root();
 
     if (!client) {
         LOG(log_error, logtype_sl, "Failed connecting to Tracker");
@@ -157,7 +155,6 @@ static int sl_mod_fetch_result(void *p)
     if (slq->slq_state == SLQ_STATE_RUNNING) {
         /* Run the query */
         LOG(log_debug, logtype_sl, "sl_mod_fetch_result: calling tracker");
-        become_root();
         array = tracker_search_query(client,
                                      time(NULL),
                                      slq->slq_service,
@@ -171,7 +168,6 @@ static int sl_mod_fetch_result(void *p)
                                      NULL,
                                      FALSE,
                                      &error);
-        unbecome_root();
 
         if (error) {
             slq->slq_state = SLQ_STATE_DONE;
index 9edad460b6135089843e8b8707f79b943e0a3cfa..b9748176917aa9c288f4059775633e8bf435189e 100644 (file)
@@ -71,7 +71,6 @@ static int sl_mod_init(void *p)
     dup2(type_configs[logtype_sl].fd, 2);
 #endif
 
-    become_root();
     connection = tracker_sparql_connection_get(NULL, &error);
 #if 0 
     /*
@@ -80,7 +79,6 @@ static int sl_mod_init(void *p)
      */
     manager = tracker_miner_manager_new_full(FALSE, &error);
 #endif
-    unbecome_root();
 
     if (!connection) {
         LOG(log_error, logtype_sl, "Couldn't obtain a direct connection to the Tracker store: %s",
@@ -140,9 +138,7 @@ static int sl_mod_start_search(void *p)
     tracker_sparql_connection_query_async(connection, sparql_query, NULL, tracker_cb, slq);
 #endif
 
-    become_root();
     slq->slq_tracker_cursor = tracker_sparql_connection_query(connection, sparql_query, NULL, &error);
-    unbecome_root();
 
     if (error) {
         LOG(log_error, logtype_sl, "Couldn't query the Tracker Store: '%s'",
@@ -236,10 +232,7 @@ static int sl_mod_fetch_result(void *p)
     LOG(log_debug, logtype_sl, "sl_mod_fetch_result: now interating Tracker results cursor");
 
     while ((slq->slq_state == SLQ_STATE_RUNNING) && (i <= MAX_SL_RESULTS)) {
-        become_root();
         qres = tracker_sparql_cursor_next(slq->slq_tracker_cursor, NULL, &error);
-        unbecome_root();
-
         if (!qres)
             break;
 
@@ -249,10 +242,7 @@ static int sl_mod_fetch_result(void *p)
             firstmatch = false;
         }
 
-        become_root();
         uri = tracker_sparql_cursor_get_string(slq->slq_tracker_cursor, 0, NULL);
-        unbecome_root();
-
         EC_NULL_LOG( path = tracker_to_unix_path(uri) );
 
         if ((id = cnid_for_path(slq->slq_vol->v_cdb, slq->slq_vol->v_path, path, &did)) == CNID_INVALID) {
@@ -346,11 +336,7 @@ static int sl_mod_index_file(const void *p)
     GFile *file = NULL;
 
     file = g_file_new_for_commandline_arg(f);
-
-    become_root();
     tracker_miner_manager_index_file(manager, file, &error);
-    unbecome_root();
-
     if (error)
         LOG(log_error, logtype_sl, "sl_mod_index_file(\"%s\"): indexing failed", f);
     else