diff options
-rw-r--r-- | ChangeLog | 31 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | dbus/dbus-userdb-util.c | 5 | ||||
-rw-r--r-- | dbus/dbus-userdb.c | 6 |
4 files changed, 46 insertions, 2 deletions
@@ -1,3 +1,34 @@ +2006-12-12 Tim Dijkstra <tim@famdijkstra.org> + + * configure.in: Added switch to disable user_database caching. + + * dbus/dbus-userdb-util.c, dbus/dbus-userdb.c: Add ifdefs to + be able disable user_dabase caching. + +2006-12-12 Tim Dijkstra <tim@famdijkstra.org> + + * bus/bus.c, bus/bus.h: Remove DBusUserDatabase from the BusContext + struct. It is unnecessary we have a global one already. Also remove + bus_context_get_user_database function, it is no longer needed. + Flush the global database on reload. + + * dbus/dbus-userdb-util.c: Replace _dbus_user_database_get_groups + with _dbus_groups_from_uid. It no longer needs a DBusUserDatabase. + + * dbus/dbus-userdb.c, dbus/dbus-userdb.h: + Add _dbus_user_database_flush_system. + Make more functions DBUS_USERDB_INCLUDES_PRIVATE. + Small unrelated change in _dbus_is_a_number: change + _dbus_string_parse_int to _dbus_string_parse_uint. + + * bus/connection.c: Change call to _dbus_user_database_get_groups to + _dbus_groups_from_uid. + + * bus/policy.c, bus/policy.h: Change call to + _dbus_user_database_get_groups to _dbus_groups_from_uid. Remove + DBusUserDatabase from bus_policy_allow_user prototype, it no longer + needs it. + 2006-12-12 John (J5) Palmieri <johnp@redhat.com> * bus/signal.c: Fix match_rule_equal errata diff --git a/configure.in b/configure.in index 24b5dc1f..7fbbc924 100644 --- a/configure.in +++ b/configure.in @@ -59,6 +59,7 @@ AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux sup AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto) AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto) AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto) +AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes) AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use])) AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install])) @@ -105,6 +106,10 @@ if test x$enable_checks = xno; then AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking]) fi +if test x$enable_userdb_cache = xyes; then + AC_DEFINE(DBUS_ENABLE_USERDB_CACHE,1,[Build with caching of user data]) +fi + #### gcc warning flags cc_supports_flag() { @@ -1259,6 +1264,7 @@ echo " Building X11 code: ${enable_x11} Building Doxygen docs: ${enable_doxygen_docs} Building XML docs: ${enable_xml_docs} + Building cache support: ${enable_userdb_cache} Gettext libs (empty OK): ${INTLLIBS} Using XML parser: ${with_xml} Init scripts style: ${with_init_scripts} diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index bd393a27..7b12de50 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -234,7 +234,7 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db, gid = n; } - +#ifdef DBUS_ENABLE_USER_CACHE if (gid != DBUS_GID_UNSET) info = _dbus_hash_table_lookup_ulong (db->groups, gid); else @@ -247,6 +247,9 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db, return info; } else +#else + if (1) +#endif { if (gid != DBUS_GID_UNSET) _dbus_verbose ("No cache for GID "DBUS_GID_FORMAT"\n", diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c index 1be3dda6..2aa395dc 100644 --- a/dbus/dbus-userdb.c +++ b/dbus/dbus-userdb.c @@ -118,11 +118,12 @@ _dbus_user_database_lookup (DBusUserDatabase *db, uid = n; } +#ifdef DBUS_ENABLE_USER_CACHE if (uid != DBUS_UID_UNSET) info = _dbus_hash_table_lookup_ulong (db->users, uid); else info = _dbus_hash_table_lookup_string (db->users_by_name, _dbus_string_get_const_data (username)); - + if (info) { _dbus_verbose ("Using cache for UID "DBUS_UID_FORMAT" information\n", @@ -130,6 +131,9 @@ _dbus_user_database_lookup (DBusUserDatabase *db, return info; } else +#else + if (1) +#endif { if (uid != DBUS_UID_UNSET) _dbus_verbose ("No cache for UID "DBUS_UID_FORMAT"\n", |