s3:smbd/msdfs: pass 'allow_broken_path' to get_referred_path()
authorStefan Metzmacher <metze@samba.org>
Wed, 23 May 2012 11:09:40 +0000 (13:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 24 May 2012 12:12:32 +0000 (14:12 +0200)
Note the DCERPC code should not be smb2 specific!

I wonder why this is at all smb2 specific...

metze

source3/modules/vfs_default.c
source3/rpc_server/dfs/srv_dfs_nt.c
source3/smbd/msdfs.c
source3/smbd/proto.h

index 887dbcb9afc2209e11cfed15879e90efe9402b8d..8908508af44acf21c06f2a7bd5875596249c43ce 100644 (file)
@@ -22,6 +22,7 @@
 #include "system/time.h"
 #include "system/filesys.h"
 #include "smbd/smbd.h"
+#include "smbd/globals.h"
 #include "ntioctl.h"
 #include "smbprofile.h"
 #include "../libcli/security/security.h"
@@ -209,7 +210,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,
+       status = get_referred_path(r, pathnamep,
+                                  !handle->conn->sconn->using_smb2,
                                   junction, &consumedcnt, &self_referral);
        if (!NT_STATUS_IS_OK(status)) {
                vfs_ChDir(handle->conn, handle->conn->connectpath);
index e765f15a8da327b629386999685a96712956e795..2c840e20c2a855a81e01bcd40e7160f32a312d23 100644 (file)
@@ -75,8 +75,9 @@ 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, smbd_server_conn, jn,
-                                  &consumedcnt, &self_ref);
+       status = get_referred_path(ctx, r->in.path,
+                                  true, /*allow_broken_path */
+                                  jn, &consumedcnt, &self_ref);
        if(!NT_STATUS_IS_OK(status)) {
                return ntstatus_to_werror(status);
        }
@@ -142,7 +143,8 @@ WERROR _dfs_Remove(struct pipes_struct *p, struct dfs_Remove *r)
                        r->in.dfs_entry_path, r->in.servername, r->in.sharename));
        }
 
-       status = get_referred_path(ctx, r->in.dfs_entry_path, smbd_server_conn,
+       status = get_referred_path(ctx, r->in.dfs_entry_path,
+                                  true, /*allow_broken_path */
                                   jn, &consumedcnt, &self_ref);
        if(!NT_STATUS_IS_OK(status)) {
                return WERR_DFS_NO_SUCH_VOL;
@@ -369,7 +371,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, smbd_server_conn,
+       status = get_referred_path(ctx, r->in.dfs_entry_path,
+                                  true, /*allow_broken_path */
                                   jn, &consumedcnt, &self_ref);
        if(!NT_STATUS_IS_OK(status) ||
                        consumedcnt < strlen(r->in.dfs_entry_path)) {
index 82859c3be4d8f9532cb459795fa38f00d51a59ef..76fcb8cbe3850a8deb1b2707a1e1260e427df77b 100644 (file)
@@ -856,7 +856,7 @@ static NTSTATUS self_ref(TALLOC_CTX *ctx,
 
 NTSTATUS get_referred_path(TALLOC_CTX *ctx,
                        const char *dfs_path,
-                       struct smbd_server_connection *sconn,
+                       bool allow_broken_path,
                        struct junction_map *jucn,
                        int *consumedcntp,
                        bool *self_referralp)
@@ -875,7 +875,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
 
        *self_referralp = False;
 
-       status = parse_dfs_path(NULL, dfs_path, False, !sconn->using_smb2,
+       status = parse_dfs_path(NULL, dfs_path, False, allow_broken_path,
                                pdp, &dummy);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
index f8a828180663cf1bc080f4b49f8ee88efbfe479f..c5ca6b7176b6ce620a4b555b5cf0e2fffbd8a184 100644 (file)
@@ -457,7 +457,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,
+                       bool allow_broken_path,
                        struct junction_map *jucn,
                        int *consumedcntp,
                        bool *self_referralp);