From: Andreas Schneider Date: Tue, 21 Mar 2017 14:32:37 +0000 (+0100) Subject: s3:smbd: Pass down remote and local address to get_referred_path() X-Git-Tag: ldb-1.1.30~24 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=cbf67123e037207662ec0d4e53c55990e21b157e;p=samba.git s3:smbd: Pass down remote and local address to get_referred_path() BUG: https://bugzilla.samba.org/show_bug.cgi?id=12687 Pair-Programmed-With: Ralph Boehme Signed-off-by: Andreas Schneider Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index fa89f7f2551..e1b2712d793 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -217,6 +217,8 @@ static NTSTATUS vfswrap_get_dfs_referrals(struct vfs_handle_struct *handle, /* The following call can change cwd. */ status = get_referred_path(r, pathnamep, + handle->conn->sconn->remote_address, + handle->conn->sconn->local_address, !handle->conn->sconn->using_smb2, junction, &consumedcnt, &self_referral); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/rpc_server/dfs/srv_dfs_nt.c b/source3/rpc_server/dfs/srv_dfs_nt.c index ab2af53c0ba..0a4d6d31b7c 100644 --- a/source3/rpc_server/dfs/srv_dfs_nt.c +++ b/source3/rpc_server/dfs/srv_dfs_nt.c @@ -76,6 +76,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, + p->remote_address, + p->local_address, true, /*allow_broken_path */ jn, &consumedcnt, &self_ref); if(!NT_STATUS_IS_OK(status)) { @@ -146,6 +148,8 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r) } status = get_referred_path(ctx, r->in.dfs_entry_path, + p->remote_address, + p->local_address, true, /*allow_broken_path */ jn, &consumedcnt, &self_ref); if(!NT_STATUS_IS_OK(status)) { @@ -374,6 +378,8 @@ WERROR _dfs_GetInfo(struct pipes_struct *p, struct dfs_GetInfo *r) /* The following call can change the cwd. */ status = get_referred_path(ctx, r->in.dfs_entry_path, + p->remote_address, + p->local_address, true, /*allow_broken_path */ jn, &consumedcnt, &self_ref); if(!NT_STATUS_IS_OK(status) || diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index c22cd1e77b8..fb222127fd4 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -953,11 +953,13 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx, **********************************************************************/ NTSTATUS get_referred_path(TALLOC_CTX *ctx, - const char *dfs_path, - bool allow_broken_path, - struct junction_map *jucn, - int *consumedcntp, - bool *self_referralp) + const char *dfs_path, + const struct tsocket_address *remote_address, + const struct tsocket_address *local_address, + bool allow_broken_path, + struct junction_map *jucn, + int *consumedcntp, + bool *self_referralp) { struct connection_struct *conn; char *targetpath = NULL; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 0be2a49b4f3..e2d5a6a9fbe 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -472,11 +472,13 @@ bool is_msdfs_link(connection_struct *conn, SMB_STRUCT_STAT *sbufp); struct junction_map; NTSTATUS get_referred_path(TALLOC_CTX *ctx, - const char *dfs_path, - bool allow_broken_path, - struct junction_map *jucn, - int *consumedcntp, - bool *self_referralp); + const char *dfs_path, + const struct tsocket_address *remote_address, + const struct tsocket_address *local_address, + bool allow_broken_path, + struct junction_map *jucn, + int *consumedcntp, + bool *self_referralp); int setup_dfs_referral(connection_struct *orig_conn, const char *dfs_path, int max_referral_level,