{
fstring buf;
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
do_cd(buf);
else
DEBUG(0,("Current directory is %s\n",CNV_LANG(cur_dir)));
if(mask[strlen(mask)-1]!='\\')
pstrcat(mask,"\\");
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
{
if (*p == '\\')
pstrcpy(mask,p);
p = rname + strlen(rname);
- if (!next_token(NULL,p,NULL)) {
+ if (!next_token(NULL,p,NULL,sizeof(rname)-strlen(rname))) {
DEBUG(0,("get <filename>\n"));
return;
}
pstrcpy(lname,p);
dos_clean_name(rname);
- next_token(NULL,lname,NULL);
+ next_token(NULL,lname,NULL,sizeof(lname));
do_get(rname,lname,NULL);
}
"%s/smbmore.%d",tmpdir(),(int)getpid());
fstrcpy(lname,tmpname);
- if (!next_token(NULL,rname+strlen(rname),NULL)) {
+ if (!next_token(NULL,rname+strlen(rname),NULL,sizeof(rname)-strlen(rname))) {
DEBUG(0,("more <filename>\n"));
return;
}
abort_mget = False;
- while (next_token(NULL,p,NULL))
+ while (next_token(NULL,p,NULL,sizeof(buf)))
{
pstrcpy(mget_mask,cur_dir);
if(mget_mask[strlen(mget_mask)-1]!='\\')
pstrcpy(mask,cur_dir);
- if (!next_token(NULL,p,NULL))
+ if (!next_token(NULL,p,NULL,sizeof(buf)))
{
if (!recurse)
DEBUG(0,("mkdir <dirname>\n"));
pstrcat(rname,"\\");
- if (!next_token(NULL,p,NULL))
+ if (!next_token(NULL,p,NULL,sizeof(buf)))
{
DEBUG(0,("put <filename>\n"));
return;
}
pstrcpy(lname,p);
- if (next_token(NULL,p,NULL))
+ if (next_token(NULL,p,NULL,sizeof(buf)))
pstrcat(rname,p);
else
pstrcat(rname,lname);
static void cmd_select(char *dum_in, char *dum_out)
{
pstrcpy(fileselection,"");
- next_token(NULL,fileselection,NULL);
+ next_token(NULL,fileselection,NULL,sizeof(fileselection));
}
finfo = def_finfo;
- while (next_token(NULL,p,NULL))
+ while (next_token(NULL,p,NULL,sizeof(buf)))
{
struct stat st;
pstring cmd;
DEBUG(0,("Trying to cancel print jobs without -P may fail\n"));
}
- if (!next_token(NULL,buf,NULL)) {
+ if (!next_token(NULL,buf,NULL,sizeof(buf))) {
printf("cancel <jobid> ...\n");
return;
}
do {
job = atoi(buf);
do_cancel(job);
- } while (next_token(NULL,buf,NULL));
+ } while (next_token(NULL,buf,NULL,sizeof(buf)));
}
DEBUG(0,("Trying to print without -P may fail\n"));
}
- if (!next_token(NULL,lname,NULL))
+ if (!next_token(NULL,lname,NULL, sizeof(lname)))
{
DEBUG(0,("print <filename>\n"));
return;
pstrcpy(mask,cur_dir);
- if (!next_token(NULL,buf,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
DEBUG(0,("del <filename>\n"));
return;
pstrcpy(mask,cur_dir);
- if (!next_token(NULL,buf,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
DEBUG(0,("rmdir <dirname>\n"));
return;
pstrcpy(src,cur_dir);
pstrcpy(dest,cur_dir);
- if (!next_token(NULL,buf,NULL) || !next_token(NULL,buf2,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)) ||
+ !next_token(NULL,buf2,NULL, sizeof(buf2)))
{
DEBUG(0,("rename <src> <dest>\n"));
return;
BOOL ok;
struct stat sbuf;
- ok = next_token(NULL,buf,NULL);
+ ok = next_token(NULL,buf,NULL,sizeof(buf));
if (ok && (sys_stat(buf,&sbuf) == 0))
{
newer_than = sbuf.st_mtime;
{
fstring buf;
- if (next_token(NULL,buf,NULL)) {
+ if (next_token(NULL,buf,NULL,sizeof(buf))) {
archive_level = atoi(buf);
} else
DEBUG(0,("Archive level is %d\n",archive_level));
fstring buf;
fstring mode;
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
{
if (strequal(buf,"text"))
printmode = 0;
fstring buf;
pstring d;
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
sys_chdir(buf);
DEBUG(2,("the local directory is now %s\n",GetWd(d)));
}
int i=0,j;
fstring buf;
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
{
if ((i = process_tok(buf)) >= 0)
DEBUG(0,("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description));
/* and get the first part of the command */
{
char *ptr = line;
- if (!next_token(&ptr,tok,NULL)) continue;
+ if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue;
}
if ((i = process_tok(tok)) >= 0)
/* and get the first part of the command */
{
char *ptr = line;
- if (!next_token(&ptr,tok,NULL)) continue;
+ if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue;
}
if ((i = process_tok(tok)) >= 0)
fstring buf;
int block;
- if (!next_token(NULL,buf,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
DEBUG(0, ("blocksize <n>\n"));
return;
{
fstring buf;
- while (next_token(NULL,buf,NULL)) {
+ while (next_token(NULL,buf,NULL,sizeof(buf))) {
if (strequal(buf, "full"))
tar_inc=False;
else if (strequal(buf, "inc"))
attra[0] = attra[1] = 0;
- if (!next_token(NULL,buf,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
DEBUG(0, ("setmode <filename> <perm=[+|-]rsha>\n"));
return;
safe_strcpy(fname, cur_dir, sizeof(pstring));
safe_strcat(fname, buf, sizeof(pstring));
- while (next_token(NULL,buf,NULL)) {
+ while (next_token(NULL,buf,NULL,sizeof(buf))) {
q=buf;
while(*q)
char **argl;
int argcl;
- if (!next_token(NULL,buf,NULL))
+ if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
DEBUG(0,("tar <c|x>[IXbga] <filename>\n"));
return;
int retval;
char mount_point[MAXPATHLEN+1];
- if (!next_token(NULL, mpoint, NULL))
+ if (!next_token(NULL, mpoint, NULL, sizeof(mpoint)))
{
DEBUG(0,("You must supply a mount point\n"));
return;
slprintf(mount_command, sizeof(mount_command)-1,"smbmnt %s -s %s", mount_point, share_name);
- while(next_token(NULL, buf, NULL))
+ while(next_token(NULL, buf, NULL, sizeof(buf)))
{
pstrcat(mount_command, " ");
pstrcat(mount_command, buf);
int i=0,j;
fstring buf;
- if (next_token(NULL,buf,NULL))
+ if (next_token(NULL,buf,NULL,sizeof(buf)))
{
if ((i = process_tok(buf)) >= 0)
DEBUG(0,("HELP %s:\n\t%s\n\n",commands[i].name,commands[i].description));
/* and get the first part of the command */
{
char *ptr = line;
- if (!next_token(&ptr,tok,NULL)) continue;
+ if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue;
}
if ((i = process_tok(tok)) >= 0)
/* and get the first part of the command */
{
char *ptr = line;
- if (!next_token(&ptr,tok,NULL)) continue;
+ if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue;
}
if ((i = process_tok(tok)) >= 0)
char *tmpdir(void);
BOOL is_a_socket(int fd);
-BOOL next_token(char **ptr,char *buff,char *sep);
+BOOL next_token(char **ptr,char *buff,char *sep, int bufsize);
char **toktocliplist(int *ctok, char *sep);
void *mem_dup( void *from, int size );
void array_promote(char *array,int elsize,int element);
allones_ip = *interpret_addr2("255.255.255.255");
loopback_ip = *interpret_addr2("127.0.0.1");
- while (next_token(&ptr,token,NULL)) {
+ while (next_token(&ptr,token,NULL,sizeof(token))) {
/* parse it into an IP address/netmasklength pair */
char *p = strchr(token,'/');
if (p) *p++ = 0;
pstring tok;
char *p=list;
- while (next_token(&p,tok,LIST_SEP))
+ while (next_token(&p,tok,LIST_SEP, sizeof(tok)))
{
/*
* Check raw username.
Based on a routine by GJC@VILLAGE.COM.
Extensively modified by Andrew.Tridgell@anu.edu.au
****************************************************************************/
-BOOL next_token(char **ptr,char *buff,char *sep)
+BOOL next_token(char **ptr,char *buff,char *sep, int bufsize)
{
char *s;
BOOL quoted;
+ int len=1;
if (!ptr) ptr = &last_ptr;
if (!ptr) return(False);
if (! *s) return(False);
/* copy over the token */
- for (quoted = False; *s && (quoted || !strchr(sep,*s)); s++)
+ for (quoted = False; len < bufsize && *s && (quoted || !strchr(sep,*s)); s++)
{
- if (*s == '\"')
- quoted = !quoted;
- else
- *buff++ = *s;
+ if (*s == '\"') {
+ quoted = !quoted;
+ } else {
+ len++;
+ *buff++ = *s;
+ }
}
*ptr = (*s) ? s+1 : s;
{
fstring tok;
- while (next_token(&options,tok," \t,"))
+ while (next_token(&options,tok," \t,", sizeof(tok)))
{
int ret=0,i;
int value = 1;
if (!list) return(False);
- while (next_token(&p,tok,LIST_SEP))
+ while (next_token(&p,tok,LIST_SEP,sizeof(tok)))
{
if (casesensitive) {
if (strcmp(tok,s) == 0)
}
p += 2;
- if(!next_token(&p, tok, "-")) {
+ if(!next_token(&p, tok, "-", sizeof(tok))) {
DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr));
return False;
}
/* Get the revision number. */
sidout->sid_rev_num = atoi(tok);
- if(!next_token(&p, tok, "-")) {
+ if(!next_token(&p, tok, "-", sizeof(tok))) {
DEBUG(0,("string_to_sid: Sid %s is not in a valid format.\n", sidstr));
return False;
}
sidout->num_auths = 0;
- while(next_token(&p, tok, "-") && sidout->num_auths < MAXSUBAUTHS) {
+ while(next_token(&p, tok, "-", sizeof(tok)) &&
+ sidout->num_auths < MAXSUBAUTHS) {
/*
* NOTE - the subauths are in native machine-endian format. They
* are converted to little-endian when linearized onto the wire.
ptr = line;
- if (next_token(&ptr,ip ,NULL))
+ if (next_token(&ptr,ip ,NULL,sizeof(ip)))
++count;
- if (next_token(&ptr,name ,NULL))
+ if (next_token(&ptr,name ,NULL, sizeof(name)))
++count;
- if (next_token(&ptr,flags,NULL))
+ if (next_token(&ptr,flags,NULL, sizeof(flags)))
++count;
- if (next_token(&ptr,extra,NULL))
+ if (next_token(&ptr,extra,NULL, sizeof(extra)))
++count;
if (count <= 0)
ptr = name_resolve_list;
if (!ptr || !*ptr) ptr = "host";
- while (next_token(&ptr, tok, LIST_SEP)) {
+ while (next_token(&ptr, tok, LIST_SEP, sizeof(tok))) {
if(strequal(tok, "host") || strequal(tok, "hosts")) {
/*
*/
/* Work out the max number of netbios aliases that we have */
ptr = lp_netbios_aliases();
- for( namecount=0; next_token(&ptr,nbname,NULL); namecount++ )
+ for( namecount=0; next_token(&ptr,nbname,NULL, sizeof(nbname)); namecount++ )
;
if ( *global_myname )
namecount++;
my_netbios_names[namecount++] = global_myname;
ptr = lp_netbios_aliases();
- while ( next_token( &ptr, nbname, NULL ) )
+ while ( next_token( &ptr, nbname, NULL, sizeof(nbname) ) )
{
strupper( nbname );
/* Look for duplicates */
comment = lp_serverstring();
- for (ptr=s; next_token(&ptr,s2,NULL); )
+ for (ptr=s; next_token(&ptr,s2,NULL,sizeof(s2)); )
{
/* The entries are of the form a.b.c.d/WORKGROUP with
WORKGROUP being optional */
strupper(p);
p = skip_string(p,1);
- for (ptr=s; next_token(&ptr,s2,NULL); )
+ for (ptr=s; next_token(&ptr,s2,NULL,sizeof(s2)); )
{
/* The entries are of the form a.b.c.d */
addr = *interpret_addr2(s2);
CatchChild();
if ((s->pid = fork())) return;
+ BlockSignals( False, SIGTERM );
+
DEBUG(2,("Initiating browse sync for %s to %s(%s)\n",
work->work_group, name, inet_ntoa(ip)));
ptr = line;
- DEBUG(9,("sync line [%s]\n", line));
-
- if (!next_token(&ptr,server,NULL) ||
- !next_token(&ptr,type_str,NULL) ||
- !next_token(&ptr,comment,NULL)) {
+ if (!next_token(&ptr,server,NULL,sizeof(server)) ||
+ !next_token(&ptr,type_str,NULL, sizeof(type_str)) ||
+ !next_token(&ptr,comment,NULL, sizeof(comment))) {
continue;
}
* time to actually parse them into the ip_list array.
*/
- if (!next_token(&ptr,name_str,NULL))
+ if (!next_token(&ptr,name_str,NULL,sizeof(name_str)))
{
DEBUG(0,("initialise_wins: Failed to parse name when parsing line %s\n", line ));
continue;
}
- if (!next_token(&ptr,ttl_str,NULL))
+ if (!next_token(&ptr,ttl_str,NULL,sizeof(ttl_str)))
{
DEBUG(0,("initialise_wins: Failed to parse time to live when parsing line %s\n", line ));
continue;
num_ips = 0;
do
{
- got_token = next_token(&ptr,ip_str,NULL);
+ got_token = next_token(&ptr,ip_str,NULL,sizeof(ip_str));
was_ip = False;
if(got_token && strchr(ip_str, '.'))
/* Reset and re-parse the line. */
ptr = line;
- next_token(&ptr,name_str,NULL);
- next_token(&ptr,ttl_str,NULL);
+ next_token(&ptr,name_str,NULL,sizeof(name_str));
+ next_token(&ptr,ttl_str,NULL,sizeof(ttl_str));
for(i = 0; i < num_ips; i++)
{
- next_token(&ptr, ip_str, NULL);
+ next_token(&ptr, ip_str, NULL, sizeof(ip_str));
ip_list[i] = *interpret_addr2(ip_str);
if (ip_equal(ip_list[i], ipzero))
source = SELF_NAME;
}
- next_token(&ptr,nb_flags_str,NULL);
+ next_token(&ptr,nb_flags_str,NULL, sizeof(nb_flags_str));
/*
* Deal with SELF or REGISTER name encoding. Default is REGISTER
string_sub(line,"(","\"");
string_sub(line,")","\"");
- for (count=0; count<NTOK && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0;
+ count<NTOK &&
+ next_token(&line,tok[count],NULL, sizeof(tok[count]));
+ count++) ;
/* we must get NTOK tokens */
if (count < NTOK)
string_sub(line,"(","\"");
string_sub(line,")","\"");
- for (count=0; count<LPRNG_NTOK && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0;
+ count<LPRNG_NTOK &&
+ next_token(&line,tok[count],NULL, sizeof(tok[count]));
+ count++) ;
/* we must get LPRNG_NTOK tokens */
if (count < LPRNG_NTOK)
string_sub(line,"(","\"");
string_sub(line,")","\"");
- for (count=0; count<10 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0;
+ count<10 &&
+ next_token(&line,tok[count],NULL, sizeof(tok[count]));
+ count++) ;
/* we must get 6 tokens */
if (count < 10)
string_sub(line,"(","\"");
string_sub(line,")","\"");
- for (count=0; count<2 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<2 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 2 tokens */
if (count < 2) return(False);
/* handle the dash in the job id */
string_sub(line,"-"," ");
- for (count=0; count<12 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<12 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 8 tokens */
if (count < 8) return(False);
/* handle the dash in the job id */
string_sub(line,"-"," ");
- for (count=0; count<9 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<9 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 7 tokens */
if (count < 7)
- for (count=0; count<7 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<7 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 7 tokens */
if (count < 7)
string_sub(line,"(","\"");
string_sub(line,")","\"");
- for (count=0; count<11 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<11 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 11 tokens */
if (count < 11)
/* mung all the ":"s to spaces*/
string_sub(line,":"," ");
- for (count=0; count<10 && next_token(&line,tok[count],NULL); count++) ;
+ for (count=0; count<10 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ;
/* we must get 9 tokens */
if (count < 9)
*/
generate_random_buffer( new_trust_passwd_hash, 16, True);
- while(remote_machine_list && next_token( &remote_machine_list,
- remote_machine, LIST_SEP)) {
+ while(remote_machine_list &&
+ next_token(&remote_machine_list, remote_machine,
+ LIST_SEP, sizeof(remote_machine))) {
strupper(remote_machine);
if(modify_trust_password( domain, remote_machine,
old_trust_passwd_hash, new_trust_passwd_hash)) {
if (sids_str == NULL || *sids_str == 0) return 0;
- for (count = 0, ptr = sids_str; next_token(&ptr, s2, NULL) && count < max_sids; count++)
+ for (count = 0, ptr = sids_str;
+ next_token(&ptr, s2, NULL, sizeof(s2)) && count < max_sids;
+ count++)
{
DOM_SID tmpsid;
string_to_sid(&tmpsid, s2);
if (gids_str == NULL || *gids_str == 0)
return 0;
- for (count = 0, ptr = gids_str; next_token(&ptr, s2, NULL); count++)
+ for (count = 0, ptr = gids_str;
+ next_token(&ptr, s2, NULL, sizeof(s2));
+ count++)
;
gids = (DOM_GID *)malloc( sizeof(DOM_GID) * count );
return 0;
}
- for (count = 0, ptr = gids_str; next_token(&ptr, s2, NULL) &&
- count < LSA_MAX_GROUPS; count++)
+ for (count = 0, ptr = gids_str;
+ next_token(&ptr, s2, NULL, sizeof(s2)) &&
+ count < LSA_MAX_GROUPS;
+ count++)
{
/* the entries are of the form GID/ATTR, ATTR being optional.*/
char *attr;
*buf = 0;
sleep(1);
- while (next_token(&ptr,chatbuf,NULL)) {
+ while (next_token(&ptr,chatbuf,NULL,sizeof(chatbuf))) {
BOOL ok=True;
count++;
pwd_sub(chatbuf);
return(False);
}
- if (!next_token(&ptr,chatbuf,NULL)) break;
+ if (!next_token(&ptr,chatbuf,NULL,sizeof(chatbuf))) break;
pwd_sub(chatbuf);
if (!strequal(chatbuf,"."))
writestring(master,chatbuf);
if (!*s || strchr("#;",*s))
continue;
- if(!next_token(&s,unixname, "\t\n\r="))
+ if(!next_token(&s,unixname, "\t\n\r=", sizeof(unixname)))
continue;
- if(!next_token(&s,windows_name, "\t\n\r="))
+ if(!next_token(&s,windows_name, "\t\n\r=", sizeof(windows_name)))
continue;
trim_string(unixname, " ", " ");
p = q; /* reset string pointer */
fgets(p,8191,f);
p[strlen(p)-1]='\0';
- if (next_token(&p,tok,":") &&
+ if (next_token(&p,tok,":",sizeof(tok)) &&
(strlen(lp_printerdriver(snum)) == strlen(tok)) &&
(!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
ok=1;
fclose(f);
/* driver file name */
- if (ok && !next_token(&p,driver,":")) ok = 0;
+ if (ok && !next_token(&p,driver,":",sizeof(driver))) ok = 0;
/* data file name */
- if (ok && !next_token(&p,datafile,":")) ok = 0;
+ if (ok && !next_token(&p,datafile,":",sizeof(datafile))) ok = 0;
/*
* for the next tokens - which may be empty - I have to check for empty
* tokens first because the next_token function will skip all empty
if (*p == ':') {
*helpfile = '\0';
p++;
- } else if (!next_token(&p,helpfile,":")) ok = 0;
+ } else if (!next_token(&p,helpfile,":",sizeof(helpfile))) ok = 0;
}
if (ok) {
if (*p == ':') {
*langmon = '\0';
p++;
- } else if (!next_token(&p,langmon,":")) ok = 0;
+ } else if (!next_token(&p,langmon,":",sizeof(langmon))) ok = 0;
}
/* default data type */
- if (ok && !next_token(&p,datatype,":")) ok = 0;
+ if (ok && !next_token(&p,datatype,":",sizeof(datatype))) ok = 0;
if (ok) {
PACKI(desc,"W",0x0400); /* don't know */
/* no need to check return value here - it was already tested in
* get_printerdrivernumber
*/
- next_token(&p,tok,",");
+ next_token(&p,tok,",",sizeof(tok));
PACKS(desc,"z",tok); /* driver files to copy */
DEBUG(3,("file:%s:\n",tok));
}
{
p = q; /* reset string pointer */
fgets(p,8191,f);
- if (next_token(&p,tok,":") &&
+ if (next_token(&p,tok,":",sizeof(tok)) &&
(!strncmp(tok,lp_printerdriver(snum),strlen(lp_printerdriver(snum)))))
ok=1;
}
return(0);
/* count the number of files */
- while (next_token(&p,tok,","))
+ while (next_token(&p,tok,",",sizeof(tok)))
i++;
}
free(q);
}
s = &(*servers)[count];
- if (!next_token(&ptr,s->name , NULL)) continue;
- if (!next_token(&ptr,stype , NULL)) continue;
- if (!next_token(&ptr,s->comment, NULL)) continue;
- if (!next_token(&ptr,s->domain , NULL)) {
+ if (!next_token(&ptr,s->name , NULL, sizeof(s->name))) continue;
+ if (!next_token(&ptr,stype , NULL, sizeof(stype))) continue;
+ if (!next_token(&ptr,s->comment, NULL, sizeof(s->comment))) continue;
+ if (!next_token(&ptr,s->domain , NULL, sizeof(s->domain))) {
/* this allows us to cope with an old nmbd */
pstrcpy(s->domain,global_myworkgroup);
}
return NULL;
p = lp_passwordserver();
- while(p && next_token( &p, desthost, LIST_SEP)) {
+ while(p && next_token( &p, desthost, LIST_SEP, sizeof(desthost))) {
standard_sub_basic(desthost);
strupper(desthost);
*/
p = lp_passwordserver();
- while(p && next_token( &p, remote_machine, LIST_SEP)) {
+ while(p && next_token(&p,remote_machine,LIST_SEP,sizeof(remote_machine))) {
standard_sub_basic(remote_machine);
strupper(remote_machine);
unsigned char b = 0;
/* Get the 'lower' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse first value");
if(!parse_byte( token_buf, &b))
parse_error(buf, "first value doesn't resolve to a byte");
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4),b);
/* Get the 'upper' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse second value");
if(!parse_byte( token_buf, &b))
parse_error(buf, "second value doesn't resolve to a byte");
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 1,b);
/* Get the 'upper to lower' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse third value");
if(!parse_bool( token_buf, &b))
parse_error(buf, "third value doesn't resolve to a boolean");
SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 2,b);
/* Get the 'lower to upper' value. */
- if(!next_token(&p, token_buf, NULL))
+ if(!next_token(&p, token_buf, NULL, sizeof(token_buf)))
parse_error(buf, "cannot parse fourth value");
if(!parse_bool( token_buf, &b))
parse_error(buf, "fourth value doesn't resolve to a boolean");