mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
Rename cli_open -> cli_openx. Prelude to replacing generic cli_open()
with a call that uses NTCreateX in preference to OpenAndX.
This commit is contained in:
parent
c326b37358
commit
4e709dc42f
@ -412,7 +412,7 @@ NTSTATUS smbclient_cli_open(struct cli_state *cli, const char *fname, int flags,
|
||||
|
||||
try_openx:
|
||||
|
||||
return cli_open(cli, fname, flags, share_mode_in, pfnum);
|
||||
return cli_openx(cli, fname, flags, share_mode_in, pfnum);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -576,7 +576,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
|
||||
* Open the printer device...
|
||||
*/
|
||||
|
||||
nt_status = cli_open(cli, title, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE,
|
||||
nt_status = cli_openx(cli, title, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE,
|
||||
&fnum);
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
fprintf(stderr, "ERROR: %s opening remote spool %s\n",
|
||||
|
@ -50,7 +50,7 @@ NTSTATUS gpo_copy_file(TALLOC_CTX *mem_ctx,
|
||||
int read_size = io_bufsize;
|
||||
off_t nread = 0;
|
||||
|
||||
result = cli_open(cli, nt_path, O_RDONLY, DENY_NONE, &fnum);
|
||||
result = cli_openx(cli, nt_path, O_RDONLY, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto out;
|
||||
}
|
||||
|
@ -2111,7 +2111,7 @@ NTSTATUS cli_nttrans_create(struct cli_state *cli,
|
||||
WARNING: if you open with O_WRONLY then getattrE won't work!
|
||||
****************************************************************************/
|
||||
|
||||
struct cli_open_state {
|
||||
struct cli_openx_state {
|
||||
struct tevent_context *ev;
|
||||
struct cli_state *cli;
|
||||
const char *fname;
|
||||
@ -2123,20 +2123,20 @@ struct cli_open_state {
|
||||
struct iovec bytes;
|
||||
};
|
||||
|
||||
static void cli_open_done(struct tevent_req *subreq);
|
||||
static void cli_openx_done(struct tevent_req *subreq);
|
||||
static void cli_open_ntcreate_done(struct tevent_req *subreq);
|
||||
|
||||
struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
|
||||
struct event_context *ev,
|
||||
struct cli_state *cli, const char *fname,
|
||||
int flags, int share_mode,
|
||||
struct tevent_req **psmbreq)
|
||||
{
|
||||
struct tevent_req *req, *subreq;
|
||||
struct cli_open_state *state;
|
||||
struct cli_openx_state *state;
|
||||
uint8_t *bytes;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state, struct cli_open_state);
|
||||
req = tevent_req_create(mem_ctx, &state, struct cli_openx_state);
|
||||
if (req == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
@ -2211,19 +2211,19 @@ struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
|
||||
TALLOC_FREE(req);
|
||||
return NULL;
|
||||
}
|
||||
tevent_req_set_callback(subreq, cli_open_done, req);
|
||||
tevent_req_set_callback(subreq, cli_openx_done, req);
|
||||
*psmbreq = subreq;
|
||||
return req;
|
||||
}
|
||||
|
||||
struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
struct cli_state *cli, const char *fname,
|
||||
int flags, int share_mode)
|
||||
{
|
||||
struct tevent_req *req, *subreq;
|
||||
NTSTATUS status;
|
||||
|
||||
req = cli_open_create(mem_ctx, ev, cli, fname, flags, share_mode,
|
||||
req = cli_openx_create(mem_ctx, ev, cli, fname, flags, share_mode,
|
||||
&subreq);
|
||||
if (req == NULL) {
|
||||
return NULL;
|
||||
@ -2236,12 +2236,12 @@ struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
return req;
|
||||
}
|
||||
|
||||
static void cli_open_done(struct tevent_req *subreq)
|
||||
static void cli_openx_done(struct tevent_req *subreq)
|
||||
{
|
||||
struct tevent_req *req = tevent_req_callback_data(
|
||||
subreq, struct tevent_req);
|
||||
struct cli_open_state *state = tevent_req_data(
|
||||
req, struct cli_open_state);
|
||||
struct cli_openx_state *state = tevent_req_data(
|
||||
req, struct cli_openx_state);
|
||||
uint8_t wct;
|
||||
uint16_t *vwv;
|
||||
uint8_t *inbuf;
|
||||
@ -2290,8 +2290,8 @@ static void cli_open_ntcreate_done(struct tevent_req *subreq)
|
||||
{
|
||||
struct tevent_req *req = tevent_req_callback_data(
|
||||
subreq, struct tevent_req);
|
||||
struct cli_open_state *state = tevent_req_data(
|
||||
req, struct cli_open_state);
|
||||
struct cli_openx_state *state = tevent_req_data(
|
||||
req, struct cli_openx_state);
|
||||
NTSTATUS status;
|
||||
|
||||
status = cli_ntcreate_recv(subreq, &state->fnum);
|
||||
@ -2302,10 +2302,10 @@ static void cli_open_ntcreate_done(struct tevent_req *subreq)
|
||||
tevent_req_done(req);
|
||||
}
|
||||
|
||||
NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *pfnum)
|
||||
NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *pfnum)
|
||||
{
|
||||
struct cli_open_state *state = tevent_req_data(
|
||||
req, struct cli_open_state);
|
||||
struct cli_openx_state *state = tevent_req_data(
|
||||
req, struct cli_openx_state);
|
||||
NTSTATUS status;
|
||||
|
||||
if (tevent_req_is_nterror(req, &status)) {
|
||||
@ -2315,7 +2315,7 @@ NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *pfnum)
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
|
||||
NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags,
|
||||
int share_mode, uint16_t *pfnum)
|
||||
{
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
@ -2337,7 +2337,7 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
req = cli_open_send(frame, ev, cli, fname, flags, share_mode);
|
||||
req = cli_openx_send(frame, ev, cli, fname, flags, share_mode);
|
||||
if (req == NULL) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
goto fail;
|
||||
@ -2348,7 +2348,7 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
status = cli_open_recv(req, pfnum);
|
||||
status = cli_openx_recv(req, pfnum);
|
||||
fail:
|
||||
TALLOC_FREE(frame);
|
||||
return status;
|
||||
|
@ -123,7 +123,7 @@ SMBC_open_ctx(SMBCCTX *context,
|
||||
}
|
||||
/*d_printf(">>>open: resolved %s as %s\n", path, targetpath);*/
|
||||
|
||||
status = cli_open(targetcli, targetpath, flags,
|
||||
status = cli_openx(targetcli, targetpath, flags,
|
||||
context->internal->share_mode, &fd);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
||||
@ -633,7 +633,7 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path,
|
||||
srv->no_pathinfo = True;
|
||||
|
||||
/* Open the file */
|
||||
if (!NT_STATUS_IS_OK(cli_open(srv->cli, path, O_RDWR, DENY_NONE, &fd))) {
|
||||
if (!NT_STATUS_IS_OK(cli_openx(srv->cli, path, O_RDWR, DENY_NONE, &fd))) {
|
||||
errno = SMBC_errno(context, srv->cli);
|
||||
TALLOC_FREE(frame);
|
||||
return -1;
|
||||
|
@ -387,16 +387,16 @@ uint8_t *trans2_bytes_push_str(uint8_t *buf, bool ucs2,
|
||||
size_t *pconverted_size);
|
||||
uint8_t *trans2_bytes_push_bytes(uint8_t *buf,
|
||||
const uint8_t *bytes, size_t num_bytes);
|
||||
struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_req *cli_openx_create(TALLOC_CTX *mem_ctx,
|
||||
struct event_context *ev,
|
||||
struct cli_state *cli, const char *fname,
|
||||
int flags, int share_mode,
|
||||
struct tevent_req **psmbreq);
|
||||
struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
|
||||
struct cli_state *cli, const char *fname,
|
||||
int flags, int share_mode);
|
||||
NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum);
|
||||
NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
|
||||
NTSTATUS cli_openx_recv(struct tevent_req *req, uint16_t *fnum);
|
||||
NTSTATUS cli_openx(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum);
|
||||
struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx,
|
||||
struct event_context *ev,
|
||||
struct cli_state *cli, uint16_t fnum,
|
||||
|
@ -1424,7 +1424,7 @@ bool torture_denytest1(int dummy)
|
||||
|
||||
for (i=0;i<2;i++) {
|
||||
cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
cli_writeall(cli1, fnum1, 0, (const uint8_t *)fnames[i], 0,
|
||||
strlen(fnames[i]), NULL);
|
||||
cli_close(cli1, fnum1);
|
||||
@ -1438,10 +1438,10 @@ bool torture_denytest1(int dummy)
|
||||
|
||||
progress_bar(i, ARRAY_SIZE(denytable1));
|
||||
|
||||
ret1 = cli_open(cli1, fname,
|
||||
ret1 = cli_openx(cli1, fname,
|
||||
denytable1[i].mode1,
|
||||
denytable1[i].deny1, &fnum1);
|
||||
ret2 = cli_open(cli1, fname,
|
||||
ret2 = cli_openx(cli1, fname,
|
||||
denytable1[i].mode2,
|
||||
denytable1[i].deny2, &fnum2);
|
||||
|
||||
@ -1522,7 +1522,7 @@ bool torture_denytest2(int dummy)
|
||||
|
||||
for (i=0;i<2;i++) {
|
||||
cli_unlink(cli1, fnames[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_open(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fnames[i], O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
cli_writeall(cli1, fnum1, 0, (const uint8_t *)fnames[i], 0,
|
||||
strlen(fnames[i]), NULL);
|
||||
cli_close(cli1, fnum1);
|
||||
@ -1534,10 +1534,10 @@ bool torture_denytest2(int dummy)
|
||||
|
||||
progress_bar(i, ARRAY_SIZE(denytable2));
|
||||
|
||||
ret1 = cli_open(cli1, fname,
|
||||
ret1 = cli_openx(cli1, fname,
|
||||
denytable2[i].mode1,
|
||||
denytable2[i].deny1, &fnum1);
|
||||
ret2 = cli_open(cli2, fname,
|
||||
ret2 = cli_openx(cli2, fname,
|
||||
denytable2[i].mode2,
|
||||
denytable2[i].deny2, &fnum2);
|
||||
|
||||
|
@ -347,7 +347,7 @@ static bool test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS],
|
||||
}
|
||||
for (server=0;server<NSERVERS;server++) {
|
||||
fnum[server][conn][f] = (uint16_t)-1;
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli[server][conn], FILENAME,
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli[server][conn], FILENAME,
|
||||
O_RDWR|O_CREAT,
|
||||
DENY_NONE, &fnum[server][conn][f]))) {
|
||||
printf("failed to reopen on share%d\n", server);
|
||||
@ -392,7 +392,7 @@ static void open_files(struct cli_state *cli[NSERVERS][NCONNECTIONS],
|
||||
for (conn=0;conn<NCONNECTIONS;conn++)
|
||||
for (f=0;f<NFILES;f++) {
|
||||
fnum[server][conn][f] = (uint16_t)-1;
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli[server][conn], FILENAME,
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli[server][conn], FILENAME,
|
||||
O_RDWR|O_CREAT,
|
||||
DENY_NONE,
|
||||
&fnum[server][conn][f]))) {
|
||||
|
@ -73,7 +73,7 @@ static int try_open(struct cli_state *c, char *nfs, int fstype, const char *fnam
|
||||
case FSTYPE_SMB:
|
||||
{
|
||||
uint16_t fd;
|
||||
if (!NT_STATUS_IS_OK(cli_open(c, fname, flags, DENY_NONE, &fd))) {
|
||||
if (!NT_STATUS_IS_OK(cli_openx(c, fname, flags, DENY_NONE, &fd))) {
|
||||
return -1;
|
||||
}
|
||||
return fd;
|
||||
|
@ -42,7 +42,7 @@ static bool test_one(struct cli_state *cli, const char *name)
|
||||
|
||||
total++;
|
||||
|
||||
status = cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", name, nt_errstr(status));
|
||||
return False;
|
||||
@ -70,7 +70,7 @@ static bool test_one(struct cli_state *cli, const char *name)
|
||||
}
|
||||
|
||||
/* recreate by short name */
|
||||
status = cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open2 of %s failed (%s)\n", name2, nt_errstr(status));
|
||||
return False;
|
||||
|
@ -320,7 +320,7 @@ static void testpair(struct cli_state *cli, const char *mask, const char *file)
|
||||
|
||||
fstrcpy(res1, "---");
|
||||
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli, file, O_CREAT|O_TRUNC|O_RDWR, 0, &fnum))) {
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli, file, O_CREAT|O_TRUNC|O_RDWR, 0, &fnum))) {
|
||||
DEBUG(0,("Can't create %s\n", file));
|
||||
return;
|
||||
}
|
||||
|
@ -243,12 +243,12 @@ bool torture_trans2_scan(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
DENY_NONE, &fnum))) {
|
||||
printf("open of %s failed\n", fname);
|
||||
return false;
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli, "\\", O_RDONLY, DENY_NONE, &dnum))) {
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli, "\\", O_RDONLY, DENY_NONE, &dnum))) {
|
||||
printf("open of \\ failed\n");
|
||||
return false;
|
||||
}
|
||||
@ -488,9 +488,9 @@ bool torture_nttrans_scan(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
DENY_NONE, &fnum);
|
||||
cli_open(cli, "\\", O_RDONLY, DENY_NONE, &dnum);
|
||||
cli_openx(cli, "\\", O_RDONLY, DENY_NONE, &dnum);
|
||||
|
||||
for (op=OP_MIN; op<=OP_MAX; op++) {
|
||||
printf("Scanning op=%d\n", op);
|
||||
|
@ -49,9 +49,9 @@ bool run_case_insensitive_create(int dummy)
|
||||
printf("cli_chkpath failed: %s\n", nt_errstr(status));
|
||||
goto rmdir;
|
||||
}
|
||||
status = cli_open(cli, "x\\y", O_RDWR|O_CREAT, 0, &fnum);
|
||||
status = cli_openx(cli, "x\\y", O_RDWR|O_CREAT, 0, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("cli_open failed: %s\n", nt_errstr(status));
|
||||
printf("cli_openx failed: %s\n", nt_errstr(status));
|
||||
|
||||
if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_IS_A_DIRECTORY)) {
|
||||
printf("Bug 8042 reappeared!!\n");
|
||||
|
@ -610,10 +610,10 @@ static bool rw_torture(struct cli_state *c)
|
||||
|
||||
memset(buf, '\0', sizeof(buf));
|
||||
|
||||
status = cli_open(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
status = cli_open(c, lockfname, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(c, lockfname, O_RDWR, DENY_NONE, &fnum2);
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n",
|
||||
@ -633,7 +633,7 @@ static bool rw_torture(struct cli_state *c)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(c, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
status = cli_openx(c, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
DENY_ALL, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open failed (%s)\n", nt_errstr(status));
|
||||
@ -751,7 +751,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
|
||||
"not exist)\n", nt_errstr(status));
|
||||
}
|
||||
|
||||
status = cli_open(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("first open read/write of %s failed (%s)\n",
|
||||
@ -763,7 +763,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
|
||||
{
|
||||
for (i = 0; i < 500 && fnum == (uint16_t)-1; i++)
|
||||
{
|
||||
status = cli_open(c, lockfname, O_RDONLY,
|
||||
status = cli_openx(c, lockfname, O_RDONLY,
|
||||
DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
break;
|
||||
@ -852,7 +852,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
|
||||
printf("unlink failed (%s) (normal, this file should not exist)\n", nt_errstr(status));
|
||||
}
|
||||
|
||||
status = cli_open(c1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(c1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("first open read/write of %s failed (%s)\n",
|
||||
@ -860,7 +860,7 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(c2, lockfname, O_RDONLY, DENY_NONE, &fnum2);
|
||||
status = cli_openx(c2, lockfname, O_RDONLY, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("second open read-only of %s failed (%s)\n",
|
||||
lockfname, nt_errstr(status));
|
||||
@ -999,7 +999,7 @@ static bool run_readwritelarge_internal(void)
|
||||
|
||||
cli_unlink(cli1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open read/write of %s failed (%s)\n", lockfname, nt_errstr(status));
|
||||
@ -1036,7 +1036,7 @@ static bool run_readwritelarge_internal(void)
|
||||
correct = False;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open read/write of %s failed (%s)\n", lockfname, nt_errstr(status));
|
||||
@ -1252,20 +1252,20 @@ static bool run_locktest1(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open2 of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
status = cli_openx(cli2, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open3 of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -1384,7 +1384,7 @@ static bool run_tcon_test(int dummy)
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -1655,13 +1655,13 @@ static bool run_locktest2(int dummy)
|
||||
|
||||
cli_setpid(cli, 1);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open2 of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -1669,7 +1669,7 @@ static bool run_locktest2(int dummy)
|
||||
|
||||
cli_setpid(cli, 2);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
status = cli_openx(cli, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open3 of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -1816,14 +1816,14 @@ static bool run_locktest3(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open2 of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -1978,8 +1978,8 @@ static bool run_locktest4(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
cli_openx(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
@ -2120,12 +2120,12 @@ static bool run_locktest4(int dummy)
|
||||
|
||||
cli_close(cli1, fnum1);
|
||||
cli_close(cli2, fnum2);
|
||||
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
cli_open(cli1, fname, O_RDWR, DENY_NONE, &f);
|
||||
cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fname, O_RDWR, DENY_NONE, &f);
|
||||
ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 8, 0, READ_LOCK)) &&
|
||||
NT_STATUS_IS_OK(cli_lock32(cli1, f, 0, 1, 0, READ_LOCK)) &&
|
||||
NT_STATUS_IS_OK(cli_close(cli1, fnum1)) &&
|
||||
NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1)) &&
|
||||
NT_STATUS_IS_OK(cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1)) &&
|
||||
NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 7, 1, 0, WRITE_LOCK));
|
||||
cli_close(cli1, f);
|
||||
cli_close(cli1, fnum1);
|
||||
@ -2167,9 +2167,9 @@ static bool run_locktest5(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
cli_openx(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum3);
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
@ -2185,13 +2185,13 @@ static bool run_locktest5(int dummy)
|
||||
ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 8, 0, READ_LOCK)) &&
|
||||
NT_STATUS_IS_OK(cli_lock32(cli1, fnum3, 0, 1, 0, READ_LOCK));
|
||||
cli_close(cli1, fnum1);
|
||||
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
status = cli_lock32(cli1, fnum1, 7, 1, 0, WRITE_LOCK);
|
||||
ret = NT_STATUS_IS_OK(status);
|
||||
EXPECTED(ret, True);
|
||||
printf("this server %s the NT locking bug\n", ret ? "doesn't have" : "has");
|
||||
cli_close(cli1, fnum1);
|
||||
cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
cli_unlock(cli1, fnum3, 0, 1);
|
||||
|
||||
ret = NT_STATUS_IS_OK(cli_lock32(cli1, fnum1, 0, 4, 0, WRITE_LOCK)) &&
|
||||
@ -2298,12 +2298,12 @@ static bool run_locktest6(int dummy)
|
||||
|
||||
cli_unlink(cli, fname[i], FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
cli_open(cli, fname[i], O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
cli_openx(cli, fname[i], O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_locktype(cli, fnum, 0, 8, 0, LOCKING_ANDX_CHANGE_LOCKTYPE);
|
||||
cli_close(cli, fnum);
|
||||
printf("CHANGE_LOCKTYPE gave %s\n", nt_errstr(status));
|
||||
|
||||
cli_open(cli, fname[i], O_RDWR, DENY_NONE, &fnum);
|
||||
cli_openx(cli, fname[i], O_RDWR, DENY_NONE, &fnum);
|
||||
status = cli_locktype(cli, fnum, 0, 8, 0, LOCKING_ANDX_CANCEL_LOCK);
|
||||
cli_close(cli, fnum);
|
||||
printf("CANCEL_LOCK gave %s\n", nt_errstr(status));
|
||||
@ -2337,7 +2337,7 @@ static bool run_locktest7(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
@ -2514,18 +2514,18 @@ static bool run_locktest8(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_WRITE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_WRITE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_fprintf(stderr, "cli_open returned %s\n", nt_errstr(status));
|
||||
d_fprintf(stderr, "cli_openx returned %s\n", nt_errstr(status));
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
|
||||
status = cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_fprintf(stderr, "cli_open second time returned %s\n",
|
||||
d_fprintf(stderr, "cli_openx second time returned %s\n",
|
||||
nt_errstr(status));
|
||||
goto fail;
|
||||
}
|
||||
@ -2543,9 +2543,9 @@ static bool run_locktest8(int dummy)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_fprintf(stderr, "cli_open third time returned %s\n",
|
||||
d_fprintf(stderr, "cli_openx third time returned %s\n",
|
||||
nt_errstr(status));
|
||||
goto fail;
|
||||
}
|
||||
@ -2705,10 +2705,10 @@ static bool run_locktest9(int dummy)
|
||||
|
||||
cli_sockopt(cli1, sockops);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_NONE,
|
||||
&fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_fprintf(stderr, "cli_open returned %s\n", nt_errstr(status));
|
||||
d_fprintf(stderr, "cli_openx returned %s\n", nt_errstr(status));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -2789,7 +2789,7 @@ static bool run_fdpasstest(int dummy)
|
||||
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
@ -2855,7 +2855,7 @@ static bool run_fdsesstest(int dummy)
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_unlink(cli, fname1, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -2877,7 +2877,7 @@ static bool run_fdsesstest(int dummy)
|
||||
ret = false;
|
||||
}
|
||||
/* Try to open a file with different vuid, samba cnum. */
|
||||
if (NT_STATUS_IS_OK(cli_open(cli, fname1, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum2))) {
|
||||
if (NT_STATUS_IS_OK(cli_openx(cli, fname1, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum2))) {
|
||||
printf("create with different vuid, same cnum succeeded.\n");
|
||||
cli_close(cli, fnum2);
|
||||
cli_unlink(cli, fname1, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
@ -2932,7 +2932,7 @@ static bool run_unlinktest(int dummy)
|
||||
|
||||
cli_setpid(cli, 1);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -2985,7 +2985,7 @@ static bool run_maxfidtest(int dummy)
|
||||
|
||||
for (i=0; i<0x11000; i++) {
|
||||
slprintf(fname,sizeof(fname)-1,"\\maxfid.%d.%d", i,(int)getpid());
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE,
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE,
|
||||
&fnums[i]);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n",
|
||||
@ -3224,7 +3224,7 @@ static bool run_attrtest(int dummy)
|
||||
}
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_open(cli, fname,
|
||||
cli_openx(cli, fname,
|
||||
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
|
||||
cli_close(cli, fnum);
|
||||
|
||||
@ -3306,7 +3306,7 @@ static bool run_trans2test(int dummy)
|
||||
}
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
|
||||
cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
|
||||
status = cli_qfileinfo_basic(cli, fnum, NULL, &size, &c_time_ts,
|
||||
&a_time_ts, &w_time_ts, &m_time_ts, NULL);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
@ -3331,7 +3331,7 @@ static bool run_trans2test(int dummy)
|
||||
sleep(2);
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
status = cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE,
|
||||
status = cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_NONE,
|
||||
&fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
@ -3366,7 +3366,7 @@ static bool run_trans2test(int dummy)
|
||||
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
cli_open(cli, fname,
|
||||
cli_openx(cli, fname,
|
||||
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
|
||||
cli_close(cli, fnum);
|
||||
status = cli_qpathinfo2(cli, fname, &c_time_ts, &a_time_ts, &w_time_ts,
|
||||
@ -3400,7 +3400,7 @@ static bool run_trans2test(int dummy)
|
||||
correct = False;
|
||||
}
|
||||
|
||||
cli_open(cli, fname2,
|
||||
cli_openx(cli, fname2,
|
||||
O_RDWR | O_CREAT | O_TRUNC, DENY_NONE, &fnum);
|
||||
cli_writeall(cli, fnum, 0, (uint8_t *)&fnum, 0, sizeof(fnum), NULL);
|
||||
cli_close(cli, fnum);
|
||||
@ -3466,7 +3466,7 @@ static bool run_w2ktest(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
cli_open(cli, fname,
|
||||
cli_openx(cli, fname,
|
||||
O_RDWR | O_CREAT , DENY_NONE, &fnum);
|
||||
|
||||
for (level = 1004; level < 1040; level++) {
|
||||
@ -3508,7 +3508,7 @@ static bool run_oplock1(int dummy)
|
||||
|
||||
cli1->use_oplocks = True;
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
@ -3578,7 +3578,7 @@ static bool run_oplock2(int dummy)
|
||||
cli_sockopt(cli1, sockops);
|
||||
cli_sockopt(cli2, sockops);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
@ -3591,7 +3591,7 @@ static bool run_oplock2(int dummy)
|
||||
|
||||
if (fork() == 0) {
|
||||
/* Child code */
|
||||
status = cli_open(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli2, fname, O_RDWR, DENY_NONE, &fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("second open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
*shared_correct = False;
|
||||
@ -3721,7 +3721,7 @@ static bool run_oplock4(int dummy)
|
||||
cli_sockopt(cli2, sockops);
|
||||
|
||||
/* Create the file. */
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE,
|
||||
&fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
@ -3742,13 +3742,13 @@ static bool run_oplock4(int dummy)
|
||||
}
|
||||
|
||||
/* Prove that opening hardlinks cause deny modes to conflict. */
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_ALL, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return false;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, fname_ln, O_RDWR, DENY_NONE, &fnum2);
|
||||
status = cli_openx(cli1, fname_ln, O_RDWR, DENY_NONE, &fnum2);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s succeeded - should fail with sharing violation.\n",
|
||||
fname_ln);
|
||||
@ -3770,7 +3770,7 @@ static bool run_oplock4(int dummy)
|
||||
cli1->use_oplocks = true;
|
||||
cli2->use_oplocks = true;
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return false;
|
||||
@ -3800,10 +3800,10 @@ static bool run_oplock4(int dummy)
|
||||
}
|
||||
tevent_req_set_callback(oplock_req, oplock4_got_break, state);
|
||||
|
||||
open_req = cli_open_send(
|
||||
open_req = cli_openx_send(
|
||||
talloc_tos(), ev, cli2, fname_ln, O_RDWR, DENY_NONE);
|
||||
if (oplock_req == NULL) {
|
||||
printf("cli_open_send failed\n");
|
||||
printf("cli_openx_send failed\n");
|
||||
return false;
|
||||
}
|
||||
tevent_req_set_callback(open_req, oplock4_got_open, state);
|
||||
@ -3889,9 +3889,9 @@ static void oplock4_got_open(struct tevent_req *req)
|
||||
req, struct oplock4_state);
|
||||
NTSTATUS status;
|
||||
|
||||
status = cli_open_recv(req, state->fnum2);
|
||||
status = cli_openx_recv(req, state->fnum2);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("cli_open_recv returned %s\n", nt_errstr(status));
|
||||
printf("cli_openx_recv returned %s\n", nt_errstr(status));
|
||||
*state->fnum2 = 0xffff;
|
||||
}
|
||||
}
|
||||
@ -3938,7 +3938,7 @@ static bool run_deletetest(int dummy)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1))) {
|
||||
if (NT_STATUS_IS_OK(cli_openx(cli1, fname, O_RDWR, DENY_NONE, &fnum1))) {
|
||||
printf("[1] open of %s succeeded (should fail)\n", fname);
|
||||
correct = False;
|
||||
goto fail;
|
||||
@ -3974,7 +3974,7 @@ static bool run_deletetest(int dummy)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
if (NT_STATUS_IS_OK(cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
printf("[2] open of %s succeeded should have been deleted on close !\n", fname);
|
||||
status = cli_close(cli1, fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
@ -4044,7 +4044,7 @@ static bool run_deletetest(int dummy)
|
||||
|
||||
/* This should fail - file should no longer be there. */
|
||||
|
||||
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
if (NT_STATUS_IS_OK(cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
printf("[3] open of %s succeeded should have been deleted on close !\n", fname);
|
||||
status = cli_close(cli1, fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
@ -4117,7 +4117,7 @@ static bool run_deletetest(int dummy)
|
||||
cli_setatr(cli1, fname, 0, 0);
|
||||
cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("[5] open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
correct = False;
|
||||
@ -4207,7 +4207,7 @@ static bool run_deletetest(int dummy)
|
||||
}
|
||||
|
||||
/* This next open should succeed - we reset the flag. */
|
||||
status = cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("[5] open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
correct = False;
|
||||
@ -4278,7 +4278,7 @@ static bool run_deletetest(int dummy)
|
||||
}
|
||||
|
||||
/* This should fail.. */
|
||||
status = cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum1);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
printf("[8] open of %s succeeded should have been deleted on close !\n", fname);
|
||||
goto fail;
|
||||
@ -4316,7 +4316,7 @@ static bool run_deletetest(int dummy)
|
||||
}
|
||||
|
||||
/* This should fail.. */
|
||||
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
if (NT_STATUS_IS_OK(cli_openx(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
|
||||
printf("[10] open of %s succeeded should have been deleted on close !\n", fname);
|
||||
goto fail;
|
||||
correct = False;
|
||||
@ -4411,7 +4411,7 @@ static bool run_deletetest_ln(int dummy)
|
||||
cli_sockopt(cli, sockops);
|
||||
|
||||
/* Create the file. */
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return false;
|
||||
@ -4867,7 +4867,7 @@ static bool run_opentest(int dummy)
|
||||
|
||||
cli_sockopt(cli1, sockops);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -4885,14 +4885,14 @@ static bool run_opentest(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, fname, O_RDONLY, DENY_WRITE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDONLY, DENY_WRITE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* This will fail - but the error should be ERRnoaccess, not ERRbadshare. */
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
|
||||
|
||||
if (check_error(__LINE__, status, ERRDOS, ERRnoaccess,
|
||||
NT_STATUS_ACCESS_DENIED)) {
|
||||
@ -4907,14 +4907,14 @@ static bool run_opentest(int dummy)
|
||||
|
||||
cli_setatr(cli1, fname, 0, 0);
|
||||
|
||||
status = cli_open(cli1, fname, O_RDONLY, DENY_WRITE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDONLY, DENY_WRITE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
}
|
||||
|
||||
/* This will fail - but the error should be ERRshare. */
|
||||
status = cli_open(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
|
||||
status = cli_openx(cli1, fname, O_RDWR, DENY_ALL, &fnum2);
|
||||
|
||||
if (check_error(__LINE__, status, ERRDOS, ERRbadshare,
|
||||
NT_STATUS_SHARING_VIOLATION)) {
|
||||
@ -4932,7 +4932,7 @@ static bool run_opentest(int dummy)
|
||||
printf("finished open test 2\n");
|
||||
|
||||
/* Test truncate open disposition on file opened for read. */
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("(3) open (1) of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -4967,7 +4967,7 @@ static bool run_opentest(int dummy)
|
||||
}
|
||||
|
||||
/* Now test if we can truncate a file opened for readonly. */
|
||||
status = cli_open(cli1, fname, O_RDONLY|O_TRUNC, DENY_NONE, &fnum1);
|
||||
status = cli_openx(cli1, fname, O_RDONLY|O_TRUNC, DENY_NONE, &fnum1);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("(3) open (2) of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -5860,7 +5860,7 @@ static bool run_dirtest(int dummy)
|
||||
for (i=0;i<torture_numops;i++) {
|
||||
fstring fname;
|
||||
slprintf(fname, sizeof(fname), "\\%x", (int)random());
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli, fname, O_RDWR|O_CREAT, DENY_NONE, &fnum))) {
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli, fname, O_RDWR|O_CREAT, DENY_NONE, &fnum))) {
|
||||
fprintf(stderr,"Failed to open %s\n", fname);
|
||||
return False;
|
||||
}
|
||||
@ -5940,7 +5940,7 @@ bool torture_ioctl_test(int dummy)
|
||||
|
||||
cli_unlink(cli, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open of %s failed (%s)\n", fname, nt_errstr(status));
|
||||
return False;
|
||||
@ -6008,7 +6008,7 @@ bool torture_chkpath_test(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli, "\\chkpath.dir\\foo.txt", O_RDWR|O_CREAT|O_EXCL,
|
||||
status = cli_openx(cli, "\\chkpath.dir\\foo.txt", O_RDWR|O_CREAT|O_EXCL,
|
||||
DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open1 failed (%s)\n", nt_errstr(status));
|
||||
@ -6471,10 +6471,10 @@ static void chain1_open_completion(struct tevent_req *req)
|
||||
{
|
||||
uint16_t fnum;
|
||||
NTSTATUS status;
|
||||
status = cli_open_recv(req, &fnum);
|
||||
status = cli_openx_recv(req, &fnum);
|
||||
TALLOC_FREE(req);
|
||||
|
||||
d_printf("cli_open_recv returned %s: %d\n",
|
||||
d_printf("cli_openx_recv returned %s: %d\n",
|
||||
nt_errstr(status),
|
||||
NT_STATUS_IS_OK(status) ? fnum : -1);
|
||||
}
|
||||
@ -6520,7 +6520,7 @@ static bool run_chain1(int dummy)
|
||||
|
||||
cli_sockopt(cli1, sockops);
|
||||
|
||||
reqs[0] = cli_open_create(talloc_tos(), evt, cli1, "\\test",
|
||||
reqs[0] = cli_openx_create(talloc_tos(), evt, cli1, "\\test",
|
||||
O_CREAT|O_RDWR, 0, &smbreqs[0]);
|
||||
if (reqs[0] == NULL) return false;
|
||||
tevent_req_set_callback(reqs[0], chain1_open_completion, NULL);
|
||||
@ -7043,9 +7043,9 @@ static bool run_mangle1(int dummy)
|
||||
}
|
||||
d_printf("alt_name: %s\n", alt_name);
|
||||
|
||||
status = cli_open(cli, alt_name, O_RDONLY, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli, alt_name, O_RDONLY, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf("cli_open(%s) failed: %s\n", alt_name,
|
||||
d_printf("cli_openx(%s) failed: %s\n", alt_name,
|
||||
nt_errstr(status));
|
||||
return false;
|
||||
}
|
||||
@ -7094,7 +7094,7 @@ static bool run_windows_write(int dummy)
|
||||
return False;
|
||||
}
|
||||
|
||||
status = cli_open(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
status = cli_openx(cli1, fname, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("open failed (%s)\n", nt_errstr(status));
|
||||
return False;
|
||||
@ -7539,10 +7539,10 @@ static bool run_dir_createtime(int dummy)
|
||||
/* Sleep 3 seconds, then create a file. */
|
||||
sleep(3);
|
||||
|
||||
status = cli_open(cli, fname, O_RDWR | O_CREAT | O_EXCL,
|
||||
status = cli_openx(cli, fname, O_RDWR | O_CREAT | O_EXCL,
|
||||
DENY_NONE, &fnum);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
printf("cli_open failed: %s\n", nt_errstr(status));
|
||||
printf("cli_openx failed: %s\n", nt_errstr(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ bool torture_utable(int dummy)
|
||||
p[len] = 0;
|
||||
fstrcat(fname,"_a_long_extension");
|
||||
|
||||
if (!NT_STATUS_IS_OK(cli_open(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
if (!NT_STATUS_IS_OK(cli_openx(cli, fname, O_RDWR | O_CREAT | O_TRUNC,
|
||||
DENY_NONE, &fnum))) {
|
||||
continue;
|
||||
}
|
||||
|
@ -327,7 +327,7 @@ NTSTATUS net_copy_file(struct net_context *c,
|
||||
DEBUGADD(3,("opening %s %s on originating server\n",
|
||||
is_file ? "file":"dir", src_name));
|
||||
if (is_file)
|
||||
nt_status = cli_open(cli_share_src, src_name, O_RDONLY, DENY_NONE, &fnum_src);
|
||||
nt_status = cli_openx(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);
|
||||
@ -344,7 +344,7 @@ NTSTATUS net_copy_file(struct net_context *c,
|
||||
|
||||
/* open file on the destination server */
|
||||
DEBUGADD(3,("opening file %s on destination server\n", dst_name));
|
||||
nt_status = cli_open(cli_share_dst, dst_name,
|
||||
nt_status = cli_openx(cli_share_dst, dst_name,
|
||||
O_RDWR|O_CREAT|O_TRUNC, DENY_NONE, &fnum_dst);
|
||||
|
||||
if (!NT_STATUS_IS_OK(nt_status)) {
|
||||
|
Loading…
Reference in New Issue
Block a user