summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-26 10:41:11 +0100
committerKarolin Seeger <kseeger@samba.org>2009-03-27 13:06:56 +0100
commita596eb3115464725ac2e8c897554d9b5c6a707f3 (patch)
treef924126877a17575ecb1f27291ae7f9878c1db43
parentaccce80f82e6978e062a71e89ef150bb71f6e61e (diff)
downloadsamba-a596eb3115464725ac2e8c897554d9b5c6a707f3.tar.gz
samba-a596eb3115464725ac2e8c897554d9b5c6a707f3.tar.xz
samba-a596eb3115464725ac2e8c897554d9b5c6a707f3.zip
s3-net: Fix Bug #6102. NetQueryDisplayInformation could return wrong information.
Guenther (cherry picked from commit 490ed838f2626893bb623ea6ad8d79595c8c44c4)
-rw-r--r--source/lib/netapi/user.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/lib/netapi/user.c b/source/lib/netapi/user.c
index 05a051067ad..b31d8384be2 100644
--- a/source/lib/netapi/user.c
+++ b/source/lib/netapi/user.c
@@ -899,6 +899,9 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
NTSTATUS status;
WERROR werr;
+ WERROR werr_tmp;
+
+ *r->out.entries_read = 0;
ZERO_STRUCT(connect_handle);
ZERO_STRUCT(domain_handle);
@@ -992,15 +995,18 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
&total_size,
&returned_size,
&info);
- if (!NT_STATUS_IS_OK(status)) {
- werr = ntstatus_to_werror(status);
+ werr = ntstatus_to_werror(status);
+ if (NT_STATUS_IS_ERR(status)) {
goto done;
}
- werr = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
- r->in.level,
- r->out.entries_read,
- r->out.buffer);
+ werr_tmp = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
+ r->in.level,
+ r->out.entries_read,
+ r->out.buffer);
+ if (!W_ERROR_IS_OK(werr_tmp)) {
+ werr = werr_tmp;
+ }
done:
if (!cli) {
return werr;