]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs:
authorThorsten Kukuk <kukuk@thkukuk.de>
Wed, 18 Feb 2009 21:25:46 +0000 (21:25 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Wed, 18 Feb 2009 21:25:46 +0000 (21:25 +0000)
Purpose of commit: sanity check

Commit summary:
---------------

2009-02-18  Thorsten Kukuk  <kukuk@thkukuk.de>

        * libpam/pam_password.c (pam_chauthtok): Make sure applications
        don't set internal flags.

ChangeLog
libpam/pam_password.c

index 402e54fe6d68b1bea8eca0a276ee16f2beb8e12b..cc8a1ac0a7810f16478d9c611295d704f06a3f2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-18  Thorsten Kukuk  <kukuk@thkukuk.de>
+
+       * libpam/pam_password.c (pam_chauthtok): Make sure applications
+       don't set internal flags.
+
 2009-02-17  Thorsten Kukuk  <kukuk@thkukuk.de>
 
        * doc/man/pam_sm_chauthtok.3.xml: Document that sufficient
index 7100979fbb460f938b60cd0ae1529bc0bde6317b..70917c58efd6e0ea1608621bad1216ff7b0f94fb 100644 (file)
@@ -24,6 +24,13 @@ int pam_chauthtok(pam_handle_t *pamh, int flags)
        return PAM_SYSTEM_ERR;
     }
 
+    /* applications are not allowed to set this flags */
+    if (flags & (PAM_PRELIM_CHECK | PAM_UPDATE_AUTHTOK)) {
+      pam_syslog (pamh, LOG_ERR,
+                 "PAM_PRELIM_CHECK or PAM_UPDATE_AUTHTOK set by application");
+      return PAM_SYSTEM_ERR;
+    }
+
     if (pamh->former.choice == PAM_NOT_STACKED) {
        _pam_start_timer(pamh);    /* we try to make the time for a failure
                                      independent of the time it takes to
@@ -58,4 +65,3 @@ int pam_chauthtok(pam_handle_t *pamh, int flags)
 
     return retval;
 }
-