[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Tue Apr 27 08:42:45 MDT 2010
The branch, master has been updated
via a2b8e28... s4-smbtorture: upload the full cups driver, otherwise windows will not allow using it.
via f44cec7... s4-smbtorture: only compare level 3 for s3 when checking winreg and spoolss_Driver.
via a0fd53e... s4-smbtorture: mention architecture of added drivers in debug output.
via b40d281... s4-smbtorture: make sure to not attempt to remove a driver file twice.
via ad80131... s4-smbtorture: setup all members of level 3,4,6,8 driver add.
via fc3e959... s4-smbtorture: use a torture_printer_context and upload own driver for RPC-SPOOLSS-PRINTER test.
via 12cf6dc... s4-smbtorture: split RPC-SPOOLSS-PRINTER into more tests.
via b062cac... s4-smbtorture: finally test REG_MULTI_SZ in winreg/driverinfo consistency tests.
via 6864828... s3: use shared registry functions.
via a833be0... s4: use shared registry functions.
via ee1b8e5... registry: add some shared registry helper functions.
via c2c5672... s4-smbtorture: remove some typecasts in rap tests.
from 91bb489... s4-netlogon: fixed getDcNameEx2 for blank inputs
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit a2b8e28aef1799cac45809bfe38c9b0980aef68f
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 15:56:09 2010 +0200
s4-smbtorture: upload the full cups driver, otherwise windows will not allow using it.
Guenther
commit f44cec7b60f3b6449fe2844a1600438b7b13682c
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 15:48:03 2010 +0200
s4-smbtorture: only compare level 3 for s3 when checking winreg and spoolss_Driver.
Guenther
commit a0fd53e388466c4866f96d2ca728eec28181e42f
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 14:13:12 2010 +0200
s4-smbtorture: mention architecture of added drivers in debug output.
Guenther
commit b40d2815cd3495b66ed2b469e3495baf1a7a6256
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 15:48:52 2010 +0200
s4-smbtorture: make sure to not attempt to remove a driver file twice.
Guenther
commit ad80131bb176b17fda15e9a76f3934913829a0bb
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 13:15:04 2010 +0200
s4-smbtorture: setup all members of level 3,4,6,8 driver add.
Guenther
commit fc3e9595060db116cd6661baa311ba6fe992162a
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 11:30:35 2010 +0200
s4-smbtorture: use a torture_printer_context and upload own driver for RPC-SPOOLSS-PRINTER test.
Guenther
commit 12cf6dc8ee649e5888dd7210bd279931fa2ff4e0
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 10:38:36 2010 +0200
s4-smbtorture: split RPC-SPOOLSS-PRINTER into more tests.
Guenther
commit b062cac6c4b15569ae42dc7e4fea9ee709fce337
Author: Günther Deschner <gd at samba.org>
Date: Mon Apr 26 23:35:19 2010 +0200
s4-smbtorture: finally test REG_MULTI_SZ in winreg/driverinfo consistency tests.
Guenther
commit 6864828d9d85dacff0ca9df73761a98d2ceb9f2e
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 16:38:40 2010 +0200
s3: use shared registry functions.
Guenther
commit a833be0c4e44135e4f45b3d460586762da04cf32
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 16:37:56 2010 +0200
s4: use shared registry functions.
Guenther
commit ee1b8e5edeecd5a6a3526e88265a5ad28522a45d
Author: Günther Deschner <gd at samba.org>
Date: Tue Apr 27 16:37:06 2010 +0200
registry: add some shared registry helper functions.
Guenther
commit c2c56722b5588206fefaa0fdfa1ea9a8b557750d
Author: Günther Deschner <gd at samba.org>
Date: Mon Apr 26 23:21:07 2010 +0200
s4-smbtorture: remove some typecasts in rap tests.
Guenther
-----------------------------------------------------------------------
Summary of changes:
{source3/lib => libcli/registry}/util_reg.c | 98 +++---
source3/Makefile.in | 2 +-
source3/include/proto.h | 4 +-
source3/libgpo/gpo_reg.c | 4 +-
source3/utils/net_registry.c | 2 +-
source3/utils/net_registry_util.c | 2 +-
source3/utils/net_rpc_registry.c | 2 +-
source4/lib/registry/config.mk | 3 +-
source4/lib/registry/registry.h | 9 +
source4/lib/registry/util.c | 48 +---
source4/lib/registry/wscript_build | 2 +-
source4/torture/rap/rap.c | 14 +-
source4/torture/rpc/spoolss.c | 476 ++++++++++++++++++++-------
13 files changed, 427 insertions(+), 239 deletions(-)
rename {source3/lib => libcli/registry}/util_reg.c (71%)
Changeset truncated at 500 lines:
diff --git a/source3/lib/util_reg.c b/libcli/registry/util_reg.c
similarity index 71%
rename from source3/lib/util_reg.c
rename to libcli/registry/util_reg.c
index c5528e4..6ab2be0 100644
--- a/source3/lib/util_reg.c
+++ b/libcli/registry/util_reg.c
@@ -2,75 +2,73 @@
* Unix SMB/CIFS implementation.
* Registry helper routines
* Copyright (C) Volker Lendecke 2006
- *
+ * Copyright (C) Guenther Deschner 2009
+ * Copyright (C) Jelmer Vernooij 2003-2007
+ *
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with
* this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
-#include "../librpc/gen_ndr/ndr_winreg.h"
+#include "../librpc/gen_ndr/ndr_misc.h"
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_REGISTRY
+/**
+ * @file
+ * @brief Registry utility functions
+ */
+
+static const struct {
+ uint32_t id;
+ const char *name;
+} reg_value_types[] = {
+ { REG_NONE, "REG_NONE" },
+ { REG_SZ, "REG_SZ" },
+ { REG_EXPAND_SZ, "REG_EXPAND_SZ" },
+ { REG_BINARY, "REG_BINARY" },
+ { REG_DWORD, "REG_DWORD" },
+ { REG_DWORD_BIG_ENDIAN, "REG_DWORD_BIG_ENDIAN" },
+ { REG_LINK, "REG_LINK" },
+ { REG_MULTI_SZ, "REG_MULTI_SZ" },
+ { REG_RESOURCE_LIST, "REG_RESOURCE_LIST" },
+ { REG_FULL_RESOURCE_DESCRIPTOR, "REG_FULL_RESOURCE_DESCRIPTOR" },
+ { REG_RESOURCE_REQUIREMENTS_LIST, "REG_RESOURCE_REQUIREMENTS_LIST" },
+ { REG_QWORD, "REG_QWORD" },
+
+ { 0, NULL }
+};
+
+/** Return string description of registry value type */
+_PUBLIC_ const char *str_regtype(int type)
+{
+ unsigned int i;
+ for (i = 0; reg_value_types[i].name; i++) {
+ if (reg_value_types[i].id == type)
+ return reg_value_types[i].name;
+ }
-extern struct registry_ops smbconf_reg_ops;
+ return "Unknown";
+}
-const char *reg_type_lookup(enum winreg_Type type)
+/** Return registry value type for string description */
+_PUBLIC_ int regtype_by_string(const char *str)
{
- const char *result;
-
- switch(type) {
- case REG_NONE:
- result = "REG_NONE";
- break;
- case REG_SZ:
- result = "REG_SZ";
- break;
- case REG_EXPAND_SZ:
- result = "REG_EXPAND_SZ";
- break;
- case REG_BINARY:
- result = "REG_BINARY";
- break;
- case REG_DWORD:
- result = "REG_DWORD";
- break;
- case REG_DWORD_BIG_ENDIAN:
- result = "REG_DWORD_BIG_ENDIAN";
- break;
- case REG_LINK:
- result = "REG_LINK";
- break;
- case REG_MULTI_SZ:
- result = "REG_MULTI_SZ";
- break;
- case REG_RESOURCE_LIST:
- result = "REG_RESOURCE_LIST";
- break;
- case REG_FULL_RESOURCE_DESCRIPTOR:
- result = "REG_FULL_RESOURCE_DESCRIPTOR";
- break;
- case REG_RESOURCE_REQUIREMENTS_LIST:
- result = "REG_RESOURCE_REQUIREMENTS_LIST";
- break;
- case REG_QWORD:
- result = "REG_QWORD";
- break;
- default:
- result = "REG TYPE IS UNKNOWN";
- break;
+ unsigned int i;
+ for (i = 0; reg_value_types[i].name; i++) {
+ if (strequal(reg_value_types[i].name, str))
+ return reg_value_types[i].id;
}
- return result;
+
+ return -1;
}
/*******************************************************************
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 5551ee4..4721463 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -561,7 +561,7 @@ LIBMSRPC_GEN_OBJ = ../librpc/gen_ndr/cli_lsa.o \
#
# registry-related objects
#
-UTIL_REG_OBJ = lib/util_reg.o
+UTIL_REG_OBJ = ../libcli/registry/util_reg.o
UTIL_REG_API_OBJ = lib/util_reg_api.o
REG_INIT_BASIC_OBJ = registry/reg_init_basic.o
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ff4a04b..09c2c02 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1290,9 +1290,9 @@ void flush_pwnam_cache(void);
struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name);
struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) ;
-/* The following definitions come from lib/util_reg.c */
+/* The following definitions come from ..libcli/registry/util_reg.c */
-const char *reg_type_lookup(enum winreg_Type type);
+const char *str_regtype(int type);
bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
DATA_BLOB *blob, const char *s);
bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
diff --git a/source3/libgpo/gpo_reg.c b/source3/libgpo/gpo_reg.c
index 9367bca..0c26dbe 100644
--- a/source3/libgpo/gpo_reg.c
+++ b/source3/libgpo/gpo_reg.c
@@ -787,7 +787,7 @@ void dump_reg_val(int lvl, const char *direction,
return;
}
- type_str = reg_type_lookup(val->type);
+ type_str = str_regtype(val->type);
DEBUG(lvl,("\tdump_reg_val:\t%s '%s'\n\t\t\t'%s' %s: ",
direction, key, subkey, type_str));
@@ -933,7 +933,7 @@ WERROR reg_apply_registry_entry(TALLOC_CTX *mem_ctx,
if (flags & GPO_INFO_FLAG_VERBOSE) {
printf("about to store key: [%s]\n", entry->key);
printf(" value: [%s]\n", entry->value);
- printf(" data: [%s]\n", reg_type_lookup(entry->data->type));
+ printf(" data: [%s]\n", str_regtype(entry->data->type));
printf(" action: [%s]\n", gp_reg_action_str(entry->action));
}
diff --git a/source3/utils/net_registry.c b/source3/utils/net_registry.c
index 3b55c14..ae9cdde 100644
--- a/source3/utils/net_registry.c
+++ b/source3/utils/net_registry.c
@@ -418,7 +418,7 @@ static void net_registry_increment_fn(void *private_data)
if (value->type != REG_DWORD) {
d_fprintf(stderr, _("value not a DWORD: %s\n"),
- reg_type_lookup(value->type));
+ str_regtype(value->type));
goto done;
}
diff --git a/source3/utils/net_registry_util.c b/source3/utils/net_registry_util.c
index 3d1919c..0b0f617 100644
--- a/source3/utils/net_registry_util.c
+++ b/source3/utils/net_registry_util.c
@@ -37,7 +37,7 @@ void print_registry_value(const struct registry_value *valvalue, bool raw)
{
if (!raw) {
d_printf(_("Type = %s\n"),
- reg_type_lookup(valvalue->type));
+ str_regtype(valvalue->type));
}
switch(valvalue->type) {
case REG_DWORD:
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index 28a1c8d..2400af4 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -955,7 +955,7 @@ static void dump_values( REGF_NK_REC *nk )
for ( i=0; i<nk->num_values; i++ ) {
d_printf( "\"%s\" = ", nk->values[i].valuename ? nk->values[i].valuename : "(default)" );
- d_printf( "(%s) ", reg_type_lookup( nk->values[i].type ) );
+ d_printf( "(%s) ", str_regtype( nk->values[i].type ) );
data_size = nk->values[i].data_size & ~VK_DATA_IN_OFFSET;
switch ( nk->values[i].type ) {
diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk
index adf26b2..9ff917f 100644
--- a/source4/lib/registry/config.mk
+++ b/source4/lib/registry/config.mk
@@ -30,7 +30,8 @@ registry_SOVERSION = 0
registry_OBJ_FILES = $(addprefix $(libregistrysrcdir)/, interface.o util.o samba.o \
patchfile_dotreg.o patchfile_preg.o patchfile.o regf.o \
- hive.o local.o ldb.o dir.o rpc.o)
+ hive.o local.o ldb.o dir.o rpc.o) \
+ ../libcli/registry/util_reg.o
PUBLIC_HEADERS += $(libregistrysrcdir)/registry.h
diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index 3ac50d5..e43b0b0 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -453,6 +453,15 @@ WERROR reg_create_key(TALLOC_CTX *mem_ctx,
/* Utility functions */
const char *str_regtype(int type);
+bool push_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+ DATA_BLOB *blob, const char *s);
+bool push_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+ DATA_BLOB *blob, const char **a);
+bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+ const DATA_BLOB *blob, const char **s);
+bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic,
+ const DATA_BLOB *blob, const char ***a);
+int regtype_by_string(const char *str);
char *reg_val_data_string(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t type, const DATA_BLOB data);
char *reg_val_description(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const char *name,
uint32_t type, const DATA_BLOB data);
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c
index 0620748..62a94df 100644
--- a/source4/lib/registry/util.c
+++ b/source4/lib/registry/util.c
@@ -21,43 +21,6 @@
#include "lib/registry/registry.h"
#include "librpc/gen_ndr/winreg.h"
-/**
- * @file
- * @brief Registry utility functions
- */
-
-static const struct {
- uint32_t id;
- const char *name;
-} reg_value_types[] = {
- { REG_NONE, "REG_NONE" },
- { REG_SZ, "REG_SZ" },
- { REG_EXPAND_SZ, "REG_EXPAND_SZ" },
- { REG_BINARY, "REG_BINARY" },
- { REG_DWORD, "REG_DWORD" },
- { REG_DWORD_BIG_ENDIAN, "REG_DWORD_BIG_ENDIAN" },
- { REG_LINK, "REG_LINK" },
- { REG_MULTI_SZ, "REG_MULTI_SZ" },
- { REG_RESOURCE_LIST, "REG_RESOURCE_LIST" },
- { REG_FULL_RESOURCE_DESCRIPTOR, "REG_FULL_RESOURCE_DESCRIPTOR" },
- { REG_RESOURCE_REQUIREMENTS_LIST, "REG_RESOURCE_REQUIREMENTS_LIST" },
- { REG_QWORD, "REG_QWORD" },
-
- { 0, NULL }
-};
-
-/** Return string description of registry value type */
-_PUBLIC_ const char *str_regtype(int type)
-{
- unsigned int i;
- for (i = 0; reg_value_types[i].name; i++) {
- if (reg_value_types[i].id == type)
- return reg_value_types[i].name;
- }
-
- return "Unknown";
-}
-
_PUBLIC_ char *reg_val_data_string(TALLOC_CTX *mem_ctx,
struct smb_iconv_convenience *iconv_convenience,
uint32_t type,
@@ -126,16 +89,7 @@ _PUBLIC_ bool reg_string_to_val(TALLOC_CTX *mem_ctx,
const char *data_str, uint32_t *type,
DATA_BLOB *data)
{
- unsigned int i;
- *type = -1;
-
- /* Find the correct type */
- for (i = 0; reg_value_types[i].name; i++) {
- if (!strcmp(reg_value_types[i].name, type_str)) {
- *type = reg_value_types[i].id;
- break;
- }
- }
+ *type = regtype_by_string(type_str);
if (*type == -1)
return false;
diff --git a/source4/lib/registry/wscript_build b/source4/lib/registry/wscript_build
index 1b34f79..2e07757 100644
--- a/source4/lib/registry/wscript_build
+++ b/source4/lib/registry/wscript_build
@@ -11,7 +11,7 @@ bld.SAMBA_SUBSYSTEM('TDR_REGF',
bld.SAMBA_LIBRARY('registry',
- source='interface.c util.c samba.c patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c dir.c rpc.c',
+ source='interface.c ../libcli/registry/util_reg.c util.c samba.c patchfile_dotreg.c patchfile_preg.c patchfile.c regf.c hive.c local.c ldb.c dir.c rpc.c',
pc_files='registry.pc',
public_deps='LIBSAMBA-UTIL CHARSET TDR_REGF ldb RPC_NDR_WINREG LDB_WRAP',
public_headers='registry.h',
diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 57d27ed..bddface 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -291,13 +291,13 @@ static NTSTATUS smbcli_rap_netshareenum(struct smbcli_tree *tree,
switch(r->in.level) {
case 0:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info[i].info0.share_name, 13));
+ r->out.info[i].info0.share_name, 13));
break;
case 1:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info[i].info1.share_name, 13));
+ r->out.info[i].info1.share_name, 13));
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)&r->out.info[i].info1.reserved1, 1));
+ &r->out.info[i].info1.reserved1, 1));
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_data,
NDR_SCALARS, &r->out.info[i].info1.share_type));
RAP_GOTO(rap_pull_string(mem_ctx, call->ndr_pull_data,
@@ -387,11 +387,11 @@ static NTSTATUS smbcli_rap_netserverenum2(struct smbcli_tree *tree,
switch(r->in.level) {
case 0:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info[i].info0.name, 16));
+ r->out.info[i].info0.name, 16));
break;
case 1:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info[i].info1.name, 16));
+ r->out.info[i].info1.name, 16));
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
&r->out.info[i].info1.version_major, 1));
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
@@ -482,11 +482,11 @@ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree *tree,
switch(r->in.level) {
case 0:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info.info0.name, 16));
+ r->out.info.info0.name, 16));
break;
case 1:
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
- (uint8_t *)r->out.info.info1.name, 16));
+ r->out.info.info1.name, 16));
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
&r->out.info.info1.version_major, 1));
NDR_GOTO(ndr_pull_bytes(call->ndr_pull_data,
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 3cf1a93..a0adff3 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -90,6 +90,31 @@ struct torture_driver_context {
bool ex;
};
+struct torture_printer_context {
+ struct spoolss_SetPrinterInfo2 info2;
+ struct torture_driver_context driver;
+ bool ex;
+ bool wellknown;
+ bool added_driver;
+ bool have_driver;
+};
+
+static bool upload_printer_driver(struct torture_context *tctx,
+ const char *server_name,
+ struct torture_driver_context *d);
+static bool remove_printer_driver(struct torture_context *tctx,
+ const char *server_name,
+ struct torture_driver_context *d);
+static bool fillup_printserver_info(struct torture_context *tctx,
+ struct dcerpc_pipe *p,
+ struct torture_driver_context *d);
+static bool test_AddPrinterDriver_args_level_3(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b,
+ const char *server_name,
+ struct spoolss_AddDriverInfo8 *r,
+ uint32_t flags,
+ bool ex);
+
#define COMPARE_STRING(tctx, c,r,e) \
torture_assert_str_equal(tctx, c.e, r.e, "invalid value")
@@ -4162,6 +4187,30 @@ do {\
"sd unequal");\
} while(0);
+#define test_multi_sz(wname, iname) \
+do {\
+ DATA_BLOB blob;\
+ const char **array;\
+ enum winreg_Type w_type;\
+ uint32_t w_size;\
+ uint32_t w_length;\
+ uint8_t *w_data;\
+ int i;\
+ torture_assert(tctx,\
+ test_winreg_QueryValue(tctx, winreg_handle, &key_handle, wname,\
+ &w_type, &w_size, &w_length, &w_data),\
+ "failed to query winreg");\
+ torture_assert_int_equal(tctx, w_type, REG_MULTI_SZ, "unexpected type");\
+ blob = data_blob(w_data, w_size);\
+ torture_assert(tctx, \
+ pull_reg_multi_sz(tctx, lp_iconv_convenience(tctx->lp_ctx), &blob, &array),\
+ "failed to pull multi sz");\
+ for (i=0; array[i] != NULL; i++) {\
+ torture_assert_str_equal(tctx, array[i], iname[i],\
+ talloc_asprintf(tctx, "%s - %s mismatch", #wname, iname[i]));\
+ }\
+} while(0);
+
if (!test_winreg_symbolic_link(tctx, winreg_handle, hive_handle,
TOP_LEVEL_CONTROL_PRINTERS_KEY,
@@ -4243,6 +4292,21 @@ static const char *strip_path(const char *path)
return path;
}
+static const char **strip_paths(const char **path_array)
+{
+ int i;
+
+ if (path_array == NULL) {
+ return NULL;
+ }
+
+ for (i=0; path_array[i] != NULL; i++) {
+ path_array[i] = strip_path(path_array[i]);
+ }
+
+ return path_array;
+}
+
static const char *driver_winreg_date(TALLOC_CTX *mem_ctx, NTTIME nt)
{
time_t t;
@@ -4301,6 +4365,10 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx,
test_winreg_OpenKey(tctx, winreg_handle, hive_handle, driver_key, &key_handle),
"failed to open driver key");
+ if (torture_setting_bool(tctx, "samba3", false)) {
+ goto try_level3;
+ }
+
torture_assert(tctx,
test_GetPrinterDriver2_level(tctx, b, handle, driver_name, environment, 8, 3, 0, &info, &result),
"failed to get driver info level 8");
@@ -4313,7 +4381,7 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx,
data_file = strip_path(info.info8.data_file);
config_file = strip_path(info.info8.config_file);
help_file = strip_path(info.info8.help_file);
-/* dependent_files = strip_paths(info.info8.dependent_files); */
+ dependent_files = strip_paths(info.info8.dependent_files);
driver_date = driver_winreg_date(tctx, info.info8.driver_date);
inbox_driver_date = driver_winreg_date(tctx, info.info8.min_inbox_driver_ver_date);
@@ -4338,12 +4406,10 @@ static bool test_GetDriverInfo_winreg(struct torture_context *tctx,
test_sz("Print Processor", info.info8.print_processor);
test_sz("Provider", info.info8.provider);
test_sz("VendorSetup", info.info8.vendor_setup);
-#if 0
test_multi_sz("ColorProfiles", info.info8.color_profiles);
test_multi_sz("Dependent Files", dependent_files);
--
Samba Shared Repository
More information about the samba-cvs
mailing list