[SCM] Samba Shared Repository - branch v4-4-test updated

Karolin Seeger kseeger at samba.org
Mon May 9 12:09:13 UTC 2016


The branch, v4-4-test has been updated
       via  9799c30 s3:libnet:libnet_join: add netbios aliases as SPNs
       via  15a5069 init: set core file size to unlimited by default
       via  79cbf02 source3: Honor the core soft limit of the OS.
       via  6823ef7 heimdal: encode/decode kvno as signed integer
       via  37da5c2 torture:smb2: Add test replay6 to verify Error Codes for DurableHandleReqV2 replay
       via  97e96c1 lib/torture: add torture_assert_u64_not_equal_goto macro
       via  470569a torture:smb2: add test for checking sequence number wrap around.
       via  8240ef3 libcli:smb:smbXcli_base: add smb2cli_session_current_channel_sequence() call.
       via  15700e9 smbd:smb2: add some asserts before decrementing the counters
       via  6dec722 smbd:smb2: update outstanding request counters before sending a reply
       via  c8624df smbd:smb2: implement channel sequence checks and request counters in dispatch
       via  a962dec smbd:smb2: add request_counters_updated to the smbd_smb2_request struct
       via  7894513 smbd:smb2: add a modify flag to dispatch table
       via  6266902 s3:smbXsrv.idl: add 8 byte channel_sequence number and request counters to IDL.
       via  5fcfb62 ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read
       via  be1c27e dbwrap_ctdb: Fix ENOENT->NT_STATUS_NOT_FOUND
       via  41f3e50 vfs_fruit: add an option that allows disabling POSIX rename behaviour
       via  ae7e3d1 s3:smbd/filename remove smelly code
       via  cb3d4b1 s3:smbd/service apply some code formatting
       via  9892c48 s3:smbd/service disable case-sensitivity for SMB2/3 connections
       via  6a6f678 Correctly set cli->raw_status for libsmbclient in SMB2 code
      from  ddd90dc VERSION: Bump version up to 4.4.4...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-4-test


- Log -----------------------------------------------------------------
commit 9799c3063aa7e188d7a44cda53e8f537f869d083
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Apr 26 17:21:46 2016 +0200

    s3:libnet:libnet_join: add netbios aliases as SPNs
    
    Add all listed smb.conf netbios aliases as SPNs to the machine account:
    
      HOST/NETBIOS_ALIAS at REALM
    
    and
    
      HOST/netbios_alias.dnsdomain.name at REALM
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=1703
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Wed May  4 17:58:05 CEST 2016 on sn-devel-144
    
    Autobuild-User(v4-4-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-4-test): Mon May  9 14:08:44 CEST 2016 on sn-devel-144

commit 15a50691e7b683fd9697b0dad424c4e6b22927e4
Author: Raghavendra Talur <rtalur at redhat.com>
Date:   Mon May 2 16:14:06 2016 +0530

    init: set core file size to unlimited by default
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11907
    
    Signed-off-by: Raghavendra Talur <rtalur at redhat.com>
    
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jose A. Rivera <jarrpa at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Fri May  6 19:15:17 CEST 2016 on sn-devel-144
    
    (cherry picked from commit ebd139c4db7e51a2d7843a773991f15cadf504dd)

commit 79cbf029f1846f82e3df67899c991ee0c57d1d44
Author: Ira Cooper <ira at samba.org>
Date:   Thu Mar 3 13:47:32 2016 -0500

    source3: Honor the core soft limit of the OS.
    
    We should honor the soft limits set by the operating system.
    
    In any case, 16M doesn't make a useful coredump for modern
    Samba.
    
    Signed-off-by: Ira Cooper <ira at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Mar  5 00:39:48 CET 2016 on sn-devel-144
    
    (cherry picked from commit 58d3462bc58290d8eb5e554c6c59cf6b73ccf58a)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11907

commit 6823ef7b13545832628f92d71840495eb6ccae00
Author: Uri Simchoni <uri at samba.org>
Date:   Thu May 5 23:40:22 2016 +0300

    heimdal: encode/decode kvno as signed integer
    
    This patch changes the encoding/decoding of kvno (key version number)
    in blobs and packets to signed integer, for compatibility with Windows.
    Reportedly, MIT Kerberos does the same.
    
    This patch effectively reverts commit 1124c4872dfb81bec9c4b527b8927ca35e39a599
    in the heimdal tree.
    
    According to the Kerberos spec (RFC 4120 5.2.9), the kvno field
    in encrypted data object is an unsigned integer that fits in
    32 bits. The Heimdal Kerberos component bundled with Samba
    conforms to this. However, Windows deviates from the standard
    and encodes kvno as a signed integer, and this creates
    interoperability issues.
    
    ASN.1 DER has no special encoding for unsigned integer. A 32-bit
    unsigned integer is encoded as a signed integer, so while a signed
    32-bit integer (covering the range of -0x80000000..0x7fffffff) is
    encoded using up to 4 bytes, an unsigned integer (covering
    0..0xffffffff) could require 5 bytes.
    
    Normally, kvno for a given account starts at 1 and increments on
    password changes. Kerberos defined this as unsigned because there's
    no meaning for negative version numbers, so the standard writers figured
    4 billion versions is better than 2 billion. It was not
    expected for a kvno to really go past 0x7fffffff and the disctinction
    usually does not matter. However, RODCs use kvnos which
    have the most-significant bit set.
    
    In Active Directory, RODCs have a private secret for the krbtgt,
    because the assumption is that the RODC is less secure, and
    recovering the domain krbtgt secret from the RODC would compromise
    the security of the entire domain. The kvno field is being used
    to identify the private krbtgt account that owns the key - the
    upper 16 bits are the RODC id, and the lower 16 bits identify
    the key version number for this specific RODC. It's common to
    have an RODC id greater than 0x8000, and therefore to have a
    kvno larger than 0x7fffffff, which would be DER-encoded using
    5 bytes.
    
    Windows encodes kvno as signed integer - basically taking the
    32 bits and treating them as a signed integer rather than an
    unsigned integer. This means that in Windows a kvno can
    always be encoded using 4 bytes, and Windows DCs reject a kvno
    encoded using more than 4 bytes without even generating an error
    response (the DC assumes it's an attack).
    
    Heimdal re-encodes the TGT when it creates a TGS request. Obviously
    it cannot decode and encode the encrypted parts but it does re-encode
    the plain parts, which include the kvno. That leads to a 5-byte
    kvno in the TGS request, which is rejected without an error
    response.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11900
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Sat May  7 21:14:21 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 6379737b7ddc6ccb752238c5820cc62e76a8da17)

commit 37da5c2a431ee1a906347d3166dc633349412e9c
Author: Anubhav Rakshit <anubhav.rakshit at gmail.com>
Date:   Thu Oct 30 13:20:57 2014 +0530

    torture:smb2: Add test replay6 to verify Error Codes for DurableHandleReqV2 replay
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    Pair-Programmed-With: Michael Adam <obnox at samba.org>
    
    Signed-off-by: Anubhav Rakshit <anubhav.rakshit at gmail.com>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit e095a61c4b36e71b03d8afc724da09c91603a29b)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 97e96c127522eed61261b2ef2328ce9e497abf0c
Author: Günther Deschner <gd at samba.org>
Date:   Wed Feb 24 19:23:21 2016 +0100

    lib/torture: add torture_assert_u64_not_equal_goto macro
    
    Guenther
    
    Signed-off-by: Günther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c5c3f91c6fd1ac3282d2fa27e262af097f0adfca)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 470569ac469e992f1c7514f5eb00821584c85527
Author: Günther Deschner <gd at samba.org>
Date:   Thu Feb 25 11:15:06 2016 +0100

    torture:smb2: add test for checking sequence number wrap around.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 2b799880b91f2ee44531644c62916f9a50531d04)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 8240ef3b35b28ae3c31221f5c17a32464e83b892
Author: Günther Deschner <gd at samba.org>
Date:   Tue Mar 1 15:15:10 2016 +0100

    libcli:smb:smbXcli_base: add smb2cli_session_current_channel_sequence() call.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ccda60ed9b33bb22ec2e162401a949aeaa631c8d)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 15700e9ebe5cdc75ee7f7dca261a9b9c12589645
Author: Michael Adam <obnox at samba.org>
Date:   Sat Feb 27 14:02:02 2016 +0100

    smbd:smb2: add some asserts before decrementing the counters
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f81f3a2d78832258b09bcc63d5cce2b4594cbbc8)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 6dec7228d7af16d061d1cd1af930089ad4d23b05
Author: Michael Adam <obnox at samba.org>
Date:   Tue Feb 23 20:54:34 2016 +0100

    smbd:smb2: update outstanding request counters before sending a reply
    
    This is part of the channel sequence number treatment of multi-channel.
    
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 7dbb1707d96e39bed8898db08339d3b2d768c87c)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit c8624df3e10ea6b83988d12c1afe40a3b994e8bd
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 24 15:54:41 2016 +0100

    smbd:smb2: implement channel sequence checks and request counters in dispatch
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 71d2b190646bdf5fce65a776dfe6873da8d82479)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit a962decf6a8b2be58221bd43f20fdebb7b167cbd
Author: Michael Adam <obnox at samba.org>
Date:   Tue Mar 15 12:36:59 2016 +0100

    smbd:smb2: add request_counters_updated to the smbd_smb2_request struct
    
    This will be used to keep track of whether the outstanding request
    counters have been updated in the dispatch, so that the reply
    code can act accordingly.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ae6967ea3e39a1a5401be4a4c969b467dd22dce4)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 7894513fc7757f4cf0674d0c1bc939eed898da53
Author: Michael Adam <obnox at samba.org>
Date:   Wed Feb 24 15:51:14 2016 +0100

    smbd:smb2: add a modify flag to dispatch table
    
    This indicates that an operation is a modifying operation.
    Some parts of the upcoming channel sequence number logic
    only applies to modify operations.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 088468195b7f7f04eab0ce6fb928bda1c703e2fa)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 62669024caa30a676f661ea3f5e612f4d6a46bee
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jan 27 16:18:25 2016 +0100

    s3:smbXsrv.idl: add 8 byte channel_sequence number and request counters to IDL.
    
    Guenther
    
    Signed-off-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 31f33a3f3996a5fff9833540c8227600f4aa2a55)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11809

commit 5fcfb62d4b0ae750236562bce641baf7e355d5b0
Author: Robin Hack <hack.robin at gmail.com>
Date:   Tue Apr 26 17:51:46 2016 +0200

    ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read
    
    Fix unitialized 'visited' value (pointer to pointer) in
    ldb_eval_transitive_filter() which passes 'visited' value later to
    ldb_eval_transitive_filter_helper().
    
    Signed-off-by: Robin Hack <hack.robin at gmail.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Apr 27 02:12:39 CEST 2016 on sn-devel-144
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11890
    
    (cherry picked from commit f4181f25b4ae3db684e43837449617e75183ecc8)

commit be1c27e32b7b10c43cd7a9f75a871aac969350d3
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 20 13:27:07 2016 +0200

    dbwrap_ctdb: Fix ENOENT->NT_STATUS_NOT_FOUND
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11844
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Tue Apr 26 14:34:14 CEST 2016 on sn-devel-144
    
    (cherry picked from commit cce6b677ff90ef361c45a7b8ad3d482908c3c4a7)

commit 41f3e50faa6530785b1b1a9ec7b6d1032f42bef2
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Apr 11 12:17:22 2016 +0200

    vfs_fruit: add an option that allows disabling POSIX rename behaviour
    
    https://bugzilla.samba.org/show_bug.cgi?id=11721
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu May  5 00:04:50 CEST 2016 on sn-devel-144
    
    (cherry picked from commit 625dcef765adc75c34ee5955a08c6cb77b87f41b)

commit ae7e3d1d041a2ff24ea46de77b87c5606fcb060b
Author: Christian Ambach <ambi at samba.org>
Date:   Tue Apr 5 02:58:48 2016 +0200

    s3:smbd/filename remove smelly code
    
    not sure how this chunk ended up there, but I agree with
    the statement in the comment that behavior should not depend
    on developer mode
    
    make test does not seem to depend on it anymore.
    
    This piece had some bad influence on the tests I wrote
    for case insensitivite behavior of SMB2/3, so let us
    remove this technical debt.
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    The last 3 patches address
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11438

commit cb3d4b111ff2466c05ba3fc559b1b354f17cca1d
Author: Christian Ambach <ambi at samba.org>
Date:   Sun Apr 3 05:16:45 2016 +0200

    s3:smbd/service apply some code formatting
    
    reduce indentation in switch statement, obey 80 char line limit, use C99 bool
    
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9892c482832b90df28488a7fd4cd1227a0b6ffa5
Author: Christian Ambach <ambi at samba.org>
Date:   Sun Apr 3 05:06:05 2016 +0200

    s3:smbd/service disable case-sensitivity for SMB2/3 connections
    
    in SMB2, there is no flag to let us know if the client wants to have case-sensitive behavior,
    so in Auto mode, disable case-sensitivity
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11438
    Signed-off-by: Christian Ambach <ambi at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6a6f6785df3d77ff2db2eb55ad0772e9a45a30bd
Author: Robin McCorkell <robin at mccorkell.me.uk>
Date:   Mon May 2 21:48:14 2016 +0100

    Correctly set cli->raw_status for libsmbclient in SMB2 code
    
    The SMB2 file handling code wasn't correctly setting raw_status, which
    is used by libsmbclient to report file open errors etc.
    
    https://bugzilla.samba.org/show_bug.cgi?id=11276
    
    Signed-off-by: Robin McCorkell <robin at mccorkell.me.uk>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 2a872e2b66f373b3c96b315b13c9f06a15522e13)

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

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml  |  11 +
 lib/ldb-samba/ldb_matching_rules.c |   2 +-
 lib/torture/torture.h              |  12 +
 libcli/smb/smbXcli_base.c          |   5 +
 libcli/smb/smbXcli_base.h          |   1 +
 packaging/RHEL-CTDB/setup/smb.init |   1 +
 packaging/RHEL/setup/smb.init      |   1 +
 packaging/systemd/smb.service      |   1 +
 selftest/knownfail                 |   1 +
 source3/lib/dbwrap/dbwrap_ctdb.c   |  10 +
 source3/lib/dumpcore.c             |  15 --
 source3/libnet/libnet_join.c       |  60 +++++
 source3/librpc/idl/smbXsrv.idl     |   3 +
 source3/libsmb/cli_smb2_fnum.c     |  16 +-
 source3/modules/vfs_fruit.c        |   6 +-
 source3/smbd/filename.c            |  28 ---
 source3/smbd/globals.h             |   7 +
 source3/smbd/service.c             |  50 ++--
 source3/smbd/smb2_server.c         | 163 +++++++++++++
 source4/heimdal/kdc/misc.c         |   2 +-
 source4/heimdal/lib/asn1/krb5.asn1 |   2 +-
 source4/torture/rpc/lsa.c          |   2 +-
 source4/torture/smb2/replay.c      | 477 ++++++++++++++++++++++++++++++++++++-
 23 files changed, 804 insertions(+), 72 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index 2ac5db7..a275344 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -226,6 +226,17 @@
 	    </listitem>
 	  </varlistentry>
 
+	  <varlistentry>
+	    <term>fruit:posix_rename = yes | no</term>
+	    <listitem>
+	      <para>Whether to enable POSIX directory rename behaviour
+	      for OS X clients. Without this, directories can't be
+	      renamed if any client has any file inside it
+	      (recursive!) open.</para>
+	      <para>The default is <emphasis>yes</emphasis>.</para>
+	    </listitem>
+	  </varlistentry>
+
 	</variablelist>
 </refsect1>
 
diff --git a/lib/ldb-samba/ldb_matching_rules.c b/lib/ldb-samba/ldb_matching_rules.c
index 1692a73..637858f 100644
--- a/lib/ldb-samba/ldb_matching_rules.c
+++ b/lib/ldb-samba/ldb_matching_rules.c
@@ -206,7 +206,7 @@ static int ldb_eval_transitive_filter(TALLOC_CTX *mem_ctx,
 	struct dsdb_dn *dn_to_match;
 	const char *dn_oid;
 	unsigned int count;
-	struct dsdb_dn **visited;
+	struct dsdb_dn **visited = NULL;
 
 	schema = dsdb_get_schema(ldb, mem_ctx);
 	if (schema == NULL) {
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 356922a..e710873 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -479,6 +479,18 @@ void torture_result(struct torture_context *test,
 	} \
 	} while(0)
 
+#define torture_assert_u64_not_equal_goto(torture_ctx,got,not_expected,ret,label,cmt)\
+	do { uint64_t __got = (got), __not_expected = (not_expected); \
+	if (__got == __not_expected) { \
+		torture_result(torture_ctx, TORTURE_FAIL, \
+			__location__": "#got" was %llu (0x%llX), expected a different number: %s", \
+			(unsigned long long)__got, (unsigned long long)__got, \
+			cmt); \
+		ret = false; \
+		goto label; \
+	} \
+	} while(0)
+
 #define torture_assert_errno_equal(torture_ctx,expected,cmt)\
 	do { int __expected = (expected); \
 	if (errno != __expected) { \
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index faf74ca..4332374 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -5522,6 +5522,11 @@ uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
 	return prev_cs;
 }
 
+uint16_t smb2cli_session_current_channel_sequence(struct smbXcli_session *session)
+{
+	return session->smb2->channel_sequence;
+}
+
 void smb2cli_session_start_replay(struct smbXcli_session *session)
 {
 	session->smb2->replay_active = true;
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 8b9851b..16c8848 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -413,6 +413,7 @@ void smb2cli_session_set_id_and_flags(struct smbXcli_session *session,
 void smb2cli_session_increment_channel_sequence(struct smbXcli_session *session);
 uint16_t smb2cli_session_reset_channel_sequence(struct smbXcli_session *session,
 						uint16_t channel_sequence);
+uint16_t smb2cli_session_current_channel_sequence(struct smbXcli_session *session);
 void smb2cli_session_start_replay(struct smbXcli_session *session);
 void smb2cli_session_stop_replay(struct smbXcli_session *session);
 NTSTATUS smb2cli_session_update_preauth(struct smbXcli_session *session,
diff --git a/packaging/RHEL-CTDB/setup/smb.init b/packaging/RHEL-CTDB/setup/smb.init
index 4dd5b23..00984d2 100644
--- a/packaging/RHEL-CTDB/setup/smb.init
+++ b/packaging/RHEL-CTDB/setup/smb.init
@@ -51,6 +51,7 @@ RETVAL=0
 start() {
 	KIND="SMB"
 	echo -n $"Starting $KIND services: "
+	ulimit -c unlimited
 	daemon smbd $SMBDOPTIONS
 	RETVAL=$?
 	echo
diff --git a/packaging/RHEL/setup/smb.init b/packaging/RHEL/setup/smb.init
index af85b2c..dff9cd8 100644
--- a/packaging/RHEL/setup/smb.init
+++ b/packaging/RHEL/setup/smb.init
@@ -50,6 +50,7 @@ RETVAL=0
 start() {
 	KIND="SMB"
 	echo -n $"Starting $KIND services: "
+	ulimit -c unlimited
 	daemon smbd $SMBDOPTIONS
 	RETVAL=$?
 	echo
diff --git a/packaging/systemd/smb.service b/packaging/systemd/smb.service
index 9810891..6053a5c 100644
--- a/packaging/systemd/smb.service
+++ b/packaging/systemd/smb.service
@@ -10,6 +10,7 @@ LimitNOFILE=16384
 EnvironmentFile=-/etc/sysconfig/samba
 ExecStart=/usr/sbin/smbd $SMBDOPTIONS
 ExecReload=/usr/bin/kill -HUP $MAINPID
+LimitCORE=infinity
 
 [Install]
 WantedBy=multi-user.target
diff --git a/selftest/knownfail b/selftest/knownfail
index 1678cd0..997d29c 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -211,6 +211,7 @@
 ^samba3.smb2.setinfo.setinfo
 ^samba3.smb2.session.*reauth5 # some special anonymous checks?
 ^samba3.smb2.compound.interim2 # wrong return code (STATUS_CANCELLED)
+^samba3.smb2.replay.channel-sequence
 ^samba3.smb2.replay.replay3
 ^samba3.smb2.replay.replay4
 ^samba3.smb2.lock.*replay
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 93df7ef..d5b8f45 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1298,6 +1298,16 @@ static NTSTATUS db_ctdb_parse_record(struct db_context *db, TDB_DATA key,
 	ret = ctdbd_parse(messaging_ctdbd_connection(), ctx->db_id, key,
 			  state.ask_for_readonly_copy, parser, private_data);
 	if (ret != 0) {
+		if (ret == ENOENT) {
+			/*
+			 * This maps to
+			 * NT_STATUS_OBJECT_NAME_NOT_FOUND. Our upper
+			 * layers expect NT_STATUS_NOT_FOUND for "no
+			 * record around". We need to convert dbwrap
+			 * to 0/errno away from NTSTATUS ... :-)
+			 */
+			return NT_STATUS_NOT_FOUND;
+		}
 		return map_nt_error_from_unix(ret);
 	}
 	return NT_STATUS_OK;
diff --git a/source3/lib/dumpcore.c b/source3/lib/dumpcore.c
index 487ccec..c72aa88 100644
--- a/source3/lib/dumpcore.c
+++ b/source3/lib/dumpcore.c
@@ -251,21 +251,6 @@ void dump_core_setup(const char *progname, const char *log_file)
 		goto out;
 	}
 
-
-#ifdef HAVE_GETRLIMIT
-#ifdef RLIMIT_CORE
-	{
-		struct rlimit rlp;
-		getrlimit(RLIMIT_CORE, &rlp);
-		rlp.rlim_cur = MAX(16*1024*1024,rlp.rlim_cur);
-		setrlimit(RLIMIT_CORE, &rlp);
-		getrlimit(RLIMIT_CORE, &rlp);
-		DEBUG(3,("Maximum core file size limits now %d(soft) %d(hard)\n",
-			 (int)rlp.rlim_cur,(int)rlp.rlim_max));
-	}
-#endif
-#endif
-
 	/* FIXME: if we have a core-plus-pid facility, configurably set
 	 * this up here.
 	 */
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index ef6c995..a28864d 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -463,6 +463,7 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
 	size_t num_spns = 0;
 	char *spn = NULL;
 	bool ok;
+	const char **netbios_aliases = NULL;
 
 	/* Find our DN */
 
@@ -524,6 +525,65 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
 		}
 	}
 
+	netbios_aliases = lp_netbios_aliases();
+	if (netbios_aliases != NULL) {
+		for (; *netbios_aliases != NULL; netbios_aliases++) {
+			/*
+			 * Add HOST/NETBIOSNAME
+			 */
+			spn = talloc_asprintf(mem_ctx, "HOST/%s", *netbios_aliases);
+			if (spn == NULL) {
+				TALLOC_FREE(spn);
+				return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
+			}
+			if (!strupper_m(spn)) {
+				TALLOC_FREE(spn);
+				return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
+			}
+
+			ok = ads_element_in_array(spn_array, num_spns, spn);
+			if (ok) {
+				TALLOC_FREE(spn);
+				continue;
+			}
+			ok = add_string_to_array(spn_array, spn,
+						 &spn_array, &num_spns);
+			if (!ok) {
+				TALLOC_FREE(spn);
+				return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
+			}
+			TALLOC_FREE(spn);
+
+			/*
+			 * Add HOST/netbiosname.domainname
+			 */
+			if (r->out.dns_domain_name == NULL) {
+				continue;
+			}
+			fstr_sprintf(my_fqdn, "%s.%s",
+				     *netbios_aliases,
+				     r->out.dns_domain_name);
+
+			spn = talloc_asprintf(mem_ctx, "HOST/%s", my_fqdn);
+			if (spn == NULL) {
+				return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
+			}
+
+			ok = ads_element_in_array(spn_array, num_spns, spn);
+			if (ok) {
+				TALLOC_FREE(spn);
+				continue;
+			}
+			ok = add_string_to_array(spn_array, spn,
+						 &spn_array, &num_spns);
+			if (!ok) {
+				TALLOC_FREE(spn);
+				return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
+			}
+			TALLOC_FREE(spn);
+		}
+	}
+
 	/* make sure to NULL terminate the array */
 	spn_array = talloc_realloc(mem_ctx, spn_array, const char *, num_spns + 1);
 	if (spn_array == NULL) {
diff --git a/source3/librpc/idl/smbXsrv.idl b/source3/librpc/idl/smbXsrv.idl
index 4c6895a..1bfa51e 100644
--- a/source3/librpc/idl/smbXsrv.idl
+++ b/source3/librpc/idl/smbXsrv.idl
@@ -430,6 +430,7 @@ interface smbXsrv
 		uint32					durable_timeout_msec;
 		boolean8				durable;
 		DATA_BLOB				backend_cookie;
+		hyper					channel_sequence;
 	} smbXsrv_open_global0;
 
 	typedef union {
@@ -470,6 +471,8 @@ interface smbXsrv
 		[ignore] files_struct			*compat;
 		smbXsrv_open_flags			flags;
 		uint32					create_action;
+		hyper					request_count;
+		hyper					pre_request_count;
 	} smbXsrv_open;
 
 	typedef union {
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index c9f4060..a17d918 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -262,6 +262,7 @@ NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, uint16_t *pfnum,
 	NTSTATUS status;
 
 	if (tevent_req_is_nterror(req, &status)) {
+		state->cli->raw_status = status;
 		return status;
 	}
 	if (pfnum != NULL) {
@@ -270,6 +271,7 @@ NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, uint16_t *pfnum,
 	if (cr != NULL) {
 		*cr = state->cr;
 	}
+	state->cli->raw_status = NT_STATUS_OK;
 	return NT_STATUS_OK;
 }
 
@@ -390,7 +392,11 @@ static void cli_smb2_close_fnum_done(struct tevent_req *subreq)
 
 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req)
 {
-	return tevent_req_simple_recv_ntstatus(req);
+	struct cli_smb2_close_fnum_state *state = tevent_req_data(
+		req, struct cli_smb2_close_fnum_state);
+	NTSTATUS status = tevent_req_simple_recv_ntstatus(req);
+	state->cli->raw_status = status;
+	return status;
 }
 
 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum)
@@ -2302,6 +2308,7 @@ NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
 				req, struct cli_smb2_read_state);
 
 	if (tevent_req_is_nterror(req, &status)) {
+		state->cli->raw_status = status;
 		return status;
 	}
 	/*
@@ -2311,6 +2318,7 @@ NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
 	 */
 	*received = (ssize_t)state->received;
 	*rcvbuf = state->buf;
+	state->cli->raw_status = NT_STATUS_OK;
 	return NT_STATUS_OK;
 }
 
@@ -2409,6 +2417,7 @@ NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
 	NTSTATUS status;
 
 	if (tevent_req_is_nterror(req, &status)) {
+		state->cli->raw_status = status;
 		tevent_req_received(req);
 		return status;
 	}
@@ -2416,6 +2425,7 @@ NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
 	if (pwritten != NULL) {
 		*pwritten = (size_t)state->written;
 	}
+	state->cli->raw_status = NT_STATUS_OK;
 	tevent_req_received(req);
 	return NT_STATUS_OK;
 }
@@ -2573,11 +2583,13 @@ NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
 	NTSTATUS status;
 
 	if (tevent_req_is_nterror(req, &status)) {
+		state->cli->raw_status = status;
 		return status;
 	}
 	if (pwritten != NULL) {
 		*pwritten = (size_t)state->written;
 	}
+	state->cli->raw_status = NT_STATUS_OK;
 	return NT_STATUS_OK;
 }
 
@@ -2838,12 +2850,14 @@ NTSTATUS cli_smb2_splice_recv(struct tevent_req *req, off_t *written)
 	NTSTATUS status;
 
 	if (tevent_req_is_nterror(req, &status)) {
+		state->cli->raw_status = status;
 		tevent_req_received(req);
 		return status;
 	}
 	if (written != NULL) {
 		*written = state->written;
 	}
+	state->cli->raw_status = NT_STATUS_OK;
 	tevent_req_received(req);
 	return NT_STATUS_OK;
 }
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index cb0d284..89e9412 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -132,6 +132,7 @@ struct fruit_config_data {
 	bool unix_info_enabled;
 	bool copyfile_enabled;
 	bool veto_appledouble;
+	bool posix_rename;
 
 	/*
 	 * Additional options, all enabled by default,
@@ -1355,6 +1356,9 @@ static int init_fruit_config(vfs_handle_struct *handle)
 	config->use_copyfile = lp_parm_bool(-1, FRUIT_PARAM_TYPE_NAME,
 					   "copyfile", false);
 
+	config->posix_rename = lp_parm_bool(
+		SNUM(handle->conn), FRUIT_PARAM_TYPE_NAME, "posix_rename", true);
+
 	config->readdir_attr_rsize = lp_parm_bool(
 		SNUM(handle->conn), "readdir_attr", "aapl_rsize", true);
 
@@ -3427,7 +3431,7 @@ static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
 			fsp->aapl_copyfile_supported = true;
 		}
 
-		if (fsp->is_directory) {
+		if (config->posix_rename && fsp->is_directory) {
 			/*
 			 * Enable POSIX directory rename behaviour
 			 */
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index f2c9184..e89575d 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -940,34 +940,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 			TALLOC_FREE(found_name);
 		} /* end else */
 
-#ifdef DEVELOPER
-		/*
-		 * This sucks!
-		 * We should never provide different behaviors
-		 * depending on DEVELOPER!!!
-		 */
-		if (VALID_STAT(smb_fname->st)) {
-			bool delete_pending;
-			uint32_t name_hash;
-
-			status = file_name_hash(conn,
-					smb_fname_str_dbg(smb_fname),
-					&name_hash);
-			if (!NT_STATUS_IS_OK(status)) {
-				goto fail;
-			}
-
-			get_file_infos(vfs_file_id_from_sbuf(conn,
-							     &smb_fname->st),
-				       name_hash,
-				       &delete_pending, NULL);
-			if (delete_pending) {
-				status = NT_STATUS_DELETE_PENDING;
-				goto fail;
-			}
-		}
-#endif
-
 		/*
 		 * Add to the dirpath that we have resolved so far.
 		 */
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 15f29a8..9e3e95c 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -727,6 +727,13 @@ struct smbd_smb2_request {
 	struct files_struct *compat_chain_fsp;
 
 	/*
+	 * Keep track of whether the outstanding request counters
+	 * had been updated in dispatch, so that they need to be
+	 * adapted again in reply.
+	 */
+	bool request_counters_updated;
+
+	/*
 	 * The sub request for async backend calls.
 	 * This is used for SMB2 Cancel.
 	 */
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index ba8946d..0c70250 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -181,6 +181,7 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
 bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir)
 {
 	int snum;
+	enum remote_arch_types ra_type;
 
 	if (!conn)  {
 		last_conn = NULL;
@@ -206,28 +207,35 @@ bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir)
 	last_conn = conn;
 	last_flags = flags;
 
-	/* Obey the client case sensitivity requests - only for clients that support it. */
+	/*
+	 * Obey the client case sensitivity requests - only for clients that
+	 * support it. */
 	switch (lp_case_sensitive(snum)) {
-		case Auto:
-			{
-				/* We need this uglyness due to DOS/Win9x clients that lie about case insensitivity. */
-				enum remote_arch_types ra_type = get_remote_arch();
-				if ((ra_type != RA_SAMBA) && (ra_type != RA_CIFSFS)) {
-					/* Client can't support per-packet case sensitive pathnames. */
-					conn->case_sensitive = False;
-				} else {
-					conn->case_sensitive = !(flags & FLAG_CASELESS_PATHNAMES);
-				}
-			}
-			break;
-		case True:
-			conn->case_sensitive = True;
-			break;
-		default:
-			conn->case_sensitive = False;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list