[PATCHES] Fix inconsistent environment in spoolss_MonitorInfo2
Günther Deschner
gd at samba.org
Mon Nov 21 13:23:03 UTC 2016
Hi,
please review and push.
Thanks,
Guenther
--
Günther Deschner GPG-ID: 8EE11688
Red Hat gdeschner at redhat.com
Samba Team gd at samba.org
-------------- next part --------------
From a949818a0b714354f73a5319831c7b49cf5b660b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Mon, 21 Nov 2016 11:27:31 +0100
Subject: [PATCH 1/2] s3-spoolss: use architecture in spoolss_MonitorInfo calls
consistently
Guenther
Signed-off-by: Guenther Deschner <gd at samba.org>
---
source3/rpc_server/spoolss/srv_spoolss_nt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 45061b6..06f704d 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -9533,15 +9533,21 @@ static WERROR enumprintmonitors_level_2(TALLOC_CTX *mem_ctx,
{
union spoolss_MonitorInfo *info;
WERROR result = WERR_OK;
+ const char *architecture;
info = talloc_array(mem_ctx, union spoolss_MonitorInfo, 2);
W_ERROR_HAVE_NO_MEMORY(info);
*count = 2;
+ architecture = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "spoolss",
+ "architecture",
+ SPOOLSS_ARCHITECTURE_NT_X86);
+
result = fill_monitor_2(info, &info[0].info2,
SPL_LOCAL_PORT,
- "Windows NT X86", /* FIXME */
+ architecture,
"localmon.dll");
if (!W_ERROR_IS_OK(result)) {
goto out;
@@ -9549,7 +9555,7 @@ static WERROR enumprintmonitors_level_2(TALLOC_CTX *mem_ctx,
result = fill_monitor_2(info, &info[1].info2,
SPL_TCPIP_PORT,
- "Windows NT X86", /* FIXME */
+ architecture,
"tcpmon.dll");
if (!W_ERROR_IS_OK(result)) {
goto out;
--
2.7.4
From ed59fe3fa7530d53a3420b3a402893bfcbced66e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Mon, 21 Nov 2016 12:44:54 +0100
Subject: [PATCH 2/2] s4-torture: test valid environment in
spoolss_EnumMonitors level 2.
Guenther
Signed-off-by: Guenther Deschner <gd at samba.org>
---
source4/torture/rpc/spoolss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 751a3b2..81efff8 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -863,6 +863,7 @@ static bool test_EnumMonitors(struct torture_context *tctx,
COMPARE_STRING(tctx, cur->info1, ref->info2, monitor_name);
break;
case 2:
+ torture_assert_str_equal(tctx, ref->info2.environment, ctx->environment, "invalid environment");
/* level 2 is our reference, and it makes no sense to compare it to itself */
break;
}
--
2.7.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 201 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161121/523dd0db/signature.sig>
More information about the samba-technical
mailing list