summaryrefslogtreecommitdiff
path: root/modules/pam_listfile
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 21:13:04 -0800
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 21:13:04 -0800
commitc55c14c5c6762139ec6695d84ea0e2e917da5264 (patch)
tree9e6119760c93841b2bc3e05680ac9e4e15ae9c25 /modules/pam_listfile
parentf3c0273b7bd2d7fdcac3fe3604cedd82afc57f49 (diff)
parentfc772e7236a7aea9c9c26b0be2ee6f3ed8ae444a (diff)
New upstream version 1.1.5
Diffstat (limited to 'modules/pam_listfile')
-rw-r--r--modules/pam_listfile/pam_listfile.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/pam_listfile/pam_listfile.c b/modules/pam_listfile/pam_listfile.c
index 616d2201..2af2afd8 100644
--- a/modules/pam_listfile/pam_listfile.c
+++ b/modules/pam_listfile/pam_listfile.c
@@ -78,8 +78,14 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
{
const char *junk;
+ /* option quiet has no value */
+ if(!strcmp(argv[i],"quiet")) {
+ quiet = 1;
+ continue;
+ }
+
memset(mybuf,'\0',sizeof(mybuf));
- memset(myval,'\0',sizeof(mybuf));
+ memset(myval,'\0',sizeof(myval));
junk = strchr(argv[i], '=');
if((junk == NULL) || (junk - argv[i]) >= (int) sizeof(mybuf)) {
pam_syslog(pamh,LOG_ERR, "Bad option: \"%s\"",
@@ -142,8 +148,6 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
apply_type=APPLY_TYPE_USER;
strncpy(apply_val,myval,sizeof(apply_val)-1);
}
- } else if (!strcmp(mybuf,"quiet")) {
- quiet = 1;
} else {
free(ifname);
pam_syslog(pamh,LOG_ERR, "Unknown option: %s",mybuf);
@@ -283,7 +287,8 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED,
ifname, citem, citemp, sense);
#endif
if(lstat(ifname,&fileinfo)) {
- pam_syslog(pamh,LOG_ERR, "Couldn't open %s",ifname);
+ if(!quiet)
+ pam_syslog(pamh,LOG_ERR, "Couldn't open %s",ifname);
free(ifname);
return onerr;
}