diff options
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index c6c0088b3c..923a6f3a23 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -696,11 +696,12 @@ static int do_get(struct smbclient_context *ctx, char *rname, const char *p_lnam char *lname; - lname = talloc_strdup(ctx, p_lname); GetTimeOfDay(&tp_start); if (ctx->lowercase) { - strlower(lname); + lname = strlower_talloc(ctx, p_lname); + } else { + lname = talloc_strdup(ctx, p_lname); } fnum = smbcli_open(ctx->cli->tree, rname, O_RDONLY, DENY_NONE); @@ -884,13 +885,14 @@ static void do_mget(struct smbclient_context *ctx, struct clilist_file_info *fin ctx->remote_cur_dir = talloc_asprintf_append_buffer(NULL, "%s\\", finfo->name); - l_fname = talloc_strdup(ctx, finfo->name); - - string_replace(l_fname, '\\', '/'); if (ctx->lowercase) { - strlower(l_fname); + l_fname = strlower_talloc(ctx, finfo->name); + } else { + l_fname = talloc_strdup(ctx, finfo->name); } + string_replace(l_fname, '\\', '/'); + if (!directory_exist(l_fname) && mkdir(l_fname, 0777) != 0) { d_printf("failed to create directory %s\n", l_fname); |