diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 16:09:38 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 16:09:38 -0800 |
commit | 03398c56c56ed427818d2ce879d45d1009f7d46b (patch) | |
tree | 9a7bc0d7d15ac988ac9ad31ad18a769030faced7 /Linux-PAM/modules/pam_time/pam_time.c | |
parent | e78677298d54010c3a62b932baefdae152fd0fed (diff) | |
parent | 281e859131adad49301befbc50cfc5cd282c6937 (diff) | |
download | pam-03398c56c56ed427818d2ce879d45d1009f7d46b.tar.gz pam-03398c56c56ed427818d2ce879d45d1009f7d46b.tar.bz2 pam-03398c56c56ed427818d2ce879d45d1009f7d46b.zip |
merge upstream version 0.99.9.0
Diffstat (limited to 'Linux-PAM/modules/pam_time/pam_time.c')
-rw-r--r-- | Linux-PAM/modules/pam_time/pam_time.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Linux-PAM/modules/pam_time/pam_time.c b/Linux-PAM/modules/pam_time/pam_time.c index 43b716f0..56b418f4 100644 --- a/Linux-PAM/modules/pam_time/pam_time.c +++ b/Linux-PAM/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 ); } |