The Samba-Bugzilla – Attachment 9992 Details for
Bug 10587
Opening directories on SLES's cifsd and Apple's smbx succeeds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixed patch for 4.1.next
tmp41.diff (text/plain), 58.76 KB, created by
Jeremy Allison
on 2014-05-28 19:11:34 UTC
(
hide
)
Description:
Fixed patch for 4.1.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-05-28 19:11:34 UTC
Size:
58.76 KB
patch
obsolete
>From 34d1f93f117ca2ce60e05dc8acff4330d3dff524 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 8 May 2014 20:08:41 -0700 >Subject: [PATCH 1/4] 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@samba.org> >Reviewed-by: Stefan Metzmacher <metze@samba.org> >(cherry picked from commit 2900dfa5b928ef237e72ac4e15481e083d61750a) >--- > libcli/smb/smb2_create_blob.h | 2 +- > libcli/smb/smb2cli_create.c | 6 +++--- > libcli/smb/smbXcli_base.h | 6 +++--- > source3/libsmb/cli_smb2_fnum.c | 4 ++-- > source3/libsmb/cli_smb2_fnum.h | 2 +- > 5 files changed, 10 insertions(+), 10 deletions(-) > >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/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); >-- >1.9.1.423.g4596e3a > > >From 12b570f82306625b8f35c7ff822340384e431364 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 8 May 2014 20:55:57 -0700 >Subject: [PATCH 2/4] 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@samba.org> >Reviewed-by: Stefan Metzmacher <metze@samba.org> >(cherry picked from commit 69e24b4e8bc607806453ab137efda6d6bf74fb12) >--- > source3/client/client.c | 10 +-- > source3/libsmb/cli_np_tstream.c | 2 +- > source3/libsmb/clifile.c | 29 +++++--- > 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 +- > 22 files changed, 137 insertions(+), 113 deletions(-) > >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/clifile.c b/source3/libsmb/clifile.c >index 424354b..bd886ea 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); >@@ -1887,10 +1888,13 @@ static void cli_ntcreate_done(struct tevent_req *subreq) > return; > } > state->fnum = SVAL(vwv+2, 1); >+ /* TODO - fill in state->cr.. */ > 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 +1904,7 @@ NTSTATUS cli_ntcreate_recv(struct tevent_req *req, uint16_t *pfnum) > return status; > } > *pfnum = state->fnum; >+ /* TODO - fill in *cr.. */ > return NT_STATUS_OK; > } > >@@ -1912,7 +1917,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 +1935,7 @@ NTSTATUS cli_ntcreate(struct cli_state *cli, > CreateDisposition, > CreateOptions, > pfid, >- NULL); >+ cr); > } > > frame = talloc_stackframe(); >@@ -1962,7 +1968,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 +1976,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); >@@ -2083,11 +2090,14 @@ static void cli_nttrans_create_done(struct tevent_req *subreq) > return; > } > state->fnum = SVAL(param, 2); >+ /* TODO - fill in state->cr.. */ > 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 +2107,7 @@ NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, uint16_t *fnum) > return status; > } > *fnum = state->fnum; >+ /* TODO - fill in *cr.. */ > return NT_STATUS_OK; > } > >@@ -2112,7 +2123,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 +2153,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; >@@ -2433,7 +2445,8 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, > create_disposition, > create_options, > 0, >- pfnum); >+ pfnum, >+ NULL); > > /* Try and cope will all varients of "we don't do this call" > and fall back to 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 >@@ -166,7 +166,7 @@ void nb_createx(const char *fname, > 0x0, > FILE_SHARE_READ|FILE_SHARE_WRITE, > create_disposition, >- create_options, 0, &fd); >+ create_options, 0, &fd, NULL); > if (!NT_STATUS_IS_OK(status) && handle != -1) { > printf("ERROR: cli_ntcreate failed for %s - %s\n", > fname, nt_errstr(status)); >diff --git a/source3/torture/test_chain3.c b/source3/torture/test_chain3.c >index 7be8859..cad1a3f 100644 >--- a/source3/torture/test_chain3.c >+++ b/source3/torture/test_chain3.c >@@ -234,7 +234,7 @@ static void chain3_ntcreate_done(struct tevent_req *subreq) > req, struct chain3_state); > NTSTATUS status; > >- status = cli_ntcreate_recv(subreq, &state->fnum); >+ status = cli_ntcreate_recv(subreq, &state->fnum, NULL); > TALLOC_FREE(subreq); > printf("cli_ntcreate returned %s, fnum=%u\n", nt_errstr(status), > (unsigned)state->fnum); >diff --git a/source3/torture/test_cleanup.c b/source3/torture/test_cleanup.c >index 319a55f..a831ed7 100644 >--- a/source3/torture/test_cleanup.c >+++ b/source3/torture/test_cleanup.c >@@ -60,7 +60,7 @@ bool run_cleanup1(int dummy) > FILE_GENERIC_READ|FILE_GENERIC_WRITE|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, FILE_DELETE_ON_CLOSE, 0, &fnum); >+ FILE_OPEN, FILE_DELETE_ON_CLOSE, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("2nd open of %s failed (%s)\n", fname, > nt_errstr(status)); >@@ -89,7 +89,7 @@ bool run_cleanup2(int dummy) > cli1, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("open of %s failed (%s)\n", fname, nt_errstr(status)); > return false; >@@ -110,7 +110,7 @@ bool run_cleanup2(int dummy) > cli2, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("open of %s failed (%s)\n", fname, nt_errstr(status)); > return false; >@@ -144,7 +144,7 @@ bool run_cleanup2(int dummy) > cli2, fname, 0, FILE_GENERIC_READ|FILE_GENERIC_WRITE, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("open of %s failed (%s)\n", fname, nt_errstr(status)); > return false; >@@ -352,7 +352,7 @@ bool run_cleanup4(int dummy) > FILE_GENERIC_READ|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("creating file failed: %s\n", > nt_errstr(status)); >@@ -364,7 +364,7 @@ bool run_cleanup4(int dummy) > FILE_GENERIC_READ|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("opening file 1st time failed: %s\n", > nt_errstr(status)); >@@ -390,7 +390,7 @@ bool run_cleanup4(int dummy) > FILE_GENERIC_WRITE|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION)) { > printf("opening file 2nd time returned: %s\n", > nt_errstr(status)); >diff --git a/source3/torture/test_notify.c b/source3/torture/test_notify.c >index e1755ad..ac62237 100644 >--- a/source3/torture/test_notify.c >+++ b/source3/torture/test_notify.c >@@ -82,7 +82,7 @@ static void wait_for_one_notify_opened(struct tevent_req *subreq) > req, struct wait_for_one_notify_state); > NTSTATUS status; > >- status = cli_ntcreate_recv(subreq, &state->dnum); >+ status = cli_ntcreate_recv(subreq, &state->dnum, NULL); > TALLOC_FREE(subreq); > if (tevent_req_nterror(req, status)) { > return; >@@ -334,7 +334,7 @@ static void notify_bench3_mkdir1_done(struct tevent_req *subreq) > req, struct notify_bench3_state); > NTSTATUS status; > >- status = cli_ntcreate_recv(subreq, &state->dnum); >+ status = cli_ntcreate_recv(subreq, &state->dnum, NULL); > TALLOC_FREE(subreq); > if (tevent_req_nterror(req, status)) { > return; >@@ -471,7 +471,7 @@ static void notify_bench3_mksubdir_done(struct tevent_req *subreq) > req, struct notify_bench3_state); > NTSTATUS status; > >- status = cli_ntcreate_recv(subreq, &state->subdir_dnum); >+ status = cli_ntcreate_recv(subreq, &state->subdir_dnum, NULL); > TALLOC_FREE(subreq); > if (tevent_req_nterror(req, status)) { > return; >diff --git a/source3/torture/test_notify_online.c b/source3/torture/test_notify_online.c >index b59ce20..7f4f521 100644 >--- a/source3/torture/test_notify_online.c >+++ b/source3/torture/test_notify_online.c >@@ -77,7 +77,7 @@ static void notify_online_opened_dir(struct tevent_req *subreq) > req, struct notify_online_state); > NTSTATUS status; > >- status = cli_ntcreate_recv(subreq, &state->dnum); >+ status = cli_ntcreate_recv(subreq, &state->dnum, NULL); > TALLOC_FREE(subreq); > if (tevent_req_nterror(req, status)) { > return; >@@ -131,7 +131,7 @@ static void notify_online_opened_file(struct tevent_req *subreq) > req, struct notify_online_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/torture/test_nttrans_create.c b/source3/torture/test_nttrans_create.c >index f6444e8..5e7ce7e 100644 >--- a/source3/torture/test_nttrans_create.c >+++ b/source3/torture/test_nttrans_create.c >@@ -71,7 +71,7 @@ bool run_nttrans_create(int dummy) > READ_CONTROL_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE| FILE_SHARE_DELETE, >- FILE_CREATE, 0, 0, sd, NULL, 0, &fnum); >+ FILE_CREATE, 0, 0, sd, NULL, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_fprintf(stderr, "cli_nttrans_create returned %s\n", > nt_errstr(status)); >@@ -84,7 +84,7 @@ bool run_nttrans_create(int dummy) > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE| > FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > > status = cli_nt_delete_on_close(cli, fnum, true); > if (!NT_STATUS_IS_OK(status)) { >diff --git a/source3/torture/test_nttrans_fsctl.c b/source3/torture/test_nttrans_fsctl.c >index 963b20e..c2d8e68 100644 >--- a/source3/torture/test_nttrans_fsctl.c >+++ b/source3/torture/test_nttrans_fsctl.c >@@ -51,7 +51,7 @@ bool run_nttrans_fsctl(int dummy) > READ_CONTROL_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE| FILE_SHARE_DELETE, >- FILE_CREATE, 0, 0, NULL, NULL, 0, &fnum); >+ FILE_CREATE, 0, 0, NULL, NULL, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_fprintf(stderr, "cli_nttrans_create returned %s\n", > nt_errstr(status)); >diff --git a/source3/torture/test_posix_append.c b/source3/torture/test_posix_append.c >index d4784e8..9f892e3 100644 >--- a/source3/torture/test_posix_append.c >+++ b/source3/torture/test_posix_append.c >@@ -57,7 +57,7 @@ bool run_posix_append(int dummy) > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, > FILE_OVERWRITE_IF, > FILE_NON_DIRECTORY_FILE|FILE_DELETE_ON_CLOSE, >- 0, &fnum); >+ 0, &fnum, NULL); > > if (!NT_STATUS_IS_OK(status)) { > printf("cli_ntcreate failed: %s\n", nt_errstr(status)); >diff --git a/source3/torture/torture.c b/source3/torture/torture.c >index 197f71f..2b09a10 100644 >--- a/source3/torture/torture.c >+++ b/source3/torture/torture.c >@@ -3873,7 +3873,7 @@ static bool run_deletetest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, GENERIC_ALL_ACCESS|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, >- FILE_DELETE_ON_CLOSE, 0, &fnum1); >+ FILE_DELETE_ON_CLOSE, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[1] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -3900,7 +3900,7 @@ static bool run_deletetest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, GENERIC_ALL_ACCESS, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[2] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -3938,7 +3938,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_ALL_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[3] open - 1 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -3950,7 +3950,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("[3] open - 2 of %s succeeded - should have failed.\n", fname); > goto fail; >@@ -3960,7 +3960,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[3] open - 3 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4007,7 +4007,7 @@ static bool run_deletetest(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[4] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4017,7 +4017,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[4] open - 2 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4039,7 +4039,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("[4] open - 3 of %s succeeded ! Should have failed.\n", fname ); > goto fail; >@@ -4086,7 +4086,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[6] open of %s failed (%s)\n", fname, > nt_errstr(status)); >@@ -4116,7 +4116,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, > FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, >- 0, 0, &fnum1); >+ 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[7] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4170,7 +4170,7 @@ static bool run_deletetest(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[8] open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4180,7 +4180,7 @@ static bool run_deletetest(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[8] open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4220,7 +4220,7 @@ static bool run_deletetest(int dummy) > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_NONE, > FILE_OVERWRITE_IF, >- FILE_DELETE_ON_CLOSE, 0, &fnum1); >+ FILE_DELETE_ON_CLOSE, 0, &fnum1, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("[9] open of %s succeeded should have failed!\n", fname); > goto fail; >@@ -4234,7 +4234,7 @@ static bool run_deletetest(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, > FILE_OVERWRITE_IF, FILE_DELETE_ON_CLOSE, >- 0, &fnum1); >+ 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[10] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4266,7 +4266,7 @@ static bool run_deletetest(int dummy) > /* Create a readonly file. */ > status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA, > FILE_ATTRIBUTE_READONLY, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[11] open of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4283,7 +4283,7 @@ static bool run_deletetest(int dummy) > FILE_READ_ATTRIBUTES|DELETE_ACCESS, > 0, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum1); >+ FILE_OPEN, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[11] open of %s failed: %s\n", fname, nt_errstr(status)); > goto fail; >@@ -4306,7 +4306,7 @@ static bool run_deletetest(int dummy) > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE, > FILE_OVERWRITE_IF, >- FILE_DELETE_ON_CLOSE, 0, &fnum1); >+ FILE_DELETE_ON_CLOSE, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[12] open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4315,7 +4315,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[12] open 2 of %s failed(%s).\n", fname, nt_errstr(status)); > goto fail; >@@ -4337,7 +4337,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("[12] open 3 of %s succeeded - should fail).\n", fname); > goto fail; >@@ -4352,7 +4352,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("[12] open 4 of %s failed (%s)\n", fname, nt_errstr(status)); > goto fail; >@@ -4377,7 +4377,7 @@ static bool run_deletetest(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0, 0, &fnum2); >+ FILE_OPEN, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("[12] open 5 of %s succeeded - should fail).\n", fname); > goto fail; >@@ -4460,7 +4460,7 @@ static bool run_deletetest_ln(int dummy) > status = cli_ntcreate(cli, fname, 0, FILE_READ_DATA, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN_IF, 0, 0, &fnum); >+ FILE_OPEN_IF, 0, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("ntcreate of %s failed (%s)\n", fname, nt_errstr(status)); > return false; >@@ -4470,7 +4470,7 @@ static bool run_deletetest_ln(int dummy) > status = cli_ntcreate(cli, fname_ln, 0, DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN_IF, 0, 0, &fnum1); >+ FILE_OPEN_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("ntcreate of %s failed (%s)\n", fname_ln, nt_errstr(status)); > return false; >@@ -4595,7 +4595,7 @@ static bool run_xcopy(int dummy) > > status = cli_ntcreate(cli1, fname, 0, FIRST_DESIRED_ACCESS, > FILE_ATTRIBUTE_ARCHIVE, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0x4044, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0x4044, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("First open failed - %s\n", nt_errstr(status)); > return False; >@@ -4603,7 +4603,7 @@ static bool run_xcopy(int dummy) > > status = cli_ntcreate(cli1, fname, 0, SECOND_DESIRED_ACCESS, 0, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OPEN, 0x200000, 0, &fnum2); >+ FILE_OPEN, 0x200000, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("second open failed - %s\n", nt_errstr(status)); > return False; >@@ -4640,7 +4640,7 @@ static bool run_rename(int dummy) > > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("First open failed - %s\n", nt_errstr(status)); > return False; >@@ -4668,7 +4668,7 @@ static bool run_rename(int dummy) > #else > FILE_SHARE_DELETE|FILE_SHARE_READ, > #endif >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Second open failed - %s\n", nt_errstr(status)); > return False; >@@ -4693,7 +4693,7 @@ static bool run_rename(int dummy) > > status = cli_ntcreate(cli1, fname, 0, READ_CONTROL_ACCESS, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Third open failed - %s\n", nt_errstr(status)); > return False; >@@ -4705,7 +4705,7 @@ static bool run_rename(int dummy) > uint16_t fnum2; > > if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, DELETE_ACCESS, FILE_ATTRIBUTE_NORMAL, >- FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum2))) { >+ FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum2, NULL))) { > printf("Fourth open failed - %s\n", cli_errstr(cli1)); > return False; > } >@@ -4743,7 +4743,7 @@ static bool run_rename(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ | FILE_SHARE_WRITE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Fourth open failed - %s\n", nt_errstr(status)); > return False; >@@ -4771,7 +4771,7 @@ static bool run_rename(int dummy) > status = cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Fifth open failed - %s\n", nt_errstr(status)); > return False; >@@ -4790,7 +4790,8 @@ static bool run_rename(int dummy) > */ > > /* if (!NT_STATUS_OP(cli_ntcreate(cli1, fname, 0, GENERIC_READ_ACCESS, FILE_ATTRIBUTE_NORMAL, >- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, FILE_OVERWRITE_IF, 0, 0, &fnum2))) { >+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, >+ FILE_OVERWRITE_IF, 0, 0, &fnum2, NULL))) { > printf("Opening original file after rename of open file fails: %s\n", > cli_errstr(cli1)); > } >@@ -4853,7 +4854,7 @@ static bool run_pipe_number(int dummy) > status = cli_ntcreate(cli1, pipe_name, 0, FILE_READ_DATA, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OPEN_IF, 0, 0, &fnum); >+ FILE_OPEN_IF, 0, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Open of pipe %s failed with error (%s)\n", pipe_name, nt_errstr(status)); > break; >@@ -5052,7 +5053,7 @@ static bool run_opentest(int dummy) > printf("TEST #1 testing 2 non-io opens (no delete)\n"); > status = cli_ntcreate(cli1, fname, 0, FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #1 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5060,7 +5061,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #1 open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5087,7 +5088,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli1, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #2 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5095,7 +5096,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #2 open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5121,7 +5122,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #3 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5130,7 +5131,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli2, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #3 open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5157,7 +5158,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli1, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #4 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5166,7 +5167,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli2, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("TEST #4 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5189,7 +5190,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli1, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #5 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5198,7 +5199,7 @@ static bool run_opentest(int dummy) > status = cli_ntcreate(cli2, fname, 0, > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_DELETE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #5 open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5224,7 +5225,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #6 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5232,7 +5233,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #6 open 2 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5258,7 +5259,7 @@ static bool run_opentest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #7 open 1 of %s failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5268,7 +5269,7 @@ static bool run_opentest(int dummy) > DELETE_ACCESS|FILE_READ_ATTRIBUTES, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_DELETE, >- FILE_OPEN_IF, 0, 0, &fnum2); >+ FILE_OPEN_IF, 0, 0, &fnum2, NULL); > if (NT_STATUS_IS_OK(status)) { > printf("TEST #7 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, nt_errstr(status)); > return False; >@@ -5289,7 +5290,7 @@ static bool run_opentest(int dummy) > printf("TEST #8 testing open without WRITE_ATTRIBUTES, updating close write time.\n"); > status = cli_ntcreate(cli1, fname, 0, FILE_WRITE_DATA, FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("TEST #8 open of %s failed (%s)\n", fname, nt_errstr(status)); > correct = false; >@@ -5700,7 +5701,7 @@ static bool run_simple_posix_open_test(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA, 0, > FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, > FILE_CREATE, >- 0x0, 0x0, &fnum2); >+ 0x0, 0x0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Windows create of %s failed (%s)\n", fname_windows, > nt_errstr(status)); >@@ -5834,7 +5835,7 @@ static bool run_openattrtest(int dummy) > > status = cli_ntcreate(cli1, fname, 0, FILE_WRITE_DATA, > open_attrs_table[i], FILE_SHARE_NONE, >- FILE_OVERWRITE_IF, 0, 0, &fnum1); >+ FILE_OVERWRITE_IF, 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("open %d (1) of %s failed (%s)\n", i, fname, nt_errstr(status)); > return False; >@@ -5851,7 +5852,7 @@ static bool run_openattrtest(int dummy) > FILE_READ_DATA|FILE_WRITE_DATA, > open_attrs_table[j], > FILE_SHARE_NONE, FILE_OVERWRITE, >- 0, 0, &fnum1); >+ 0, 0, &fnum1, NULL); > if (!NT_STATUS_IS_OK(status)) { > for (l = 0; l < sizeof(attr_results)/sizeof(struct trunc_open_results); l++) { > if (attr_results[l].num == k) { >@@ -6187,7 +6188,7 @@ static bool run_eatest(int dummy) > status = cli_ntcreate(cli, fname, 0, > FIRST_DESIRED_ACCESS, FILE_ATTRIBUTE_ARCHIVE, > FILE_SHARE_NONE, FILE_OVERWRITE_IF, >- 0x4044, 0, &fnum); >+ 0x4044, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("open failed - %s\n", nt_errstr(status)); > talloc_destroy(mem_ctx); >@@ -6321,7 +6322,8 @@ static bool run_dirtest1(int dummy) > fstring fname; > slprintf(fname, sizeof(fname), "\\LISTDIR\\f%d", i); > if (!NT_STATUS_IS_OK(cli_ntcreate(cli, fname, 0, GENERIC_ALL_ACCESS, FILE_ATTRIBUTE_ARCHIVE, >- FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OVERWRITE_IF, 0, 0, &fnum))) { >+ FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OVERWRITE_IF, >+ 0, 0, &fnum, NULL))) { > fprintf(stderr,"Failed to open %s\n", fname); > return False; > } >@@ -6516,7 +6518,7 @@ static bool run_sesssetup_bench(int dummy) > > status = cli_ntcreate(c, fname, 0, GENERIC_ALL_ACCESS|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, >- FILE_DELETE_ON_CLOSE, 0, &fnum); >+ FILE_DELETE_ON_CLOSE, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_printf("open %s failed: %s\n", fname, nt_errstr(status)); > return false; >@@ -6752,7 +6754,7 @@ static void torture_createdel_created(struct tevent_req *subreq) > NTSTATUS status; > uint16_t fnum; > >- status = cli_ntcreate_recv(subreq, &fnum); >+ status = cli_ntcreate_recv(subreq, &fnum, NULL); > TALLOC_FREE(subreq); > if (!NT_STATUS_IS_OK(status)) { > DEBUG(10, ("cli_ntcreate_recv returned %s\n", >@@ -7057,7 +7059,7 @@ static bool run_notify_bench(int dummy) > 0, FILE_SHARE_READ|FILE_SHARE_WRITE| > FILE_SHARE_DELETE, > FILE_OPEN_IF, FILE_DIRECTORY_FILE, 0, >- &dnum); >+ &dnum, NULL); > > if (!NT_STATUS_IS_OK(status)) { > d_printf("Could not create %s: %s\n", dname, >@@ -7127,7 +7129,7 @@ static bool run_mangle1(int dummy) > > status = cli_ntcreate(cli, fname, 0, GENERIC_ALL_ACCESS|DELETE_ACCESS, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, >- 0, 0, &fnum); >+ 0, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_printf("open %s failed: %s\n", fname, nt_errstr(status)); > return false; >@@ -7403,7 +7405,7 @@ static bool run_large_readx(int dummy) > /* Create a file of size 4MB. */ > status = cli_ntcreate(cli1, fname, 0, GENERIC_ALL_ACCESS, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, >- 0, 0, &fnum1); >+ 0, 0, &fnum1, NULL); > > if (!NT_STATUS_IS_OK(status)) { > d_printf("open %s failed: %s\n", fname, nt_errstr(status)); >@@ -7512,7 +7514,7 @@ static bool run_large_readx(int dummy) > > status = cli_ntcreate(cli2, fname, 0, FILE_READ_DATA, > FILE_ATTRIBUTE_NORMAL, 0, FILE_OPEN, >- 0, 0, &fnum2); >+ 0, 0, &fnum2, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_printf("Second open %s failed: %s\n", fname, nt_errstr(status)); > goto out; >@@ -7794,7 +7796,8 @@ static bool run_shortname_test(int dummy) > fname[15] = i; > > status = cli_ntcreate(cli, fname, 0, GENERIC_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL, >- FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OVERWRITE_IF, 0, 0, &fnum); >+ FILE_SHARE_READ|FILE_SHARE_WRITE, >+ FILE_OVERWRITE_IF, 0, 0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > d_printf("(%s) cli_nt_create of %s failed: %s\n", > __location__, fname, nt_errstr(status)); >@@ -8050,7 +8053,7 @@ static bool run_streamerror(int dummy) > FILE_READ_DATA|FILE_READ_EA| > FILE_READ_ATTRIBUTES|READ_CONTROL_ACCESS, > FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ, >- FILE_OPEN, 0, 0, &fnum); >+ FILE_OPEN, 0, 0, &fnum, NULL); > > if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) { > printf("ntcreate returned %s, expected " >diff --git a/source3/torture/utable.c b/source3/torture/utable.c >index a2db3ba..2733091 100644 >--- a/source3/torture/utable.c >+++ b/source3/torture/utable.c >@@ -164,7 +164,7 @@ bool torture_casetable(int dummy) > GENERIC_ALL_ACCESS, > FILE_ATTRIBUTE_NORMAL, > FILE_SHARE_NONE, >- FILE_OPEN_IF, 0, 0, &fnum))) { >+ FILE_OPEN_IF, 0, 0, &fnum, NULL))) { > printf("Failed to create file with char %04x\n", c); > continue; > } >diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c >index 92964b5..c5c4d6c 100644 >--- a/source3/utils/net_rpc.c >+++ b/source3/utils/net_rpc.c >@@ -4925,7 +4925,8 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd, > } > > if (!NT_STATUS_IS_OK(cli_ntcreate(cli, "\\", 0, READ_CONTROL_ACCESS, 0, >- FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0, &fnum))) { >+ FILE_SHARE_READ|FILE_SHARE_WRITE, >+ FILE_OPEN, 0x0, 0x0, &fnum, NULL))) { > cli_query_secdesc(cli, fnum, mem_ctx, &root_sd); > } > >diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c >index 9743d08..ba34de1 100644 >--- a/source3/utils/net_rpc_printer.c >+++ b/source3/utils/net_rpc_printer.c >@@ -177,7 +177,7 @@ NTSTATUS net_copy_fileattr(struct net_context *c, > nt_status = cli_ntcreate(cli_share_src, src_name, 0, > READ_CONTROL_ACCESS, 0, > FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, >- 0x0, 0x0, &fnum_src); >+ 0x0, 0x0, &fnum_src, NULL); > if (!NT_STATUS_IS_OK(nt_status)) { > DEBUGADD(0,("cannot open %s %s on originating server %s\n", > is_file?"file":"dir", src_name, nt_errstr(nt_status))); >@@ -214,7 +214,7 @@ NTSTATUS net_copy_fileattr(struct net_context *c, > nt_status = cli_ntcreate(cli_share_dst, dst_name, 0, > WRITE_DAC_ACCESS | WRITE_OWNER_ACCESS, 0, > FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, >- 0x0, 0x0, &fnum_dst); >+ 0x0, 0x0, &fnum_dst, NULL); > if (!NT_STATUS_IS_OK(nt_status)) { > DEBUG(0,("failed to open %s on the destination server: %s: %s\n", > is_file?"file":"dir", dst_name, nt_errstr(nt_status))); >@@ -331,7 +331,8 @@ NTSTATUS net_copy_file(struct net_context *c, > nt_status = cli_open(cli_share_src, src_name, O_RDONLY, DENY_NONE, &fnum_src); > else > nt_status = cli_ntcreate(cli_share_src, src_name, 0, READ_CONTROL_ACCESS, 0, >- FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0, &fnum_src); >+ FILE_SHARE_READ|FILE_SHARE_WRITE, >+ FILE_OPEN, 0x0, 0x0, &fnum_src, NULL); > > if (!NT_STATUS_IS_OK(nt_status)) { > DEBUGADD(0,("cannot open %s %s on originating server %s\n", >diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c >index f1f92c8..23a1192 100644 >--- a/source3/utils/smbcacls.c >+++ b/source3/utils/smbcacls.c >@@ -811,7 +811,7 @@ static uint16 get_fileinfo(struct cli_state *cli, const char *filename) > > status = cli_ntcreate(cli, filename, 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)) { > printf("Failed to open %s: %s\n", filename, nt_errstr(status)); > return 0; >@@ -859,7 +859,7 @@ static struct security_descriptor *get_secdesc(struct cli_state *cli, const char > > status = cli_ntcreate(cli, filename, 0, desired_access, > 0, FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OPEN, 0x0, 0x0, &fnum); >+ FILE_OPEN, 0x0, 0x0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Failed to open %s: %s\n", filename, nt_errstr(status)); > return NULL; >@@ -923,7 +923,7 @@ static bool set_secdesc(struct cli_state *cli, const char *filename, > status = cli_ntcreate(cli, filename, 0, > desired_access, > 0, FILE_SHARE_READ|FILE_SHARE_WRITE, >- FILE_OPEN, 0x0, 0x0, &fnum); >+ FILE_OPEN, 0x0, 0x0, &fnum, NULL); > if (!NT_STATUS_IS_OK(status)) { > printf("Failed to open %s: %s\n", filename, nt_errstr(status)); > return false; >-- >1.9.1.423.g4596e3a > > >From 0df41e1778283e567d187d24632d3eaa3a938f36 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 8 May 2014 21:23:22 -0700 >Subject: [PATCH 3/4] 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@samba.org> >Reviewed-by: Stefan Metzmacher <metze@samba.org> >(cherry picked from commit 3d8ba9b34e34c1f3e0c1c231d6b772994b45eeaf) >--- > source3/libsmb/clifile.c | 32 +++++++++++++++++++++++++++----- > 1 file changed, 27 insertions(+), 5 deletions(-) > >diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c >index bd886ea..7f562a80 100644 >--- a/source3/libsmb/clifile.c >+++ b/source3/libsmb/clifile.c >@@ -1881,14 +1881,23 @@ 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); >- /* TODO - fill in state->cr.. */ >+ 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); > } > >@@ -1904,7 +1913,9 @@ NTSTATUS cli_ntcreate_recv(struct tevent_req *req, > return status; > } > *pfnum = state->fnum; >- /* TODO - fill in *cr.. */ >+ if (cr != NULL) { >+ *cr = state->cr; >+ } > return NT_STATUS_OK; > } > >@@ -2089,8 +2100,17 @@ 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); >- /* TODO - fill in state->cr.. */ >+ 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); > } >@@ -2107,7 +2127,9 @@ NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, > return status; > } > *fnum = state->fnum; >- /* TODO - fill in *cr.. */ >+ if (cr != NULL) { >+ *cr = state->cr; >+ } > return NT_STATUS_OK; > } > >-- >1.9.1.423.g4596e3a > > >From bce9516eedba60ee0ecf45380bfb916e26d93fbc Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Thu, 8 May 2014 21:31:49 -0700 >Subject: [PATCH 4/4] 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@samba.org> >Reviewed-by: Stefan Metzmacher <metze@samba.org> >(cherry picked from commit b2ce2441a35ed68c39791168217d159352b5143c) >--- > source3/libsmb/clifile.c | 22 +++++++++++++++++++++- > 1 file changed, 21 insertions(+), 1 deletion(-) > >diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c >index 7f562a80..70b769d 100644 >--- a/source3/libsmb/clifile.c >+++ b/source3/libsmb/clifile.c >@@ -2387,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) { >@@ -2468,7 +2469,7 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, > create_options, > 0, > pfnum, >- NULL); >+ &cr); > > /* Try and cope will all varients of "we don't do this call" > and fall back to openX. */ >@@ -2485,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: >-- >1.9.1.423.g4596e3a >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review?
(
ddiss
)
vl
:
review+
Actions:
View
Attachments on
bug 10587
:
9903
|
9904
|
9906
|
9908
|
9909
|
9914
|
9915
|
9928
|
9929
|
9932
| 9992