diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-01 15:33:40 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2013-03-01 17:39:25 +0100 |
commit | b4afe7c94d24825afeedeab08a05bceee3ad3c40 (patch) | |
tree | 851c3221dc758001269439e05f5e4f7527619ccb /nslcd/pam.c | |
parent | 31f9098856d99a04cf96be8683fbf99b72ac6983 (diff) |
log a more meaningful error in nslcd when trying to authenticate as administrator when rootpwmoddn is not set
Diffstat (limited to 'nslcd/pam.c')
-rw-r--r-- | nslcd/pam.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nslcd/pam.c b/nslcd/pam.c index 2e09584..40e0069 100644 --- a/nslcd/pam.c +++ b/nslcd/pam.c @@ -274,8 +274,14 @@ int nslcd_pam_authc(TFILE *fp, MYLDAP_SESSION *session, uid_t calleruid) WRITE_INT32(fp, NSLCD_ACTION_PAM_AUTHC); /* if the username is blank and rootpwmoddn is configured, try to authenticate as administrator, otherwise validate request as usual */ - if ((*username == '\0') && (nslcd_cfg->rootpwmoddn != NULL)) + if (*username == '\0') { + if (nslcd_cfg->rootpwmoddn == NULL) + { + log_log(LOG_NOTICE, "rootpwmoddn not configured"); + /* we break the protocol */ + return -1; + } userdn = nslcd_cfg->rootpwmoddn; /* if the caller is root we will allow the use of the rootpwmodpw option */ if ((*password == '\0') && (calleruid == 0) && (nslcd_cfg->rootpwmodpw != NULL)) |