diff options
author | Tomas Mraz <tmraz@fedoraproject.org> | 2011-08-25 15:48:51 +0200 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2011-08-25 15:48:51 +0200 |
commit | 61f4f06abc9b8fcb3c478fa430b52499fd2ca300 (patch) | |
tree | b843f346a382b1bf6ffbf653afea907be3bf0915 | |
parent | ca6fbe92205fe5b4acf2e92e4c2bf73327b26780 (diff) | |
download | pam-61f4f06abc9b8fcb3c478fa430b52499fd2ca300.tar.gz pam-61f4f06abc9b8fcb3c478fa430b52499fd2ca300.tar.bz2 pam-61f4f06abc9b8fcb3c478fa430b52499fd2ca300.zip |
Fix the split on @ in the user field. (Red Hat Bug #732081)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | modules/pam_access/pam_access.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2011-08-25 Tomas Mraz <tm@t8m.info> + + * modules/pam_access/pam_access.c (user_match): Fix the split + on @ in the user field. (Red Hat Bug #732081) + 2011-08-23 Tomas Mraz <tm@t8m.info> * modules/pam_env/pam_env.c (_pam_parse): Fix missing dereference. diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 0eb1e8c6..472116c3 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -521,7 +521,10 @@ user_match (pam_handle_t *pamh, char *tok, struct login_info *item) * name of the user's primary group. */ - if (tok[0] != '@' && (at = strchr(tok + 1, '@')) != 0) { + /* Try to split on a pattern (@*[^@]+)(@+.*) */ + for (at = tok; *at == '@'; ++at); + + if ((at = strchr(at, '@')) != NULL) { /* split user@host pattern */ if (item->hostname == NULL) return NO; |