The branch, master has been updated
       via  53712fb s4-smbtorture: only run the cupsaddsmb adobe driver test 
against s3.
       via  c62509c s3-spoolss: Fix Bug #7641: handle win9x adddriver calls w/o 
config file.
       via  e722c66 s4-smbtorture: add torture test for cupsaddsmb win9x driver 
install behavior.
       via  7f2afe2 s4-smbtorture: make add-printerdriver test more robust 
against empty configfiles.
       via  118a797 s4-smbtorture: make driver upload/removal more robust 
against empty filenames.
      from  800a76d s3-oldtest: add WIN40 to print$ share.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 53712fbb4fa1988480467e73b3b1ea88f9584abb
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 29 17:59:31 2010 +0100

    s4-smbtorture: only run the cupsaddsmb adobe driver test against s3.
    
    Guenther
    
    Autobuild-User: Günther Deschner <g...@samba.org>
    Autobuild-Date: Mon Nov 29 18:47:17 CET 2010 on sn-devel-104

commit c62509c8f2589e7b952517626d61ee34b83e96b3
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 29 17:56:40 2010 +0100

    s3-spoolss: Fix Bug #7641: handle win9x adddriver calls w/o config file.
    
    This turned cupsaddsmb to run into an infinite loop.
    
    Guenther

commit e722c66b9884cfdd45d944969c582e897f64cd6d
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 29 17:50:05 2010 +0100

    s4-smbtorture: add torture test for cupsaddsmb win9x driver install 
behavior.
    
    Guenther

commit 7f2afe25e7552bf871b68278749742c54b729d76
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 29 17:48:42 2010 +0100

    s4-smbtorture: make add-printerdriver test more robust against empty 
configfiles.
    
    Guenther

commit 118a79719c220ef521088e41ff37aff9da1ad03a
Author: Günther Deschner <g...@samba.org>
Date:   Mon Nov 29 17:07:02 2010 +0100

    s4-smbtorture: make driver upload/removal more robust against empty 
filenames.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/printing/nt_printing.c |   10 ++++++-
 source4/torture/rpc/spoolss.c  |   50 +++++++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 8462c85..671aca6 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -761,7 +761,11 @@ static WERROR clean_up_driver_struct_level(TALLOC_CTX 
*mem_ctx,
        WERROR err;
        char *_p;
 
-       if (!*driver_path || !*data_file || !*config_file) {
+       if (!*driver_path || !*data_file) {
+               return WERR_INVALID_PARAM;
+       }
+
+       if (!strequal(architecture, SPOOLSS_ARCHITECTURE_4_0) && !*config_file) 
{
                return WERR_INVALID_PARAM;
        }
 
@@ -773,7 +777,9 @@ static WERROR clean_up_driver_struct_level(TALLOC_CTX 
*mem_ctx,
 
        strip_driver_path(mem_ctx, *driver_path);
        strip_driver_path(mem_ctx, *data_file);
-       strip_driver_path(mem_ctx, *config_file);
+       if (*config_file) {
+               strip_driver_path(mem_ctx, *config_file);
+       }
        if (help_file) {
                strip_driver_path(mem_ctx, *help_file);
        }
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 25b1275..dfd1c7e 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -47,6 +47,7 @@
 #define TORTURE_DRIVER_EX              "torture_driver_ex"
 #define TORTURE_DRIVER_ADOBE           "torture_driver_adobe"
 #define TORTURE_DRIVER_EX_ADOBE                "torture_driver_ex_adobe"
+#define TORTURE_DRIVER_ADOBE_CUPSADDSMB        
"torture_driver_adobe_cupsaddsmb"
 
 #define TOP_LEVEL_PRINT_KEY "SOFTWARE\\Microsoft\\Windows 
NT\\CurrentVersion\\Print"
 #define TOP_LEVEL_PRINT_PRINTERS_KEY TOP_LEVEL_PRINT_KEY "\\Printers"
@@ -8601,7 +8602,7 @@ static bool upload_printer_driver_file(struct 
torture_context *tctx,
        const char *local_name = talloc_asprintf(tctx, "%s/%s", 
d->local.driver_directory, file_name);
        const char *remote_name = talloc_asprintf(tctx, "%s\\%s", remote_dir, 
file_name);
 
-       if (!file_name) {
+       if (!file_name || strlen(file_name) == 0) {
                return true;
        }
 
@@ -8733,7 +8734,7 @@ static bool remove_printer_driver_file(struct 
torture_context *tctx,
        const char *remote_name;
        const char *remote_dir =  
driver_directory_dir(d->remote.driver_directory);
 
-       if (!file_name) {
+       if (!file_name || strlen(file_name) == 0) {
                return true;
        }
 
@@ -8857,7 +8858,9 @@ static bool test_add_driver_arg(struct torture_context 
*tctx,
 
        info8.driver_path       = talloc_asprintf(tctx, "%s\\%s", 
d->remote.driver_directory, d->info8.driver_path);
        info8.data_file         = talloc_asprintf(tctx, "%s\\%s", 
d->remote.driver_directory, d->info8.data_file);
-       info8.config_file       = talloc_asprintf(tctx, "%s\\%s", 
d->remote.driver_directory, d->info8.config_file);
+       if (d->info8.config_file) {
+               info8.config_file       = talloc_asprintf(tctx, "%s\\%s", 
d->remote.driver_directory, d->info8.config_file);
+       }
 
        for (i=0; i < ARRAY_SIZE(levels); i++) {
 
@@ -8994,6 +8997,45 @@ static bool test_add_driver_adobe(struct torture_context 
*tctx,
        return test_add_driver_arg(tctx, p, d);
 }
 
+static bool test_add_driver_adobe_cupsaddsmb(struct torture_context *tctx,
+                                            struct dcerpc_pipe *p)
+{
+       struct torture_driver_context *d;
+       struct spoolss_StringArray *a;
+
+       if (!torture_setting_bool(tctx, "samba3", false)) {
+               torture_skip(tctx, "skipping cupsaddsmb test which only works 
against samba3");
+       }
+
+       d = talloc_zero(tctx, struct torture_driver_context);
+
+       d->info8.version                = SPOOLSS_DRIVER_VERSION_9X;
+       d->info8.driver_name            = TORTURE_DRIVER_ADOBE_CUPSADDSMB;
+       d->info8.architecture           = NULL;
+       d->info8.driver_path            = talloc_strdup(d, "ADOBEPS4.DRV");
+       d->info8.data_file              = talloc_strdup(d, "DEFPRTR2.PPD");
+       d->info8.config_file            = NULL;
+       d->info8.help_file              = talloc_strdup(d, "ADOBEPS4.HLP");
+       d->info8.monitor_name           = talloc_strdup(d, "PSMON.DLL");
+       d->info8.default_datatype       = talloc_strdup(d, "RAW");
+
+       a                               = talloc_zero(d, struct 
spoolss_StringArray);
+       a->string                       = talloc_zero_array(a, const char *, 7);
+       a->string[0]                    = talloc_strdup(a->string, 
"ADOBEPS4.DRV");
+       a->string[1]                    = talloc_strdup(a->string, 
"DEFPRTR2.PPD");
+       a->string[2]                    = talloc_strdup(a->string, 
"ADOBEPS4.HLP");
+       a->string[3]                    = talloc_strdup(a->string, "PSMON.DLL");
+       a->string[4]                    = talloc_strdup(a->string, 
"ADFONTS.MFM");
+       a->string[5]                    = talloc_strdup(a->string, 
"ICONLIB.DLL");
+
+       d->info8.dependent_files        = a;
+       d->local.environment            = talloc_strdup(d, "Windows 4.0");
+       d->local.driver_directory       = talloc_strdup(d, 
"/usr/share/cups/drivers/adobe/");
+       d->ex                           = false;
+
+       return test_add_driver_arg(tctx, p, d);
+}
+
 struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx)
 {
        struct torture_suite *suite = torture_suite_create(mem_ctx, 
"SPOOLSS-DRIVER");
@@ -9008,5 +9050,7 @@ struct torture_suite 
*torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx)
 
        torture_rpc_tcase_add_test(tcase, "add_driver_adobe", 
test_add_driver_adobe);
 
+       torture_rpc_tcase_add_test(tcase, "add_driver_adobe_cupsaddsmb", 
test_add_driver_adobe_cupsaddsmb);
+
        return suite;
 }


-- 
Samba Shared Repository

Reply via email to