summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-01-22 15:57:22 +0100
committerAndreas Schneider <asn@samba.org>2013-01-24 17:42:26 +0100
commitaab232cb2ea91b3a6c636f4ea47ca9f872848f3f (patch)
treedf8dd956b3140dc9b447160b52c00c294fb7214a /source3/rpcclient
parentce1a9ae8abc3e4d49374b5b02c6ec55d2df63f72 (diff)
downloadsamba-aab232cb2ea91b3a6c636f4ea47ca9f872848f3f.tar.gz
samba-aab232cb2ea91b3a6c636f4ea47ca9f872848f3f.tar.bz2
samba-aab232cb2ea91b3a6c636f4ea47ca9f872848f3f.zip
s3-rpcclient: decode OsVersion{Ex} binary blobs when displaying printerdata.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index ced224b4d7..35fbb9b8af 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -25,6 +25,7 @@
#include "includes.h"
#include "rpcclient.h"
#include "../librpc/gen_ndr/ndr_spoolss_c.h"
+#include "../librpc/gen_ndr/ndr_spoolss.h"
#include "rpc_client/cli_spoolss.h"
#include "rpc_client/init_spoolss.h"
#include "nt_printing.h"
@@ -831,6 +832,7 @@ static void display_printer_data(const char *v,
union spoolss_PrinterData r;
DATA_BLOB blob = data_blob_const(data, length);
WERROR result;
+ enum ndr_err_code ndr_err;
result = pull_spoolss_PrinterData(talloc_tos(), &blob, &r, type);
if (!W_ERROR_IS_OK(result)) {
@@ -861,6 +863,25 @@ static void display_printer_data(const char *v,
}
TALLOC_FREE(hex);
putchar('\n');
+
+ if (strequal(v, "OsVersion")) {
+ struct spoolss_OSVersion os;
+ ndr_err = ndr_pull_struct_blob(&blob, talloc_tos(), &os,
+ (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersion);
+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ printf("%s: OsVersion:\n", v);
+ NDR_PRINT_DEBUG(spoolss_OSVersion, &os);
+ }
+ }
+ if (strequal(v, "OsVersionEx")) {
+ struct spoolss_OSVersionEx os;
+ ndr_err = ndr_pull_struct_blob(&blob, talloc_tos(), &os,
+ (ndr_pull_flags_fn_t)ndr_pull_spoolss_OSVersionEx);
+ if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+ printf("%s: OsVersionEx:\n", v);
+ NDR_PRINT_DEBUG(spoolss_OSVersionEx, &os);
+ }
+ }
break;
}
case REG_MULTI_SZ: