]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs:
authorTomas Mraz <tm@t8m.info>
Tue, 3 Mar 2009 08:10:53 +0000 (08:10 +0000)
committerTomas Mraz <tm@t8m.info>
Tue, 3 Mar 2009 08:10:53 +0000 (08:10 +0000)
Purpose of commit: bugfix

Commit summary:
---------------
2009-03-03  Tomas Mraz <t8m@centrum.cz>

        * modules/pam_unix/pam_unix_acct.c(_unix_run_verify_binary): Test
        for abnormal exit of the helper binary.
        * modules/pam_unix/pam_unix_passwd.c(_unix_run_update_binary): Likewise.
        * modules/pam_unix/support.c(_unix_run_helper_binary): Likewise.
        * modules/pam_mkhomedir/pam_mkhomedir.c(create_homedir): Likewise.

ChangeLog
modules/pam_mkhomedir/pam_mkhomedir.c
modules/pam_unix/pam_unix_acct.c
modules/pam_unix/pam_unix_passwd.c
modules/pam_unix/support.c

index 5abf28e32e96e0abfdeb8556ddfe979cd18474f1..2d72519005b86685eeb2dfad663ae72a7f9c5127 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-03-03  Tomas Mraz <t8m@centrum.cz> 
+
+        * modules/pam_unix/pam_unix_acct.c(_unix_run_verify_binary): Test
+        for abnormal exit of the helper binary.
+        * modules/pam_unix/pam_unix_passwd.c(_unix_run_update_binary): Likewise.
+        * modules/pam_unix/support.c(_unix_run_helper_binary): Likewise.
+       * modules/pam_mkhomedir/pam_mkhomedir.c(create_homedir): Likewise.
+
 2009-02-27  Tomas Mraz <t8m@centrum.cz>
 
        * modules/pam_mkhomedir/pam_mkhomedir.c(create_homedir): Replace
index 1beb2d9fc3b6dd2ce60750aaffcf44e3f43a3211..419b525a6a304245257f502f5ab9e6efe3113e71 100644 (file)
@@ -159,7 +159,10 @@ create_homedir (pam_handle_t *pamh, int ctrl,
        if (rc < 0) {
          pam_syslog(pamh, LOG_ERR, "waitpid failed: %m");
          retval = PAM_SYSTEM_ERR;
-       } else {
+       } else if (!WIFEXITED(retval)) {
+          pam_syslog(pamh, LOG_ERR, "mkhomedir_helper abnormal exit: %d", retval);
+          retval = PAM_SYSTEM_ERR;
+        } else {
          retval = WEXITSTATUS(retval);
        }
    } else {
index f8698337ad9ff0b045211f3befb6e90d56b4a189..4e11934073c45917295e12ff2735318efe2dda10 100644 (file)
@@ -140,6 +140,9 @@ int _unix_run_verify_binary(pam_handle_t *pamh, unsigned int ctrl,
       if (rc<0) {
        pam_syslog(pamh, LOG_ERR, "unix_chkpwd waitpid returned %d: %m", rc);
        retval = PAM_AUTH_ERR;
+      } else if (!WIFEXITED(retval)) {
+        pam_syslog(pamh, LOG_ERR, "unix_chkpwd abnormal exit: %d", retval);
+        retval = PAM_AUTH_ERR;
       } else {
        retval = WEXITSTATUS(retval);
         rc = pam_modutil_read(fds[0], buf, sizeof(buf) - 1);
index 9386d87f1797029cf47d962bd8a642ff3ec5a888..ab1adda0a6ed95893706f60c55ecff35568d77a8 100644 (file)
@@ -227,8 +227,11 @@ static int _unix_run_update_binary(pam_handle_t *pamh, unsigned int ctrl, const
        rc=waitpid(child, &retval, 0);  /* wait for helper to complete */
        if (rc<0) {
          pam_syslog(pamh, LOG_ERR, "unix_update waitpid failed: %m");
-         retval = PAM_AUTH_ERR;
-       } else {
+         retval = PAM_AUTHTOK_ERR;
+       } else if (!WIFEXITED(retval)) {
+          pam_syslog(pamh, LOG_ERR, "unix_update abnormal exit: %d", retval);
+          retval = PAM_AUTHTOK_ERR;
+        } else {
          retval = WEXITSTATUS(retval);
        }
     } else {
index 6e1bd4543da06347f52652eb20e0fd9b5f11eafc..dda617a00ff7e2026e7706a9a14f6c016bf9b4db 100644 (file)
@@ -489,6 +489,9 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
        if (rc<0) {
          pam_syslog(pamh, LOG_ERR, "unix_chkpwd waitpid returned %d: %m", rc);
          retval = PAM_AUTH_ERR;
+       } else if (!WIFEXITED(retval)) {
+         pam_syslog(pamh, LOG_ERR, "unix_chkpwd abnormal exit: %d", retval);
+         retval = PAM_AUTH_ERR;
        } else {
          retval = WEXITSTATUS(retval);
        }