[SCM] Samba Shared Repository - branch master updated

Gary Lockyer gary at samba.org
Fri Jul 19 02:21:02 UTC 2019


The branch, master has been updated
       via  0bcfc550b1a gp_inf: Read/write files with a UTF-16LE BOM in GptTmpl.inf
      from  b0fc1ca65ab lib: Fix the 32-bit build

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


- Log -----------------------------------------------------------------
commit 0bcfc550b1a902e3a6a766b06603ac9285d0ff63
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Thu Jul 18 14:50:57 2019 +1200

    gp_inf: Read/write files with a UTF-16LE BOM in GptTmpl.inf
    
    Regression caused by 16596842a62bec0a9d974c48d64000e3c079254e
    
    [MS-GPSB] 2.2 Message Syntax says that you have to write a BOM which I
    didn't do up until this patch. UTF-16 as input encoding was marked much
    higher up in the inheritance tree, which got overriden with the Python 3
    fixes. I've now marked the encoding much more obviously for this file.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14004
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Gary Lockyer <gary at catalyst.net.nz>
    
    Autobuild-User(master): Gary Lockyer <gary at samba.org>
    Autobuild-Date(master): Fri Jul 19 02:20:47 UTC 2019 on sn-devel-184

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

Summary of changes:
 python/samba/gp_parse/gp_inf.py                       |   9 ++++++---
 .../Windows NT/SecEdit/GptTmpl.inf.SAMBABACKUP        | Bin 2580 -> 2582 bytes
 2 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/gp_parse/gp_inf.py b/python/samba/gp_parse/gp_inf.py
index 79e28159f1f..a3c828fa82d 100644
--- a/python/samba/gp_parse/gp_inf.py
+++ b/python/samba/gp_parse/gp_inf.py
@@ -29,11 +29,11 @@ from samba.gp_parse import GPParser
 # [MS-GPSB] Security Protocol Extension
 class GptTmplInfParser(GPParser):
     sections = None
-    encoding = 'utf-16le'
+    encoding = 'utf-16'
+    output_encoding = 'utf-16le'
 
     class AbstractParam:
         __metaclass__ = ABCMeta
-        encoding = 'utf-16le'
 
         def __init__(self):
             self.param_list = []
@@ -333,7 +333,10 @@ class GptTmplInfParser(GPParser):
 
     def write_binary(self, filename):
         with codecs.open(filename, 'wb+',
-                         self.encoding) as f:
+                         self.output_encoding) as f:
+            # Write the byte-order mark
+            f.write(u'\ufeff')
+
             for s in self.sections:
                 self.sections[s].write_section(s, f)
 
diff --git a/source4/selftest/provisions/generalized-gpo-backup/policy/{1E1DC8EA-390C-4800-B327-98B56A0AEA5D}/Machine/Microsoft/Windows NT/SecEdit/GptTmpl.inf.SAMBABACKUP b/source4/selftest/provisions/generalized-gpo-backup/policy/{1E1DC8EA-390C-4800-B327-98B56A0AEA5D}/Machine/Microsoft/Windows NT/SecEdit/GptTmpl.inf.SAMBABACKUP
index 18c58a7baa9..8de94078e70 100644
Binary files a/source4/selftest/provisions/generalized-gpo-backup/policy/{1E1DC8EA-390C-4800-B327-98B56A0AEA5D}/Machine/Microsoft/Windows NT/SecEdit/GptTmpl.inf.SAMBABACKUP and b/source4/selftest/provisions/generalized-gpo-backup/policy/{1E1DC8EA-390C-4800-B327-98B56A0AEA5D}/Machine/Microsoft/Windows NT/SecEdit/GptTmpl.inf.SAMBABACKUP differ


-- 
Samba Shared Repository



More information about the samba-cvs mailing list