diff options
author | Tim Potter <tpot@samba.org> | 2001-09-13 01:00:46 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2001-09-13 01:00:46 +0000 |
commit | f04f28a62246dd16b3467f7aba2a492e64b8eed1 (patch) | |
tree | 5e933fcbc4c4840e9fb7852045feb137328d2e7c | |
parent | 5366c4c542b2a1c7bcc268daba02af25ce6eab6e (diff) | |
download | samba-f04f28a62246dd16b3467f7aba2a492e64b8eed1.tar.gz samba-f04f28a62246dd16b3467f7aba2a492e64b8eed1.tar.bz2 samba-f04f28a62246dd16b3467f7aba2a492e64b8eed1.zip |
Fixed return value for cli_dfs_exist() - nt4 returns 1, w2k returns 2.
Use werror_to_ntstatus() to convert error returns from dfs client functions
into nt errors.
(This used to be commit a83061ef3e4933c52e7206270b455a3888fa63a8)
-rw-r--r-- | source3/libsmb/cli_dfs.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/source3/libsmb/cli_dfs.c b/source3/libsmb/cli_dfs.c index d900d95bb2..83220fd1af 100644 --- a/source3/libsmb/cli_dfs.c +++ b/source3/libsmb/cli_dfs.c @@ -64,7 +64,7 @@ NTSTATUS cli_dfs_exist(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return result */ - *dfs_exists = (r.status == 1); + *dfs_exists = (r.status != 0); result = NT_STATUS_OK; @@ -110,6 +110,8 @@ NTSTATUS cli_dfs_add(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return result */ + result = werror_to_ntstatus(r.status); + done: prs_mem_free(&qbuf); prs_mem_free(&rbuf); @@ -123,7 +125,7 @@ NTSTATUS cli_dfs_remove(struct cli_state *cli, TALLOC_CTX *mem_ctx, prs_struct qbuf, rbuf; DFS_Q_DFS_REMOVE q; DFS_R_DFS_REMOVE r; - WERROR result = WERR_BADFUNC; + NTSTATUS result = NT_STATUS_UNSUCCESSFUL; ZERO_STRUCT(q); ZERO_STRUCT(r); @@ -150,13 +152,13 @@ NTSTATUS cli_dfs_remove(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return result */ - result = r.status; + result = werror_to_ntstatus(r.status); done: prs_mem_free(&qbuf); prs_mem_free(&rbuf); - return NT_STATUS_OK; + return result; } NTSTATUS cli_dfs_get_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, @@ -167,7 +169,7 @@ NTSTATUS cli_dfs_get_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, prs_struct qbuf, rbuf; DFS_Q_DFS_GET_INFO q; DFS_R_DFS_GET_INFO r; - WERROR result = WERR_BADFUNC; + NTSTATUS result = NT_STATUS_UNSUCCESSFUL; ZERO_STRUCT(q); ZERO_STRUCT(r); @@ -195,14 +197,14 @@ NTSTATUS cli_dfs_get_info(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return result */ - result = r.status; + result = werror_to_ntstatus(r.status); *ctr = r.ctr; done: prs_mem_free(&qbuf); prs_mem_free(&rbuf); - return NT_STATUS_OK; /* Should return a WERROR */ + return result; } /* Enumerate dfs shares */ @@ -213,7 +215,7 @@ NTSTATUS cli_dfs_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, prs_struct qbuf, rbuf; DFS_Q_DFS_ENUM q; DFS_R_DFS_ENUM r; - WERROR result = WERR_BADFUNC; + NTSTATUS result = NT_STATUS_UNSUCCESSFUL; ZERO_STRUCT(q); ZERO_STRUCT(r); @@ -242,11 +244,11 @@ NTSTATUS cli_dfs_enum(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return result */ - result = r.status; + result = werror_to_ntstatus(r.status); done: prs_mem_free(&qbuf); prs_mem_free(&rbuf); - return NT_STATUS_OK; + return result; } |