[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Jan 17 14:24:03 UTC 2019


The branch, master has been updated
       via  b8c248e4d90 dns_hub: Rename variable to avoid naming collision in exception handler
       via  48285a9c60a s4:librpc: Use C99 initializer for PyGetSetDef in py_auth
       via  1937b0cb153 generate_param.py: Use C99 initializer for last element in param table
      from  a67b711ebcc tests: Switchover auth_log from s4 SMB client bindings to s4

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


- Log -----------------------------------------------------------------
commit b8c248e4d903b657c209b4faedcf6dc1ddacf2fe
Author: Tim Beale <timbeale at catalyst.net.nz>
Date:   Thu Jan 17 17:36:50 2019 +1300

    dns_hub: Rename variable to avoid naming collision in exception handler
    
    In dns_hup.py, we are both importing the socket module and declaring a
    variable called socket. When we try to catch a socket.error exception
    (defined by the module), Python thinks we're referring to the variable.
    As the variable has no attribute called 'error', Python throws an
    exception, e.g.:
    
      File "./bin/python/samba/tests/dns_forwarder_helpers/dns_hub.py", line
    123, in handle
        except socket.error as err:
    AttributeError: 'socket' object has no attribute 'error'
    
    We can avoid this problem by calling the variable 'sock' instead.
    
    Signed-off-by: Tim Beale <timbeale at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Thu Jan 17 15:23:23 CET 2019 on sn-devel-144

commit 48285a9c60a9156d465d1dc04e4a0289c043a5af
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Dec 13 11:40:09 2018 +0100

    s4:librpc: Use C99 initializer for PyGetSetDef in py_auth
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 1937b0cb1533ecf8178a20301b06584973ec7d5b
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Dec 12 21:30:44 2018 +0100

    generate_param.py: Use C99 initializer for last element in param table
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

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

Summary of changes:
 python/samba/tests/dns_forwarder_helpers/dns_hub.py | 4 ++--
 script/generate_param.py                            | 2 +-
 source4/librpc/ndr/py_auth.c                        | 8 ++++++--
 3 files changed, 9 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/dns_forwarder_helpers/dns_hub.py b/python/samba/tests/dns_forwarder_helpers/dns_hub.py
index cf9beb7fa7a..067f32d0bf6 100755
--- a/python/samba/tests/dns_forwarder_helpers/dns_hub.py
+++ b/python/samba/tests/dns_forwarder_helpers/dns_hub.py
@@ -89,7 +89,7 @@ class DnsHandler(sserver.BaseRequestHandler):
         return None
 
     def handle(self):
-        data, socket = self.request
+        data, sock = self.request
         query = ndr.ndr_unpack(dns.name_packet, data);
         name = query.questions[0].name
         forwarder = self.forwarder(name)
@@ -119,7 +119,7 @@ class DnsHandler(sserver.BaseRequestHandler):
             (forwarder, self.client_address, name))
 
         try:
-            socket.sendto(send_packet, self.client_address)
+            sock.sendto(send_packet, self.client_address)
         except socket.error as err:
             print("Error sending %s to address %s for name %s: %s\n" %
                 (forwarder, self.client_address, name, err.errno))
diff --git a/script/generate_param.py b/script/generate_param.py
index 4580f096c8b..5f8a50562d4 100644
--- a/script/generate_param.py
+++ b/script/generate_param.py
@@ -393,7 +393,7 @@ def make_param_table(path_in, path_out):
                         file_out.write("\t\t.flags\t\t= %s,\n" % flags)
                     file_out.write("\t},\n")
 
-        file_out.write("\n\t{NULL,  P_BOOL,  P_NONE,  0,  NULL,  NULL,  0}\n")
+        file_out.write("\n\t{ .label = NULL }\n")
         file_out.write("};\n")
         file_out.write("\n#endif /* %s */\n\n" % header)
     finally:
diff --git a/source4/librpc/ndr/py_auth.c b/source4/librpc/ndr/py_auth.c
index 95c9a30321f..b534e79b631 100644
--- a/source4/librpc/ndr/py_auth.c
+++ b/source4/librpc/ndr/py_auth.c
@@ -58,8 +58,12 @@ static int py_auth_session_set_credentials(PyObject *self, PyObject *value, void
 }
 
 static PyGetSetDef py_auth_session_extra_getset[] = {
-	{ discard_const_p(char, "credentials"), (getter)py_auth_session_get_credentials, (setter)py_auth_session_set_credentials, NULL },
-	{ NULL }
+	{
+		.name = discard_const_p(char, "credentials"),
+		.get  = (getter)py_auth_session_get_credentials,
+		.set  = (setter)py_auth_session_set_credentials,
+	},
+	{ .name = NULL },
 };
 
 static void py_auth_session_info_patch(PyTypeObject *type)


-- 
Samba Shared Repository



More information about the samba-cvs mailing list