Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 1.09 KB

glibc-2.25-nsswitchconf-location.diff

File metadata and controls

30 lines (27 loc) · 1.09 KB
 
Mar 24, 2012
Mar 24, 2012
1
2
3
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
Dec 4, 2018
Dec 4, 2018
4
5
6
7
@@ -41,6 +41,8 @@
#include "../nscd/nscd_proto.h"
#include <sysdep.h>
8
9
10
11
12
+#include <unistd.h> /* __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;
Dec 4, 2018
Dec 4, 2018
13
14
@@ -121,8 +123,16 @@ __nss_database_lookup (const char *datab
15
16
/* Are we initialized yet? */
if (service_table == NULL)
Dec 4, 2018
Dec 4, 2018
17
18
19
+ {
+ const char *ext_nss_config_file = NULL;
+ if (__libc_enable_secure == 0)
Dec 4, 2018
Dec 4, 2018
21
+ ext_nss_config_file = getenv ("NSSWITCH_CONF_PATH");
Dec 4, 2018
Dec 4, 2018
23
24
25
26
27
28
/* 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);
+ }
29
/* Test whether configuration data is available. */
Dec 4, 2018
Dec 4, 2018
30
if (service_table != NULL)