summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-11-26 19:01:54 +0100
committerGünther Deschner <gd@samba.org>2009-11-27 18:31:13 +0100
commite512ccb5b677fa7f285829ec645fc067837c0e11 (patch)
treecd4f9293dd4085f1aa4acbf6f107d970677f8a8e /source3/rpc_server
parent663a1f599aa163ebb5c81c02988c07cb1f0e3e6c (diff)
downloadsamba-e512ccb5b677fa7f285829ec645fc067837c0e11.tar.gz
samba-e512ccb5b677fa7f285829ec645fc067837c0e11.tar.bz2
samba-e512ccb5b677fa7f285829ec645fc067837c0e11.zip
s3-spoolss: simplify _spoolss_EnumPrinterKey a little more.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index c704418334..8d7973d13e 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -9125,10 +9125,6 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
goto done;
}
- /* two byte termination (a multisz) */
-
- *r->out.needed = 2;
-
array = talloc_zero_array(r->out.key_buffer, const char *, num_keys + 1);
if (!array) {
result = WERR_NOMEM;
@@ -9145,23 +9141,19 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
result = WERR_NOMEM;
goto done;
}
-
- *r->out.needed += strlen_m_term(keynames[i]) * 2;
- }
-
- if (r->in.offered < *r->out.needed) {
- result = WERR_MORE_DATA;
- goto done;
}
- result = WERR_OK;
-
if (!push_reg_multi_sz(p->mem_ctx, &blob, array)) {
result = WERR_NOMEM;
goto done;
}
- if (r->in.offered >= blob.length) {
+ *r->out.needed = blob.length;
+
+ if (r->in.offered < *r->out.needed) {
+ result = WERR_MORE_DATA;
+ } else {
+ result = WERR_OK;
memcpy(r->out.key_buffer, blob.data, blob.length);
}