[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha7-2153-g6dd1f99
Günther Deschner
gd at samba.org
Mon Jun 8 19:25:01 GMT 2009
The branch, master has been updated
via 6dd1f99ec09aff71f04d103554e848e0ddcf0cb7 (commit)
via d11d4382b965b72532dcb797089a614aa774af7e (commit)
from 094f47e7cf88b411eb4f1cbce0e52665c4a7cec6 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6dd1f99ec09aff71f04d103554e848e0ddcf0cb7
Author: Günther Deschner <gd at samba.org>
Date: Wed May 13 15:35:55 2009 +0200
s3-spoolss: add server-support for queries for the "all" architecture in printdriver enum calls.
Guenther
commit d11d4382b965b72532dcb797089a614aa774af7e
Author: Günther Deschner <gd at samba.org>
Date: Wed May 13 15:35:25 2009 +0200
s4-smbtorture: also test for "all" architecture in enum driver tests in RPC-SPOOLSS.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source3/rpc_server/srv_spoolss_nt.c | 74 +++++++++++++++++++++++++++++++---
source4/torture/rpc/spoolss.c | 33 +++++++++++++--
2 files changed, 95 insertions(+), 12 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 8280011..f710994 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6708,16 +6708,28 @@ WERROR _spoolss_SetJob(pipes_struct *p,
return errcode;
}
+static const struct print_architecture_table_node archi_table[]= {
+
+ {"Windows 4.0", SPL_ARCH_WIN40, 0 },
+ {"Windows NT x86", SPL_ARCH_W32X86, 2 },
+ {"Windows NT R4000", SPL_ARCH_W32MIPS, 2 },
+ {"Windows NT Alpha_AXP", SPL_ARCH_W32ALPHA, 2 },
+ {"Windows NT PowerPC", SPL_ARCH_W32PPC, 2 },
+ {"Windows IA64", SPL_ARCH_IA64, 3 },
+ {"Windows x64", SPL_ARCH_X64, 3 },
+ {NULL, "", -1 }
+};
+
/****************************************************************************
- Enumerates all printer drivers by level.
+ Enumerates all printer drivers by level and architecture.
****************************************************************************/
-static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
- const char *servername,
- const char *architecture,
- uint32_t level,
- union spoolss_DriverInfo **info_p,
- uint32_t *count_p)
+static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx,
+ const char *servername,
+ const char *architecture,
+ uint32_t level,
+ union spoolss_DriverInfo **info_p,
+ uint32_t *count_p)
{
int i;
int ndrivers;
@@ -6820,6 +6832,54 @@ static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
}
/****************************************************************************
+ Enumerates all printer drivers by level.
+****************************************************************************/
+
+static WERROR enumprinterdrivers_level(TALLOC_CTX *mem_ctx,
+ const char *servername,
+ const char *architecture,
+ uint32_t level,
+ union spoolss_DriverInfo **info_p,
+ uint32_t *count_p)
+{
+ uint32_t a,i;
+ WERROR result = WERR_OK;
+
+ if (strequal(architecture, "all")) {
+
+ for (a=0; archi_table[a].long_archi != NULL; a++) {
+
+ union spoolss_DriverInfo *info = NULL;
+ uint32_t count = 0;
+
+ result = enumprinterdrivers_level_by_architecture(mem_ctx,
+ servername,
+ archi_table[a].long_archi,
+ level,
+ &info,
+ &count);
+ if (!W_ERROR_IS_OK(result)) {
+ continue;
+ }
+
+ for (i=0; i < count; i++) {
+ ADD_TO_ARRAY(mem_ctx, union spoolss_DriverInfo,
+ info[i], info_p, count_p);
+ }
+ }
+
+ return result;
+ }
+
+ return enumprinterdrivers_level_by_architecture(mem_ctx,
+ servername,
+ architecture,
+ level,
+ info_p,
+ count_p);
+}
+
+/****************************************************************************
Enumerates all printer drivers at level 1.
****************************************************************************/
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index bfe6672..4640494 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -304,9 +304,14 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
NTSTATUS status;
struct spoolss_EnumPrinterDrivers r;
uint16_t levels[] = { 1, 2, 3, 4, 5, 6 };
- int i, j;
+ int i, j, a;
+ const char *architectures[] = {
+ SPOOLSS_ARCHITECTURE_NT_X86,
+ SPOOLSS_ARCHITECTURE_ALL
+ };
for (i=0;i<ARRAY_SIZE(levels);i++) {
+ for (a=0;a<ARRAY_SIZE(architectures);a++) {
int level = levels[i];
DATA_BLOB blob;
uint32_t needed;
@@ -318,7 +323,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
* server */
r.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.environment = SPOOLSS_ARCHITECTURE_NT_X86;
+ r.in.environment = architectures[a];
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
@@ -326,7 +331,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
r.out.count = &count;
r.out.info = &info;
- torture_comment(tctx, "Testing EnumPrinterDrivers level %u\n", r.in.level);
+ torture_comment(tctx, "Testing EnumPrinterDrivers level %u (%s)\n", r.in.level, r.in.environment);
status = dcerpc_spoolss_EnumPrinterDrivers(p, ctx, &r);
torture_assert_ntstatus_ok(tctx, status,
@@ -347,19 +352,37 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx,
torture_assert_werr_ok(tctx, r.out.result, "EnumPrinterDrivers failed");
+ /* don't do cross-architecture comparison */
+ if (strequal(r.in.environment, SPOOLSS_ARCHITECTURE_ALL)) {
+ continue;
+ }
+
ctx->driver_count[level] = count;
ctx->drivers[level] = info;
}
+ }
for (i=1;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
int old_level = levels[i-1];
+
+ /* don't do cross-architecture comparison */
+ if (strequal(r.in.environment, SPOOLSS_ARCHITECTURE_ALL)) {
+ continue;
+ }
+
torture_assert_int_equal(tctx, ctx->driver_count[level], ctx->driver_count[old_level],
"EnumPrinterDrivers invalid value");
}
for (i=0;i<ARRAY_SIZE(levels);i++) {
int level = levels[i];
+
+ /* don't do cross-architecture comparison */
+ if (strequal(r.in.environment, SPOOLSS_ARCHITECTURE_ALL)) {
+ continue;
+ }
+
for (j=0;j<ctx->driver_count[level];j++) {
union spoolss_DriverInfo *cur = &ctx->drivers[level][j];
union spoolss_DriverInfo *ref = &ctx->drivers[6][j];
@@ -513,7 +536,7 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx,
union spoolss_PrintProcessorInfo *info;
r.in.servername = "";
- r.in.environment = "Windows NT x86";
+ r.in.environment = SPOOLSS_ARCHITECTURE_NT_X86;
r.in.level = level;
r.in.buffer = NULL;
r.in.offered = 0;
@@ -1965,7 +1988,7 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx,
union spoolss_DriverInfo *info;
r.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.environment = "Windows NT x86";
+ r.in.environment = SPOOLSS_ARCHITECTURE_NT_X86;
r.in.level = levels[i];
r.in.buffer = NULL;
r.in.offered = 0;
--
Samba Shared Repository
More information about the samba-cvs
mailing list