]> granicus.if.org Git - linux-pam/commitdiff
2011-05-24 Thorsten Kukuk <kukuk@thkukuk.de>
authorThorsten Kukuk <kukuk@thkukuk.de>
Tue, 24 May 2011 14:48:11 +0000 (16:48 +0200)
committerThorsten Kukuk <kukuk@thkukuk.de>
Tue, 24 May 2011 14:48:11 +0000 (16:48 +0200)
        * modules/pam_listfile/pam_listfile.c (pam_sm_authenticate): quiet
        option has no argument, print no missing file if quiet is set
        [sf#3194930].

ChangeLog
modules/pam_listfile/pam_listfile.c

index 763c44e86a62e88e7af4ea63d8a9c70349cb40a7..b90a2e6d90900ff98b52b9bb255146eb7235d761 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-24  Thorsten Kukuk  <kukuk@thkukuk.de>
+
+       * modules/pam_listfile/pam_listfile.c (pam_sm_authenticate): quiet
+       option has no argument, print no missing file if quiet is set
+       [sf#3194930].
+
 2011-05-04  Thorsten Kukuk  <kukuk@thkukuk.de>
 
        * modules/pam_lastlog/pam_lastlog.c (last_login_failed): Don't
index 616d2201a1413b1e4f73f6e3d70a4ef57b8d591c..2af2afd8055d7cc9ff4b4f206200e5d226535205 100644 (file)
@@ -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;
     }