The Samba-Bugzilla – Attachment 6267 Details for
Bug 7567
printing from Windows 7 fails with 0x000003e6 (in AD w2k8r2 controlled domain)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rebased patch for 3.5.6
samba-3.5.6-win7print.patch (text/plain), 6.61 KB, created by
Orion Poplawski
on 2011-02-23 10:28:54 UTC
(
hide
)
Description:
Rebased patch for 3.5.6
Filename:
MIME Type:
Creator:
Orion Poplawski
Created:
2011-02-23 10:28:54 UTC
Size:
6.61 KB
patch
obsolete
>diff -up samba-3.5.6/librpc/idl/idl_types.h.win7print samba-3.5.6/librpc/idl/idl_types.h >--- samba-3.5.6/librpc/idl/idl_types.h.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/idl/idl_types.h 2011-02-23 08:25:14.265293015 -0700 >@@ -12,7 +12,7 @@ > /* > a null terminated UCS2 string > */ >-#define nstring [flag(STR_NULLTERM)] string >+#define nstring [flag(STR_NULLTERM|NDR_ALIGN2)] string > > /* > an ascii string prefixed with [offset] [length], both 32 bits >@@ -50,7 +50,7 @@ > /* > a null terminated UCS2 string > */ >-#define nstring_array [flag(STR_NULLTERM)] string_array >+#define nstring_array [flag(STR_NULLTERM|NDR_ALIGN2)] string_array > > #define NDR_NOALIGN LIBNDR_FLAG_NOALIGN > #define NDR_REMAINING LIBNDR_FLAG_REMAINING >diff -up samba-3.5.6/librpc/idl/spoolss.idl.win7print samba-3.5.6/librpc/idl/spoolss.idl >--- samba-3.5.6/librpc/idl/spoolss.idl.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/idl/spoolss.idl 2011-02-23 08:30:30.876841371 -0700 >@@ -1256,7 +1256,7 @@ cpp_quote("#define spoolss_security_desc > spoolss_DriverOSVersion version; > [relative] nstring *driver_name; > [relative] nstring *architecture; >- [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info; >+ [relative,size_is(file_count),flag(NDR_ALIGN4)] spoolss_DriverFileInfo *file_info; > uint32 file_count; > [relative] nstring *monitor_name; > [relative] nstring *default_datatype; >@@ -2550,7 +2550,7 @@ cpp_quote("#define spoolss_security_desc > [relative] nstring *value_name; > [value(2*strlen_m_term(value_name))] uint32 value_name_len; > winreg_Type type; >- [relative,subcontext(0),subcontext_size(data_length),flag(NDR_REMAINING)] DATA_BLOB *data; >+ [relative,subcontext(0),subcontext_size(data_length),flag(NDR_REMAINING|ndr_spoolss_PrinterEnumValues_align(r->type))] DATA_BLOB *data; > [value(data->length)] uint32 data_length; > } spoolss_PrinterEnumValues; > >diff -up samba-3.5.6/librpc/ndr/ndr_basic.c.win7print samba-3.5.6/librpc/ndr/ndr_basic.c >--- samba-3.5.6/librpc/ndr/ndr_basic.c.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/ndr/ndr_basic.c 2011-02-23 08:25:14.262293031 -0700 >@@ -1011,7 +1011,8 @@ _PUBLIC_ void ndr_print_DATA_BLOB(struct > */ > _PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob) > { >- if (ndr->flags & LIBNDR_ALIGN_FLAGS) { >+ if (ndr->flags & LIBNDR_FLAG_REMAINING) { >+ } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) { > if (ndr->flags & LIBNDR_FLAG_ALIGN2) { > blob.length = NDR_ALIGN(ndr, 2); > } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { >@@ -1035,7 +1036,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull_DATA > { > uint32_t length = 0; > >- if (ndr->flags & LIBNDR_ALIGN_FLAGS) { >+ if (ndr->flags & LIBNDR_FLAG_REMAINING) { >+ length = ndr->data_size - ndr->offset; >+ } else if (ndr->flags & LIBNDR_ALIGN_FLAGS) { > if (ndr->flags & LIBNDR_FLAG_ALIGN2) { > length = NDR_ALIGN(ndr, 2); > } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { >@@ -1046,8 +1049,6 @@ _PUBLIC_ enum ndr_err_code ndr_pull_DATA > if (ndr->data_size - ndr->offset < length) { > length = ndr->data_size - ndr->offset; > } >- } else if (ndr->flags & LIBNDR_FLAG_REMAINING) { >- length = ndr->data_size - ndr->offset; > } else { > NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &length)); > } >diff -up samba-3.5.6/librpc/ndr/ndr.c.win7print samba-3.5.6/librpc/ndr/ndr.c >--- samba-3.5.6/librpc/ndr/ndr.c.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/ndr/ndr.c 2011-02-23 08:25:14.268293003 -0700 >@@ -1105,6 +1105,31 @@ _PUBLIC_ enum ndr_err_code ndr_push_rela > return NDR_ERR_SUCCESS; > } > if (!(ndr->flags & LIBNDR_FLAG_RELATIVE_REVERSE)) { >+ uint32_t relative_offset; >+ size_t pad; >+ size_t align = 1; >+ >+ if (ndr->offset < ndr->relative_base_offset) { >+ return ndr_push_error(ndr, NDR_ERR_BUFSIZE, >+ "ndr_push_relative_ptr2_start ndr->offset(%u) < ndr->relative_base_offset(%u)", >+ ndr->offset, ndr->relative_base_offset); >+ } >+ >+ relative_offset = ndr->offset - ndr->relative_base_offset; >+ >+ if (ndr->flags & LIBNDR_FLAG_ALIGN2) { >+ align = 2; >+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { >+ align = 4; >+ } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) { >+ align = 8; >+ } >+ >+ pad = ndr_align_size(relative_offset, align); >+ if (pad) { >+ NDR_CHECK(ndr_push_zero(ndr, pad)); >+ } >+ > return ndr_push_relative_ptr2(ndr, p); > } > if (ndr->relative_end_offset == -1) { >@@ -1171,9 +1196,6 @@ _PUBLIC_ enum ndr_err_code ndr_push_rela > /* the reversed offset is at the end of the main buffer */ > correct_offset = ndr->relative_end_offset - len; > >- /* TODO: remove this hack and let the idl use FLAG_ALIGN2 explicit */ >- align = 2; >- > if (ndr->flags & LIBNDR_FLAG_ALIGN2) { > align = 2; > } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) { >diff -up samba-3.5.6/librpc/ndr/ndr_spoolss_buf.c.win7print samba-3.5.6/librpc/ndr/ndr_spoolss_buf.c >--- samba-3.5.6/librpc/ndr/ndr_spoolss_buf.c.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/ndr/ndr_spoolss_buf.c 2011-02-23 08:27:55.189555042 -0700 >@@ -1382,3 +1382,35 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoo > } > return NDR_ERR_SUCCESS; > } >+ >+_PUBLIC_ uint32_t ndr_spoolss_PrinterEnumValues_align(enum winreg_Type type) >+{ >+ switch(type) { >+ case REG_NONE: >+ return 0; >+ case REG_SZ: >+ return LIBNDR_FLAG_ALIGN2; >+ case REG_EXPAND_SZ: >+ return LIBNDR_FLAG_ALIGN2; >+ case REG_BINARY: >+ return 0; >+ case REG_DWORD: >+ return LIBNDR_FLAG_ALIGN4; >+ case REG_DWORD_BIG_ENDIAN: >+ return LIBNDR_FLAG_ALIGN4; >+ case REG_LINK: >+ return 0; >+ case REG_MULTI_SZ: >+ return LIBNDR_FLAG_ALIGN2; >+ case REG_RESOURCE_LIST: >+ return LIBNDR_FLAG_ALIGN2; >+ case REG_FULL_RESOURCE_DESCRIPTOR: >+ return LIBNDR_FLAG_ALIGN4; >+ case REG_RESOURCE_REQUIREMENTS_LIST: >+ return LIBNDR_FLAG_ALIGN2; >+ case REG_QWORD: >+ return LIBNDR_FLAG_ALIGN8; >+ } >+ >+ return 0; >+} >diff -up samba-3.5.6/librpc/ndr/ndr_spoolss_buf.h.win7print samba-3.5.6/librpc/ndr/ndr_spoolss_buf.h >--- samba-3.5.6/librpc/ndr/ndr_spoolss_buf.h.win7print 2010-10-07 10:41:16.000000000 -0600 >+++ samba-3.5.6/librpc/ndr/ndr_spoolss_buf.h 2011-02-23 08:28:44.584328586 -0700 >@@ -51,6 +51,7 @@ size_t ndr_size_spoolss_PrinterData(cons > void ndr_print_spoolss_security_descriptor(struct ndr_print *ndr, const char *name, const struct security_descriptor *r); > enum ndr_err_code ndr_pull_spoolss_security_descriptor(struct ndr_pull *ndr, int ndr_flags, struct security_descriptor *r); > enum ndr_err_code ndr_push_spoolss_security_descriptor(struct ndr_push *ndr, int ndr_flags, const struct security_descriptor *r); >+_PUBLIC_ uint32_t ndr_spoolss_PrinterEnumValues_align(enum winreg_Type type); > > #undef _PRINTF_ATTRIBUTE > #define _PRINTF_ATTRIBUTE(a1, a2)
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 7567
:
6229
|
6230
|
6231
|
6250
|
6251
|
6258
|
6259
|
6263
|
6267
|
6271
|
6274