]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Make userdb cache as a built-in feature
authorChengwei Yang <chengwei.yang@intel.com>
Wed, 4 Sep 2013 07:13:33 +0000 (15:13 +0800)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 13 Sep 2013 13:59:20 +0000 (14:59 +0100)
The disable-userdb-cache code path is never been fine tested and you
could expect an extramely slow bus if you did that. And there are known
bugs on fd.o if build without userdb cache. So to prevent user from
using bus without userdb cache, it changed to a built-in feature, no
longer optional now.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66947
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=15589
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
configure.ac
dbus/dbus-userdb-util.c
dbus/dbus-userdb.c

index b6ff7690d737c534b6b6b2328c3863a20d31ff58..da4ab5fb91438ddda8800e83b80c8fd2557ad963 100644 (file)
@@ -153,7 +153,6 @@ AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon su
 AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=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_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
 AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
 
@@ -316,10 +315,6 @@ AH_BOTTOM([
 #  define DBUS_ENABLE_CHECKS 1
 #endif])
 
-if test x$enable_userdb_cache = xyes; then
-    AC_DEFINE(DBUS_ENABLE_USERDB_CACHE,1,[Build with caching of user data])
-fi
-
 if test x$enable_compiler_coverage = xyes; then
      ## so that config.h changes when you toggle gcov support
      AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
@@ -1864,7 +1859,6 @@ echo "
         Building X11 code:        ${have_x11}
         Building Doxygen docs:    ${enable_doxygen_docs}
         Building XML docs:        ${enable_xml_docs}
-        Building cache support:   ${enable_userdb_cache}
         Building launchd support: ${have_launchd}
         Init scripts style:       ${with_init_scripts}
         Abstract socket names:    ${ac_cv_have_abstract_sockets}
index 62495d831fa287b0e044e379506bbd5c440770bd..888a23e9f53373c91ddf781853fd4514035fbfa2 100644 (file)
@@ -261,7 +261,6 @@ _dbus_user_database_lookup_group (DBusUserDatabase *db,
         gid = n;
     }
 
-#ifdef DBUS_ENABLE_USERDB_CACHE
   if (gid != DBUS_GID_UNSET)
     info = _dbus_hash_table_lookup_uintptr (db->groups, gid);
   else
@@ -274,9 +273,6 @@ _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",
index b792cbe48b18f55f01c9cce63ff7b7e94d0a5f5d..52f927a3d0fc7508ed0533422b54a08e51620c42 100644 (file)
@@ -144,7 +144,6 @@ _dbus_user_database_lookup (DBusUserDatabase *db,
         uid = n;
     }
 
-#ifdef DBUS_ENABLE_USERDB_CACHE  
   if (uid != DBUS_UID_UNSET)
     info = _dbus_hash_table_lookup_uintptr (db->users, uid);
   else
@@ -157,9 +156,6 @@ _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",