diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-12-12 23:22:28 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-12-12 23:22:28 +0100 |
commit | f13d4d573a3cb241080434b1ded5b66fa91a4eec (patch) | |
tree | 5550c1f48c652a18f7798bf044aae78388a48cb2 | |
parent | e961186ba74374ecd0de57acaba62d92082076dc (diff) |
fallback to standard PAM error message if one wasn't returned by nslcd
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1326 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | pam/pam.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -433,6 +433,9 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc,const char **argv) /* check the returned authorisation value */ if (ctx2.authz!=PAM_SUCCESS) { + /* turn in to generic PAM error message if message is empty */ + if ((ctx2.authzmsg==NULL)||(ctx2.authzmsg[0]=='\0')) + ctx2.authzmsg=(char *)pam_strerror(pamh,ctx2.authz); pam_syslog(pamh,LOG_NOTICE,"%s; user=%s",ctx2.authzmsg,username); rc=remap_pam_rc(ctx2.authz,&cfg); if ((rc!=PAM_IGNORE)&&(!cfg.no_warn)) @@ -442,6 +445,8 @@ int pam_sm_acct_mgmt(pam_handle_t *pamh,int flags,int argc,const char **argv) /* check the original authorisation check from authentication */ if (ctx->authz!=PAM_SUCCESS) { + if ((ctx->authzmsg==NULL)||(ctx->authzmsg[0]=='\0')) + ctx->authzmsg=(char *)pam_strerror(pamh,ctx->authz); pam_syslog(pamh,LOG_NOTICE,"%s; user=%s",ctx->authzmsg,username); rc=remap_pam_rc(ctx->authz,&cfg); if ((rc!=PAM_IGNORE)&&(!cfg.no_warn)) |