summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-27 05:44:33 +0200
committerMichael Adam <obnox@samba.org>2013-10-17 16:17:27 +0200
commit37f0e3722cea3ff433d2c95d697e38693c676ae0 (patch)
treeaf0964892400a8455d1fe30421b2c3c1707afc07
parent114e33717df8b49239ac08399a379a8363d33b85 (diff)
downloadsamba-37f0e3722cea3ff433d2c95d697e38693c676ae0.tar.gz
samba-37f0e3722cea3ff433d2c95d697e38693c676ae0.tar.bz2
samba-37f0e3722cea3ff433d2c95d697e38693c676ae0.zip
s3/libsmb: make use of smbXcli_tcon_is_dfs_share()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10200 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/libsmb/clidfs.c18
-rw-r--r--source3/libsmb/libsmb_stat.c11
2 files changed, 26 insertions, 3 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 83bfdcf17e..2e4a3b8ef1 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -822,6 +822,8 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
SMB_STRUCT_STAT sbuf;
uint32 attributes;
NTSTATUS status;
+ struct smbXcli_tcon *root_tcon = NULL;
+ struct smbXcli_tcon *target_tcon = NULL;
if ( !rootcli || !path || !targetcli ) {
return NT_STATUS_INVALID_PARAMETER;
@@ -829,7 +831,13 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
/* Don't do anything if this is not a DFS root. */
- if ( !rootcli->dfsroot) {
+ if (smbXcli_conn_protocol(rootcli->conn) >= PROTOCOL_SMB2_02) {
+ root_tcon = rootcli->smb2.tcon;
+ } else {
+ root_tcon = rootcli->smb1.tcon;
+ }
+
+ if (!smbXcli_tcon_is_dfs_share(root_tcon)) {
*targetcli = rootcli;
*pp_targetpath = talloc_strdup(ctx, path);
if (!*pp_targetpath) {
@@ -1029,8 +1037,14 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
done:
+ if (smbXcli_conn_protocol((*targetcli)->conn) >= PROTOCOL_SMB2_02) {
+ target_tcon = (*targetcli)->smb2.tcon;
+ } else {
+ target_tcon = (*targetcli)->smb1.tcon;
+ }
+
/* If returning true ensure we return a dfs root full path. */
- if ((*targetcli)->dfsroot) {
+ if (smbXcli_tcon_is_dfs_share(target_tcon)) {
dfs_path = talloc_strdup(ctx, *pp_targetpath);
if (!dfs_path) {
return NT_STATUS_NO_MEMORY;
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index dc59f9cc82..94449e0d86 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/libsmb/libsmb_stat.c
@@ -364,6 +364,13 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
unsigned long flags = 0;
uint32 fs_attrs = 0;
struct cli_state *cli = file->srv->cli;
+ struct smbXcli_tcon *tcon;
+
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ tcon = cli->smb2.tcon;
+ } else {
+ tcon = cli->smb1.tcon;
+ }
/* Initialize all fields (at least until we actually use them) */
memset(st, 0, sizeof(*st));
@@ -469,7 +476,9 @@ SMBC_fstatvfs_ctx(SMBCCTX *context,
}
/* See if DFS is supported */
- if (smbXcli_conn_dfs_supported(cli->conn) && cli->dfsroot) {
+ if (smbXcli_conn_dfs_supported(cli->conn) &&
+ smbXcli_tcon_is_dfs_share(tcon))
+ {
flags |= SMBC_VFS_FEATURE_DFS;
}