The branch, master has been updated via aa43d0d source3 smdb: fix null pointer dereference via 85e98d2 source3 smbd: tests for null pointer dereference via a939db7 s3: smbd: inotify_map_mask_to_filter incorrectly indexes an array. from 77d4e07 tdb: version 1.3.13
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit aa43d0d81baa497135a17e843b05336b4a504809 Author: Gary Lockyer <g...@catalyst.net.nz> Date: Thu Apr 27 12:39:34 2017 +1200 source3 smdb: fix null pointer dereference Fix the null pointer dereference in smbd, introduced in the auth logging changes. Signed-off-by: Gary Lockyer <g...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Fri Apr 28 07:18:54 CEST 2017 on sn-devel-144 commit 85e98d2a3190653af56b1adb7597a903b8dec83b Author: Gary Lockyer <g...@catalyst.net.nz> Date: Thu Apr 27 12:02:29 2017 +1200 source3 smbd: tests for null pointer dereference Test case to replicate null pointer dereference in smbd, introduced in the auth logging changes. Signed-off-by: Gary Lockyer <g...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit a939db725ea81944532ba3b035da0d145bc3b62a Author: Doug Nazar <naz...@nazar.ca> Date: Thu Apr 27 15:41:24 2017 -0700 s3: smbd: inotify_map_mask_to_filter incorrectly indexes an array. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12760 Signed-off-by: Doug Nazar <naz...@nazar.ca> Reviewed-by: Jeremy Allison <j...@samba.org> Reviewed-by: Christof Schmitt <c...@samba.org> ----------------------------------------------------------------------- Summary of changes: python/samba/tests/net_join_no_spnego.py | 59 ++++++++++++++++++++++++++++++++ source3/smbd/notify_inotify.c | 2 +- source3/smbd/sesssetup.c | 2 +- source4/selftest/tests.py | 3 ++ 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 python/samba/tests/net_join_no_spnego.py Changeset truncated at 500 lines: diff --git a/python/samba/tests/net_join_no_spnego.py b/python/samba/tests/net_join_no_spnego.py new file mode 100644 index 0000000..4da9c2e --- /dev/null +++ b/python/samba/tests/net_join_no_spnego.py @@ -0,0 +1,59 @@ +# Unix SMB/CIFS implementation. +# +# Copyright (C) Catalyst.Net Ltd. 2017 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +""" +Detect null pointer exception in /source3/smbd/sessetup.c +""" + +import samba.tests +import os +from samba.net import Net, LIBNET_JOIN_AUTOMATIC +from samba.credentials import DONT_USE_KERBEROS +from samba import NTSTATUSError, ntstatus +import ctypes + +class NetJoinNoSpnegoTests(samba.tests.TestCase): + + def setUp(self): + super(NetJoinNoSpnegoTests, self).setUp() + self.remoteAddress = "/root/ncalrpc_as_system" + self.domain = os.environ["DOMAIN"] + self.server = os.environ["SERVER"] + + def tearDown(self): + super(NetJoinNoSpnegoTests, self).tearDown() + + def test_net_join_no_spnego(self): + lp = self.get_loadparm() + lp.set("client use spnego", "no") + netbios_name = "NetJoinNoSpnego" + machinepass = "abcdefghij" + creds = self.insta_creds(template=self.get_credentials(), + kerberos_state=DONT_USE_KERBEROS) + + net = Net(creds, lp, server=self.server) + + try: + (join_password, sid, domain_name) = net.join_member( + self.domain, netbios_name, LIBNET_JOIN_AUTOMATIC, + machinepass=machinepass) + except NTSTATUSError as e: + code = ctypes.c_uint32(e[0]).value + if code == ntstatus.NT_STATUS_CONNECTION_DISCONNECTED: + self.fail("Connection failure") + pass diff --git a/source3/smbd/notify_inotify.c b/source3/smbd/notify_inotify.c index 3848dd6..74855a9 100644 --- a/source3/smbd/notify_inotify.c +++ b/source3/smbd/notify_inotify.c @@ -97,7 +97,7 @@ static uint32_t inotify_map_mask_to_filter(uint32_t mask) uint32_t filter = 0; for (i = 0; i < ARRAY_SIZE(inotify_mapping); i++) { - if (inotify_mapping[0].inotify_mask & mask) { + if (inotify_mapping[i].inotify_mask & mask) { filter |= inotify_mapping[i].notify_mask; } } diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 2ed5a4c..a44af7f 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -908,9 +908,9 @@ void reply_sesssetup_and_X(struct smb_request *req) sconn->local_address, "SMB", lm_resp, nt_resp); - user_info->auth_description = "bare-NTLM"; if (NT_STATUS_IS_OK(nt_status)) { + user_info->auth_description = "bare-NTLM"; nt_status = auth_check_password_session_info(negprot_auth_context, req, user_info, &session_info); } diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 8312f48..f73dca3 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -608,6 +608,9 @@ if have_jansson_support: 'SOCKET_WRAPPER_DEFAULT_IFACE': 11}) planoldpythontestsuite("ad_dc_ntvfs:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"']) planoldpythontestsuite("ad_dc:local", "samba.tests.auth_log_ncalrpc", extra_args=['-U"$USERNAME%$PASSWORD"']) +planoldpythontestsuite("ad_dc:local", + "samba.tests.net_join_no_spnego", + extra_args=['-U"$USERNAME%$PASSWORD"']) # Need to test the password hashing in multiple environments to ensure that # all the possible options are covered # -- Samba Shared Repository