[Patch] Fix _dbus_group_info_free_allocated to not call itself recursively forever

Sjoerd Simons sjoerd at luon.net
Thu Feb 23 06:11:28 PST 2006


Hi,

  _dbus_group_info_free_allocated currently just calls itself again (without
  doing anything), leading to an infinite loop. Attached patch lets it call
  _dbus_group_info_free, making it act as stated in the doxygen
  documentation.

  To accomplish this _dbus_group_info_free had to be moved from
  dbus/dbus-sysdeps-util.c to dbus/dbus-sysdeps.c (also in attached patch)

  This bug is triggerd when there is an unknown group mentioned in a bus
  configuration file.

  Sjoerd
-- 
All great ideas are controversial, or have been at one time.
-------------- next part --------------
? dbus/.dbus-sysdeps.c.swp
Index: dbus/dbus-sysdeps-util.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps-util.c,v
retrieving revision 1.5
diff -u -r1.5 dbus-sysdeps-util.c
--- dbus/dbus-sysdeps-util.c	8 Jul 2005 14:36:22 -0000	1.5
+++ dbus/dbus-sysdeps-util.c	23 Feb 2006 11:29:06 -0000
@@ -680,17 +680,6 @@
   return fill_group_info (info, gid, NULL, error);
 }
 
-/**
- * Frees the members of info (but not info itself).
- *
- * @param info the group info
- */
-void
-_dbus_group_info_free (DBusGroupInfo    *info)
-{
-  dbus_free (info->groupname);
-}
-
 /** @} */ /* End of DBusInternalsUtils functions */
 
 /**
Index: dbus/dbus-sysdeps.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v
retrieving revision 1.100
diff -u -r1.100 dbus-sysdeps.c
--- dbus/dbus-sysdeps.c	22 Nov 2005 20:37:00 -0000	1.100
+++ dbus/dbus-sysdeps.c	23 Feb 2006 11:29:06 -0000
@@ -1754,6 +1754,17 @@
 }
 
 /**
+ * Frees the members of info (but not info itself).
+ *
+ * @param info the group info
+ */
+void
+_dbus_group_info_free (DBusGroupInfo    *info)
+{
+  dbus_free (info->groupname);
+}
+
+/**
  * Sets fields in DBusCredentials to DBUS_PID_UNSET,
  * DBUS_UID_UNSET, DBUS_GID_UNSET.
  *
Index: dbus/dbus-userdb.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-userdb.c,v
retrieving revision 1.17
diff -u -r1.17 dbus-userdb.c
--- dbus/dbus-userdb.c	22 Mar 2005 17:57:27 -0000	1.17
+++ dbus/dbus-userdb.c	23 Feb 2006 11:29:06 -0000
@@ -61,7 +61,7 @@
   if (info == NULL) /* hash table will pass NULL */
     return;
 
-  _dbus_group_info_free_allocated (info);
+  _dbus_group_info_free (info);
   dbus_free (info);
 }
 


More information about the dbus mailing list