summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-01-24 14:06:22 +0300
committerAlexander Bokovoy <ab@samba.org>2008-01-24 14:06:22 +0300
commiteba5fbff749b84a3e1bcd1f849c3454417532454 (patch)
tree42b9da9b96fb26706f4c8486cd01821f83e318f3 /source3/client
parentc17c64530ec479334f88679ef780691e06ccd65a (diff)
parent9344628bef74ac759197601dc5dd44514b836e3e (diff)
downloadsamba-eba5fbff749b84a3e1bcd1f849c3454417532454.tar.gz
samba-eba5fbff749b84a3e1bcd1f849c3454417532454.tar.bz2
samba-eba5fbff749b84a3e1bcd1f849c3454417532454.zip
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into ctdb-merge
(This used to be commit 42d06d41bf2e9fb094f6064dc04f549d880b5f8d)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c7
-rw-r--r--source3/client/clitar.c7
-rw-r--r--source3/client/smbmnt.c5
-rw-r--r--source3/client/smbmount.c4
4 files changed, 14 insertions, 9 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 59ca2e0adc..c934310491 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1463,6 +1463,7 @@ static int cmd_mkdir(void)
struct cli_state *targetcli;
char *targetname = NULL;
char *p = NULL;
+ char *saveptr;
ddir2 = talloc_strdup(ctx, "");
if (!ddir2) {
@@ -1478,7 +1479,7 @@ static int cmd_mkdir(void)
return 1;
}
trim_char(ddir,'.','\0');
- p = strtok(ddir,"/\\");
+ p = strtok_r(ddir, "/\\", &saveptr);
while (p) {
ddir2 = talloc_asprintf_append(ddir2, p);
if (!ddir2) {
@@ -1491,7 +1492,7 @@ static int cmd_mkdir(void)
if (!ddir2) {
return 1;
}
- p = strtok(NULL,"/\\");
+ p = strtok_r(NULL, "/\\", &saveptr);
}
} else {
do_mkdir(mask);
@@ -1600,7 +1601,7 @@ static int cmd_allinfo(void)
}
if (!next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
- d_printf("altname <file>\n");
+ d_printf("allinfo <file>\n");
return 1;
}
name = talloc_asprintf_append(name, buf);
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 135815c3cd..816e7b1710 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -513,6 +513,7 @@ static bool ensurepath(const char *fname)
char *partpath, *ffname;
const char *p=fname;
char *basehack;
+ char *saveptr;
DEBUG(5, ( "Ensurepath called with: %s\n", fname));
@@ -528,7 +529,7 @@ static bool ensurepath(const char *fname)
*partpath = 0;
- /* fname copied to ffname so can strtok */
+ /* fname copied to ffname so can strtok_r */
safe_strcpy(ffname, fname, strlen(fname));
@@ -541,7 +542,7 @@ static bool ensurepath(const char *fname)
*basehack='\0';
}
- p=strtok(ffname, "\\");
+ p=strtok_r(ffname, "\\", &saveptr);
while (p) {
safe_strcat(partpath, p, strlen(fname) + 1);
@@ -558,7 +559,7 @@ static bool ensurepath(const char *fname)
}
safe_strcat(partpath, "\\", strlen(fname) + 1);
- p = strtok(NULL,"/\\");
+ p = strtok_r(NULL, "/\\", &saveptr);
}
SAFE_FREE(partpath);
diff --git a/source3/client/smbmnt.c b/source3/client/smbmnt.c
index 7f1e1d5003..79c55b2f90 100644
--- a/source3/client/smbmnt.c
+++ b/source3/client/smbmnt.c
@@ -162,6 +162,7 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
char *release, *major, *minor;
char *data1, *data2;
int ret;
+ char *saveptr;
if (asprintf(&opts,
"version=7,uid=%d,gid=%d,file_mode=0%o,dir_mode=0%o,%s",
@@ -172,8 +173,8 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
uname(&uts);
release = uts.release;
- major = strtok(release, ".");
- minor = strtok(NULL, ".");
+ major = strtok_r(release, ".", &saveptr);
+ minor = strtok_r(NULL, ".", &saveptr);
if (major && minor && atoi(major) == 2 && atoi(minor) < 4) {
/* < 2.4, assume struct */
data1 = (char *) data;
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index 98c61a30d8..9fe2d36bd3 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -764,6 +764,7 @@ static void parse_mount_smb(int argc, char **argv)
char *opts;
char *opteq;
int val;
+ char *saveptr;
TALLOC_CTX *ctx = talloc_tos();
/* FIXME: This function can silently fail if the arguments are
@@ -813,7 +814,8 @@ static void parse_mount_smb(int argc, char **argv)
/*
* option parsing from nfsmount.c (util-linux-2.9u)
*/
- for (opts = strtok(optarg, ","); opts; opts = strtok(NULL, ",")) {
+ for (opts = strtok_r(optarg, ",", &saveptr); opts;
+ opts = strtok_r(NULL, ",", &saveptr)) {
DEBUG(3, ("opts: %s\n", opts));
if ((opteq = strchr_m(opts, '='))) {
val = atoi(opteq + 1);