The branch, master has been updated
       via  addabf1 torture: test printing using "XPS_PASS" datatype
       via  b2815b4 spoolss: accept XPS_PASS datatype used by Windows 8
      from  979d9db replace: Fix developer build on BSD.

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


- Log -----------------------------------------------------------------
commit addabf151377c8c0ab75fb591bc85d8ea5c8acfa
Author: Arvid Requate <[email protected]>
Date:   Thu Nov 21 12:40:15 2013 +0100

    torture: test printing using "XPS_PASS" datatype
    
    The "XPS_PASS" datatype is used by Windows 8.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10267
    
    Reviewed-by: David Disseldorp <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>
    
    Autobuild-User(master): Andreas Schneider <[email protected]>
    Autobuild-Date(master): Thu Nov 21 15:01:30 CET 2013 on sn-devel-104

commit b2815b4c8c3e436a79fb7f07be285a417fd6e8cb
Author: Arvid Requate <[email protected]>
Date:   Thu Nov 21 12:35:20 2013 +0100

    spoolss: accept XPS_PASS datatype used by Windows 8
    
    The new v4 driver model used in Windows 8 declares print jobs
    intended to bypass the XPS processing layer by setting datatype to
    "XPS_PASS" instead of "RAW".
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=10267
    
    Reviewed-by: David Disseldorp <[email protected]>
    Reviewed-by: Andreas Schneider <[email protected]>

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

Summary of changes:
 source3/rpc_server/spoolss/srv_spoolss_nt.c |    8 +++++-
 source4/torture/rpc/spoolss.c               |   33 ++++++++++++++++++++++++--
 2 files changed, 37 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c 
b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 7154cb4..150b6ca 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -5802,7 +5802,13 @@ WERROR _spoolss_StartDocPrinter(struct pipes_struct *p,
         */
 
        if (info_1->datatype) {
-               if (strcmp(info_1->datatype, "RAW") != 0) {
+               /*
+                * The v4 driver model used in Windows 8 declares print jobs
+                * intended to bypass the XPS processing layer by setting
+                * datatype to "XPS_PASS" instead of "RAW".
+                */
+                if ((strcmp(info_1->datatype, "RAW") != 0)
+                 && (strcmp(info_1->datatype, "XPS_PASS") != 0)) {
                        *r->out.job_id = 0;
                        return WERR_INVALID_DATATYPE;
                }
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index f2a44c9..d216e07 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -3368,11 +3368,11 @@ static bool test_JobPropertyDelete(struct 
torture_context *tctx,
        return true;
 }
 
-
-static bool test_DoPrintTest_add_one_job(struct torture_context *tctx,
+static bool test_DoPrintTest_add_one_job_common(struct torture_context *tctx,
                                         struct dcerpc_binding_handle *b,
                                         struct policy_handle *handle,
                                         const char *document_name,
+                                        const char *datatype,
                                         uint32_t *job_id)
 {
        NTSTATUS status;
@@ -3394,7 +3394,7 @@ static bool test_DoPrintTest_add_one_job(struct 
torture_context *tctx,
 
        info1.document_name     = document_name;
        info1.output_file       = NULL;
-       info1.datatype          = "RAW";
+       info1.datatype          = datatype;
 
        info_ctr.level          = 1;
        info_ctr.info.info1     = &info1;
@@ -3443,6 +3443,25 @@ static bool test_DoPrintTest_add_one_job(struct 
torture_context *tctx,
        return true;
 }
 
+static bool test_DoPrintTest_add_one_job(struct torture_context *tctx,
+                                        struct dcerpc_binding_handle *b,
+                                        struct policy_handle *handle,
+                                        const char *document_name,
+                                        uint32_t *job_id)
+{
+       test_DoPrintTest_add_one_job_common(tctx, b, handle, document_name, 
"RAW", job_id);
+}
+
+static bool test_DoPrintTest_add_one_job_v4(struct torture_context *tctx,
+                                        struct dcerpc_binding_handle *b,
+                                        struct policy_handle *handle,
+                                        const char *document_name,
+                                        uint32_t *job_id)
+{
+       test_DoPrintTest_add_one_job_common(tctx, b, handle, document_name, 
"XPS_PASS", job_id);
+}
+
+
 static bool test_DoPrintTest_check_jobs(struct torture_context *tctx,
                                        struct dcerpc_binding_handle *b,
                                        struct policy_handle *handle,
@@ -3545,6 +3564,14 @@ static bool test_DoPrintTest(struct torture_context 
*tctx,
                ret &= test_SetJob(tctx, b, handle, job_ids[i], NULL, 
SPOOLSS_JOB_CONTROL_DELETE);
        }
 
+       for (i=0; i < num_jobs; i++) {
+               ret &= test_DoPrintTest_add_one_job_v4(tctx, b, handle, 
"TorturePrintJob v4", &job_ids[i]);
+       }
+
+       for (i=0; i < num_jobs; i++) {
+               ret &= test_SetJob(tctx, b, handle, job_ids[i], NULL, 
SPOOLSS_JOB_CONTROL_DELETE);
+       }
+
        if (ret == true) {
                torture_comment(tctx, "real print operations test 
succeeded\n\n");
        }


-- 
Samba Shared Repository

Reply via email to