summaryrefslogtreecommitdiff
path: root/source3/libsmb/clidfs.c
diff options
context:
space:
mode:
authorRichard Sharpe <richard.sharpe@primarydata.com>2017-06-26 09:43:31 -0700
committerJeremy Allison <jra@samba.org>2017-07-07 00:52:24 +0200
commitb6d6f67bad397f30b6b5779c4e8ba8bf12f49d4b (patch)
tree884c3ea83aaa6a813a65296c2580951c3a574a15 /source3/libsmb/clidfs.c
parent1de439035308b80a6bedc8110d02a4c29388c975 (diff)
downloadsamba-b6d6f67bad397f30b6b5779c4e8ba8bf12f49d4b.tar.gz
Add support for passing the max_referral_level into the cli call to get a DFS referral. This is being done so I can write tests of the DFS referral code on the server side.
Signed-off-by: Richard Sharpe <richard.sharpe@primarydata.com> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/libsmb/clidfs.c')
-rw-r--r--source3/libsmb/clidfs.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 207b3240f5e..b740007f675 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -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 {