Patch: Add support for passing the max_referral_level into the CLI call for DFS referrals
Richard Sharpe
realrichardsharpe at gmail.com
Mon Jun 26 17:05:41 UTC 2017
Hi folks,
This is a small patch to allow me to write tests of our server code.
--
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)
-------------- next part --------------
From 9985a33464734f74f5203e88932153dd38b503cd Mon Sep 17 00:00:00 2001
From: Richard Sharpe <richard.sharpe at primarydata.com>
Date: Mon, 26 Jun 2017 09:43:31 -0700
Subject: [PATCH] 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.
---
source3/libsmb/clidfs.c | 21 +++++++++++++++++++--
source3/libsmb/proto.h | 7 +++++++
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 060c4e9..561ce44 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -675,9 +675,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)
@@ -704,7 +705,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,
@@ -870,6 +871,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 {
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index fb122b9..2239707 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -153,6 +153,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,
--
2.3.6
More information about the samba-technical
mailing list