The Samba-Bugzilla – Attachment 15188 Details for
Bug 13965
samba-tool dns uses strings, not bytes for inet_ntop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch that probably works
0001-samba-tool-dns-use-bytes-for-inet_ntop.patch (text/plain), 1.33 KB, created by
Douglas Bagnall
on 2019-05-23 22:23:23 UTC
(
hide
)
Description:
patch that probably works
Filename:
MIME Type:
Creator:
Douglas Bagnall
Created:
2019-05-23 22:23:23 UTC
Size:
1.33 KB
patch
obsolete
>From 393e8f6201d7f5657467e87ddf7c010327920f49 Mon Sep 17 00:00:00 2001 >From: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >Date: Fri, 24 May 2019 09:58:12 +1200 >Subject: [PATCH] samba-tool dns: use bytes for inet_ntop > >Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> >--- > python/samba/netcmd/dns.py | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py >index b7459a71acd..ae51a99a638 100644 >--- a/python/samba/netcmd/dns.py >+++ b/python/samba/netcmd/dns.py >@@ -153,10 +153,13 @@ def dns_addr_array_string(array): > return ret > for i in range(array.AddrCount): > if array.AddrArray[i].MaxSa[0] == 0x02: >- x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[4:8] >+ # This could look more like >+ # x = bytes(array.AddrArray[i].MaxSa[4:8]) >+ # once we are pure Python 3. >+ x = b"".join(bytes(chr(b)) for b in array.AddrArray[i].MaxSa)[4:8] > addr = inet_ntop(AF_INET, x) > elif array.AddrArray[i].MaxSa[0] == 0x17: >- x = "".join([chr(b) for b in array.AddrArray[i].MaxSa])[8:24] >+ x = b"".join(bytes(chr(b)) for b in array.AddrArray[i].MaxSa)[8:24] > addr = inet_ntop(AF_INET6, x) > else: > addr = 'UNKNOWN' >-- >2.17.1 >
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 13965
:
15188
|
15197
|
15204