dbus/dbus dbus-hash.c, 1.19, 1.20 dbus-hash.h, 1.14,
1.15 dbus-userdb.c, 1.18, 1.19 dbus-userdb.h, 1.10, 1.11
Sjoerd Simons
sjoerd at kemper.freedesktop.org
Mon Mar 6 11:06:47 PST 2006
Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv22575/dbus
Modified Files:
dbus-hash.c dbus-hash.h dbus-userdb.c dbus-userdb.h
Log Message:
* bus/bus.c: (bus_context_reload_config): Flush the user database cache on
config reload.
* bus/dbus-daemon.1.in: Also note that SIGHUP flushes the user/group
information caches
* dbus/dbus-hash.c: (_dbus_hash_table_remove_all):
* dbus/dbus-hash.h: Add function to remove all entries from a hash table
* dbus/dbus-userdb.c: (_dbus_user_database_flush):
* dbus/dbus-userdb.h: Add function to flush all user/group information
caches.
Index: dbus-hash.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-hash.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- dbus-hash.c 17 Jan 2005 03:53:40 -0000 1.19
+++ dbus-hash.c 6 Mar 2006 19:06:45 -0000 1.20
@@ -422,6 +422,22 @@
}
}
+/**
+ * Removed all entries from a hash table.
+ *
+ * @param table the hash table to remove all entries from.
+ */
+void
+_dbus_hash_table_remove_all (DBusHashTable *table)
+{
+ DBusHashIter iter;
+ _dbus_hash_iter_init (table, &iter);
+ while (_dbus_hash_iter_next (&iter))
+ {
+ _dbus_hash_iter_remove_entry(&iter);
+ }
+}
+
static DBusHashEntry*
alloc_entry (DBusHashTable *table)
{
Index: dbus-hash.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-hash.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- dbus-hash.h 9 Sep 2004 10:20:17 -0000 1.14
+++ dbus-hash.h 6 Mar 2006 19:06:45 -0000 1.15
@@ -63,6 +63,7 @@
DBusFreeFunction value_free_function);
DBusHashTable* _dbus_hash_table_ref (DBusHashTable *table);
void _dbus_hash_table_unref (DBusHashTable *table);
+void _dbus_hash_table_remove_all (DBusHashTable *table);
void _dbus_hash_iter_init (DBusHashTable *table,
DBusHashIter *iter);
dbus_bool_t _dbus_hash_iter_next (DBusHashIter *iter);
Index: dbus-userdb.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-userdb.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- dbus-userdb.c 24 Feb 2006 16:13:08 -0000 1.18
+++ dbus-userdb.c 6 Mar 2006 19:06:45 -0000 1.19
@@ -476,6 +476,18 @@
return NULL;
}
+/**
+ * Flush all information out of the user database.
+ */
+void
+_dbus_user_database_flush (DBusUserDatabase *db)
+{
+ _dbus_hash_table_remove_all(db->users_by_name);
+ _dbus_hash_table_remove_all(db->groups_by_name);
+ _dbus_hash_table_remove_all(db->users);
+ _dbus_hash_table_remove_all(db->groups);
+}
+
#ifdef DBUS_BUILD_TESTS
/**
* Increments refcount of user database.
Index: dbus-userdb.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-userdb.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dbus-userdb.h 22 Mar 2005 17:57:27 -0000 1.10
+++ dbus-userdb.h 6 Mar 2006 19:06:45 -0000 1.11
@@ -51,6 +51,7 @@
DBusUserDatabase* _dbus_user_database_new (void);
DBusUserDatabase* _dbus_user_database_ref (DBusUserDatabase *db);
+void _dbus_user_database_flush (DBusUserDatabase *db);
void _dbus_user_database_unref (DBusUserDatabase *db);
dbus_bool_t _dbus_user_database_get_groups (DBusUserDatabase *db,
dbus_uid_t uid,
More information about the dbus-commit
mailing list