}
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(),
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;
return 1;
}
+ mask = client_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());
} else {
mask = talloc_strdup(ctx, "*");
}
+ if (!mask) {
+ return 1;
+ }
+
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = do_list(mask, attribute, do_du, recurse, true);
if (!NT_STATUS_IS_OK(status)) {
if (!rname) {
return 1;
}
- rname = clean_name(ctx, rname);
+ rname = client_clean_name(ctx, rname);
if (!rname) {
return 1;
}
if (!rname) {
return NT_STATUS_NO_MEMORY;
}
+ rname = client_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;
if (!new_cd) {
return NT_STATUS_NO_MEMORY;
}
+ new_cd = client_clean_name(ctx, new_cd);
+ if (new_cd == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
client_set_cur_dir(new_cd);
string_replace(finfo->name,'\\','/');
return NT_STATUS_NO_MEMORY;
}
+ mget_mask = client_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
if (!rname) {
return 1;
}
- rname = clean_name(ctx,rname);
+ rname = client_clean_name(ctx,rname);
if (!rname) {
return 1;
}
if (!mget_mask) {
return 1;
}
+ mget_mask = client_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;
if (!mget_mask) {
return 1;
}
+ mget_mask = client_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;
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
if (recurse) {
char *ddir = NULL;
if (!name) {
return 1;
}
+ name = client_clean_name(ctx, name);
+ if (name == NULL) {
+ return 1;
+ }
do_altname(name);
return 0;
}
if (!name) {
return 1;
}
-
+ name = client_clean_name(ctx, name);
+ if (name == NULL) {
+ return 1;
+ }
do_allinfo(name);
return 0;
return 1;
}
- rname = clean_name(ctx, rname);
+ rname = client_clean_name(ctx, rname);
if (!rname) {
return 1;
}
break;
}
normalize_name(rname);
+ {
+ char *tmp_rname =
+ client_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..."));
normalize_name(rname);
+ {
+ char *tmp_rname = client_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);
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = do_list(mask,attribute,do_del,false,false);
if (!NT_STATUS_IS_OK(status)) {
if (mask == NULL) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
deltree_list_head = NULL;
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, mask, &targetcli, &targetname);
return 1;
}
+ mask = client_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)) {
if (!mask) {
return 1;
}
+ mask = client_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");
if (!mask) {
return 1;
}
+ mask = client_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");
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, mask, &targetcli, &targetname);
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, mask, &targetcli, &targetname);
if (!mask) {
return 1;
}
+ mask = client_clean_name(ctx, mask);
+ if (mask == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, mask, &targetcli, &targetname);
if (!oldname) {
return 1;
}
+ oldname = client_clean_name(ctx, oldname);
+ if (oldname == NULL) {
+ return 1;
+ }
newname = talloc_asprintf(ctx,
"%s%s",
client_get_cur_dir(),
if (!newname) {
return 1;
}
+ newname = client_clean_name(ctx, newname);
+ if (newname == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, oldname, &targetcli, &targetname);
if (!name) {
return 1;
}
+ name = client_clean_name(ctx, name);
+ if (name == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, name, &targetcli, &targetname);
if (!newname) {
return 1;
}
+ newname = client_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,
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
mode = (mode_t)strtol(buf, NULL, 8);
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetname);
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetname);
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetname);
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetname);
if (!src) {
return 1;
}
+ src = client_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)) {
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
dest = talloc_asprintf(ctx,
"%s%s",
if (!dest) {
return 1;
}
+ dest = client_clean_name(ctx, dest);
+ if (dest == NULL) {
+ return 1;
+ }
if (next_token_talloc(ctx, &cmd_ptr, &buf, NULL) &&
strcsequal(buf, "-f")) {
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
dest = talloc_asprintf(ctx,
"%s%s",
if (!dest) {
return 1;
}
+ dest = client_clean_name(ctx, dest);
+ if (dest == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetsrc);
if (!src) {
return 1;
}
+ src = client_clean_name(ctx, src);
+ if (src == NULL) {
+ return 1;
+ }
dest = talloc_asprintf(ctx,
"%s%s",
if (!dest) {
return 1;
}
+ dest = client_clean_name(ctx, dest);
+ if (dest == NULL) {
+ return 1;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, src, &targetcli, &targetname);
if (name == NULL) {
goto fail;
}
+ name = client_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,
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;
}
return 1;
}
- remote_name = clean_name(ctx, remote_name);
+ remote_name = client_clean_name(ctx, remote_name);
if (!remote_name) {
return 1;
}
err = 1;
goto out;
}
+ fname = client_clean_name(ctx, fname);
+ if (fname == NULL) {
+ err = 1;
+ goto out;
+ }
while (next_token_talloc(ctx, &cmd_ptr, &buf, NULL) &&
time_count < 4) {
err = 1;
goto out;
}
+ fname = client_clean_name(ctx, fname);
+ if (fname == NULL) {
+ err = 1;
+ goto out;
+ }
while (next_token_talloc(ctx, &cmd_ptr, &buf, NULL)) {
const char *s = buf;
if (!dirmask) {
goto cleanup;
}
+ dirmask = client_clean_name(ctx, dirmask);
+ if (dirmask == NULL) {
+ goto cleanup;
+ }
status = cli_resolve_path(ctx, "", popt_get_cmdline_auth_info(),
cli, dirmask, &targetcli, &targetpath);