1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

smbd: convert get_referred_path() to use create_conn_struct_tos_cwd()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2018-05-24 17:55:02 +02:00
parent 42610e0ca7
commit 73e5d47d32

View File

@ -1083,13 +1083,13 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
bool *self_referralp)
{
TALLOC_CTX *frame = talloc_stackframe();
struct connection_struct *conn;
struct conn_struct_tos *c = NULL;
struct connection_struct *conn = NULL;
char *targetpath = NULL;
int snum;
NTSTATUS status = NT_STATUS_NOT_FOUND;
bool dummy;
struct dfs_path *pdp = talloc_zero(frame, struct dfs_path);
struct smb_filename *oldcwd_fname = NULL;
if (!pdp) {
TALLOC_FREE(frame);
@ -1185,18 +1185,16 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
return NT_STATUS_OK;
}
status = create_conn_struct_cwd(frame,
server_event_context(),
server_messaging_context(),
&conn,
snum,
lp_path(frame, snum),
NULL,
&oldcwd_fname);
status = create_conn_struct_tos_cwd(server_messaging_context(),
snum,
lp_path(frame, snum),
NULL,
&c);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(frame);
return status;
}
conn = c->conn;
/*
* TODO
@ -1258,9 +1256,6 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
status = NT_STATUS_OK;
err_exit:
vfs_ChDir(conn, oldcwd_fname);
SMB_VFS_DISCONNECT(conn);
conn_free(conn);
TALLOC_FREE(frame);
return status;
}