summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-12-10 14:20:22 +0100
committerGünther Deschner <gd@samba.org>2009-12-10 17:48:50 +0100
commitf20effc437970d826c5bd4f047ff47e23e7a1a73 (patch)
tree0c1f5c0efb90f29ac5b5572f154a819477c83392 /source3/rpc_server
parentfa413d167bc3ea9aff3dcff97152ef07a1173939 (diff)
downloadsamba-f20effc437970d826c5bd4f047ff47e23e7a1a73.tar.gz
samba-f20effc437970d826c5bd4f047ff47e23e7a1a73.tar.bz2
samba-f20effc437970d826c5bd4f047ff47e23e7a1a73.zip
s3-spoolss: fix enumprinter key client and server.
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 1e66c7c021..0028ec0188 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -8786,12 +8786,20 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
goto done;
}
- array = talloc_zero_array(r->out.key_buffer, const char *, num_keys + 1);
+ array = talloc_zero_array(r->out.key_buffer, const char *, num_keys + 2);
if (!array) {
result = WERR_NOMEM;
goto done;
}
+ if (!num_keys) {
+ array[0] = talloc_strdup(array, "");
+ if (!array[0]) {
+ result = WERR_NOMEM;
+ goto done;
+ }
+ }
+
for (i=0; i < num_keys; i++) {
DEBUG(10,("_spoolss_EnumPrinterKey: adding keyname: %s\n",
@@ -8809,13 +8817,14 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
goto done;
}
+ *r->out._ndr_size = r->in.offered / 2;
*r->out.needed = blob.length;
if (r->in.offered < *r->out.needed) {
result = WERR_MORE_DATA;
} else {
result = WERR_OK;
- r->out.key_buffer->string = array;
+ r->out.key_buffer->string_array = array;
}
done: