diff options
author | Tomas Mraz <tm@t8m.info> | 2007-08-15 20:44:55 +0000 |
---|---|---|
committer | Tomas Mraz <tm@t8m.info> | 2007-08-15 20:44:55 +0000 |
commit | f6ad669fce9a091773ba36f991559aa502dd4f47 (patch) | |
tree | 673439532c4ded3536712faca8ccd862904ceaa7 /modules/pam_access/pam_access.c | |
parent | 50f0f6d7738be8f35264e53461f14e2c3afa83c8 (diff) | |
download | pam-f6ad669fce9a091773ba36f991559aa502dd4f47.tar.gz pam-f6ad669fce9a091773ba36f991559aa502dd4f47.tar.bz2 pam-f6ad669fce9a091773ba36f991559aa502dd4f47.zip |
Relevant BUGIDs:
Purpose of commit: cleanup
Commit summary:
---------------
2007-08-15 Tomas Mraz <t8m@centrum.cz>
* modules/pam_access/pam_access.c (list_match): Add explicit
sptr argument for strtok_r, otherwise the code is not portable.
Diffstat (limited to 'modules/pam_access/pam_access.c')
-rw-r--r-- | modules/pam_access/pam_access.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 29a1606c..e12bc721 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -153,7 +153,7 @@ parse_args(pam_handle_t *pamh, struct login_info *loginfo, typedef int match_func (pam_handle_t *, char *, struct login_info *); -static int list_match (pam_handle_t *, char *, struct login_info *, +static int list_match (pam_handle_t *, char *, char *, struct login_info *, match_func *); static int user_match (pam_handle_t *, char *, struct login_info *); static int group_match (pam_handle_t *, const char *, const char *); @@ -376,11 +376,11 @@ login_access (pam_handle_t *pamh, struct login_info *item) if (pam_access_debug) pam_syslog (pamh, LOG_DEBUG, "line %d: %s : %s : %s", lineno, perm, users, froms); - match = list_match(pamh, froms, item, from_match); + match = list_match(pamh, froms, NULL, item, from_match); if (pam_access_debug) pam_syslog (pamh, LOG_DEBUG, "from_match=%d, \"%s\"", match, item->from); - match = match && list_match (pamh, users, item, user_match); + match = match && list_match (pamh, users, NULL, item, user_match); if (pam_access_debug) pam_syslog (pamh, LOG_DEBUG, "user_match=%d, \"%s\"", match, item->user->pw_name); @@ -400,14 +400,14 @@ login_access (pam_handle_t *pamh, struct login_info *item) /* list_match - match an item against a list of tokens with exceptions */ -static int list_match(pam_handle_t *pamh, - char *list, struct login_info *item, match_func *match_fn) +static int +list_match(pam_handle_t *pamh, char *list, char *sptr, + struct login_info *item, match_func *match_fn) { char *tok; int match = NO; - char *sptr; - if (pam_access_debug) + if (pam_access_debug && list != NULL) pam_syslog (pamh, LOG_DEBUG, "list_match: list=%s, item=%s", list, item->user->pw_name); @@ -430,7 +430,7 @@ static int list_match(pam_handle_t *pamh, if (match != NO) { while ((tok = strtok_r(NULL, sep, &sptr)) && strcasecmp(tok, "EXCEPT")) /* VOID */ ; - if (tok == 0 || list_match(pamh, sptr, item, match_fn) == NO) + if (tok == 0 || list_match(pamh, NULL, sptr, item, match_fn) == NO) return (match); } return (NO); |