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

Karolin Seeger kseeger at samba.org
Tue Jun 10 05:09:03 MDT 2014


The branch, v4-1-test has been updated
       via  5663c4a winbindd: Ensure we do not look at rid_array before checking if it was returned
       via  b42fb61 s3: libsmbclient: Work around bugs in SLES cifsd and Apple smbx SMB1 servers.
       via  5857b18 s3: client : correctly fill in the struct smb_create_returns from cli_ntcreate(), cli_ntcreate_recv(), cli_nttrans_create() and cli_nttrans_create_recv().
       via  569a4e1 s3: client : Add extra return parameter to all client open calls.
       via  2363553 s3: client - rename 'struct smb2_create_returns' to 'struct smb_create_returns' so we can use this in SMB1 create returns as well.
      from  b1523ef VERSION: Bump version number up to 4.1.9...

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-1-test


- Log -----------------------------------------------------------------
commit 5663c4ac8b7f2c1fbd59177423d35cf8ad31dd82
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Mar 28 16:30:28 2014 +1300

    winbindd: Ensure we do not look at rid_array before checking if it was returned
    
    We no longer return early if there are no members, we just return an empty array.
    
    Fixes bug #10627 - rid_array used before status checked - segmentation fault due to null pointer dereference
    
    https://bugzilla.samba.org/show_bug.cgi?id=10627
    
    Change-Id: I7b0949e0c0b9277426a8007514a8658615f6c709
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(v4-1-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-1-test): Tue Jun 10 13:08:54 CEST 2014 on sn-devel-104

commit b42fb61476413b8a075647b33f967bb3fb992d20
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 8 21:31:49 2014 -0700

    s3: libsmbclient: Work around bugs in SLES cifsd and Apple smbx SMB1 servers.
    
    SLES's cifsd and Apple's smbx do not correctly handle FILE_NON_DIRECTORY_FILE
    which prevents recursive copies in gvfs from working correctly [1] since GVFS
    tries to open the directory, expecting ENOTDIR, but it suceeds and appears as a
    zero byte file.
    
    This fix adds code to the cli_open() open code that checks if
    CreateOptions was requested with FILE_NON_DIRECTORY_FILE set,
    and if the attributes returned include FILE_ATTRIBUTE_DIRECTORY
    we synchronously close the file handle just opened, and return
    NT_STATUS_FILE_IS_A_DIRECTORY to the caller.
    
    Depends on the previous API update to cli_ntcreate()
    to add returned attributes.
    
    Fixes bug #10587 - Opening directories on SLES's cifsd and Apple's smbx succeeds.
    
    https://bugzilla.samba.org/show_bug.cgi?id=10587
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit b2ce2441a35ed68c39791168217d159352b5143c)

commit 5857b18052e25fd3c1fcee45a563bd1b339be4bb
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 8 21:23:22 2014 -0700

    s3: client : correctly fill in the struct smb_create_returns from cli_ntcreate(), cli_ntcreate_recv(), cli_nttrans_create() and cli_nttrans_create_recv().
    
    This completes the update of the create API to return
    all the data returned by the server on open.
    
    We can now use this data to detect buggy servers
    without an extra round trip.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 3d8ba9b34e34c1f3e0c1c231d6b772994b45eeaf)

commit 569a4e10d9e063f79ed51a4381df80c19904d9bd
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 8 20:55:57 2014 -0700

    s3: client : Add extra return parameter to all client open calls.
    
    Add a return parameter of struct smb_create_returns *cr to
    cli_ntcreate()
    cli_ntcreate_recv()
    cli_nttrans_create()
    cli_nttrans_create_recv()
    
    Always pass in NULL for now. This fixes the create
    API to always fully return the data the server has
    given back to us on the open file to the caller.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 69e24b4e8bc607806453ab137efda6d6bf74fb12)

commit 236355398a6cdeb54e61578fe6ea4617e860a772
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 8 20:08:41 2014 -0700

    s3: client - rename 'struct smb2_create_returns' to 'struct smb_create_returns' so we can use this in SMB1 create returns as well.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 2900dfa5b928ef237e72ac4e15481e083d61750a)

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

Summary of changes:
 libcli/smb/smb2_create_blob.h         |    2 +-
 libcli/smb/smb2cli_create.c           |    6 +-
 libcli/smb/smbXcli_base.h             |    6 +-
 source3/client/client.c               |   10 ++--
 source3/libsmb/cli_np_tstream.c       |    2 +-
 source3/libsmb/cli_smb2_fnum.c        |    4 +-
 source3/libsmb/cli_smb2_fnum.h        |    2 +-
 source3/libsmb/clifile.c              |   73 +++++++++++++++++---
 source3/libsmb/cliquota.c             |    2 +-
 source3/libsmb/clisymlink.c           |    4 +-
 source3/libsmb/libsmb_xattr.c         |    6 +-
 source3/libsmb/proto.h                |   14 +++-
 source3/libsmb/pylibsmb.c             |    2 +-
 source3/torture/nbench.c              |    2 +-
 source3/torture/nbio.c                |    2 +-
 source3/torture/test_chain3.c         |    2 +-
 source3/torture/test_cleanup.c        |   14 ++--
 source3/torture/test_notify.c         |    6 +-
 source3/torture/test_notify_online.c  |    4 +-
 source3/torture/test_nttrans_create.c |    4 +-
 source3/torture/test_nttrans_fsctl.c  |    2 +-
 source3/torture/test_posix_append.c   |    2 +-
 source3/torture/torture.c             |  125 +++++++++++++++++----------------
 source3/torture/utable.c              |    2 +-
 source3/utils/net_rpc.c               |    3 +-
 source3/utils/net_rpc_printer.c       |    7 +-
 source3/utils/smbcacls.c              |    6 +-
 source3/winbindd/winbindd_rpc.c       |    6 +-
 28 files changed, 193 insertions(+), 127 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb2_create_blob.h b/libcli/smb/smb2_create_blob.h
index 2f915b3..90697a7 100644
--- a/libcli/smb/smb2_create_blob.h
+++ b/libcli/smb/smb2_create_blob.h
@@ -33,7 +33,7 @@ struct smb2_create_blobs {
 	struct smb2_create_blob *blobs;
 };
 
-struct smb2_create_returns {
+struct smb_create_returns {
 	uint8_t oplock_level;
 	uint32_t create_action;
 	NTTIME creation_time;
diff --git a/libcli/smb/smb2cli_create.c b/libcli/smb/smb2cli_create.c
index 9cb94b1..834a881 100644
--- a/libcli/smb/smb2cli_create.c
+++ b/libcli/smb/smb2cli_create.c
@@ -29,7 +29,7 @@ struct smb2cli_create_state {
 
 	uint64_t fid_persistent;
 	uint64_t fid_volatile;
-	struct smb2_create_returns cr;
+	struct smb_create_returns cr;
 	struct smb2_create_blobs blobs;
 };
 
@@ -225,7 +225,7 @@ static void smb2cli_create_done(struct tevent_req *subreq)
 NTSTATUS smb2cli_create_recv(struct tevent_req *req,
 			     uint64_t *fid_persistent,
 			     uint64_t *fid_volatile,
-			     struct smb2_create_returns *cr)
+			     struct smb_create_returns *cr)
 {
 	struct smb2cli_create_state *state =
 		tevent_req_data(req,
@@ -258,7 +258,7 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
 			struct smb2_create_blobs *blobs,
 			uint64_t *fid_persistent,
 			uint64_t *fid_volatile,
-			struct smb2_create_returns *cr)
+			struct smb_create_returns *cr)
 {
 	TALLOC_CTX *frame = talloc_stackframe();
 	struct tevent_context *ev;
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 5fe4018..28120f4 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -28,7 +28,7 @@ struct smb_trans_enc_state;
 struct GUID;
 struct iovec;
 struct smb2_create_blobs;
-struct smb2_create_returns;
+struct smb_create_returns;
 
 struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx,
 					 int fd,
@@ -366,7 +366,7 @@ struct tevent_req *smb2cli_create_send(
 NTSTATUS smb2cli_create_recv(struct tevent_req *req,
 			     uint64_t *fid_persistent,
 			     uint64_t *fid_volatile,
-			     struct smb2_create_returns *cr);
+			     struct smb_create_returns *cr);
 NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
 			uint32_t timeout_msec,
 			struct smbXcli_session *session,
@@ -382,7 +382,7 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
 			struct smb2_create_blobs *blobs,
 			uint64_t *fid_persistent,
 			uint64_t *fid_volatile,
-			struct smb2_create_returns *cr);
+			struct smb_create_returns *cr);
 
 struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
 				      struct tevent_context *ev,
diff --git a/source3/client/client.c b/source3/client/client.c
index 9d5cec9..ab46cb8 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -579,7 +579,7 @@ static NTSTATUS display_finfo(struct cli_state *cli_state, struct file_info *fin
 		status = cli_ntcreate(cli_state, afname, 0,
 				      CREATE_ACCESS_READ, 0,
 				      FILE_SHARE_READ|FILE_SHARE_WRITE,
-				      FILE_OPEN, 0x0, 0x0, &fnum);
+				      FILE_OPEN, 0x0, 0x0, &fnum, NULL);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG( 0, ("display_finfo() Failed to open %s: %s\n",
 				   afname, nt_errstr(status)));
@@ -1778,7 +1778,7 @@ static int do_allinfo(const char *name)
 			      SEC_STD_SYNCHRONIZE, 0,
 			      FILE_SHARE_READ|FILE_SHARE_WRITE
 			      |FILE_SHARE_DELETE,
-			      FILE_OPEN, 0x0, 0x0, &fnum);
+			      FILE_OPEN, 0x0, 0x0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		/*
 		 * Ignore failure, it does not hurt if we can't list
@@ -2502,12 +2502,12 @@ static int cmd_open(void)
 	status = cli_ntcreate(targetcli, targetname, 0,
 			FILE_READ_DATA|FILE_WRITE_DATA, 0,
 			FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
-			0x0, 0x0, &fnum);
+			0x0, 0x0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		status = cli_ntcreate(targetcli, targetname, 0,
 				FILE_READ_DATA, 0,
 				FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
-				0x0, 0x0, &fnum);
+				0x0, 0x0, &fnum, NULL);
 		if (NT_STATUS_IS_OK(status)) {
 			d_printf("open file %s: for read/write fnum %d\n", targetname, fnum);
 		} else {
@@ -3949,7 +3949,7 @@ static int cmd_notify(void)
 	status = cli_ntcreate(
 		cli, name, 0, FILE_READ_DATA, 0,
 		FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
-		FILE_OPEN, 0, 0, &fnum);
+		FILE_OPEN, 0, 0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("Could not open file: %s\n", nt_errstr(status));
 		goto fail;
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index f3a9962..bf9a0c3 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -204,7 +204,7 @@ static void tstream_cli_np_open_done(struct tevent_req *subreq)
 	NTSTATUS status;
 
 	if (state->is_smb1) {
-		status = cli_ntcreate_recv(subreq, &state->fnum);
+		status = cli_ntcreate_recv(subreq, &state->fnum, NULL);
 	} else {
 		status = smb2cli_create_recv(subreq,
 					     &state->fid_persistent,
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 1e2047e..8eb776a 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -163,7 +163,7 @@ NTSTATUS cli_smb2_create_fnum(struct cli_state *cli,
 			uint32_t create_disposition,
 			uint32_t create_options,
 			uint16_t *pfid,
-			struct smb2_create_returns *cr)
+			struct smb_create_returns *cr)
 {
 	NTSTATUS status;
 	struct smb2_hnd h;
@@ -660,7 +660,7 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
 				uint32_t *attributes)
 {
 	NTSTATUS status;
-	struct smb2_create_returns cr;
+	struct smb_create_returns cr;
 	uint16_t fnum = 0xffff;
 	size_t namelen = strlen(name);
 
diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h
index a5cae25..61a0f68 100644
--- a/source3/libsmb/cli_smb2_fnum.h
+++ b/source3/libsmb/cli_smb2_fnum.h
@@ -34,7 +34,7 @@ NTSTATUS cli_smb2_create_fnum(struct cli_state *cli,
 			uint32_t create_disposition,
 			uint32_t create_options,
 			uint16_t *pfid,
-			struct smb2_create_returns *cr);
+			struct smb_create_returns *cr);
 
 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum);
 NTSTATUS cli_smb2_mkdir(struct cli_state *cli, const char *dirname);
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 424354b..70b769d 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1795,6 +1795,7 @@ NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag)
 struct cli_ntcreate_state {
 	uint16_t vwv[24];
 	uint16_t fnum;
+	struct smb_create_returns cr;
 };
 
 static void cli_ntcreate_done(struct tevent_req *subreq);
@@ -1880,17 +1881,29 @@ static void cli_ntcreate_done(struct tevent_req *subreq)
 	uint8_t *bytes;
 	NTSTATUS status;
 
-	status = cli_smb_recv(subreq, state, NULL, 3, &wct, &vwv,
+	status = cli_smb_recv(subreq, state, NULL, 34, &wct, &vwv,
 			      &num_bytes, &bytes);
 	TALLOC_FREE(subreq);
 	if (tevent_req_nterror(req, status)) {
 		return;
 	}
+	state->cr.oplock_level = CVAL(vwv+2, 0);
 	state->fnum = SVAL(vwv+2, 1);
+	state->cr.create_action = IVAL(vwv+3, 1);
+	state->cr.creation_time = BVAL(vwv+5, 1);
+	state->cr.last_access_time = BVAL(vwv+9, 1);
+	state->cr.last_write_time = BVAL(vwv+13, 1);
+	state->cr.change_time   = BVAL(vwv+17, 1);
+	state->cr.file_attributes = IVAL(vwv+21, 1);
+	state->cr.allocation_size = BVAL(vwv+23, 1);
+	state->cr.end_of_file   = BVAL(vwv+27, 1);
+
 	tevent_req_done(req);
 }
 
-NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum)
+NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
+		uint16_t *pfnum,
+		struct smb_create_returns *cr)
 {
 	struct cli_ntcreate_state *state = tevent_req_data(
 		req, struct cli_ntcreate_state);
@@ -1900,6 +1913,9 @@ NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum)
 		return status;
 	}
 	*pfnum = state->fnum;
+	if (cr != NULL) {
+		*cr = state->cr;
+	}
 	return NT_STATUS_OK;
 }
 
@@ -1912,7 +1928,8 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
 		      uint32_t CreateDisposition,
 		      uint32_t CreateOptions,
 		      uint8_t SecurityFlags,
-		      uint16_t *pfid)
+		      uint16_t *pfid,
+		      struct smb_create_returns *cr)
 {
 	TALLOC_CTX *frame = NULL;
 	struct tevent_context *ev;
@@ -1929,7 +1946,7 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
 					CreateDisposition,
 					CreateOptions,
 					pfid,
-					NULL);
+					cr);
 	}
 
 	frame = talloc_stackframe();
@@ -1962,7 +1979,7 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
 		goto fail;
 	}
 
-	status = cli_ntcreate_recv(req, pfid);
+	status = cli_ntcreate_recv(req, pfid, cr);
  fail:
 	TALLOC_FREE(frame);
 	return status;
@@ -1970,6 +1987,7 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
 
 struct cli_nttrans_create_state {
 	uint16_t fnum;
+	struct smb_create_returns cr;
 };
 
 static void cli_nttrans_create_done(struct tevent_req *subreq);
@@ -2082,12 +2100,24 @@ static void cli_nttrans_create_done(struct tevent_req *subreq)
 	if (tevent_req_nterror(req, status)) {
 		return;
 	}
+	state->cr.oplock_level = CVAL(param, 0);
 	state->fnum = SVAL(param, 2);
+	state->cr.create_action = IVAL(param, 4);
+	state->cr.creation_time = BVAL(param, 12);
+	state->cr.last_access_time = BVAL(param, 20);
+	state->cr.last_write_time = BVAL(param, 28);
+	state->cr.change_time   = BVAL(param, 36);
+	state->cr.file_attributes = IVAL(param, 44);
+	state->cr.allocation_size = BVAL(param, 48);
+	state->cr.end_of_file   = BVAL(param, 56);
+
 	TALLOC_FREE(param);
 	tevent_req_done(req);
 }
 
-NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, uint16_t *fnum)
+NTSTATUS cli_nttrans_create_recv(struct tevent_req *req,
+			uint16_t *fnum,
+			struct smb_create_returns *cr)
 {
 	struct cli_nttrans_create_state *state = tevent_req_data(
 		req, struct cli_nttrans_create_state);
@@ -2097,6 +2127,9 @@ NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, uint16_t *fnum)
 		return status;
 	}
 	*fnum = state->fnum;
+	if (cr != NULL) {
+		*cr = state->cr;
+	}
 	return NT_STATUS_OK;
 }
 
@@ -2112,7 +2145,8 @@ NTSTATUS cli_nttrans_create(struct cli_state *cli,
 			    struct security_descriptor *secdesc,
 			    struct ea_struct *eas,
 			    int num_eas,
-			    uint16_t *pfid)
+			    uint16_t *pfid,
+			    struct smb_create_returns *cr)
 {
 	TALLOC_CTX *frame = talloc_stackframe();
 	struct tevent_context *ev;
@@ -2141,7 +2175,7 @@ NTSTATUS cli_nttrans_create(struct cli_state *cli,
 	if (!tevent_req_poll_ntstatus(req, ev, &status)) {
 		goto fail;
 	}
-	status = cli_nttrans_create_recv(req, pfid);
+	status = cli_nttrans_create_recv(req, pfid, cr);
  fail:
 	TALLOC_FREE(frame);
 	return status;
@@ -2353,6 +2387,7 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
 	unsigned int openfn = 0;
 	unsigned int dos_deny = 0;
 	uint32_t access_mask, share_mode, create_disposition, create_options;
+	struct smb_create_returns cr;
 
 	/* Do the initial mapping into OpenX parameters. */
 	if (flags & O_CREAT) {
@@ -2433,7 +2468,8 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
 				create_disposition,
 				create_options,
 				0,
-				pfnum);
+				pfnum,
+				&cr);
 
 	/* Try and cope will all varients of "we don't do this call"
 	   and fall back to openX. */
@@ -2450,6 +2486,25 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
 		goto try_openx;
 	}
 
+	if (NT_STATUS_IS_OK(status) &&
+	    (create_options & FILE_NON_DIRECTORY_FILE) &&
+	    (cr.file_attributes & FILE_ATTRIBUTE_DIRECTORY))
+	{
+		/*
+		 * Some (broken) servers return a valid handle
+		 * for directories even if FILE_NON_DIRECTORY_FILE
+		 * is set. Just close the handle and set the
+		 * error explicitly to NT_STATUS_FILE_IS_A_DIRECTORY.
+		 */
+		status = cli_close(cli, *pfnum);
+		if (!NT_STATUS_IS_OK(status)) {
+			return status;
+		}
+		status = NT_STATUS_FILE_IS_A_DIRECTORY;
+		/* Set this so libsmbclient can retrieve it. */
+		cli->raw_status = status;
+	}
+
 	return status;
 
   try_openx:
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c
index 9136506..21dc72e 100644
--- a/source3/libsmb/cliquota.c
+++ b/source3/libsmb/cliquota.c
@@ -29,7 +29,7 @@ NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum)
 	return cli_ntcreate(cli, FAKE_FILE_NAME_QUOTA_WIN32,
 		 0x00000016, DESIRED_ACCESS_PIPE,
 		 0x00000000, FILE_SHARE_READ|FILE_SHARE_WRITE,
-		 FILE_OPEN, 0x00000000, 0x03, quota_fnum);
+		 FILE_OPEN, 0x00000000, 0x03, quota_fnum, NULL);
 }
 
 void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list)
diff --git a/source3/libsmb/clisymlink.c b/source3/libsmb/clisymlink.c
index 338f932..eacae85 100644
--- a/source3/libsmb/clisymlink.c
+++ b/source3/libsmb/clisymlink.c
@@ -90,7 +90,7 @@ static void cli_symlink_create_done(struct tevent_req *subreq)
 	size_t data_len;
 	NTSTATUS status;
 
-	status = cli_ntcreate_recv(subreq, &state->fnum);
+	status = cli_ntcreate_recv(subreq, &state->fnum, NULL);
 	TALLOC_FREE(subreq);
 	if (tevent_req_nterror(req, status)) {
 		return;
@@ -275,7 +275,7 @@ static void cli_readlink_opened(struct tevent_req *subreq)
 		req, struct cli_readlink_state);
 	NTSTATUS status;
 
-	status = cli_ntcreate_recv(subreq, &state->fnum);
+	status = cli_ntcreate_recv(subreq, &state->fnum, NULL);
 	TALLOC_FREE(subreq);
 	if (tevent_req_nterror(req, status)) {
 		return;
diff --git a/source3/libsmb/libsmb_xattr.c b/source3/libsmb/libsmb_xattr.c
index 7d34290..8e6590a 100644
--- a/source3/libsmb/libsmb_xattr.c
+++ b/source3/libsmb/libsmb_xattr.c
@@ -904,7 +904,7 @@ cacl_get(SMBCCTX *context,
 		status = cli_ntcreate(targetcli, targetpath, 0,
 				      CREATE_ACCESS_READ, 0,
 				      FILE_SHARE_READ|FILE_SHARE_WRITE,
-				      FILE_OPEN, 0x0, 0x0, &fnum);
+				      FILE_OPEN, 0x0, 0x0, &fnum, NULL);
 		if (!NT_STATUS_IS_OK(status)) {
 			DEBUG(5, ("cacl_get failed to open %s: %s\n",
 				  targetpath, nt_errstr(status)));
@@ -1563,7 +1563,7 @@ cacl_set(SMBCCTX *context,
 
 	status = cli_ntcreate(targetcli, targetpath, 0, CREATE_ACCESS_READ, 0,
 			      FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
-			      0x0, 0x0, &fnum);
+			      0x0, 0x0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
                 DEBUG(5, ("cacl_set failed to open %s: %s\n",
                           targetpath, nt_errstr(status)));
@@ -1671,7 +1671,7 @@ cacl_set(SMBCCTX *context,
 	status = cli_ntcreate(targetcli, targetpath, 0,
 			      WRITE_DAC_ACCESS | WRITE_OWNER_ACCESS, 0,
 			      FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
-			      0x0, 0x0, &fnum);
+			      0x0, 0x0, &fnum, NULL);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(5, ("cacl_set failed to open %s: %s\n",
                           targetpath, nt_errstr(status)));
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index a1389ff..525625c 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -356,7 +356,9 @@ struct tevent_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx,
 				     uint32_t CreateDisposition,
 				     uint32_t CreateOptions,
 				     uint8_t SecurityFlags);
-NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum);
+NTSTATUS cli_ntcreate_recv(struct tevent_req *req,
+			uint16_t *pfnum,
+			struct smb_create_returns *cr);
 NTSTATUS cli_ntcreate(struct cli_state *cli,
 		      const char *fname,
 		      uint32_t CreatFlags,
@@ -366,7 +368,8 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
 		      uint32_t CreateDisposition,
 		      uint32_t CreateOptions,
 		      uint8_t SecurityFlags,
-		      uint16_t *pfid);
+		      uint16_t *pfid,
+		      struct smb_create_returns *cr);
 uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str,
 			    size_t str_len, size_t *pconverted_size);
 uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
@@ -600,7 +603,9 @@ struct tevent_req *cli_nttrans_create_send(TALLOC_CTX *mem_ctx,
 					   struct security_descriptor *secdesc,
 					   struct ea_struct *eas,
 					   int num_eas);
-NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, uint16_t *fnum);
+NTSTATUS cli_nttrans_create_recv(struct tevent_req *req,
+			uint16_t *fnum,
+			struct smb_create_returns *cr);
 NTSTATUS cli_nttrans_create(struct cli_state *cli,
 			    const char *fname,
 			    uint32_t CreatFlags,
@@ -613,7 +618,8 @@ NTSTATUS cli_nttrans_create(struct cli_state *cli,
 			    struct security_descriptor *secdesc,
 			    struct ea_struct *eas,
 			    int num_eas,
-			    uint16_t *pfid);
+			    uint16_t *pfid,
+			    struct smb_create_returns *cr);
 
 /* The following definitions come from libsmb/clifsinfo.c  */
 
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index ae0d694..e3a5ac7 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -609,7 +609,7 @@ static PyObject *py_cli_create(struct py_cli_state *self, PyObject *args,
 	if (!py_tevent_req_wait_exc(self->ev, req)) {
 		return NULL;
 	}
-	status = cli_ntcreate_recv(req, &fnum);
+	status = cli_ntcreate_recv(req, &fnum, NULL);
 	TALLOC_FREE(req);
 
 	if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/torture/nbench.c b/source3/torture/nbench.c
index cb8a410..80b5a72 100644
--- a/source3/torture/nbench.c
+++ b/source3/torture/nbench.c
@@ -338,7 +338,7 @@ static void nbench_cmd_done(struct tevent_req *subreq)
 	switch (state->cmd->cmd) {
 	case NBENCH_CMD_NTCREATEX: {
 		struct ftable *ft;
-		status = cli_ntcreate_recv(subreq, &state->ft->fnum);
+		status = cli_ntcreate_recv(subreq, &state->ft->fnum, NULL);
 		TALLOC_FREE(subreq);
 		if (status_wrong(req, state->cmd->status, status)) {
 			return;
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 0c918c1..e6fd98e 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c


-- 
Samba Shared Repository


More information about the samba-cvs mailing list