Add support for passing the max_referral_level into the cli call to get a DFS referra...
authorRichard Sharpe <richard.sharpe@primarydata.com>
Mon, 26 Jun 2017 16:43:31 +0000 (09:43 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 6 Jul 2017 22:52:24 +0000 (00:52 +0200)
Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clidfs.c
source3/libsmb/proto.h

index 207b3240f5e820ee990ec953878e961b94c025e5..b740007f675348f5f40b452483d06ae30f8c242d 100644 (file)
@@ -662,9 +662,10 @@ static bool cli_dfs_check_error(struct cli_state *cli, NTSTATUS expected,
  Get the dfs referral link.
 ********************************************************************/
 
-NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
+NTSTATUS cli_dfs_get_referral_ex(TALLOC_CTX *ctx,
                        struct cli_state *cli,
                        const char *path,
+                       uint16_t max_referral_level,
                        struct client_dfs_referral **refs,
                        size_t *num_refs,
                        size_t *consumed)
@@ -691,7 +692,7 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                status = NT_STATUS_NO_MEMORY;
                goto out;
        }
-       SSVAL(param, 0, 0x03);  /* max referral level */
+       SSVAL(param, 0, max_referral_level);
 
        param = trans2_bytes_push_str(param, smbXcli_conn_use_unicode(cli->conn),
                                      path, strlen(path)+1,
@@ -857,6 +858,22 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
        return status;
 }
 
+NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
+                       struct cli_state *cli,
+                       const char *path,
+                       struct client_dfs_referral **refs,
+                       size_t *num_refs,
+                       size_t *consumed)
+{
+       return cli_dfs_get_referral_ex(ctx,
+                               cli,
+                               path,
+                               3,
+                               refs, /* Max referral level we want */
+                               num_refs,
+                               consumed);
+}
+
 /********************************************************************
 ********************************************************************/
 struct cli_dfs_path_split {
index 47b9cf190bde30b3f24486849bab66de8e39115b..05d91f79f835d87b75e2d0f5d5ab27f3b2db3eaf 100644 (file)
@@ -152,6 +152,13 @@ NTSTATUS cli_cm_open(TALLOC_CTX *ctx,
                                struct cli_state **pcli);
 void cli_cm_display(struct cli_state *c);
 struct client_dfs_referral;
+NTSTATUS cli_dfs_get_referral_ex(TALLOC_CTX *ctx,
+                       struct cli_state *cli,
+                       const char *path,
+                       uint16_t max_referral_level,
+                       struct client_dfs_referral **refs,
+                       size_t *num_refs,
+                       size_t *consumed);
 NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx,
                        struct cli_state *cli,
                        const char *path,