diff -ru eglibc-2.15/nss/nsswitch.c eglibc-2.15-nsswitch/nss/nsswitch.c --- eglibc-2.15/nss/nsswitch.c 2011-11-17 22:56:08.000000000 +0100 +++ eglibc-2.15-nsswitch/nss/nsswitch.c 2012-02-22 10:38:02.004928523 +0100 @@ -41,6 +41,8 @@ #include "../nscd/nscd_proto.h" #include +#include /* __libc_enable_secure */ + /* Prototypes for the local functions. */ static name_database *nss_parse_file (const char *fname) internal_function; static name_database_entry *nss_getline (char *line) internal_function; @@ -121,8 +123,16 @@ __nss_database_lookup (const char *datab /* Are we initialized yet? */ if (service_table == NULL) + { + const char *ext_nss_config_file = NULL; + if (__libc_enable_secure == 0) + { + ext_nss_config_file = getenv ("NSSWITCH_CONF_PATH"); + } /* Read config file. */ - service_table = nss_parse_file (_PATH_NSSWITCH_CONF); + service_table = nss_parse_file (ext_nss_config_file ? + ext_nss_config_file : _PATH_NSSWITCH_CONF); + } /* Test whether configuration data is available. */ if (service_table != NULL)