summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-20 19:29:12 +0200
committerGünther Deschner <gd@samba.org>2010-04-20 19:29:12 +0200
commit0833c9639e3e7fb7e14dc25d90f4a9973e717cbc (patch)
treef047247591437714128a248c2be04856f0e36805 /source4/torture/rpc
parent545ef2ca7636507f86f370ae57937de7a6bd5d2e (diff)
downloadsamba-0833c9639e3e7fb7e14dc25d90f4a9973e717cbc.tar.gz
samba-0833c9639e3e7fb7e14dc25d90f4a9973e717cbc.tar.bz2
samba-0833c9639e3e7fb7e14dc25d90f4a9973e717cbc.zip
s4-smbtorture: add function to get a printserver's environment.
Guenther
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/spoolss.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 25fdd7fc76..9203a7251d 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -3284,6 +3284,28 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx,
return true;
}
+static bool test_get_environment(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b,
+ struct policy_handle *handle,
+ const char **architecture)
+{
+ DATA_BLOB blob;
+ enum winreg_Type type;
+ uint8_t *data;
+ uint32_t needed;
+
+ torture_assert(tctx,
+ test_GetPrinterData(tctx, b, handle, "Architecture", &type, &data, &needed),
+ "failed to get Architecture");
+
+ torture_assert_int_equal(tctx, type, REG_SZ, "unexpected type");
+
+ blob = data_blob_const(data, needed);
+ *architecture = reg_val_data_string(tctx, lp_iconv_convenience(tctx->lp_ctx), REG_SZ, blob);
+
+ return true;
+}
+
static bool test_GetPrinterData_list(struct torture_context *tctx,
struct dcerpc_pipe *p,
struct policy_handle *handle,