mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3: Remove the smbd_server_conn ref from get_referred_path
This commit is contained in:
parent
cb2b5c521b
commit
fba833d055
@ -75,8 +75,8 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
|
||||
}
|
||||
|
||||
/* The following call can change the cwd. */
|
||||
status = get_referred_path(ctx, r->in.path, jn,
|
||||
&consumedcnt, &self_ref);
|
||||
status = get_referred_path(ctx, r->in.path, smbd_server_conn, jn,
|
||||
&consumedcnt, &self_ref);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
return ntstatus_to_werror(status);
|
||||
}
|
||||
@ -118,6 +118,7 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
|
||||
bool found = False;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
char *altpath = NULL;
|
||||
NTSTATUS status;
|
||||
|
||||
if (p->session_info->unix_token->uid != sec_initial_uid()) {
|
||||
DEBUG(10,("_dfs_remove: uid != 0. Access denied.\n"));
|
||||
@ -141,8 +142,9 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
|
||||
r->in.dfs_entry_path, r->in.servername, r->in.sharename));
|
||||
}
|
||||
|
||||
if(!NT_STATUS_IS_OK(get_referred_path(ctx, r->in.dfs_entry_path, jn,
|
||||
&consumedcnt, &self_ref))) {
|
||||
status = get_referred_path(ctx, r->in.dfs_entry_path, smbd_server_conn,
|
||||
jn, &consumedcnt, &self_ref);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
return WERR_DFS_NO_SUCH_VOL;
|
||||
}
|
||||
|
||||
@ -353,6 +355,7 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
|
||||
bool self_ref = False;
|
||||
TALLOC_CTX *ctx = talloc_tos();
|
||||
bool ret;
|
||||
NTSTATUS status;
|
||||
|
||||
jn = talloc_zero(ctx, struct junction_map);
|
||||
if (!jn) {
|
||||
@ -364,8 +367,9 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r)
|
||||
}
|
||||
|
||||
/* The following call can change the cwd. */
|
||||
if(!NT_STATUS_IS_OK(get_referred_path(ctx, r->in.dfs_entry_path,
|
||||
jn, &consumedcnt, &self_ref)) ||
|
||||
status = get_referred_path(ctx, r->in.dfs_entry_path, smbd_server_conn,
|
||||
jn, &consumedcnt, &self_ref);
|
||||
if(!NT_STATUS_IS_OK(status) ||
|
||||
consumedcnt < strlen(r->in.dfs_entry_path)) {
|
||||
return WERR_DFS_NO_SUCH_VOL;
|
||||
}
|
||||
|
@ -850,6 +850,7 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx,
|
||||
|
||||
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
||||
const char *dfs_path,
|
||||
struct smbd_server_connection *sconn,
|
||||
struct junction_map *jucn,
|
||||
int *consumedcntp,
|
||||
bool *self_referralp)
|
||||
@ -868,8 +869,8 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
||||
|
||||
*self_referralp = False;
|
||||
|
||||
status = parse_dfs_path(NULL, dfs_path, False,
|
||||
!smbd_server_conn->using_smb2, pdp, &dummy);
|
||||
status = parse_dfs_path(NULL, dfs_path, False, !sconn->using_smb2,
|
||||
pdp, &dummy);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
@ -972,7 +973,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
status = create_conn_struct(ctx, smbd_server_conn, &conn, snum,
|
||||
status = create_conn_struct(ctx, sconn, &conn, snum,
|
||||
lp_pathname(snum), NULL, &oldpath);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
TALLOC_FREE(pdp);
|
||||
@ -1276,8 +1277,8 @@ int setup_dfs_referral(connection_struct *orig_conn,
|
||||
}
|
||||
|
||||
/* The following call can change cwd. */
|
||||
*pstatus = get_referred_path(ctx, pathnamep, junction,
|
||||
&consumedcnt, &self_referral);
|
||||
*pstatus = get_referred_path(ctx, pathnamep, smbd_server_conn,
|
||||
junction, &consumedcnt, &self_referral);
|
||||
if (!NT_STATUS_IS_OK(*pstatus)) {
|
||||
vfs_ChDir(orig_conn,orig_conn->connectpath);
|
||||
talloc_destroy(ctx);
|
||||
|
@ -448,6 +448,7 @@ bool is_msdfs_link(connection_struct *conn,
|
||||
struct junction_map;
|
||||
NTSTATUS get_referred_path(TALLOC_CTX *ctx,
|
||||
const char *dfs_path,
|
||||
struct smbd_server_connection *sconn,
|
||||
struct junction_map *jucn,
|
||||
int *consumedcntp,
|
||||
bool *self_referralp);
|
||||
|
Loading…
Reference in New Issue
Block a user