summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2011-08-25 15:48:51 +0200
committerTomas Mraz <tmraz@fedoraproject.org>2011-08-25 15:48:51 +0200
commit61f4f06abc9b8fcb3c478fa430b52499fd2ca300 (patch)
treeb843f346a382b1bf6ffbf653afea907be3bf0915 /modules
parentca6fbe92205fe5b4acf2e92e4c2bf73327b26780 (diff)
Fix the split on @ in the user field. (Red Hat Bug #732081)
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_access/pam_access.c5
1 files changed, 4 insertions, 1 deletions
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;