diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2007-10-08 15:05:36 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2007-10-08 15:05:36 +0000 |
commit | 23ad0f88c676fc0032fff0eb84d17d25b2e3401c (patch) | |
tree | aaf3bb5fdd68fc8a0b4c3729305a3c3b216d0eab | |
parent | 97eb58eb40a3a27c94d1e61c6a7bc980a6d3c8e5 (diff) | |
download | pam-23ad0f88c676fc0032fff0eb84d17d25b2e3401c.tar.gz pam-23ad0f88c676fc0032fff0eb84d17d25b2e3401c.tar.bz2 pam-23ad0f88c676fc0032fff0eb84d17d25b2e3401c.zip |
Relevant BUGIDs:
Purpose of commit: bugfix
Commit summary:
---------------
2007-10-08 Thorsten Kukuk <kukuk@thkukuk.de>
* modules/pam_time/pam_time.c (is_same): Length of strings without
wildcard needs to be the same.
* modules/pam_group/pam_group.c (is_same): Likewise.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | modules/pam_group/pam_group.c | 7 | ||||
-rw-r--r-- | modules/pam_time/pam_time.c | 10 |
3 files changed, 22 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2007-10-08 Thorsten Kukuk <kukuk@thkukuk.de> + + * modules/pam_time/pam_time.c (is_same): Length of strings without + wildcard needs to be the same. + * modules/pam_group/pam_group.c (is_same): Likewise. + 2007-10-01 Thorsten Kukuk <kukuk@thkukuk.de> * xtests/tst-pam_group1.c: New test case for user compare in pam_group. diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c index 1dc329ef..4a54da14 100644 --- a/modules/pam_group/pam_group.c +++ b/modules/pam_group/pam_group.c @@ -329,6 +329,13 @@ is_same (const pam_handle_t *pamh UNUSED, return FALSE; } } + + /* Ok, we know that b is a substring from A and does not contain + wildcards, but now the length of both strings must be the same, + too. */ + if (strlen (a) != strlen(b)) + return FALSE; + return ( !len ); } diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c index 43b716f0..56b418f4 100644 --- a/modules/pam_time/pam_time.c +++ b/modules/pam_time/pam_time.c @@ -59,7 +59,7 @@ shift_bytes(char *mem, int from, int by) } static int -read_field(pam_handle_t *pamh, int fd, char **buf, int *from, int *to) +read_field(const pam_handle_t *pamh, int fd, char **buf, int *from, int *to) { /* is buf set ? */ @@ -137,6 +137,7 @@ read_field(pam_handle_t *pamh, int fd, char **buf, int *from, int *to) switch ((*buf)[i]) { int j,c; case '#': + c = 0; for (j=i; j < *to && (c = (*buf)[j]) != '\n'; ++j); if (j >= *to) { (*buf)[*to = ++i] = '\0'; @@ -324,6 +325,13 @@ is_same(pam_handle_t *pamh UNUSED, const void *A, const char *b, return FALSE; } } + + /* Ok, we know that b is a substring from A and does not contain + wildcards, but now the length of both strings must be the same, + too. */ + if (strlen (a) != strlen(b)) + return FALSE; + return ( !len ); } |