From 3f41ddd882054181e19f669513411cee4f6f76c1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 27 Sep 2005 11:02:06 +0000 Subject: r10532: Replace next_token() with str_list_make() (This used to be commit 87bb382445292755eff1c29f12358d4509ebe714) --- source4/auth/auth_sam.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'source4/auth/auth_sam.c') diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c index 57f645adc8..a6db8ef63d 100644 --- a/source4/auth/auth_sam.c +++ b/source4/auth/auth_sam.c @@ -25,7 +25,6 @@ #include "system/time.h" #include "auth/auth.h" #include "lib/ldb/include/ldb.h" -#include "pstring.h" /**************************************************************************** Do a specific test for an smb password being correct, given a smb_password and @@ -161,21 +160,21 @@ static NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx, /* Test workstation. Workstation list is comma separated. */ if (workstation_list && *workstation_list) { BOOL invalid_ws = True; - const char *s = workstation_list; - - fstring tok; - - while (next_token(&s, tok, ",", sizeof(tok))) { + int i; + const char **workstations = str_list_make(mem_ctx, workstation_list, ","); + + for (i = 0; workstations[i]; i++) { DEBUG(10,("sam_account_ok: checking for workstation match '%s' and '%s'\n", - tok, user_info->workstation_name)); + workstations[i], user_info->workstation_name)); - if (strequal(tok, user_info->workstation_name)) { + if (strequal(workstations[i], user_info->workstation_name)) { invalid_ws = False; - break; } } + talloc_free(workstations); + if (invalid_ws) { return NT_STATUS_INVALID_WORKSTATION; } -- cgit