Author: jelmer
Date: 2005-09-27 11:02:06 +0000 (Tue, 27 Sep 2005)
New Revision: 10532

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10532

Log:
Replace next_token() with str_list_make()

Modified:
   branches/SAMBA_4_0/source/auth/auth_sam.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_sam.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_sam.c   2005-09-27 10:32:49 UTC (rev 
10531)
+++ branches/SAMBA_4_0/source/auth/auth_sam.c   2005-09-27 11:02:06 UTC (rev 
10532)
@@ -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 @@
        /* 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;
                }

Reply via email to