diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-12-14 23:27:52 -0500 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2014-12-14 23:27:52 -0500 |
commit | 50626856dd001ac465a3320126e86249f788d455 (patch) | |
tree | e62a005649e3fd53c8daf0e6a05d1df9c5e13bd5 | |
parent | b89fc0fcd219d47e2bdec3066e1eff58cf7e3303 (diff) |
replace more instances of "ldap" with "nslcd"
-rw-r--r-- | nslcd/common.h | 4 | ||||
-rw-r--r-- | nslcd/db_passwd.c | 4 | ||||
-rw-r--r-- | nslcd/nslcd.c | 6 | ||||
-rw-r--r-- | nslcd/nsswitch.c | 28 |
4 files changed, 21 insertions, 21 deletions
diff --git a/nslcd/common.h b/nslcd/common.h index e75585e..0896937 100644 --- a/nslcd/common.h +++ b/nslcd/common.h @@ -83,8 +83,8 @@ MUST_USE int isvalidname(const char *name); /* check whether the nsswitch file should be reloaded */ void nsswitch_check_reload(void); -/* check whether the nsswitch.conf file has LDAP as a naming source for db */ -int nsswitch_shadow_uses_ldap(void); +/* check whether the nsswitch.conf file has NSLCD as a naming source for db */ +int nsswitch_shadow_uses_nslcd(void); /* start a child process that holds onto the original privileges with the purpose of running external cache invalidation commands */ diff --git a/nslcd/db_passwd.c b/nslcd/db_passwd.c index af6dc4c..3ff1181 100644 --- a/nslcd/db_passwd.c +++ b/nslcd/db_passwd.c @@ -42,7 +42,7 @@ #ifndef NSS_FLAVOUR_GLIBC /* only check nsswitch.conf for glibc */ #define check_nsswitch_reload() -#define shadow_uses_ldap() (1) +#define shadow_uses_nslcd() (1) #endif /* NSS_FLAVOUR_GLIBC */ /* Note that the resulting password value should be one of: @@ -57,7 +57,7 @@ static int write_passwd(TFILE *fp, struct passwd *entry, uid_t calleruid) const char *passwd; /* if we are using shadow maps and this entry looks like it would return shadow information, make the passwd entry indicate it */ - if (nsswitch_shadow_uses_ldap()) + if (nsswitch_shadow_uses_nslcd()) { passwd = "x"; } diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c index 4a005d9..f402e01 100644 --- a/nslcd/nslcd.c +++ b/nslcd/nslcd.c @@ -1,5 +1,5 @@ /* - nslcd.c - ldap local connection daemon + nslcd.c - name service LDAP connection daemon Copyright (C) 2006 West Consulting Copyright (C) 2006-2014 Arthur de Jong @@ -362,7 +362,7 @@ static void *worker(void UNUSED(*arg)) /* function to disable lookups through the nss_ldap module to avoid lookup loops */ -static void disable_nss_ldap(void) +static void disable_nss_nslcd(void) { void *handle; char *error; @@ -424,7 +424,7 @@ int main(int argc, char *argv[]) parse_cmdline(argc, argv); /* disable the nss_ldap module for this process */ - disable_nss_ldap(); + disable_nss_nslcd(); /* read configuration file */ cfg_init(NSLCD_CONF_PATH); diff --git a/nslcd/nsswitch.c b/nslcd/nsswitch.c index 2b94bc8..2a5f124 100644 --- a/nslcd/nsswitch.c +++ b/nslcd/nsswitch.c @@ -35,7 +35,7 @@ /* the cached value of whether shadow lookups use LDAP in nsswitch.conf */ #define NSSWITCH_FILE "/etc/nsswitch.conf" #define CACHED_UNKNOWN 22 -static int cached_shadow_uses_ldap = CACHED_UNKNOWN; +static int cached_shadow_uses_nslcd = CACHED_UNKNOWN; static time_t cached_shadow_lastcheck = 0; #define CACHED_SHADOW_TIMEOUT (60) static time_t nsswitch_mtime = 0; @@ -44,12 +44,12 @@ static time_t nsswitch_mtime = 0; #define MAX_LINE_LENGTH 4096 /* check whether /etc/nsswitch.conf should be reloaded to update - cached_shadow_uses_ldap */ + cached_shadow_uses_nslcd */ void nsswitch_check_reload(void) { struct stat buf; time_t t; - if ((cached_shadow_uses_ldap != CACHED_UNKNOWN) && + if ((cached_shadow_uses_nslcd != CACHED_UNKNOWN) && ((t = time(NULL)) > (cached_shadow_lastcheck + CACHED_SHADOW_TIMEOUT))) { cached_shadow_lastcheck = t; @@ -57,14 +57,14 @@ void nsswitch_check_reload(void) { log_log(LOG_ERR, "stat(%s) failed: %s", NSSWITCH_FILE, strerror(errno)); /* trigger a recheck anyway */ - cached_shadow_uses_ldap = CACHED_UNKNOWN; + cached_shadow_uses_nslcd = CACHED_UNKNOWN; return; } /* trigger a recheck if file changed */ if (buf.st_mtime != nsswitch_mtime) { nsswitch_mtime = buf.st_mtime; - cached_shadow_uses_ldap = CACHED_UNKNOWN; + cached_shadow_uses_nslcd = CACHED_UNKNOWN; } } } @@ -128,14 +128,14 @@ static int has_service(const char *services, const char *service, return 0; } -static int shadow_uses_ldap(void) +static int shadow_uses_nslcd(void) { FILE *fp; int lnr = 0; char linebuf[MAX_LINE_LENGTH]; const char *services; int shadow_found = 0; - int passwd_has_ldap = 0; + int passwd_has_nslcd = 0; /* open config file */ if ((fp = fopen(NSSWITCH_FILE, "r")) == NULL) { @@ -160,22 +160,22 @@ static int shadow_uses_ldap(void) /* see if we have a passwd line */ services = find_db(linebuf, "passwd"); if (services != NULL) - passwd_has_ldap = has_service(services, "ldap", NSSWITCH_FILE, lnr); + passwd_has_nslcd = has_service(services, "ldap", NSSWITCH_FILE, lnr); } fclose(fp); if (shadow_found) return 0; - return passwd_has_ldap; + return passwd_has_nslcd; } -/* check whether shadow lookups are configured to use ldap */ -int nsswitch_shadow_uses_ldap(void) +/* check whether shadow lookups are configured to use nslcd */ +int nsswitch_shadow_uses_nslcd(void) { - if (cached_shadow_uses_ldap == CACHED_UNKNOWN) + if (cached_shadow_uses_nslcd == CACHED_UNKNOWN) { log_log(LOG_INFO, "(re)loading %s", NSSWITCH_FILE); - cached_shadow_uses_ldap = shadow_uses_ldap(); + cached_shadow_uses_nslcd = shadow_uses_nslcd(); cached_shadow_lastcheck = time(NULL); } - return cached_shadow_uses_ldap; + return cached_shadow_uses_nslcd; } |