The Samba-Bugzilla – Attachment 13710 Details for
Bug 13093
smbclient doesn't correctly canonicalize all local names before use.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated git-am fix for master.
bug-13093 (text/plain), 27.06 KB, created by
Jeremy Allison
on 2017-10-20 23:26:30 UTC
(
hide
)
Description:
Updated git-am fix for master.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2017-10-20 23:26:30 UTC
Size:
27.06 KB
patch
obsolete
>From 3e1ff1149ecfdb7a49c0ba922d096164da42bbab Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 20 Oct 2017 15:09:38 -0700 >Subject: [PATCH 1/2] s3: smbclient: Ensure we call clean_name() before all > operations on remote pathnames. > >This allows names containing .. components to be resolved on the client side >before being sent to the server. Relative names work in SMB1 but not in SMB2. >Fix both client.c and clitar.c > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13093 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/client/client.c | 190 +++++++++++++++++++++++++++++++++++++++++++++++- > source3/client/clitar.c | 31 ++++++++ > 2 files changed, 220 insertions(+), 1 deletion(-) > >diff --git a/source3/client/client.c b/source3/client/client.c >index df16496ff86..95a6014a400 100644 >--- a/source3/client/client.c >+++ b/source3/client/client.c >@@ -953,6 +953,11 @@ static int cmd_dir(void) > return 1; > } > >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } >+ > if (showacls) { > /* cwd is only used if showacls is on */ > client_set_cwd(client_get_cur_dir()); >@@ -1005,6 +1010,14 @@ static int cmd_du(void) > } else { > mask = talloc_strdup(ctx, "*"); > } >+ if (!mask) { >+ return 1; >+ } >+ >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = do_list(mask, attribute, do_du, recurse, true); > if (!NT_STATUS_IS_OK(status)) { >@@ -1267,6 +1280,10 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > if (!rname) { > return NT_STATUS_NO_MEMORY; > } >+ rname = clean_name(ctx, rname); >+ if (rname == NULL) { >+ return NT_STATUS_NO_MEMORY; >+ } > do_get(rname, finfo->name, false); > TALLOC_FREE(rname); > return NT_STATUS_OK; >@@ -1286,6 +1303,10 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > if (!new_cd) { > return NT_STATUS_NO_MEMORY; > } >+ new_cd = clean_name(ctx, new_cd); >+ if (new_cd == NULL) { >+ return NT_STATUS_NO_MEMORY; >+ } > client_set_cur_dir(new_cd); > > string_replace(finfo->name,'\\','/'); >@@ -1316,6 +1337,10 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > return NT_STATUS_NO_MEMORY; > } > >+ mget_mask = clean_name(ctx, mget_mask); >+ if (mget_mask == NULL) { >+ return NT_STATUS_NO_MEMORY; >+ } > status = do_list(mget_mask, > (FILE_ATTRIBUTE_SYSTEM > | FILE_ATTRIBUTE_HIDDEN >@@ -1443,6 +1468,10 @@ static int cmd_mget(void) > if (!mget_mask) { > return 1; > } >+ mget_mask = clean_name(ctx, mget_mask); >+ if (mget_mask == NULL) { >+ return 1; >+ } > status = do_list(mget_mask, attribute, do_mget, false, true); > if (!NT_STATUS_IS_OK(status)) { > return 1; >@@ -1461,6 +1490,10 @@ static int cmd_mget(void) > if (!mget_mask) { > return 1; > } >+ mget_mask = clean_name(ctx, mget_mask); >+ if (mget_mask == NULL) { >+ return 1; >+ } > status = do_list(mget_mask, attribute, do_mget, false, true); > if (!NT_STATUS_IS_OK(status)) { > return 1; >@@ -1557,6 +1590,10 @@ static int cmd_mkdir(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > if (recurse) { > char *ddir = NULL; >@@ -1628,6 +1665,10 @@ static int cmd_altname(void) > if (!name) { > return 1; > } >+ name = clean_name(ctx, name); >+ if (name == NULL) { >+ return 1; >+ } > do_altname(name); > return 0; > } >@@ -1858,7 +1899,10 @@ static int cmd_allinfo(void) > if (!name) { > return 1; > } >- >+ name = clean_name(ctx, name); >+ if (name == NULL) { >+ return 1; >+ } > do_allinfo(name); > > return 0; >@@ -2230,6 +2274,19 @@ static int cmd_mput(void) > break; > } > normalize_name(rname); >+ { >+ char *tmp_rname = >+ clean_name(ctx, rname); >+ if (tmp_rname == NULL) { >+ break; >+ } >+ SAFE_FREE(rname); >+ rname = smb_xstrdup(tmp_rname); >+ TALLOC_FREE(tmp_rname); >+ if (rname == NULL) { >+ break; >+ } >+ } > if (!NT_STATUS_IS_OK(cli_chkpath(cli, rname)) && > !do_mkdir(rname)) { > DEBUG (0, ("Unable to make dir, skipping...")); >@@ -2260,6 +2317,18 @@ static int cmd_mput(void) > > normalize_name(rname); > >+ { >+ char *tmp_rname = clean_name(ctx, rname); >+ if (tmp_rname == NULL) { >+ break; >+ } >+ SAFE_FREE(rname); >+ rname = smb_xstrdup(tmp_rname); >+ TALLOC_FREE(tmp_rname); >+ if (rname == NULL) { >+ break; >+ } >+ } > do_put(rname, lname, false); > } > free_file_list(file_list); >@@ -2430,6 +2499,10 @@ static int cmd_del(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = do_list(mask,attribute,do_del,false,false); > if (!NT_STATUS_IS_OK(status)) { >@@ -2546,6 +2619,10 @@ static int cmd_deltree(void) > if (mask == NULL) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > deltree_list_head = NULL; > >@@ -2647,6 +2724,10 @@ static int cmd_wdel(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, mask, &targetcli, &targetname); >@@ -2688,6 +2769,11 @@ static int cmd_open(void) > return 1; > } > >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } >+ > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, mask, &targetcli, &targetname); > if (!NT_STATUS_IS_OK(status)) { >@@ -2803,6 +2889,10 @@ static int cmd_posix_open(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { > d_printf("posix_open <filename> 0<mode>\n"); >@@ -2858,6 +2948,10 @@ static int cmd_posix_mkdir(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { > d_printf("posix_mkdir <filename> 0<mode>\n"); >@@ -2902,6 +2996,10 @@ static int cmd_posix_unlink(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, mask, &targetcli, &targetname); >@@ -2941,6 +3039,10 @@ static int cmd_posix_rmdir(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, mask, &targetcli, &targetname); >@@ -3243,6 +3345,10 @@ static int cmd_rmdir(void) > if (!mask) { > return 1; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, mask, &targetcli, &targetname); >@@ -3287,6 +3393,10 @@ static int cmd_link(void) > if (!oldname) { > return 1; > } >+ oldname = clean_name(ctx, oldname); >+ if (oldname == NULL) { >+ return 1; >+ } > newname = talloc_asprintf(ctx, > "%s%s", > client_get_cur_dir(), >@@ -3294,6 +3404,10 @@ static int cmd_link(void) > if (!newname) { > return 1; > } >+ newname = clean_name(ctx, newname); >+ if (newname == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, oldname, &targetcli, &targetname); >@@ -3341,6 +3455,10 @@ static int cmd_readlink(void) > if (!name) { > return 1; > } >+ name = clean_name(ctx, name); >+ if (name == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, name, &targetcli, &targetname); >@@ -3395,6 +3513,10 @@ static int cmd_symlink(void) > if (!newname) { > return 1; > } >+ newname = clean_name(ctx, newname); >+ if (newname == NULL) { >+ return 1; >+ } > /* New name must be present in share namespace. */ > status = cli_resolve_path(ctx, "", > popt_get_cmdline_auth_info(), cli, newname, >@@ -3446,6 +3568,10 @@ static int cmd_chmod(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > mode = (mode_t)strtol(buf, NULL, 8); > >@@ -3605,6 +3731,10 @@ static int cmd_getfacl(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); >@@ -3773,6 +3903,10 @@ static int cmd_geteas(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); >@@ -3830,6 +3964,10 @@ static int cmd_setea(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); >@@ -3876,6 +4014,10 @@ static int cmd_stat(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); >@@ -3985,6 +4127,10 @@ static int cmd_chown(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); > if (!NT_STATUS_IS_OK(status)) { >@@ -4035,6 +4181,10 @@ static int cmd_rename(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > dest = talloc_asprintf(ctx, > "%s%s", >@@ -4043,6 +4193,10 @@ static int cmd_rename(void) > if (!dest) { > return 1; > } >+ dest = clean_name(ctx, dest); >+ if (dest == NULL) { >+ return 1; >+ } > > if (next_token_talloc(ctx, &cmd_ptr, &buf, NULL) && > strcsequal(buf, "-f")) { >@@ -4128,6 +4282,10 @@ static int cmd_scopy(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > dest = talloc_asprintf(ctx, > "%s%s", >@@ -4136,6 +4294,10 @@ static int cmd_scopy(void) > if (!dest) { > return 1; > } >+ dest = clean_name(ctx, dest); >+ if (dest == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetsrc); >@@ -4258,6 +4420,10 @@ static int cmd_hardlink(void) > if (!src) { > return 1; > } >+ src = clean_name(ctx, src); >+ if (src == NULL) { >+ return 1; >+ } > > dest = talloc_asprintf(ctx, > "%s%s", >@@ -4266,6 +4432,10 @@ static int cmd_hardlink(void) > if (!dest) { > return 1; > } >+ dest = clean_name(ctx, dest); >+ if (dest == NULL) { >+ return 1; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, src, &targetcli, &targetname); >@@ -4345,6 +4515,10 @@ static int cmd_notify(void) > if (name == NULL) { > goto fail; > } >+ name = clean_name(talloc_tos(), name); >+ if (name == NULL) { >+ return 1; >+ } > status = cli_ntcreate( > cli, name, 0, FILE_READ_DATA, 0, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >@@ -5007,6 +5181,11 @@ static int cmd_utimes(void) > err = 1; > goto out; > } >+ fname = clean_name(ctx, fname); >+ if (fname == NULL) { >+ err = 1; >+ goto out; >+ } > > while (next_token_talloc(ctx, &cmd_ptr, &buf, NULL) && > time_count < 4) { >@@ -5130,6 +5309,11 @@ int cmd_setmode(void) > err = 1; > goto out; > } >+ fname = clean_name(ctx, fname); >+ if (fname == NULL) { >+ err = 1; >+ goto out; >+ } > > while (next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) { > const char *s = buf; >@@ -5640,6 +5824,10 @@ static char **remote_completion(const char *text, int len) > if (!dirmask) { > goto cleanup; > } >+ dirmask = clean_name(ctx, dirmask); >+ if (dirmask == NULL) { >+ goto cleanup; >+ } > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), > cli, dirmask, &targetcli, &targetpath); >diff --git a/source3/client/clitar.c b/source3/client/clitar.c >index eff79698315..65f32d7b554 100644 >--- a/source3/client/clitar.c >+++ b/source3/client/clitar.c >@@ -699,6 +699,11 @@ static int tar_create(struct tar* t) > err = 1; > goto out_close; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ err = 1; >+ goto out_close; >+ } > DBG(5, ("tar_process do_list with mask: %s\n", mask)); > status = do_list(mask, TAR_DO_LIST_ATTR, get_file_callback, false, true); > if (!NT_STATUS_IS_OK(status)) { >@@ -764,6 +769,11 @@ static int tar_create_from_list(struct tar *t) > err = 1; > goto out; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ err = 1; >+ goto out; >+ } > > DBG(5, ("incl. path='%s', base='%s', mask='%s'\n", > path, base ? base : "NULL", mask)); >@@ -775,6 +785,12 @@ static int tar_create_from_list(struct tar *t) > err = 1; > goto out; > } >+ base = clean_name(ctx, base); >+ if (base == NULL) { >+ err = 1; >+ goto out; >+ } >+ > DBG(5, ("cd '%s' before do_list\n", base)); > client_set_cur_dir(base); > } >@@ -820,6 +836,11 @@ static NTSTATUS get_file_callback(struct cli_state *cli, > status = NT_STATUS_NO_MEMORY; > goto out; > } >+ remote_name = clean_name(ctx, remote_name); >+ if (remote_name == NULL) { >+ status = NT_STATUS_NO_MEMORY; >+ goto out; >+ } > > if (strequal(finfo->name, "..") || strequal(finfo->name, ".")) { > goto out; >@@ -853,6 +874,11 @@ static NTSTATUS get_file_callback(struct cli_state *cli, > status = NT_STATUS_NO_MEMORY; > goto out; > } >+ mask = clean_name(ctx, mask); >+ if (mask == NULL) { >+ status = NT_STATUS_NO_MEMORY; >+ goto out; >+ } > > rc = tar_get_file(&tar_ctx, remote_name, finfo); > if (rc != 0) { >@@ -1112,6 +1138,11 @@ static int tar_send_file(struct tar *t, struct archive_entry *entry) > err = 1; > goto out; > } >+ full_path = clean_name(ctx, full_path); >+ if (full_path == NULL) { >+ err = 1; >+ goto out; >+ } > > if (mode != AE_IFREG && mode != AE_IFDIR) { > DBG(0, ("Skipping non-dir & non-regular file %s\n", full_path)); >-- >2.15.0.rc0.271.g36b669edcc-goog > > >From 338cf8bff5d9732567321fe0e8dcbc111bfe6887 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Fri, 20 Oct 2017 15:17:34 -0700 >Subject: [PATCH 2/2] s3: smbclient: Create and use local wrapper around > clean_name() that does separator canonicalization. > >This makes smbclient much nicer to use for UNIX people. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13093 > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/client/client.c | 115 ++++++++++++++++++++++++------------------ > source3/client/client_proto.h | 1 + > source3/client/clitar.c | 12 ++--- > 3 files changed, 74 insertions(+), 54 deletions(-) > >diff --git a/source3/client/client.c b/source3/client/client.c >index 95a6014a400..26b459d07e5 100644 >--- a/source3/client/client.c >+++ b/source3/client/client.c >@@ -345,6 +345,25 @@ static void normalize_name(char *newdir) > } > } > >+/**************************************************************************** >+ Local name cleanup before sending to server. SMB1 allows relative pathnames, >+ but SMB2 does not, so we need to resolve them locally. >+****************************************************************************/ >+ >+char *client_clean_name(TALLOC_CTX *ctx, const char *name) >+{ >+ char *newname = NULL; >+ if (name == NULL) { >+ return NULL; >+ } >+ newname = clean_name(ctx, name); >+ if (newname == NULL) { >+ return NULL; >+ } >+ normalize_name(newname); >+ return newname; >+} >+ > /**************************************************************************** > Change directory - inner section. > ****************************************************************************/ >@@ -399,7 +418,7 @@ static int do_cd(const char *new_dir) > } > client_set_cur_dir(new_cd); > >- new_cd = clean_name(ctx, new_cd); >+ new_cd = client_clean_name(ctx, new_cd); > client_set_cur_dir(new_cd); > > status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(), >@@ -443,7 +462,7 @@ static int do_cd(const char *new_dir) > client_set_cur_dir(saved_dir); > goto out; > } >- targetpath = clean_name(ctx, targetpath); >+ targetpath = client_clean_name(ctx, targetpath); > if (!targetpath) { > client_set_cur_dir(saved_dir); > goto out; >@@ -953,7 +972,7 @@ static int cmd_dir(void) > return 1; > } > >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -1014,7 +1033,7 @@ static int cmd_du(void) > return 1; > } > >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -1214,7 +1233,7 @@ static int cmd_get(void) > if (!rname) { > return 1; > } >- rname = clean_name(ctx, rname); >+ rname = client_clean_name(ctx, rname); > if (!rname) { > return 1; > } >@@ -1280,7 +1299,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > if (!rname) { > return NT_STATUS_NO_MEMORY; > } >- rname = clean_name(ctx, rname); >+ rname = client_clean_name(ctx, rname); > if (rname == NULL) { > return NT_STATUS_NO_MEMORY; > } >@@ -1303,7 +1322,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > if (!new_cd) { > return NT_STATUS_NO_MEMORY; > } >- new_cd = clean_name(ctx, new_cd); >+ new_cd = client_clean_name(ctx, new_cd); > if (new_cd == NULL) { > return NT_STATUS_NO_MEMORY; > } >@@ -1337,7 +1356,7 @@ static NTSTATUS do_mget(struct cli_state *cli_state, struct file_info *finfo, > return NT_STATUS_NO_MEMORY; > } > >- mget_mask = clean_name(ctx, mget_mask); >+ mget_mask = client_clean_name(ctx, mget_mask); > if (mget_mask == NULL) { > return NT_STATUS_NO_MEMORY; > } >@@ -1410,7 +1429,7 @@ static int cmd_more(void) > if (!rname) { > return 1; > } >- rname = clean_name(ctx,rname); >+ rname = client_clean_name(ctx,rname); > if (!rname) { > return 1; > } >@@ -1468,7 +1487,7 @@ static int cmd_mget(void) > if (!mget_mask) { > return 1; > } >- mget_mask = clean_name(ctx, mget_mask); >+ mget_mask = client_clean_name(ctx, mget_mask); > if (mget_mask == NULL) { > return 1; > } >@@ -1490,7 +1509,7 @@ static int cmd_mget(void) > if (!mget_mask) { > return 1; > } >- mget_mask = clean_name(ctx, mget_mask); >+ mget_mask = client_clean_name(ctx, mget_mask); > if (mget_mask == NULL) { > return 1; > } >@@ -1590,7 +1609,7 @@ static int cmd_mkdir(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -1665,7 +1684,7 @@ static int cmd_altname(void) > if (!name) { > return 1; > } >- name = clean_name(ctx, name); >+ name = client_clean_name(ctx, name); > if (name == NULL) { > return 1; > } >@@ -1899,7 +1918,7 @@ static int cmd_allinfo(void) > if (!name) { > return 1; > } >- name = clean_name(ctx, name); >+ name = client_clean_name(ctx, name); > if (name == NULL) { > return 1; > } >@@ -2065,7 +2084,7 @@ static int cmd_put(void) > return 1; > } > >- rname = clean_name(ctx, rname); >+ rname = client_clean_name(ctx, rname); > if (!rname) { > return 1; > } >@@ -2276,7 +2295,7 @@ static int cmd_mput(void) > normalize_name(rname); > { > char *tmp_rname = >- clean_name(ctx, rname); >+ client_clean_name(ctx, rname); > if (tmp_rname == NULL) { > break; > } >@@ -2318,7 +2337,7 @@ static int cmd_mput(void) > normalize_name(rname); > > { >- char *tmp_rname = clean_name(ctx, rname); >+ char *tmp_rname = client_clean_name(ctx, rname); > if (tmp_rname == NULL) { > break; > } >@@ -2499,7 +2518,7 @@ static int cmd_del(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2619,7 +2638,7 @@ static int cmd_deltree(void) > if (mask == NULL) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2724,7 +2743,7 @@ static int cmd_wdel(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2769,7 +2788,7 @@ static int cmd_open(void) > return 1; > } > >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2889,7 +2908,7 @@ static int cmd_posix_open(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2948,7 +2967,7 @@ static int cmd_posix_mkdir(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -2996,7 +3015,7 @@ static int cmd_posix_unlink(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -3039,7 +3058,7 @@ static int cmd_posix_rmdir(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -3345,7 +3364,7 @@ static int cmd_rmdir(void) > if (!mask) { > return 1; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > return 1; > } >@@ -3393,7 +3412,7 @@ static int cmd_link(void) > if (!oldname) { > return 1; > } >- oldname = clean_name(ctx, oldname); >+ oldname = client_clean_name(ctx, oldname); > if (oldname == NULL) { > return 1; > } >@@ -3404,7 +3423,7 @@ static int cmd_link(void) > if (!newname) { > return 1; > } >- newname = clean_name(ctx, newname); >+ newname = client_clean_name(ctx, newname); > if (newname == NULL) { > return 1; > } >@@ -3455,7 +3474,7 @@ static int cmd_readlink(void) > if (!name) { > return 1; > } >- name = clean_name(ctx, name); >+ name = client_clean_name(ctx, name); > if (name == NULL) { > return 1; > } >@@ -3513,7 +3532,7 @@ static int cmd_symlink(void) > if (!newname) { > return 1; > } >- newname = clean_name(ctx, newname); >+ newname = client_clean_name(ctx, newname); > if (newname == NULL) { > return 1; > } >@@ -3568,7 +3587,7 @@ static int cmd_chmod(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -3731,7 +3750,7 @@ static int cmd_getfacl(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -3903,7 +3922,7 @@ static int cmd_geteas(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -3964,7 +3983,7 @@ static int cmd_setea(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4014,7 +4033,7 @@ static int cmd_stat(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4127,7 +4146,7 @@ static int cmd_chown(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4181,7 +4200,7 @@ static int cmd_rename(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4193,7 +4212,7 @@ static int cmd_rename(void) > if (!dest) { > return 1; > } >- dest = clean_name(ctx, dest); >+ dest = client_clean_name(ctx, dest); > if (dest == NULL) { > return 1; > } >@@ -4282,7 +4301,7 @@ static int cmd_scopy(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4294,7 +4313,7 @@ static int cmd_scopy(void) > if (!dest) { > return 1; > } >- dest = clean_name(ctx, dest); >+ dest = client_clean_name(ctx, dest); > if (dest == NULL) { > return 1; > } >@@ -4420,7 +4439,7 @@ static int cmd_hardlink(void) > if (!src) { > return 1; > } >- src = clean_name(ctx, src); >+ src = client_clean_name(ctx, src); > if (src == NULL) { > return 1; > } >@@ -4432,7 +4451,7 @@ static int cmd_hardlink(void) > if (!dest) { > return 1; > } >- dest = clean_name(ctx, dest); >+ dest = client_clean_name(ctx, dest); > if (dest == NULL) { > return 1; > } >@@ -4515,7 +4534,7 @@ static int cmd_notify(void) > if (name == NULL) { > goto fail; > } >- name = clean_name(talloc_tos(), name); >+ name = client_clean_name(talloc_tos(), name); > if (name == NULL) { > return 1; > } >@@ -4693,7 +4712,7 @@ static int cmd_reget(void) > if (!remote_name) { > return 1; > } >- remote_name = clean_name(ctx,remote_name); >+ remote_name = client_clean_name(ctx,remote_name); > if (!remote_name) { > return 1; > } >@@ -4745,7 +4764,7 @@ static int cmd_reput(void) > return 1; > } > >- remote_name = clean_name(ctx, remote_name); >+ remote_name = client_clean_name(ctx, remote_name); > if (!remote_name) { > return 1; > } >@@ -5181,7 +5200,7 @@ static int cmd_utimes(void) > err = 1; > goto out; > } >- fname = clean_name(ctx, fname); >+ fname = client_clean_name(ctx, fname); > if (fname == NULL) { > err = 1; > goto out; >@@ -5309,7 +5328,7 @@ int cmd_setmode(void) > err = 1; > goto out; > } >- fname = clean_name(ctx, fname); >+ fname = client_clean_name(ctx, fname); > if (fname == NULL) { > err = 1; > goto out; >@@ -5824,7 +5843,7 @@ static char **remote_completion(const char *text, int len) > if (!dirmask) { > goto cleanup; > } >- dirmask = clean_name(ctx, dirmask); >+ dirmask = client_clean_name(ctx, dirmask); > if (dirmask == NULL) { > goto cleanup; > } >diff --git a/source3/client/client_proto.h b/source3/client/client_proto.h >index d3d40363f20..38f13aa0adc 100644 >--- a/source3/client/client_proto.h >+++ b/source3/client/client_proto.h >@@ -35,6 +35,7 @@ enum { > > const char *client_get_cur_dir(void); > const char *client_set_cur_dir(const char *newdir); >+char *client_clean_name(TALLOC_CTX *ctx, const char *name); > NTSTATUS do_list(const char *mask, > uint16_t attribute, > NTSTATUS (*fn)(struct cli_state *cli_state, struct file_info *, >diff --git a/source3/client/clitar.c b/source3/client/clitar.c >index 65f32d7b554..b8009c92cb6 100644 >--- a/source3/client/clitar.c >+++ b/source3/client/clitar.c >@@ -699,7 +699,7 @@ static int tar_create(struct tar* t) > err = 1; > goto out_close; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > err = 1; > goto out_close; >@@ -769,7 +769,7 @@ static int tar_create_from_list(struct tar *t) > err = 1; > goto out; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > err = 1; > goto out; >@@ -785,7 +785,7 @@ static int tar_create_from_list(struct tar *t) > err = 1; > goto out; > } >- base = clean_name(ctx, base); >+ base = client_clean_name(ctx, base); > if (base == NULL) { > err = 1; > goto out; >@@ -836,7 +836,7 @@ static NTSTATUS get_file_callback(struct cli_state *cli, > status = NT_STATUS_NO_MEMORY; > goto out; > } >- remote_name = clean_name(ctx, remote_name); >+ remote_name = client_clean_name(ctx, remote_name); > if (remote_name == NULL) { > status = NT_STATUS_NO_MEMORY; > goto out; >@@ -874,7 +874,7 @@ static NTSTATUS get_file_callback(struct cli_state *cli, > status = NT_STATUS_NO_MEMORY; > goto out; > } >- mask = clean_name(ctx, mask); >+ mask = client_clean_name(ctx, mask); > if (mask == NULL) { > status = NT_STATUS_NO_MEMORY; > goto out; >@@ -1138,7 +1138,7 @@ static int tar_send_file(struct tar *t, struct archive_entry *entry) > err = 1; > goto out; > } >- full_path = clean_name(ctx, full_path); >+ full_path = client_clean_name(ctx, full_path); > if (full_path == NULL) { > err = 1; > goto out; >-- >2.15.0.rc0.271.g36b669edcc-goog >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13093
:
13709
|
13710
|
13711
|
13718
|
13719
|
13720