diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2007-09-27 11:21:11 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2007-09-27 11:21:11 +0000 |
commit | 2526591274d04d584584ea7ae9a96042477f1c74 (patch) | |
tree | d8443fdc44155c978841a3ca9be40c48fc37d98f /modules/pam_succeed_if | |
parent | e83bead09f35a7f3024ec7390394326e89b00315 (diff) | |
download | pam-2526591274d04d584584ea7ae9a96042477f1c74.tar.gz pam-2526591274d04d584584ea7ae9a96042477f1c74.tar.bz2 pam-2526591274d04d584584ea7ae9a96042477f1c74.zip |
Relevant BUGIDs: Red Hat #295151
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.
Diffstat (limited to 'modules/pam_succeed_if')
-rw-r--r-- | modules/pam_succeed_if/pam_succeed_if.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/pam_succeed_if/pam_succeed_if.c b/modules/pam_succeed_if/pam_succeed_if.c index 4f33ba2e..06cb5d6a 100644 --- a/modules/pam_succeed_if/pam_succeed_if.c +++ b/modules/pam_succeed_if/pam_succeed_if.c @@ -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; } |