From e2546c9b5832a738be84e5882c1804ff3b05c569 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 29 Mar 2007 13:45:38 +0000 Subject: Relevant BUGIDs: Purpose of commit: cleanup Commit summary: --------------- 2007-03-29 Tomas Mraz * modules/pam_access/pam_access.c (login_access, list_match): Replace strtok with strtok_r. * modules/pam_cracklib/pam_cracklib.c (check_old_password): Likewise. * modules/pam_ftp/pam_ftp.c (lookup, pam_authenticate): Likewise. * modules/pam_unix/pam_unix_passwd.c (check_old_password, save_old_password): Likewise. --- modules/pam_ftp/pam_ftp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'modules/pam_ftp') diff --git a/modules/pam_ftp/pam_ftp.c b/modules/pam_ftp/pam_ftp.c index 4f4231c2..11cdf590 100644 --- a/modules/pam_ftp/pam_ftp.c +++ b/modules/pam_ftp/pam_ftp.c @@ -79,10 +79,11 @@ static int lookup(const char *name, const char *list, const char **_user) if (list && *list) { const char *l; char *list_copy, *x; + char *sptr; list_copy = x_strdup(list); x = list_copy; - while (list_copy && (l = strtok(x, ","))) { + while (list_copy && (l = strtok_r(x, ",", &sptr))) { x = NULL; if (!strcmp(name, l)) { *_user = list; @@ -170,11 +171,12 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, /* XXX: Some effort should be made to verify this email address! */ if (!(ctrl & PAM_IGNORE_EMAIL)) { - token = strtok(resp, "@"); + char *sptr; + token = strtok_r(resp, "@", &sptr); retval = pam_set_item(pamh, PAM_RUSER, token); if ((token) && (retval == PAM_SUCCESS)) { - token = strtok(NULL, "@"); + token = strtok_r(NULL, "@", &sptr); retval = pam_set_item(pamh, PAM_RHOST, token); } } -- cgit v1.2.3