The Samba-Bugzilla – Attachment 18619 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]
Test script showing issue and proposed fix
test.py (text/x-python), 1022 bytes, created by
cn
on 2025-03-24 09:26:35 UTC
(
hide
)
Description:
Test script showing issue and proposed fix
Filename:
MIME Type:
Creator:
cn
Created:
2025-03-24 09:26:35 UTC
Size:
1022 bytes
patch
obsolete
>#!/usr/bin/python3 >import struct ># Example GUID with preprended zeros >data=b'0\xaaa\x0a\xbb\xbb\xa4N\x87a\x0c\xcc\xcc\xcc\xcc\xcc' >print('Mixed ldb data: ', data[0:]) >print('Original adsys: %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:])))) >print('Proposed zfill: %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)))
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