summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-27 11:02:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:39:02 -0500
commit3f41ddd882054181e19f669513411cee4f6f76c1 (patch)
tree09082fdfb1859815fe7b8d42b908bc99c3103542
parentd345bab9c0ea4838c31c502d769e042936ce980b (diff)
downloadsamba-3f41ddd882054181e19f669513411cee4f6f76c1.tar.gz
samba-3f41ddd882054181e19f669513411cee4f6f76c1.tar.bz2
samba-3f41ddd882054181e19f669513411cee4f6f76c1.zip
r10532: Replace next_token() with str_list_make()
(This used to be commit 87bb382445292755eff1c29f12358d4509ebe714)
-rw-r--r--source4/auth/auth_sam.c17
1 files changed, 8 insertions, 9 deletions
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;
}