TALLOC_CTX *ctx = talloc_tos();
NTSTATUS status;
- if ( !cli_resolve_path(ctx, "", auth_info, cli, client_get_cur_dir(), &targetcli, &targetpath)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli,
+ client_get_cur_dir(), &targetcli,
+ &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Error in dskattr: %s\n", cli_errstr(cli));
return 1;
}
uint32 attributes;
int ret = 1;
TALLOC_CTX *ctx = talloc_stackframe();
+ NTSTATUS status;
newdir = talloc_strdup(ctx, new_dir);
if (!newdir) {
new_cd = clean_name(ctx, new_cd);
client_set_cur_dir(new_cd);
- if ( !cli_resolve_path(ctx, "", auth_info, cli, new_cd, &targetcli, &targetpath)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, new_cd,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("cd %s: %s\n", new_cd, cli_errstr(cli));
client_set_cur_dir(saved_dir);
goto out;
Except Win9x doesn't support the qpathinfo_basic() call..... */
if (targetcli->protocol > PROTOCOL_LANMAN2 && !targetcli->win95) {
- NTSTATUS status;
status = cli_qpathinfo_basic(targetcli, targetpath, &sbuf,
&attributes);
goto out;
}
} else {
- NTSTATUS status;
targetpath = talloc_asprintf(ctx,
"%s%s",
/* check for dfs */
- if ( !cli_resolve_path(ctx, "", auth_info, cli, head, &targetcli, &targetpath ) ) {
+ status = cli_resolve_path(ctx, "", auth_info, cli,
+ head, &targetcli,
+ &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("do_list: [%s] %s\n", head, cli_errstr(cli));
remove_do_list_queue_head();
continue;
}
} else {
/* check for dfs */
- if (cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetpath)) {
-
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask,
+ &targetcli, &targetpath);
+ if (NT_STATUS_IS_OK(status)) {
status = cli_list(targetcli, targetpath, attribute,
do_list_helper, targetcli);
if (!NT_STATUS_IS_OK(status)) {
strlower_m(lname);
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, rname, &targetcli, &targetname ) ) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, rname, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Failed to open %s: %s\n", rname, cli_errstr(cli));
return 1;
}
char *targetname = NULL;
NTSTATUS status;
- if (!cli_resolve_path(ctx, "", auth_info, cli, name, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, name, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("mkdir %s: %s\n", name, cli_errstr(cli));
return false;
}
TALLOC_CTX *ctx = talloc_tos();
char *mask = NULL;
char *buf = NULL;
+ NTSTATUS status;
mask = talloc_strdup(ctx, client_get_cur_dir());
if (!mask) {
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask,
+ &targetcli, &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
return 1;
}
struct push_state state;
NTSTATUS status;
- if (!cli_resolve_path(ctx, "", auth_info, cli, rname, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, rname,
+ &targetcli, &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Failed to open %s: %s\n", rname, cli_errstr(cli));
return 1;
}
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("cmd_wdel %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *targetname = NULL;
struct cli_state *targetcli;
uint16_t fnum = (uint16_t)-1;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("open <filename>\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("open %s: %s\n", mask, cli_errstr(cli));
return 1;
}
struct cli_state *targetcli;
mode_t mode;
uint16_t fnum;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_open <filename> 0<mode>\n");
}
mode = (mode_t)strtol(buf, (char **)NULL, 8);
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("posix_open %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *targetname = NULL;
struct cli_state *targetcli;
mode_t mode;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_mkdir <filename> 0<mode>\n");
}
mode = (mode_t)strtol(buf, (char **)NULL, 8);
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("posix_mkdir %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *buf = NULL;
char *targetname = NULL;
struct cli_state *targetcli;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_unlink <filename>\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("posix_unlink %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *buf = NULL;
char *targetname = NULL;
struct cli_state *targetcli;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("posix_rmdir <filename>\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("posix_rmdir %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *buf = NULL;
char *targetname = NULL;
struct cli_state *targetcli;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("rmdir <dirname>\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, mask, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("rmdir %s: %s\n", mask, cli_errstr(cli));
return 1;
}
char *buf2 = NULL;
char *targetname = NULL;
struct cli_state *targetcli;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
!next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, oldname, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, oldname, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("link %s: %s\n", oldname, cli_errstr(cli));
return 1;
}
char *targetname = NULL;
char linkname[PATH_MAX+1];
struct cli_state *targetcli;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
d_printf("readlink <name>\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, name, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, name, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("readlink %s: %s\n", name, cli_errstr(cli));
return 1;
}
return 1;
}
/* New name must be present in share namespace. */
- if (!cli_resolve_path(ctx, "", auth_info, cli, newname,
- &newcli, &newname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, newname,
+ &newcli, &newname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("link %s: %s\n", oldname, cli_errstr(cli));
return 1;
}
char *targetname = NULL;
struct cli_state *targetcli;
mode_t mode;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
!next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
mode = (mode_t)strtol(buf, NULL, 8);
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("chmod %s: %s\n", src, cli_errstr(cli));
return 1;
}
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("stat %s: %s\n", src, cli_errstr(cli));
return 1;
}
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
- &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("stat %s: %s\n", src, cli_errstr(cli));
return 1;
}
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
- &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("stat %s: %s\n", src, cli_errstr(cli));
return 1;
}
SMB_STRUCT_STAT sbuf;
struct tm *lt;
time_t tmp_time;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&name,NULL)) {
d_printf("stat file\n");
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("stat %s: %s\n", src, cli_errstr(cli));
return 1;
}
char *buf, *buf2, *buf3;
struct cli_state *targetcli;
char *targetname = NULL;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
!next_token_talloc(ctx, &cmd_ptr,&buf2,NULL) ||
if (!src) {
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetname) ) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("chown %s: %s\n", src, cli_errstr(cli));
return 1;
}
struct cli_state *targetcli;
char *targetsrc;
char *targetdest;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
!next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetsrc)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetsrc);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("rename %s: %s\n", src, cli_errstr(cli));
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, dest, &targetcli, &targetdest)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, dest, &targetcli,
+ &targetdest);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("rename %s: %s\n", dest, cli_errstr(cli));
return 1;
}
char *buf, *buf2;
struct cli_state *targetcli;
char *targetname;
+ NTSTATUS status;
if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL) ||
!next_token_talloc(ctx, &cmd_ptr,&buf2,NULL)) {
return 1;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli, &targetname)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, src, &targetcli,
+ &targetname);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("hardlink %s: %s\n", src, cli_errstr(cli));
return 1;
}
TALLOC_CTX *ctx = talloc_tos();
struct cli_state *targetcli;
char *targetpath;
+ NTSTATUS status;
- if (!cli_resolve_path(ctx, "", auth_info, cli, client_get_cur_dir(),
- &targetcli, &targetpath ) ) {
+ status = cli_resolve_path(ctx, "", auth_info, cli,
+ client_get_cur_dir(), &targetcli,
+ &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("showconnect %s: %s\n", cur_dir, cli_errstr(cli));
return 1;
}
goto cleanup;
}
- if (!cli_resolve_path(ctx, "", auth_info, cli, dirmask, &targetcli, &targetpath)) {
+ status = cli_resolve_path(ctx, "", auth_info, cli, dirmask, &targetcli,
+ &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
goto cleanup;
}
status = cli_list(targetcli, targetpath, FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN,
/********************************************************************
********************************************************************/
-bool cli_resolve_path(TALLOC_CTX *ctx,
- const char *mountpt,
- const struct user_auth_info *dfs_auth_info,
- struct cli_state *rootcli,
- const char *path,
- struct cli_state **targetcli,
- char **pp_targetpath)
+NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
+ const char *mountpt,
+ const struct user_auth_info *dfs_auth_info,
+ struct cli_state *rootcli,
+ const char *path,
+ struct cli_state **targetcli,
+ char **pp_targetpath)
{
struct client_dfs_referral *refs = NULL;
size_t num_refs = 0;
NTSTATUS status;
if ( !rootcli || !path || !targetcli ) {
- return false;
+ return NT_STATUS_INVALID_PARAMETER;
}
/* Don't do anything if this is not a DFS root. */
*targetcli = rootcli;
*pp_targetpath = talloc_strdup(ctx, path);
if (!*pp_targetpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
- return true;
+ return NT_STATUS_OK;
}
*targetcli = NULL;
cleanpath = clean_path(ctx, path);
if (!cleanpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
dfs_path = cli_dfs_make_full_path(ctx, rootcli, cleanpath);
if (!dfs_path) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
status = cli_qpathinfo_basic( rootcli, dfs_path, &sbuf, &attributes);
*targetcli = rootcli;
*pp_targetpath = talloc_strdup(ctx, path);
if (!*pp_targetpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
goto done;
}
*targetcli = rootcli;
*pp_targetpath = talloc_strdup(ctx, path);
if (!*pp_targetpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
goto done;
}
if (!cli_dfs_check_error(rootcli, NT_STATUS_PATH_NOT_COVERED,
status)) {
- return false;
+ return status;
}
/* Check for the referral. */
0x20,
&cli_ipc);
if (!NT_STATUS_IS_OK(status)) {
- return false;
+ return status;
}
status = cli_dfs_get_referral(ctx, cli_ipc, dfs_path, &refs,
&num_refs, &consumed);
if (!NT_STATUS_IS_OK(status) || !num_refs) {
- return false;
+ return status;
}
/* Just store the first referral for now. */
if (!refs[0].dfspath) {
- return false;
+ return NT_STATUS_NOT_FOUND;
}
if (!split_dfs_path(ctx, refs[0].dfspath, &server, &share,
&extrapath)) {
- return false;
+ return NT_STATUS_NOT_FOUND;
}
/* Make sure to recreate the original string including any wildcards. */
dfs_path = cli_dfs_make_full_path(ctx, rootcli, path);
if (!dfs_path) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
pathlen = strlen(dfs_path);
consumed = MIN(pathlen, consumed);
*pp_targetpath = talloc_strdup(ctx, &dfs_path[consumed]);
if (!*pp_targetpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
dfs_path[consumed] = '\0';
if (!NT_STATUS_IS_OK(status)) {
d_printf("Unable to follow dfs referral [\\%s\\%s]\n",
server, share );
- return false;
+ return status;
}
if (extrapath && strlen(extrapath) > 0) {
*pp_targetpath);
}
if (!*pp_targetpath) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
}
d_printf("cli_resolve_path: "
"dfs_path (%s) not in correct format.\n",
dfs_path );
- return false;
+ return NT_STATUS_NOT_FOUND;
}
ppath++; /* Now pointing at start of server name. */
if ((ppath = strchr_m( dfs_path, '\\' )) == NULL) {
- return false;
+ return NT_STATUS_NOT_FOUND;
}
ppath++; /* Now pointing at start of share name. */
if ((ppath = strchr_m( ppath+1, '\\' )) == NULL) {
- return false;
+ return NT_STATUS_NOT_FOUND;
}
ppath++; /* Now pointing at path component. */
newmount = talloc_asprintf(ctx, "%s\\%s", mountpt, ppath );
if (!newmount) {
- return false;
+ return NT_STATUS_NOT_FOUND;
}
cli_set_mntpoint(*targetcli, newmount);
checking for loops here. */
if (!strequal(*pp_targetpath, "\\") && !strequal(*pp_targetpath, "/")) {
- if (cli_resolve_path(ctx,
- newmount,
- dfs_auth_info,
- *targetcli,
- *pp_targetpath,
- &newcli,
- &newpath)) {
+ status = cli_resolve_path(ctx,
+ newmount,
+ dfs_auth_info,
+ *targetcli,
+ *pp_targetpath,
+ &newcli,
+ &newpath);
+ if (NT_STATUS_IS_OK(status)) {
/*
* When cli_resolve_path returns true here it's always
* returning the complete path in newpath, so we're done
*/
*targetcli = newcli;
*pp_targetpath = newpath;
- return true;
+ return status;
}
}
if ((*targetcli)->dfsroot) {
dfs_path = talloc_strdup(ctx, *pp_targetpath);
if (!dfs_path) {
- return false;
+ return NT_STATUS_NO_MEMORY;
}
*pp_targetpath = cli_dfs_make_full_path(ctx, *targetcli, dfs_path);
+ if (*pp_targetpath == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
}
- return true;
+ return NT_STATUS_OK;
}
/********************************************************************
return NULL;
}
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(
+ frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
if (dir) {
SAFE_FREE(dir->fname);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
/*d_printf(">>>mkdir: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
/*d_printf(">>>rmdir: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
/* Local storage to avoid buffer overflows */
char *lpath;
bool smbc_rmdir_dirempty = true;
- NTSTATUS status;
lpath = talloc_asprintf(frame, "%s\\*",
targetpath);
char *path = NULL;
uint16 mode;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
}
/*d_printf(">>>unlink: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
struct cli_state *targetcli = NULL;
SMBCSRV *srv = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
}
/*d_printf(">>>unlink: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
struct cli_state *targetcli2 = NULL;
SMBCSRV *srv = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!ocontext || !ncontext ||
!ocontext->internal->initialized ||
password1);
/*d_printf(">>>rename: resolving %s\n", path1);*/
- if (!cli_resolve_path(frame, "", ocontext->internal->auth_info,
- srv->cli,
- path1,
- &targetcli1, &targetpath1)) {
+ status = cli_resolve_path(frame, "", ocontext->internal->auth_info,
+ srv->cli, path1, &targetcli1, &targetpath1);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path1);
errno = ENOENT;
TALLOC_FREE(frame);
/*d_printf(">>>rename: resolved path as %s\n", targetpath1);*/
/*d_printf(">>>rename: resolving %s\n", path2);*/
- if (!cli_resolve_path(frame, "", ncontext->internal->auth_info,
- srv->cli,
- path2,
- &targetcli2, &targetpath2)) {
+ status = cli_resolve_path(frame, "", ncontext->internal->auth_info,
+ srv->cli, path2, &targetcli2, &targetpath2);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path2);
errno = ENOENT;
TALLOC_FREE(frame);
ZERO_STRUCTP(file);
/*d_printf(">>>open: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(
+ frame, "", context->internal->auth_info,
+ srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
SAFE_FREE(file);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
/*
* offset:
}
/*d_printf(">>>read: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ file->srv->cli, path,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
}
/*d_printf(">>>write: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ file->srv->cli, path,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
/*d_printf(">>>close: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ file->srv->cli, path,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
struct cli_state *targetcli = NULL;
time_t write_time;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
DEBUG(4,("SMBC_getatr: sending qpathinfo\n"));
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- srv->cli, fixedpath,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ srv->cli, fixedpath,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Couldn't resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
/*d_printf(">>>lseek: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(
+ frame, "", context->internal->auth_info,
+ file->srv->cli, path, &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
}
/*d_printf(">>>fstat: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ file->srv->cli, path,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);