The Samba-Bugzilla – Attachment 18618 Details for
Bug 15839
gp_cert_auto_enroll_ext.py has problem unpacking GUIDs with prepended 0's
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
A simple way to ensure preprended zeros in GUIDs is to add .zfill(length)
guid-w-preprended-zero.patch (text/plain), 1.28 KB, created by
cn
on 2025-03-24 09:21:45 UTC
(
hide
)
Description:
A simple way to ensure preprended zeros in GUIDs is to add .zfill(length)
Filename:
MIME Type:
Creator:
cn
Created:
2025-03-24 09:21:45 UTC
Size:
1.28 KB
patch
obsolete
>diff --git a/python/samba/gp/gp_cert_auto_enroll_ext.py b/python/samba/gp/gp_cert_auto_enroll_ext.py >index 9b743cb7f9b..8d6d1e86d17 100644 >--- a/python/samba/gp/gp_cert_auto_enroll_ext.py >+++ b/python/samba/gp/gp_cert_auto_enroll_ext.py >@@ -54,11 +54,11 @@ global_trust_dirs = ['/etc/pki/trust/anchors', # SUSE > > def octet_string_to_objectGUID(data): > """Convert an octet string to an objectGUID.""" >- return '%s-%s-%s-%s-%s' % ('%02x' % struct.unpack('<L', data[0:4])[0], >- '%02x' % struct.unpack('<H', data[4:6])[0], >- '%02x' % struct.unpack('<H', data[6:8])[0], >- '%02x' % struct.unpack('>H', data[8:10])[0], >- '%02x%02x' % struct.unpack('>HL', data[10:])) >+ return '%s-%s-%s-%s-%s' % (('%02x' % struct.unpack('<L', data[0:4])[0]).zfill(8), >+ ('%02x' % struct.unpack('<H', data[4:6])[0]).zfill(4), >+ ('%02x' % struct.unpack('<H', data[6:8])[0]).zfill(4), >+ ('%02x' % struct.unpack('>H', data[8:10])[0]).zfill(4), >+ ('%02x%02x' % struct.unpack('>HL', data[10:])).zfill(12)) > > > def group_and_sort_end_point_information(end_point_information):
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 15839
: 18618 |
18619
|
18620