2003-04-07 Havoc Pennington <hp@pobox.com>
authorHavoc Pennington <hp@redhat.com>
Tue, 8 Apr 2003 04:46:05 +0000 (04:46 +0000)
committerHavoc Pennington <hp@redhat.com>
Tue, 8 Apr 2003 04:46:05 +0000 (04:46 +0000)
* bus/driver.c (bus_driver_handle_acquire_service): return an
error if you try to acquire a service that starts with ':'

ChangeLog
bus/driver.c
dbus/dbus-mainloop.c

index 8528c67..d7542dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-07  Havoc Pennington  <hp@pobox.com>
+
+       * bus/driver.c (bus_driver_handle_acquire_service): return an
+       error if you try to acquire a service that starts with ':'
+
 2003-04-07  Havoc Pennington  <hp@redhat.com>
 
        * doc/dbus-specification.sgml: require that base service names 
index e01949f..814e32a 100644 (file)
@@ -459,6 +459,16 @@ bus_driver_handle_acquire_service (DBusConnection *connection,
   
   _dbus_verbose ("Trying to own service %s with flags 0x%x\n", name, flags);
 
+  if (*name == ':')
+    {
+      /* Not allowed; only base services can start with ':' */
+      dbus_set_error (error, DBUS_ERROR_ACCESS_DENIED,
+                      "Cannot acquire a service starting with ':' such as \"%s\"",
+                      name);
+      
+      goto out;
+    }
+  
   retval = FALSE;
   reply = NULL;
 
index 635bd58..b1706fe 100644 (file)
@@ -373,13 +373,16 @@ check_timeout (unsigned long    tv_sec,
       if (sec > interval_seconds ||
          (sec == interval_seconds && msec > interval_milliseconds))
        {
-         /* The system time has been set backwards, reset the timeout */
+          _dbus_verbose ("System clock went backward interval_seconds %ld interval_msecs %ld sec %ld msec %ld last_tv_sec %lu last_tv_usec %lu tv_sec %lu tv_usec %lu\n",
+                         interval_seconds, interval_milliseconds, sec, msec, tcb->last_tv_sec,
+                         tcb->last_tv_usec, tv_sec, tv_usec);
+          
+         /* The system time has been set backwards, reset the timeout */          
+          
           tcb->last_tv_sec = tv_sec;
           tcb->last_tv_usec = tv_usec;
           
           msec = MIN (_DBUS_INT_MAX, interval);
-
-          _dbus_verbose ("System clock went backward\n");
        }
       else
        {