The Samba-Bugzilla – Attachment 13191 Details for
Bug 12761
Uploading 32-bit drivers to a Samba 4.6 print server fail
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch for master
spoolss_fix_copy_from_directory_32bit.patch (text/plain), 7.26 KB, created by
Andreas Schneider
on 2017-05-05 09:15:07 UTC
(
hide
)
Description:
Proposed patch for master
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2017-05-05 09:15:07 UTC
Size:
7.26 KB
patch
obsolete
>From 03621fe99eab20a2e10d231f67db410868041ef3 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Thu, 4 May 2017 17:48:42 +0200 >Subject: [PATCH 1/3] s3:printing: Change to GUID dir if we deal with > COPY_FROM_DIRECTORY > >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > source3/printing/nt_printing.c | 32 +++++++++++++++++++++++++------- > 1 file changed, 25 insertions(+), 7 deletions(-) > >diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c >index 1bd6506..f083e21 100644 >--- a/source3/printing/nt_printing.c >+++ b/source3/printing/nt_printing.c >@@ -666,6 +666,7 @@ Determine the correct cVersion associated with an architecture and driver > static uint32_t get_correct_cversion(struct auth_session_info *session_info, > const char *architecture, > const char *driverpath_in, >+ const char *driver_directory, > WERROR *perr) > { > int cversion = -1; >@@ -676,6 +677,7 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info, > connection_struct *conn = NULL; > char *oldcwd; > char *printdollar = NULL; >+ char *working_dir = NULL; > int printdollar_snum; > > *perr = WERR_INVALID_PARAMETER; >@@ -704,12 +706,21 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info, > return -1; > } > >+ working_dir = lp_path(talloc_tos(), printdollar_snum); >+ if (driver_directory != NULL) { >+ working_dir = talloc_asprintf(talloc_tos(), "%s/%s/%s", >+ lp_path(talloc_tos(), >+ printdollar_snum), >+ architecture, >+ driver_directory); >+ } >+ > nt_status = create_conn_struct_cwd(talloc_tos(), > server_event_context(), > server_messaging_context(), > &conn, > printdollar_snum, >- lp_path(talloc_tos(), printdollar_snum), >+ working_dir, > session_info, &oldcwd); > if (!NT_STATUS_IS_OK(nt_status)) { > DEBUG(0,("get_correct_cversion: create_conn_struct " >@@ -733,10 +744,14 @@ static uint32_t get_correct_cversion(struct auth_session_info *session_info, > > /* Open the driver file (Portable Executable format) and determine the > * deriver the cversion. */ >- driverpath = talloc_asprintf(talloc_tos(), >- "%s/%s", >- architecture, >- driverpath_in); >+ if (driver_directory != NULL) { >+ driverpath = talloc_strdup(talloc_tos(), driverpath_in); >+ } else { >+ driverpath = talloc_asprintf(talloc_tos(), >+ "%s/%s", >+ architecture, >+ driverpath_in); >+ } > if (!driverpath) { > *perr = WERR_NOT_ENOUGH_MEMORY; > goto error_exit; >@@ -956,8 +971,11 @@ static WERROR clean_up_driver_struct_level(TALLOC_CTX *mem_ctx, > * NT2K: cversion=3 > */ > >- *version = get_correct_cversion(session_info, short_architecture, >- *driver_path, &err); >+ *version = get_correct_cversion(session_info, >+ short_architecture, >+ *driver_path, >+ *driver_directory, >+ &err); > if (*version == -1) { > return err; > } >-- >2.9.3 > > >From 9d0a1a7a71b3ce368a9b7cb2533214c7e0774646 Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Fri, 5 May 2017 11:11:25 +0200 >Subject: [PATCH 2/3] smbtorture:spoolss: Rename the copy_from_directory test > for 64bit > >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > source4/torture/rpc/spoolss.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > >diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c >index 67822a1..fce013d 100644 >--- a/source4/torture/rpc/spoolss.c >+++ b/source4/torture/rpc/spoolss.c >@@ -11137,7 +11137,8 @@ static bool test_multiple_drivers(struct torture_context *tctx, > } > > static bool test_driver_copy_from_directory(struct torture_context *tctx, >- struct dcerpc_pipe *p) >+ struct dcerpc_pipe *p, >+ const char *architecture) > { > struct torture_driver_context *d; > struct spoolss_StringArray *a; >@@ -11153,8 +11154,7 @@ static bool test_driver_copy_from_directory(struct torture_context *tctx, > d = talloc_zero(tctx, struct torture_driver_context); > torture_assert_not_null(tctx, d, "ENOMEM"); > >- d->local.environment = >- talloc_asprintf(d, SPOOLSS_ARCHITECTURE_x64); >+ d->local.environment = talloc_strdup(d, architecture); > torture_assert_not_null_goto(tctx, d->local.environment, ok, done, "ENOMEM"); > > d->local.driver_directory = >@@ -11236,6 +11236,12 @@ done: > return ok; > } > >+static bool test_driver_copy_from_directory_64(struct torture_context *tctx, >+ struct dcerpc_pipe *p) >+{ >+ return test_driver_copy_from_directory(tctx, p, SPOOLSS_ARCHITECTURE_x64); >+} >+ > static bool test_del_driver_all_files(struct torture_context *tctx, > struct dcerpc_pipe *p) > { >@@ -11433,8 +11439,8 @@ struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx) > torture_rpc_tcase_add_test(tcase, "multiple_drivers", test_multiple_drivers); > > torture_rpc_tcase_add_test(tcase, >- "test_driver_copy_from_directory", >- test_driver_copy_from_directory); >+ "test_driver_copy_from_directory_64", >+ test_driver_copy_from_directory_64); > > torture_rpc_tcase_add_test(tcase, "del_driver_all_files", test_del_driver_all_files); > >-- >2.9.3 > > >From 9bf3fa2af603d963b96901a7385ac6430c2e2b0a Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Fri, 5 May 2017 11:12:02 +0200 >Subject: [PATCH 3/3] smbtorture:spoolss: Add a 32bit test for > copy_from_directory > >Signed-off-by: Andreas Schneider <asn@samba.org> >--- > source4/torture/rpc/spoolss.c | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > >diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c >index fce013d..7ab7c60 100644 >--- a/source4/torture/rpc/spoolss.c >+++ b/source4/torture/rpc/spoolss.c >@@ -11157,8 +11157,13 @@ static bool test_driver_copy_from_directory(struct torture_context *tctx, > d->local.environment = talloc_strdup(d, architecture); > torture_assert_not_null_goto(tctx, d->local.environment, ok, done, "ENOMEM"); > >- d->local.driver_directory = >- talloc_asprintf(d, "/usr/share/cups/drivers/x64"); >+ if (strequal(architecture, SPOOLSS_ARCHITECTURE_x64)) { >+ d->local.driver_directory = >+ talloc_strdup(d, "/usr/share/cups/drivers/x64"); >+ } else { >+ d->local.driver_directory = >+ talloc_strdup(d, "/usr/share/cups/drivers/i386"); >+ } > torture_assert_not_null_goto(tctx, d->local.driver_directory, ok, done, "ENOMEM"); > > d->remote.driver_upload_directory = GUID_string2(d, &guid); >@@ -11242,6 +11247,12 @@ static bool test_driver_copy_from_directory_64(struct torture_context *tctx, > return test_driver_copy_from_directory(tctx, p, SPOOLSS_ARCHITECTURE_x64); > } > >+static bool test_driver_copy_from_directory_32(struct torture_context *tctx, >+ struct dcerpc_pipe *p) >+{ >+ return test_driver_copy_from_directory(tctx, p, SPOOLSS_ARCHITECTURE_NT_X86); >+} >+ > static bool test_del_driver_all_files(struct torture_context *tctx, > struct dcerpc_pipe *p) > { >@@ -11442,6 +11453,10 @@ struct torture_suite *torture_rpc_spoolss_driver(TALLOC_CTX *mem_ctx) > "test_driver_copy_from_directory_64", > test_driver_copy_from_directory_64); > >+ torture_rpc_tcase_add_test(tcase, >+ "test_driver_copy_from_directory_32", >+ test_driver_copy_from_directory_32); >+ > torture_rpc_tcase_add_test(tcase, "del_driver_all_files", test_del_driver_all_files); > > torture_rpc_tcase_add_test(tcase, "del_driver_unused_files", test_del_driver_unused_files); >-- >2.9.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12761
:
13177
|
13190
|
13191
|
13192
|
13193
|
13341