diff -Naur samba-3.0.21c.org/source/lib/util_str.c samba-3.0.21c/source/lib/util_str.c --- samba-3.0.21c.org/source/lib/util_str.c 2006-02-20 21:33:21.000000000 +0100 +++ samba-3.0.21c/source/lib/util_str.c 2006-03-08 22:52:41.126596675 +0100 @@ -76,6 +76,48 @@ return(True); } + +BOOL next_token_nodq(const char **ptr,char *buff, const char *sep, size_t bufsize) +{ + char *s; + char *pbuf; + BOOL quoted; + size_t len=1; + + if (!ptr) + return(False); + + s = (char *)*ptr; + + /* default to simple separators */ + if (!sep) + sep = " \t\n\r"; + + /* find the first non sep char */ + while (*s && strchr_m(sep,*s)) + s++; + + /* nothing left? */ + if (! *s) + return(False); + + /* copy over the token */ + pbuf = buff; + for (quoted = False; len < bufsize && *s && (quoted || !strchr_m(sep,*s)); s++) { + // if ( *s == '\"' ) { + // quoted = !quoted; + // } else { + len++; + *pbuf++ = *s; + // } + } + + *ptr = (*s) ? s+1 : s; + *pbuf = 0; + + return(True); +} + /** This is like next_token but is not re-entrant and "remembers" the first parameter so you can pass NULL. This is useful for user interface code diff -Naur samba-3.0.21c.org/source/smbd/chgpasswd.c samba-3.0.21c/source/smbd/chgpasswd.c --- samba-3.0.21c.org/source/smbd/chgpasswd.c 2006-01-25 00:46:32.000000000 +0100 +++ samba-3.0.21c/source/smbd/chgpasswd.c 2006-03-08 22:52:58.479525368 +0100 @@ -317,7 +317,7 @@ return False; } - if (!next_token(&seq, issue, NULL, sizeof(issue))) + if (!next_token_nodq(&seq, issue, NULL, sizeof(issue))) fstrcpy(issue, "."); pwd_sub(issue);