]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: Red Hat #295151
authorThorsten Kukuk <kukuk@thkukuk.de>
Thu, 27 Sep 2007 11:21:11 +0000 (11:21 +0000)
committerThorsten Kukuk <kukuk@thkukuk.de>
Thu, 27 Sep 2007 11:21:11 +0000 (11:21 +0000)
Purpose of commit: testcase

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

2007-09-27  Thorsten Kukuk  <kukuk@thkukuk.de>

        * xtests/tst-pam_succeed_if1.c: New test case for
        https://bugzilla.redhat.com/show_bug.cgi?id=295151
        * xtests/tst-pam_succeed_if1.sh: Script to run test case.
        * xtests/tst-pam_succeed_if1.pamd: Config for test case.
        * xtests/Makefile.am: Add tst-pam_succeed_if1 test case.

ChangeLog
modules/pam_succeed_if/pam_succeed_if.c

index 2d82849f6c9139ba727ef24241849dc69ff45dbf..bb8e2803d0381087a1fa4afae8127642970d34e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-09-27  Thorsten Kukuk  <kukuk@thkukuk.de>
 
+       * xtests/tst-pam_succeed_if1.c: New test case for
+       https://bugzilla.redhat.com/show_bug.cgi?id=295151
+       * xtests/tst-pam_succeed_if1.sh: Script to run test case.
+       * xtests/tst-pam_succeed_if1.pamd: Config for test case.
+       * xtests/Makefile.am: Add tst-pam_succeed_if1 test case.
+
        * xtests/run-xtests.sh: Add support to skip tests.
        * xtests/tst-pam_limits1.c: Skip test if RLIMIT_NICE is not
        defined.
index 4f33ba2eee8404f5a5ff26846826ffba5f37333d..06cb5d6a37289f73a80b30085411f08db60636e9 100644 (file)
@@ -191,13 +191,19 @@ static int
 evaluate_inlist(const char *left, const char *right)
 {
        char *p;
-       if ((p=strstr(right, left)) == NULL)
-               return PAM_AUTH_ERR;
-       if (p == right || *(p-1) == ':') { /* ':' is a list separator */
-               p += strlen(left);
-               if (*p == '\0' || *p == ':') {
-                   return PAM_SUCCESS;
+       /* Don't care about left containing ':'. */
+       while ((p=strstr(right, left)) != NULL) {
+               if (p == right || *(p-1) == ':') { /* ':' is a list separator */
+                       p += strlen(left);
+                       if (*p == '\0' || *p == ':') {
+                               return PAM_SUCCESS;
+                       }
                }
+               right = strchr(p, ':');
+               if (right == NULL)
+                       break;
+               else
+                       ++right;
        }
        return PAM_AUTH_ERR;
 }