summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-11-11 14:46:58 +0100
committerVolker Lendecke <vlendec@samba.org>2010-11-11 16:16:24 +0000
commit612ded1abf15bfcc3569f061b18764bff66fe9b6 (patch)
tree069ee6cabee745f40e3cd35fef2baab149b423f9 /source3/libsmb
parent3a01edd60764723bccd742707153ab4cdf72c079 (diff)
downloadsamba-612ded1abf15bfcc3569f061b18764bff66fe9b6.tar.gz
samba-612ded1abf15bfcc3569f061b18764bff66fe9b6.tar.xz
samba-612ded1abf15bfcc3569f061b18764bff66fe9b6.zip
s3: cli_dfs_check_error does not need to depend on cli->inbuf
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clidfs.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 26c2a4a6bbc..97c1e0407cc 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -597,19 +597,20 @@ static char *cli_dfs_make_full_path(TALLOC_CTX *ctx,
check for dfs referral
********************************************************************/
-static bool cli_dfs_check_error( struct cli_state *cli, NTSTATUS status )
+static bool cli_dfs_check_error(struct cli_state *cli, NTSTATUS expected,
+ NTSTATUS status)
{
- uint32 flgs2 = SVAL(cli->inbuf,smb_flg2);
-
/* only deal with DS when we negotiated NT_STATUS codes and UNICODE */
- if (!((flgs2&FLAGS2_32_BIT_ERROR_CODES) &&
- (flgs2&FLAGS2_UNICODE_STRINGS)))
+ if (!(cli->capabilities & CAP_UNICODE)) {
return false;
-
- if (NT_STATUS_EQUAL(status, NT_STATUS(IVAL(cli->inbuf,smb_rcls))))
+ }
+ if (!(cli->capabilities & CAP_STATUS32)) {
+ return false;
+ }
+ if (NT_STATUS_EQUAL(status, expected)) {
return true;
-
+ }
return false;
}
@@ -834,7 +835,8 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
/* Special case where client asked for a path that does not exist */
- if (cli_dfs_check_error(rootcli, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+ if (cli_dfs_check_error(rootcli, NT_STATUS_OBJECT_NAME_NOT_FOUND,
+ status)) {
*targetcli = rootcli;
*pp_targetpath = talloc_strdup(ctx, path);
if (!*pp_targetpath) {
@@ -845,7 +847,8 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
/* We got an error, check for DFS referral. */
- if (!cli_dfs_check_error(rootcli, NT_STATUS_PATH_NOT_COVERED)) {
+ if (!cli_dfs_check_error(rootcli, NT_STATUS_PATH_NOT_COVERED,
+ status)) {
return false;
}