diff options
Diffstat (limited to 'nslcd/db_passwd.c')
-rw-r--r-- | nslcd/db_passwd.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/nslcd/db_passwd.c b/nslcd/db_passwd.c index 12cdea8..17b7781 100644 --- a/nslcd/db_passwd.c +++ b/nslcd/db_passwd.c @@ -49,10 +49,10 @@ /* Note that the resulting password value should be one of: <empty> - no password set, allow login without password - * - often used to prevent logins + ! - used to prevent logins x - "valid" encrypted password that does not match any valid password often used to indicate that the password is defined elsewhere - other - encrypted password, usually in crypt(3) format */ + other - encrypted password, in crypt(3) format */ static int write_passwd(TFILE *fp, struct passwd *entry, uid_t calleruid) { @@ -96,20 +96,22 @@ NSLCD_HANDLE_UID( log_log(LOG_WARNING, "request denied by validnames option"); return -1; } - nsswitch_check_reload();, - /* search */ + nsswitch_check_reload(); + ,/* search */ + struct passwd, static size_t i = 0; for (; i < session->cnt; i++) { - if (strcmp(name, session->users[i].pw_name)==0) { - *rcp = 0; - i = session->cnt; - return &(session->users[i]); - } + if (strcmp(name, session->users[i].pw_name)==0) { + *rcp = 0; + i = session->cnt; + return &(session->users[i]); + } } return NULL; - /* write */ + ,/* write */ write_passwd(fp, entry, calleruid) + ,/* cleanup */ ) NSLCD_HANDLE_UID( @@ -130,18 +132,20 @@ NSLCD_HANDLE_UID( } nsswitch_check_reload(); ,/* search */ + struct passwd, static size_t i = 0; for (; i < session->cnt; i++) { - if (uid == session->users[i].pw_uid) { - *rcp = 0; - i = session->cnt; - return &(session->users[i]); - } + if (uid == session->users[i].pw_uid) { + *rcp = 0; + i = session->cnt; + return &(session->users[i]); + } } return NULL; ,/* write */ write_passwd(fp, entry, calleruid) + ,/* cleanup */ ) NSLCD_HANDLE_UID( @@ -152,6 +156,7 @@ NSLCD_HANDLE_UID( ,/* check */ nsswitch_check_reload(); ,/* search */ + struct passwd, static size_t i = 0; for (; i < session->cnt; i++) { @@ -160,4 +165,5 @@ NSLCD_HANDLE_UID( return NULL; ,/* write */ write_passwd(fp, entry, calleruid); + ,/* cleanup */ ) |