s3:smbd: Pass down remote and local address to get_referred_path()
authorAndreas Schneider <asn@samba.org>
Tue, 21 Mar 2017 14:32:37 +0000 (15:32 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 31 May 2017 00:24:18 +0000 (02:24 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12687

Pair-Programmed-With: Ralph Boehme <slow@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c
source3/rpc_server/dfs/srv_dfs_nt.c
source3/smbd/msdfs.c
source3/smbd/proto.h

index fa89f7f255147c2a9ace76ebbd90be02c4f9afac..e1b2712d793acc8996e2ceee77bd93bb16525c10 100644 (file)
@@ -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)) {
index ab2af53c0bacda3c5c9186269252d26109e6786e..0a4d6d31b7c372ba99668020d546c6f2ec790ed0 100644 (file)
@@ -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) ||
index c22cd1e77b85aab6d92a29113b0717c74fb3128c..fb222127fd4fbf8f49b8ce7430faae356fdf0f14 100644 (file)
@@ -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;
index 0be2a49b4f3a1a78923421ebc21be344301e842b..e2d5a6a9fbeba4899f26dcbd57ff5950d9e29175 100644 (file)
@@ -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,