summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-23 11:04:10 +0100
committerVolker Lendecke <vl@samba.org>2008-01-23 15:08:04 +0100
commit587cf54c61c9f1f7bcae431a82035fd942716c32 (patch)
treec11ebe9ab6ed860e7e768b1b7de4db3c8ac609a1 /source3/smbd
parent20512431321388cf293431b942cbbe9263d295c9 (diff)
downloadsamba-587cf54c61c9f1f7bcae431a82035fd942716c32.tar.gz
samba-587cf54c61c9f1f7bcae431a82035fd942716c32.tar.bz2
samba-587cf54c61c9f1f7bcae431a82035fd942716c32.zip
strtok -> strtok_r
(This used to be commit fd34ce437057bb34cdc37f4b066e424000d36789)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/msdfs.c5
-rw-r--r--source3/smbd/password.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index 4ae735633b..8ffa0f7751 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -288,12 +288,13 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
char **alt_path = NULL;
int count = 0, i;
struct referral *reflist;
+ char *saveptr;
temp = talloc_strdup(ctx, target);
if (!temp) {
return False;
}
- prot = strtok(temp,":");
+ prot = strtok_r(temp, ":", &saveptr);
if (!prot) {
DEBUG(0,("parse_msdfs_symlink: invalid path !\n"));
return False;
@@ -306,7 +307,7 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
/* parse out the alternate paths */
while((count<MAX_REFERRAL_COUNT) &&
- ((alt_path[count] = strtok(NULL,",")) != NULL)) {
+ ((alt_path[count] = strtok_r(NULL, ",", &saveptr)) != NULL)) {
count++;
}
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 6b517c3d86..85e1ccf0a7 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -759,6 +759,7 @@ bool authorise_login(int snum, fstring user, DATA_BLOB password,
if (!ok) {
char *auser;
char *user_list = NULL;
+ char *saveptr;
if ( session_userlist )
user_list = SMB_STRDUP(session_userlist);
@@ -768,8 +769,9 @@ bool authorise_login(int snum, fstring user, DATA_BLOB password,
if (!user_list)
return(False);
- for (auser=strtok(user_list,LIST_SEP); !ok && auser;
- auser = strtok(NULL,LIST_SEP)) {
+ for (auser = strtok_r(user_list, LIST_SEP, &saveptr);
+ !ok && auser;
+ auser = strtok_r(NULL, LIST_SEP, &saveptr)) {
fstring user2;
fstrcpy(user2,auser);
if (!user_ok(user2,snum))
@@ -792,6 +794,7 @@ bool authorise_login(int snum, fstring user, DATA_BLOB password,
TALLOC_CTX *ctx = talloc_tos();
char *auser;
char *user_list = talloc_strdup(ctx, lp_username(snum));
+ char *saveptr;
if (!user_list) {
goto check_guest;
@@ -806,8 +809,9 @@ bool authorise_login(int snum, fstring user, DATA_BLOB password,
goto check_guest;
}
- for (auser=strtok(user_list,LIST_SEP); auser && !ok;
- auser = strtok(NULL,LIST_SEP)) {
+ for (auser = strtok_r(user_list, LIST_SEP, &saveptr);
+ auser && !ok;
+ auser = strtok_r(NULL, LIST_SEP, &saveptr)) {
if (*auser == '@') {
auser = validate_group(auser+1,password,snum);
if (auser) {