auth pycredentials: incorrect PyArg_ParseTupleAndKeywords call
authorGary Lockyer <gary@catalyst.net.nz>
Fri, 28 Apr 2017 01:14:16 +0000 (13:14 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 25 May 2017 00:25:13 +0000 (02:25 +0200)
The challenge parameter was being treated as a string rather than as a
data blob.  This was causing intermittent seg faults. Removed the
server_timestamp parameter as it's not currently used.

Unable to produce a test case to reliably replicate the failure.
However auth_log_samlogon does flap

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
auth/credentials/pycredentials.c
selftest/flapping
selftest/knownfail

index 165f803..fee9556 100644 (file)
@@ -90,16 +90,19 @@ static PyObject *py_creds_get_ntlm_response(PyObject *self, PyObject *args, PyOb
        DATA_BLOB lm_session_key = data_blob_null;
        DATA_BLOB nt_session_key = data_blob_null;
        const char *kwnames[] = { "flags", "challenge",
-                                 "target_info", "server_timestamp",
+                                 "target_info",
                                  NULL };
 
        tv_now = timeval_current();
        server_timestamp = timeval_to_nttime(&tv_now);
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwargs,
-                                        "i" PYARG_BYTES_LEN "|" PYARG_BYTES_LEN "K",
+       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "is#|s#",
                                         discard_const_p(char *, kwnames),
-                                        &flags, &challenge, &target_info.data, &target_info.length)) {
+                                        &flags,
+                                        &challenge.data,
+                                        &challenge.length,
+                                        &target_info.data,
+                                        &target_info.length)) {
                return NULL;
        }
 
index 50fdf1e..e40a2ab 100644 (file)
@@ -34,3 +34,4 @@
 ^samba3.blackbox.smbclient_tar.* # fails very, very often on sn-devel
 ^samba3.blackbox.smbclient_s3.*.sending a message to the remote server # flakey on sn-devel-104 and sn-devel-144
 ^samba3.blackbox.smbclient_s3.*.creating a good symlink and deleting it by path # flakey on sn-devel-104 and sn-devel-144
+^samba.tests.auth_log_samlogon
index 44757c3..b16ff52 100644 (file)
 # We currently don't send referrals for LDAP modify of non-replicated attrs
 ^samba4.ldap.rodc.python\(rodc\).__main__.RodcTests.test_modify_nonreplicated.*
 ^samba4.ldap.rodc_rwdc.python.*.__main__.RodcRwdcTests.test_change_password_reveal_on_demand_kerberos
-# samba.tests.auth_log_samlogon should fail until all the fixes are applied
-^samba.tests.auth_log_samlogon