From 212e10ee0ce5d83de6714a6d60e9e7f48c27209e Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Wed, 4 Sep 2013 15:13:33 +0800 Subject: [PATCH] Make userdb cache as a built-in feature 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 --- configure.ac | 6 ------ dbus/dbus-userdb-util.c | 4 ---- dbus/dbus-userdb.c | 4 ---- 3 files changed, 14 deletions(-) diff --git a/configure.ac b/configure.ac index ab7b1e1..b983d27 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) @@ -1861,7 +1856,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} diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index 62495d8..888a23e 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -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", diff --git a/dbus/dbus-userdb.c b/dbus/dbus-userdb.c index b792cbe..52f927a 100644 --- a/dbus/dbus-userdb.c +++ b/dbus/dbus-userdb.c @@ -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", -- 1.7.9.5