[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Mar 18 20:20:02 UTC 2019


The branch, master has been updated
       via  7d4865610f9 vfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override
       via  6a1e5fbfcd3 selftest: test vfs_nfs4acl_xattr in nfs mode
       via  c6ab2e6b735 vfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount
       via  ebf9826158c nfs4acl_xattr: reformat enum nfs4acl_encoding to one per line
       via  068721f4779 nfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions
       via  ba1fe6d11a0 nfs4acl_xattr: move a define to a common header file
       via  3490a6e27ae nfs4acl_xattr: move some functions to a seperate file
       via  10a230b98fa nfs4acl_xattr: append 'i' to nfs4acl functions
       via  6fa6ab1c73a nfs4acl_xattr: identifiers are XDR encoded as integers
       via  e872227bfbf libsmb: Fix a "assuming signed overflow does not occur" error
       via  7da54f6fd3e libsmb: Align integer types
       via  d0dc4033cc0 heimdal: Fix "assuming signed overflow doesnt occur" error
       via  4e6f32ad7de libsmb: Use cli_smb2_query_info_fnum
       via  5909709e3b2 libsmb: Add cli_smb2_query_info_fnum
       via  7e6991565ee libsmb: Change cli_posix_stat_send to take a pointer to sbuf
       via  cfc3f32038e libsmb: Make cli_posix_[sym|hard]link proper tevent_req functions
       via  2040196e10c libsmb: Use tevent_req_simple_finish_ntstatus
       via  855b785a7ac smbd: Remove two unnecessary return; statements
       via  769b51dae8a torture3: Fix an error message
       via  068f42bed78 libsmb: Use a direct struct initializer
       via  2f3e251dccb libcli: Align integer types
       via  d5877ec49e1 idl: Remove a trailing empty line
       via  636c09c8132 libcli: Add a comment explaining lack of overflow checks
       via  6625d35643b idl: Fix a typo
       via  10c70e2311d rpc_server: Give mdssd its header file
       via  311d86818ce rpc_server: Give fssd its header file
       via  2f47163a0e5 rpc_server: Give lsasd its header file
       via  38f780aedfc rpc_server: Give epmd its header file
      from  69d7a496d3b s3:client: Fix smbspool device uri handling

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


- Log -----------------------------------------------------------------
commit 7d4865610f9542555c212540c35d98536c1f37e7
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Nov 29 11:17:08 2018 +0100

    vfs_nfs4acl_xattr: check status for NT_STATUS_ACCESS_DENIED in take ownership override
    
    This was missing in commit 8b1b1cd8cc561378058b915e03996ff567355d81.
    
    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): Mon Mar 18 20:19:30 UTC 2019 on sn-devel-144

commit 6a1e5fbfcd33e849e7360c4c0eb7abf21ddb0eb8
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Nov 26 20:51:14 2018 +0100

    selftest: test vfs_nfs4acl_xattr in nfs mode
    
    The same tests as for the other modes xdr and ndr are marked as
    knownfail.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c6ab2e6b735901c8aca33928b4b17f3c784aede0
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Nov 29 11:01:59 2018 +0100

    vfs_nfs4acl_xattr: support for NFS 4.0 and 4.1 ACLs from NFS4 mount
    
    This adds a new main switch "nfs" to "nfs4acl_xattr:encoding" which
    enables to use NFS4 ACLs from an NFS4 mount on a Linux box. Tested with
    a FreeBSD NFS4 server.
    
    Supports both NFS 4.0 and 4.1 ACLs.
    
    By default NFS4 servers send user and group identifiers in ACLs as
    strings in the format "[USER|GROUP]@DNSDOMAIN". Some NFS4 servers
    support sending identifiers as numeric strings. This module does support
    this as well, the config knob "nfs4acl_xattr:nfs4_id_numeric = yes|no"
    controls behaviour.
    
    When "nfs4acl_xattr:encoding" is set to "nfs", the new option
    "nfs4acl_xattr:validate_mode", which defauts to "yes" is set to "no" to
    avoid checking and munging the mode on files.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ebf9826158c2109a6d5702ad26aa41afdf982386
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Nov 26 16:31:42 2018 +0100

    nfs4acl_xattr: reformat enum nfs4acl_encoding to one per line
    
    In preperation of adding another enum value.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 068721f4779eacfa6db870077713dc6037c1bcb5
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Nov 26 16:30:38 2018 +0100

    nfs4acl_xattr: add RFC compliant NFS 4.0 and 4.1 ACL defintions
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ba1fe6d11a0e3d5651150ddfb80f8fab7f5f7318
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Nov 26 16:29:43 2018 +0100

    nfs4acl_xattr: move a define to a common header file
    
    In preperation of a adding real NFS backend.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3490a6e27ae0ca5ebe33092aa08d6271e8ffd420
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Nov 25 12:07:26 2018 +0100

    nfs4acl_xattr: move some functions to a seperate file
    
    These functions will be called from another translation unit in a
    subsequent commit.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 10a230b98faef634cee2343b5620ae5abdb6586b
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Nov 25 11:47:48 2018 +0100

    nfs4acl_xattr: append 'i' to nfs4acl functions
    
    This reflects the new struct names the functions use.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6fa6ab1c73a057e561bc1a7db4895ba716f7861f
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Nov 22 18:27:47 2018 +0100

    nfs4acl_xattr: identifiers are XDR encoded as integers
    
    The structs nfsacl41 and nfsace4 are not RFC 3530 compliant, let's
    rename them adding a trailing "i" that indicates that the structs store
    identifiers as integers.
    
      struct nfsace4  -> struct nfsace4i
      struct nfsacl41 -> struct nfsacl41i
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit e872227bfbf63742b549a32eb98487bf61403532
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 18 09:41:57 2019 +0100

    libsmb: Fix a "assuming signed overflow does not occur" error
    
    Eventually we need to convert internal_resolve_name to "size_t" for
    "return_count". But that's a patch for another day :-)
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 7da54f6fd3e7493e0a37cfffc78cec2d5c4a4366
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 18 09:32:27 2019 +0100

    libsmb: Align integer types
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit d0dc4033cc0b636914611883caaaf6cddf527223
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 18 09:30:17 2019 +0100

    heimdal: Fix "assuming signed overflow doesnt occur" error
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

commit 4e6f32ad7de13c2659cfa1dde4aad0980052ad10
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 10 19:08:20 2019 +0100

    libsmb: Use cli_smb2_query_info_fnum
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 5909709e3b23a36dab0c294071bcbc50c0b195da
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 10 18:49:55 2019 +0100

    libsmb: Add cli_smb2_query_info_fnum
    
    This wraps getting the file handle from the fnum
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7e6991565ee335cc300cb330874b44155f950bcc
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 13 16:10:33 2019 +0100

    libsmb: Change cli_posix_stat_send to take a pointer to sbuf
    
    This moves the parsing work from the _recv function into the _done
    function. This makes writing the SMB2 call easier later on: We can
    have a smb2-specific done function doing the smb2-specific work and we
    don't have to fork on protocol in the _recv function.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cfc3f32038e9373eeab0a26d2d7b6f4eca2fecc0
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 14:23:35 2019 +0100

    libsmb: Make cli_posix_[sym|hard]link proper tevent_req functions
    
    Simplify adding SMB2 to those functions
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2040196e10cbcd5746e280ecbc0298b55805ad4c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 20:46:45 2019 +0100

    libsmb: Use tevent_req_simple_finish_ntstatus
    
    Less lines of code
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 855b785a7acd1cc89b95ed0c306ef6f205066c05
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 8 14:58:02 2019 +0100

    smbd: Remove two unnecessary return; statements
    
    return; is unnecessary at the end of a void function
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 769b51dae8ab4533741ac83ef7c365ae17bf9478
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 11:40:23 2019 +0100

    torture3: Fix an error message
    
    We tried to open "dname", not "fname"
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 068f42bed782f3489086909b202be942d1160845
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 10 15:40:45 2019 +0100

    libsmb: Use a direct struct initializer
    
    There's a few ways to initialize a DATA_BLOB to NULL. There's the
    variable data_blob_null, there's ZERO_STRUCTP, and the explicit
    initializer. And there's the data_blob() macro which calls into
    data_blob_talloc_named. You have to look at that routine to see that
    this is nothing more than a ZERO_STRUCT() and not calling into
    talloc. Choose the more direct way.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2f3e251dccbd2c7a79789b9a48c12c360a17fc91
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 10 15:36:53 2019 +0100

    libcli: Align integer types
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit d5877ec49e17bcc7012deeb0176837f7fc0d6c0f
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 16:18:03 2019 +0100

    idl: Remove a trailing empty line
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 636c09c8132dd48ece6c40d86f3c93e73d8cfc1d
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 16:13:10 2019 +0100

    libcli: Add a comment explaining lack of overflow checks
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6625d35643be100d07b9cd9e379951fd6d4a1f95
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 14 17:16:12 2019 +0100

    idl: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 10c70e2311d60353592f7dc1733fd3b1dc11cef6
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 15 09:52:16 2019 +0100

    rpc_server: Give mdssd its header file
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 311d86818cefbc7897eb4188d42c7400983cdf25
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 15 09:43:07 2019 +0100

    rpc_server: Give fssd its header file
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2f47163a0e57276a638ab204400be0fd70089297
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 15 09:40:21 2019 +0100

    rpc_server: Give lsasd its header file
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 38f780aedfc3942c8f8356878a20f7c68d9182ef
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Mar 15 09:36:35 2019 +0100

    rpc_server: Give epmd its header file
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 docs-xml/manpages/vfs_nfs4acl_xattr.8.xml          |  34 +-
 libcli/named_pipe_auth/npa_tstream.c               |   3 +
 libcli/smb/smb2_create_blob.c                      |   4 +-
 librpc/idl/auth.idl                                |   2 +-
 librpc/idl/named_pipe_auth.idl                     |   1 -
 selftest/knownfail                                 |   9 +
 selftest/target/Samba3.pm                          |  18 +
 source3/libsmb/cli_smb2_fnum.c                     | 526 ++++++------
 source3/libsmb/cli_smb2_fnum.h                     |  24 +
 source3/libsmb/clifile.c                           | 167 ++--
 source3/libsmb/namequery.c                         |   9 +-
 source3/libsmb/proto.h                             |  10 +-
 source3/modules/nfs41acl.x                         |  17 +
 source3/modules/nfs4acl_xattr.h                    |  10 +-
 source3/modules/nfs4acl_xattr_nfs.c                | 890 +++++++++++++++++++++
 .../{nfs4acl_xattr_xdr.h => nfs4acl_xattr_nfs.h}   |  15 +-
 source3/modules/nfs4acl_xattr_util.c               |  73 ++
 .../modules/nfs4acl_xattr_util.h                   |  18 +-
 source3/modules/nfs4acl_xattr_xdr.c                | 131 ++-
 source3/modules/nfs4acl_xattr_xdr.h                |   1 -
 source3/modules/vfs_nfs4acl_xattr.c                |  36 +
 source3/modules/wscript_build                      |   2 +
 source3/rpc_server/epmd.c                          |   4 +-
 .../rpc_server/{mdssvc/srv_mdssvc_nt.h => epmd.h}  |  18 +-
 source3/rpc_server/fssd.c                          |   1 +
 .../rpc_server/{mdssvc/srv_mdssvc_nt.h => fssd.h}  |  18 +-
 source3/rpc_server/lsasd.c                         |   4 +-
 .../rpc_server/{mdssvc/srv_mdssvc_nt.h => lsasd.h} |  18 +-
 source3/rpc_server/mdssd.c                         |   1 +
 .../rpc_server/{mdssvc/srv_mdssvc_nt.h => mdssd.h} |  18 +-
 source3/selftest/tests.py                          |   2 +
 source3/smbd/server.c                              |  16 +-
 source3/smbd/smb2_create.c                         |   3 -
 source3/torture/torture.c                          |   4 +-
 .../heimdal/lib/hcrypto/libtommath/bn_mp_rshd.c    |   8 +-
 35 files changed, 1658 insertions(+), 457 deletions(-)
 create mode 100644 source3/modules/nfs4acl_xattr_nfs.c
 copy source3/modules/{nfs4acl_xattr_xdr.h => nfs4acl_xattr_nfs.h} (70%)
 create mode 100644 source3/modules/nfs4acl_xattr_util.c
 copy lib/util/talloc_report.h => source3/modules/nfs4acl_xattr_util.h (64%)
 copy source3/rpc_server/{mdssvc/srv_mdssvc_nt.h => epmd.h} (72%)
 copy source3/rpc_server/{mdssvc/srv_mdssvc_nt.h => fssd.h} (71%)
 copy source3/rpc_server/{mdssvc/srv_mdssvc_nt.h => lsasd.h} (71%)
 copy source3/rpc_server/{mdssvc/srv_mdssvc_nt.h => mdssd.h} (71%)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml b/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
index c8780388184..c0fcee86b8c 100644
--- a/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
+++ b/docs-xml/manpages/vfs_nfs4acl_xattr.8.xml
@@ -45,12 +45,17 @@
     <variablelist>
 
       <varlistentry>
-	<term>nfs4acl_xattr:encoding = [ndr|xdr]</term>
+	<term>nfs4acl_xattr:encoding = [nfs|ndr|xdr]</term>
 	<listitem>
 	  <para>This parameter configures the marshaling format used in the ACL
 	  blob and the default extended attribute name used to store the blob.
 	  </para>
 
+	  <para>When set to <emphasis>nfs</emphasis> - fetch and store the NT
+	  ACL in NFS 4.0 or 4.1 compatible XDR encoding. By default this uses
+	  the extended attribute "system.nfs4_acl". This setting also
+	  disables <emphasis>validate_mode</emphasis>.</para>
+
 	  <para>When set to <emphasis>ndr (default)</emphasis> - store the NT
 	  ACL with POSIX draft NFSv4 compatible NDR encoding. By default this
 	  uses the extended attribute "security.nfs4acl_ndr".</para>
@@ -106,6 +111,33 @@
 	</listitem>
       </varlistentry>
 
+      <varlistentry>
+	<term>nfs4acl_xattr:nfs4_id_numeric = yes|no (default: no)</term>
+	<listitem>
+	  <para>This parameter tells the module how the NFS4 server encodes user
+	  and group identifiers on the network. With the default setting the
+	  module expects identifiers encoded as per the NFS4 RFC as
+	  user at domain.</para>
+	  <para>When set to <emphasis>yes</emphasis>, the module expects the
+	  identifiers as numeric string.</para>
+	  <para>The default for this options<emphasis>no</emphasis>.</para>
+	</listitem>
+      </varlistentry>
+
+      <varlistentry>
+	<term>nfs4acl_xattr:validate_mode = yes|no</term>
+	<listitem>
+	  <para>This parameter configures whether the module enforces the POSIX
+	  mode is set to 0777 for directores and 0666 for files. If this
+	  constrained is not met, the xattr with the ACL blob is
+	  discarded.</para>
+	  <para>The default depends on the setting for
+	  <emphasis>nfs4acl_xattr:encoding</emphasis>: when set to
+	  <emphasis>nfs</emphasis> this setting is disabled by default,
+	  otherwise it is enabled.</para>
+	</listitem>
+      </varlistentry>
+
     </variablelist>
   </refsect1>
 
diff --git a/libcli/named_pipe_auth/npa_tstream.c b/libcli/named_pipe_auth/npa_tstream.c
index 8ec52ed9b85..9ae4acb7f0b 100644
--- a/libcli/named_pipe_auth/npa_tstream.c
+++ b/libcli/named_pipe_auth/npa_tstream.c
@@ -852,6 +852,9 @@ static struct tevent_req *tstream_npa_writev_send(TALLOC_CTX *mem_ctx,
 
 		msg_len = 0;
 		for (i=0; i < count; i++) {
+			/*
+			 * overflow check already done in tstream_writev_send
+			 */
 			msg_len += vector[i].iov_len;
 		}
 
diff --git a/libcli/smb/smb2_create_blob.c b/libcli/smb/smb2_create_blob.c
index c6b2e1e7c88..457ed290fba 100644
--- a/libcli/smb/smb2_create_blob.c
+++ b/libcli/smb/smb2_create_blob.c
@@ -156,10 +156,10 @@ static NTSTATUS smb2_create_blob_push_one(TALLOC_CTX *mem_ctx, DATA_BLOB *buffer
 NTSTATUS smb2_create_blob_push(TALLOC_CTX *mem_ctx, DATA_BLOB *buffer,
 			       const struct smb2_create_blobs blobs)
 {
-	int i;
+	uint32_t i;
 	NTSTATUS status;
 
-	*buffer = data_blob(NULL, 0);
+	*buffer = (DATA_BLOB) { 0 };
 	for (i=0; i < blobs.num_blobs; i++) {
 		bool last = false;
 		const struct smb2_create_blob *c;
diff --git a/librpc/idl/auth.idl b/librpc/idl/auth.idl
index d26f57579a3..1092935b971 100644
--- a/librpc/idl/auth.idl
+++ b/librpc/idl/auth.idl
@@ -108,7 +108,7 @@ interface auth
 
 	        /*
 		 * It is really handy to have our authorization code log a
-		 * token that can be used to tie later requests togeather.
+		 * token that can be used to tie later requests together.
 		 * We generate this in auth_generate_session_info()
 		 */
 	        GUID unique_session_token;
diff --git a/librpc/idl/named_pipe_auth.idl b/librpc/idl/named_pipe_auth.idl
index 364ba9fdd0b..e5f0b1833a0 100644
--- a/librpc/idl/named_pipe_auth.idl
+++ b/librpc/idl/named_pipe_auth.idl
@@ -55,4 +55,3 @@ interface named_pipe_auth
 		NTSTATUS status;
 	} named_pipe_auth_rep;
 }
-
diff --git a/selftest/knownfail b/selftest/knownfail
index 750b5f51e3f..fad4daf6c86 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -44,6 +44,15 @@
 ^samba3.raw.acls nfs4acl_xattr-xdr-41.create_owner_file\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-xdr-41.create_owner_dir\(nt4_dc\)
 ^samba3.raw.acls nfs4acl_xattr-xdr-41.nulldacl\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.INHERITFLAGS\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.create_owner_file\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.create_owner_dir\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.nulldacl\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.inherit_creator_owner\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-40.inherit_creator_group\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-41.create_owner_file\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-41.create_owner_dir\(nt4_dc\)
+^samba3.raw.acls nfs4acl_xattr-nfs-41.nulldacl\(nt4_dc\)
 ^samba3.base.delete.deltest16a
 ^samba3.base.delete.deltest17a
 ^samba3.unix.whoami anonymous connection.whoami\(ad_dc\) # We need to resolve if we should be including SID_NT_WORLD and SID_NT_NETWORK in this token
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index cbf5309a9a3..647a3b50dfc 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1973,6 +1973,24 @@ sub provision($$$$$$$$$)
 	nfs4acl_xattr:encoding = xdr
 	nfs4acl_xattr:version = 41
 
+[nfs4acl_nfs_40]
+	path = $shrdir
+	comment = smb username is [%U]
+	vfs objects = nfs4acl_xattr xattr_tdb
+	nfs4:mode = simple
+	nfs4acl_xattr:encoding = nfs
+	nfs4acl_xattr:version = 40
+	nfs4acl_xattr:xattr_name = security.nfs4acl_xdr
+
+[nfs4acl_nfs_41]
+	path = $shrdir
+	comment = smb username is [%U]
+	vfs objects = nfs4acl_xattr xattr_tdb
+	nfs4:mode = simple
+	nfs4acl_xattr:encoding = nfs
+	nfs4acl_xattr:version = 41
+	nfs4acl_xattr:xattr_name = security.nfs4acl_xdr
+
 [xcopy_share]
 	path = $shrdir
 	comment = smb username is [%U]
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 76eec6b3a0b..fd73e26fb2a 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -1546,6 +1546,161 @@ NTSTATUS cli_smb2_chkpath(struct cli_state *cli,
 	return cli_smb2_close_fnum(cli, fnum);
 }
 
+struct cli_smb2_query_info_fnum_state {
+	DATA_BLOB outbuf;
+};
+
+static void cli_smb2_query_info_fnum_done(struct tevent_req *subreq);
+
+struct tevent_req *cli_smb2_query_info_fnum_send(
+	TALLOC_CTX *mem_ctx,
+	struct tevent_context *ev,
+	struct cli_state *cli,
+	uint16_t fnum,
+	uint8_t in_info_type,
+	uint8_t in_info_class,
+	uint32_t in_max_output_length,
+	const DATA_BLOB *in_input_buffer,
+	uint32_t in_additional_info,
+	uint32_t in_flags)
+{
+	struct tevent_req *req = NULL, *subreq = NULL;
+	struct cli_smb2_query_info_fnum_state *state = NULL;
+	struct smb2_hnd *ph = NULL;
+	NTSTATUS status;
+
+	req = tevent_req_create(
+		mem_ctx, &state, struct cli_smb2_query_info_fnum_state);
+	if (req == NULL) {
+		return req;
+	}
+
+	status = map_fnum_to_smb2_handle(cli, fnum, &ph);
+	if (tevent_req_nterror(req, status)) {
+		return tevent_req_post(req, ev);
+	}
+
+	subreq = smb2cli_query_info_send(
+		state,
+		ev,
+		cli->conn,
+		cli->timeout,
+		cli->smb2.session,
+		cli->smb2.tcon,
+		in_info_type,
+		in_info_class,
+		in_max_output_length,
+		in_input_buffer,
+		in_additional_info,
+		in_flags,
+		ph->fid_persistent,
+		ph->fid_volatile);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, cli_smb2_query_info_fnum_done, req);
+	return req;
+}
+
+static void cli_smb2_query_info_fnum_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct cli_smb2_query_info_fnum_state *state = tevent_req_data(
+		req, struct cli_smb2_query_info_fnum_state);
+	DATA_BLOB outbuf;
+	NTSTATUS status;
+
+	status = smb2cli_query_info_recv(subreq, state, &outbuf);
+	TALLOC_FREE(subreq);
+	if (tevent_req_nterror(req, status)) {
+		return;
+	}
+
+	/*
+	 * We have to dup the memory here because outbuf.data is not
+	 * returned as a talloc object by smb2cli_query_info_recv.
+	 * It's a pointer into the received buffer.
+	 */
+	state->outbuf = data_blob_dup_talloc(state, outbuf);
+
+	if ((outbuf.length != 0) &&
+	    tevent_req_nomem(state->outbuf.data, req)) {
+		return;
+	}
+	tevent_req_done(req);
+}
+
+NTSTATUS cli_smb2_query_info_fnum_recv(
+	struct tevent_req *req, TALLOC_CTX *mem_ctx, DATA_BLOB *outbuf)
+{
+	struct cli_smb2_query_info_fnum_state *state = tevent_req_data(
+		req, struct cli_smb2_query_info_fnum_state);
+	NTSTATUS status;
+
+	if (tevent_req_is_nterror(req, &status)) {
+		return status;
+	}
+	*outbuf = (DATA_BLOB) {
+		.data = talloc_move(mem_ctx, &state->outbuf.data),
+		.length = state->outbuf.length,
+	};
+	return NT_STATUS_OK;
+}
+
+NTSTATUS cli_smb2_query_info_fnum(
+	struct cli_state *cli,
+	uint16_t fnum,
+	uint8_t in_info_type,
+	uint8_t in_info_class,
+	uint32_t in_max_output_length,
+	const DATA_BLOB *in_input_buffer,
+	uint32_t in_additional_info,
+	uint32_t in_flags,
+	TALLOC_CTX *mem_ctx,
+	DATA_BLOB *outbuf)
+{
+	TALLOC_CTX *frame = talloc_stackframe();
+	struct tevent_context *ev = NULL;
+	struct tevent_req *req = NULL;
+	NTSTATUS status = NT_STATUS_NO_MEMORY;
+	bool ok;
+
+	if (smbXcli_conn_has_async_calls(cli->conn)) {
+		/*
+		 * Can't use sync call while an async call is in flight
+		 */
+		status = NT_STATUS_INVALID_PARAMETER;
+		goto fail;
+	}
+	ev = samba_tevent_context_init(frame);
+	if (ev == NULL) {
+		goto fail;
+	}
+	req = cli_smb2_query_info_fnum_send(
+		frame,
+		ev,
+		cli,
+		fnum,
+		in_info_type,
+		in_info_class,
+		in_max_output_length,
+		in_input_buffer,
+		in_additional_info,
+		in_flags);
+	if (req == NULL) {
+		goto fail;
+	}
+	ok = tevent_req_poll_ntstatus(req, ev, &status);
+	if (!ok) {
+		goto fail;
+	}
+	status = cli_smb2_query_info_fnum_recv(req, mem_ctx, outbuf);
+fail:
+	TALLOC_FREE(frame);
+	return status;
+}
+
 /***************************************************************
  Helper function for pathname operations.
 ***************************************************************/
@@ -1648,7 +1803,6 @@ NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
 	NTSTATUS status;
 	DATA_BLOB outbuf = data_blob_null;
 	uint16_t fnum = 0xffff;
-	struct smb2_hnd *ph = NULL;
 	uint32_t altnamelen = 0;
 	TALLOC_CTX *frame = talloc_stackframe();
 
@@ -1674,30 +1828,17 @@ NTSTATUS cli_smb2_qpathinfo_alt_name(struct cli_state *cli,
 		goto fail;
 	}
 
-	status = map_fnum_to_smb2_handle(cli,
-					fnum,
-					&ph);
-	if (!NT_STATUS_IS_OK(status)) {
-		goto fail;
-	}
-
-	/* getinfo on the handle with info_type SMB2_GETINFO_FILE (1),
-	   level SMB_FILE_ALTERNATE_NAME_INFORMATION (1021) == SMB2 21 */
-
-	status = smb2cli_query_info(cli->conn,
-				cli->timeout,
-				cli->smb2.session,
-				cli->smb2.tcon,
-				1, /* in_info_type */
-				(SMB_FILE_ALTERNATE_NAME_INFORMATION - 1000), /* in_file_info_class */
-				0xFFFF, /* in_max_output_length */
-				NULL, /* in_input_buffer */
-				0, /* in_additional_info */
-				0, /* in_flags */
-				ph->fid_persistent,
-				ph->fid_volatile,
-				frame,
-				&outbuf);
+	status = cli_smb2_query_info_fnum(
+		cli,
+		fnum,
+		1, /* in_info_type */
+		(SMB_FILE_ALTERNATE_NAME_INFORMATION - 1000), /* in_file_info_class */
+		0xFFFF, /* in_max_output_length */
+		NULL, /* in_input_buffer */
+		0, /* in_additional_info */
+		0, /* in_flags */
+		frame,
+		&outbuf);
 
 	if (!NT_STATUS_IS_OK(status)) {
 		goto fail;
@@ -1768,7 +1909,6 @@ NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
 {
 	NTSTATUS status;
 	DATA_BLOB outbuf = data_blob_null;
-	struct smb2_hnd *ph = NULL;
 	TALLOC_CTX *frame = talloc_stackframe();
 
 	if (smbXcli_conn_has_async_calls(cli->conn)) {
@@ -1784,30 +1924,20 @@ NTSTATUS cli_smb2_qfileinfo_basic(struct cli_state *cli,
 		goto fail;
 	}
 
-	status = map_fnum_to_smb2_handle(cli,
-					fnum,
-					&ph);
-	if (!NT_STATUS_IS_OK(status)) {
-		goto fail;
-	}
-
 	/* getinfo on the handle with info_type SMB2_GETINFO_FILE (1),
 	   level 0x12 (SMB2_FILE_ALL_INFORMATION). */
 
-	status = smb2cli_query_info(cli->conn,
-				cli->timeout,
-				cli->smb2.session,
-				cli->smb2.tcon,
-				1, /* in_info_type */
-				(SMB_FILE_ALL_INFORMATION - 1000), /* in_file_info_class */
-				0xFFFF, /* in_max_output_length */
-				NULL, /* in_input_buffer */
-				0, /* in_additional_info */
-				0, /* in_flags */
-				ph->fid_persistent,
-				ph->fid_volatile,
-				frame,
-				&outbuf);
+	status = cli_smb2_query_info_fnum(
+		cli,
+		fnum,
+		1, /* in_info_type */
+		(SMB_FILE_ALL_INFORMATION - 1000), /* in_file_info_class */
+		0xFFFF, /* in_max_output_length */
+		NULL, /* in_input_buffer */
+		0, /* in_additional_info */
+		0, /* in_flags */
+		frame,
+		&outbuf);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto fail;
 	}
@@ -2047,7 +2177,6 @@ NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
 				struct stream_struct **pstreams)
 {
 	NTSTATUS status;
-	struct smb2_hnd *ph = NULL;
 	uint16_t fnum = 0xffff;
 	DATA_BLOB outbuf = data_blob_null;
 	TALLOC_CTX *frame = talloc_stackframe();
@@ -2074,30 +2203,20 @@ NTSTATUS cli_smb2_qpathinfo_streams(struct cli_state *cli,
 		goto fail;
 	}
 
-	status = map_fnum_to_smb2_handle(cli,
-					fnum,
-					&ph);
-	if (!NT_STATUS_IS_OK(status)) {
-		goto fail;
-	}
-
 	/* getinfo on the handle with info_type SMB2_GETINFO_FILE (1),
 	   level 22 (SMB2_FILE_STREAM_INFORMATION). */
 
-	status = smb2cli_query_info(cli->conn,
-				cli->timeout,
-				cli->smb2.session,
-				cli->smb2.tcon,
-				1, /* in_info_type */
-				(SMB_FILE_STREAM_INFORMATION - 1000), /* in_file_info_class */
-				0xFFFF, /* in_max_output_length */
-				NULL, /* in_input_buffer */
-				0, /* in_additional_info */
-				0, /* in_flags */
-				ph->fid_persistent,
-				ph->fid_volatile,
-				frame,
-				&outbuf);
+	status = cli_smb2_query_info_fnum(
+		cli,
+		fnum,
+		1, /* in_info_type */
+		(SMB_FILE_STREAM_INFORMATION - 1000), /* in_file_info_class */
+		0xFFFF, /* in_max_output_length */
+		NULL, /* in_input_buffer */
+		0, /* in_additional_info */
+		0, /* in_flags */
+		frame,
+		&outbuf);
 
 	if (!NT_STATUS_IS_OK(status)) {
 		goto fail;
@@ -2332,7 +2451,6 @@ NTSTATUS cli_smb2_dskattr(struct cli_state *cli, const char *path,
 	NTSTATUS status;
 	uint16_t fnum = 0xffff;
 	DATA_BLOB outbuf = data_blob_null;
-	struct smb2_hnd *ph = NULL;
 	uint32_t sectors_per_unit = 0;
 	uint32_t bytes_per_sector = 0;
 	uint64_t total_size = 0;
@@ -2372,30 +2490,20 @@ NTSTATUS cli_smb2_dskattr(struct cli_state *cli, const char *path,
 		goto fail;
 	}
 
-	status = map_fnum_to_smb2_handle(cli,
-					fnum,
-					&ph);
-	if (!NT_STATUS_IS_OK(status)) {
-		goto fail;
-	}
-
 	/* getinfo on the returned handle with info_type SMB2_GETINFO_FS (2),
 	   level 3 (SMB_FS_SIZE_INFORMATION). */
 
-	status = smb2cli_query_info(cli->conn,
-				cli->timeout,
-				cli->smb2.session,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list