The branch, master has been updated via c2e235efd40 s3:modules - fix read of uninitialized memory via 1dc8a996a34 ntlm_auth: Remove an unused #include via f1050f5ba84 torture3: Pass NULL to ReadDirName via 4a54e3f28f7 smbd: Remove an unused variable via 04e127d952b torture3: Remove an unused variable via 5a4098ae60a smbd: Remove unused variables via d74a5a7c741 smbd: Shorten long lines via f14a45275be smbtorture3: Avoid an "else" via 47e2df56f6d ldb: Fix a typo via 9aca11a71a4 ldb: Fix a typo via 9d432f3c1a4 librpc: Simplify ndr_size_dom_sid28() via 2ae7ad97ab2 librpc: Simplify ndr_size_dom_sid28() via c3855fb6823 smbd: Save a few lines by using tevent_req_nterror()'s retval from 5a4b050ff7b samba-tool ntacl: better messages for missing files
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit c2e235efd402719f963b0147f795aacf86878bd7 Author: Andrew Walker <awal...@ixsystems.com> Date: Tue Sep 6 16:45:58 2022 -0400 s3:modules - fix read of uninitialized memory For loop accesses entry->next after entry has been removed from list in glfs_clear_preopened(). Signed-off-by: Andrew Walker <awal...@ixsystems.com> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Sep 7 19:40:17 UTC 2022 on sn-devel-184 commit 1dc8a996a341868091840bdb1479b7a02f2766cd Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 20:52:27 2022 +0200 ntlm_auth: Remove an unused #include Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit f1050f5ba840ab27db6730d9f54eae184ed93d41 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 10:43:29 2022 +0200 torture3: Pass NULL to ReadDirName Do the necessary fstat manually Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 4a54e3f28f7e4f80250203febd3ef74390235e3e Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 09:29:18 2022 +0200 smbd: Remove an unused variable ReadDirName happily takes NULL for "sbuf" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 04e127d952b36f5ae1039f688bca6e678a2f211a Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 09:16:14 2022 +0200 torture3: Remove an unused variable ReadDirName happily takes NULL for "sbuf" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 5a4098ae60aeec7e1ffd7ccff13156e360871a62 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 09:07:31 2022 +0200 smbd: Remove unused variables ReadDirName happily takes NULL for "sbuf" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit d74a5a7c741e5351e844b384e53d13af04ac102a Author: Volker Lendecke <v...@samba.org> Date: Mon Sep 5 15:31:19 2022 +0200 smbd: Shorten long lines This code is young enough to justify a README.Coding patch, at least IMO. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit f14a45275be4a0276d6eaec77221e756035bcbf6 Author: Volker Lendecke <v...@samba.org> Date: Mon Sep 5 13:08:54 2022 +0200 smbtorture3: Avoid an "else" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 47e2df56f6d9534fb89cd18a939abe750ed8952c Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 12:35:20 2022 +0200 ldb: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 9aca11a71a4239af089064fb7795c15791c989a3 Author: Volker Lendecke <v...@samba.org> Date: Tue Sep 6 12:15:14 2022 +0200 ldb: Fix a typo Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 9d432f3c1a4e20ac85e0affa5336cf81412db464 Author: Volker Lendecke <v...@samba.org> Date: Wed Aug 31 17:35:42 2022 +0200 librpc: Simplify ndr_size_dom_sid28() Don't duplicate the calculation Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 2ae7ad97ab2837df96a979073c7462b689ac0038 Author: Volker Lendecke <v...@samba.org> Date: Wed Aug 31 17:35:03 2022 +0200 librpc: Simplify ndr_size_dom_sid28() all_zero() treats a NULL pointer as true. Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit c3855fb6823ca49189659663232bfc380e197a7c Author: Volker Lendecke <v...@samba.org> Date: Thu Sep 1 12:30:57 2022 +0200 smbd: Save a few lines by using tevent_req_nterror()'s retval Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: lib/ldb/common/ldb_dn.c | 4 ++-- lib/ldb/include/ldb.h | 2 +- librpc/ndr/ndr_sec_helper.c | 5 +---- source3/modules/vfs_glusterfs.c | 1 + source3/smbd/close.c | 10 ++++----- source3/smbd/dir.c | 3 +-- source3/smbd/files.c | 13 +++++++---- source3/smbd/smb2_aio.c | 6 ++--- source3/smbd/smb2_create.c | 45 +++++++++++++------------------------ source3/smbd/smb2_ioctl_filesys.c | 9 +++----- source3/smbd/smb2_notify.c | 9 +++----- source3/smbd/smb2_query_directory.c | 6 ++--- source3/smbd/smb2_sesssetup.c | 9 +++----- source3/torture/cmd_vfs.c | 22 ++++++++++++++---- source3/torture/torture.c | 20 +++++++++-------- source3/utils/ntlm_auth.c | 1 - 16 files changed, 77 insertions(+), 88 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c index fb7a95bf04f..bba41d0b2c6 100644 --- a/lib/ldb/common/ldb_dn.c +++ b/lib/ldb/common/ldb_dn.c @@ -1056,7 +1056,7 @@ int ldb_dn_compare_base(struct ldb_dn *base, struct ldb_dn *dn) if (( ! base->valid_case) || ( ! dn->valid_case)) { if (base->linearized && dn->linearized && dn->special == base->special) { /* try with a normal compare first, if we are lucky - * we will avoid exploding and casfolding */ + * we will avoid exploding and casefolding */ int dif; dif = strlen(dn->linearized) - strlen(base->linearized); if (dif < 0) { @@ -1144,7 +1144,7 @@ int ldb_dn_compare(struct ldb_dn *dn0, struct ldb_dn *dn1) if (( ! dn0->valid_case) || ( ! dn1->valid_case)) { if (dn0->linearized && dn1->linearized) { /* try with a normal compare first, if we are lucky - * we will avoid exploding and casfolding */ + * we will avoid exploding and casefolding */ if (strcmp(dn0->linearized, dn1->linearized) == 0) { return 0; } diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h index 63d8aedd672..1b3021b0fba 100644 --- a/lib/ldb/include/ldb.h +++ b/lib/ldb/include/ldb.h @@ -1857,7 +1857,7 @@ struct ldb_dn *ldb_dn_new(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const ch \param mem_ctx TALLOC context to return resulting ldb_dn structure on \param new_fms The new DN as a format string (plus arguments) - \note The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntacticly correct + \note The DN will not be parsed at this time. Use ldb_dn_validate to tell if the DN is syntactically correct */ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, const char *new_fmt, ...) PRINTF_ATTRIBUTE(3,4); diff --git a/librpc/ndr/ndr_sec_helper.c b/librpc/ndr/ndr_sec_helper.c index 3adb46f5b9c..f14660fa36e 100644 --- a/librpc/ndr/ndr_sec_helper.c +++ b/librpc/ndr/ndr_sec_helper.c @@ -129,13 +129,10 @@ size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags) size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags) { - if (!sid) return 0; - if (all_zero((const uint8_t *)sid, sizeof(struct dom_sid))) { return 0; } - - return 8 + 4*sid->num_auths; + return ndr_size_dom_sid(sid, flags); } size_t ndr_size_dom_sid0(const struct dom_sid *sid, int flags) diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index e2f9fbd8bd4..ffbe0f414ae 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -151,6 +151,7 @@ static void glfs_clear_preopened(glfs_t *fs) glfs_fini(entry->fs); talloc_free(entry); + break; } } } diff --git a/source3/smbd/close.c b/source3/smbd/close.c index a4bdd56729a..4306a59342f 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -846,7 +846,6 @@ NTSTATUS recursive_rmdir(TALLOC_CTX *ctx, const char *dname = NULL; char *talloced = NULL; long offset = 0; - SMB_STRUCT_STAT st; struct smb_Dir *dir_hnd = NULL; struct files_struct *dirfsp = NULL; int retval; @@ -866,7 +865,7 @@ NTSTATUS recursive_rmdir(TALLOC_CTX *ctx, dirfsp = dir_hnd_fetch_fsp(dir_hnd); - while ((dname = ReadDirName(dir_hnd, &offset, &st, &talloced))) { + while ((dname = ReadDirName(dir_hnd, &offset, NULL, &talloced))) { struct smb_filename *atname = NULL; struct smb_filename *smb_dname_full = NULL; char *fullname = NULL; @@ -967,7 +966,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) struct smb_filename *smb_dname = fsp->fsp_name; struct smb_filename *parent_fname = NULL; struct smb_filename *at_fname = NULL; - SMB_STRUCT_STAT st; const char *dname = NULL; char *talloced = NULL; long dirpos = 0; @@ -1069,7 +1067,8 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) dirfsp = dir_hnd_fetch_fsp(dir_hnd); - while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced)) != NULL) { + while ((dname = ReadDirName( + dir_hnd, &dirpos, NULL, &talloced)) != NULL) { struct smb_filename *smb_dname_full = NULL; struct smb_filename *direntry_fname = NULL; char *fullname = NULL; @@ -1217,7 +1216,8 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) /* Do a recursive delete. */ RewindDir(dir_hnd,&dirpos); - while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced)) != NULL) { + while ((dname = ReadDirName( + dir_hnd, &dirpos, NULL, &talloced)) != NULL) { struct smb_filename *direntry_fname = NULL; struct smb_filename *smb_dname_full = NULL; char *fullname = NULL; diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 04dfef00d95..64c7d5ca962 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1931,7 +1931,6 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp) long dirpos = 0; const char *dname = NULL; char *talloced = NULL; - SMB_STRUCT_STAT st; struct connection_struct *conn = fsp->conn; struct smb_Dir *dir_hnd = NULL; @@ -1941,7 +1940,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp) return status; } - while ((dname = ReadDirName(dir_hnd, &dirpos, &st, &talloced))) { + while ((dname = ReadDirName(dir_hnd, &dirpos, NULL, &talloced))) { struct smb_filename *smb_dname_full = NULL; struct smb_filename *direntry_fname = NULL; char *fullname = NULL; diff --git a/source3/smbd/files.c b/source3/smbd/files.c index e7c83505328..0b071be33f2 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -817,7 +817,8 @@ NTSTATUS openat_pathref_dirfsp_nosymlink( next = strv_next(path, rel_fname.base_name); - if (ISDOT(rel_fname.base_name) || ISDOTDOT(rel_fname.base_name)) { + if (ISDOT(rel_fname.base_name) || + ISDOTDOT(rel_fname.base_name)) { DBG_DEBUG("%s contains a dot\n", path_in); status = NT_STATUS_OBJECT_NAME_INVALID; goto fail; @@ -853,7 +854,8 @@ NTSTATUS openat_pathref_dirfsp_nosymlink( } status = map_nt_error_from_unix(errno); - DBG_DEBUG("SMB_VFS_OPENAT(%s, %s, RESOLVE_NO_SYMLINKS) returned %d %s => %s\n", + DBG_DEBUG("SMB_VFS_OPENAT(%s, %s, RESOLVE_NO_SYMLINKS) " + "returned %d %s => %s\n", smb_fname_str_dbg(dirfsp->fsp_name), path_in, errno, strerror(errno), nt_errstr(status)); SMB_ASSERT(fd == -1); @@ -933,8 +935,11 @@ next: /* Name might have been demangled - check veto files. */ if (IS_VETO_PATH(conn, rel_fname.base_name)) { - DBG_DEBUG("%s contains veto files path component %s => %s\n", - path_in, orig_base_name, rel_fname.base_name); + DBG_DEBUG("%s contains veto files path component " + "%s => %s\n", + path_in, + orig_base_name, + rel_fname.base_name); status = NT_STATUS_OBJECT_PATH_NOT_FOUND; goto fail; } diff --git a/source3/smbd/smb2_aio.c b/source3/smbd/smb2_aio.c index eeddb27a073..76a5b644ef8 100644 --- a/source3/smbd/smb2_aio.c +++ b/source3/smbd/smb2_aio.c @@ -411,8 +411,7 @@ static void aio_pread_smb2_done(struct tevent_req *req) (unsigned int)nread, vfs_aio_state.error, nt_errstr(status))); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(subreq, status); + if (tevent_req_nterror(subreq, status)) { return; } tevent_req_done(subreq); @@ -560,8 +559,7 @@ static void aio_pwrite_smb2_done(struct tevent_req *req) (unsigned int)nwritten, err, nt_errstr(status))); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(subreq, status); + if (tevent_req_nterror(subreq, status)) { return; } tevent_req_done(subreq); diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 4865af4b862..34dd338a4a0 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -806,8 +806,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } status = open_np_file(smb1req, pipe_name, &state->result); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } state->info = FILE_WAS_OPENED; @@ -824,16 +823,14 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, } status = file_new(smb1req, smb1req->conn, &state->result); - if(!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } status = print_spool_open(state->result, in_name, smb1req->vuid); - if (!NT_STATUS_IS_OK(status)) { + if (tevent_req_nterror(req, status)) { file_free(smb1req, state->result); - tevent_req_nterror(req, status); return tevent_req_post(req, state->ev); } state->info = FILE_WAS_CREATED; @@ -844,8 +841,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, /* Check for trailing slash specific directory handling. */ status = windows_name_trailing_check(state->fname, in_create_options); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } @@ -887,10 +883,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, state->create_guid, now, &state->op); - if (!NT_STATUS_IS_OK(status)) { + if (tevent_req_nterror(req, status)) { DBG_NOTICE("smb2srv_open_recreate failed: %s\n", nt_errstr(status)); - tevent_req_nterror(req, status); return tevent_req_post(req, state->ev); } @@ -929,10 +924,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, status = smbd_smb2_create_durable_lease_check( smb1req, state->fname, state->result, state->lease_ptr); - if (!NT_STATUS_IS_OK(status)) { + if (tevent_req_nterror(req, status)) { close_file_free( smb1req, &state->result, SHUTDOWN_CLOSE); - tevent_req_nterror(req, status); return tevent_req_post(req, state->ev); } @@ -970,8 +964,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, /* convert '\\' into '/' */ status = check_path_syntax_smb2(state->fname, is_dfs); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } @@ -986,8 +979,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, state->twrp_time, &dirfsp, &smb_fname); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, state->ev); } @@ -1266,10 +1258,9 @@ static void smbd_smb2_create_before_exec(struct tevent_req *req) } else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_NOT_AVAILABLE)) { tevent_req_nterror(req, status); return; - } else if (!NT_STATUS_IS_OK(status)) { + } else if (tevent_req_nterror(req, status)) { DBG_WARNING("smb2srv_open_lookup_replay_cache " "failed: %s\n", nt_errstr(status)); - tevent_req_nterror(req, status); return; } else if (!state->replay_operation) { /* @@ -1438,8 +1429,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) state->out_context_blobs, SMB2_CREATE_TAG_MXAC, blob); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } @@ -1475,8 +1465,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) DEBUG(10, ("smb2_create_send: smbXsrv_open_update " "returned %s\n", nt_errstr(status))); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } @@ -1496,8 +1485,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) state->out_context_blobs, SMB2_CREATE_TAG_DHNQ, blob); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } @@ -1526,8 +1514,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) state->out_context_blobs, SMB2_CREATE_TAG_DH2Q, blob); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } @@ -1554,8 +1541,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) state->out_context_blobs, SMB2_CREATE_TAG_QFID, blob); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } @@ -1584,8 +1570,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req) state, state->out_context_blobs, SMB2_CREATE_TAG_RQLS, data_blob_const(buf, lease_len)); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { tevent_req_post(req, state->ev); return; } diff --git a/source3/smbd/smb2_ioctl_filesys.c b/source3/smbd/smb2_ioctl_filesys.c index fe24fca518d..36429b8fd35 100644 --- a/source3/smbd/smb2_ioctl_filesys.c +++ b/source3/smbd/smb2_ioctl_filesys.c @@ -213,8 +213,7 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx, status = fsctl_dup_extents_check_lengths(src_fsp, dst_fsp, &state->dup_extents); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } @@ -226,14 +225,12 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx, status = fsctl_dup_extents_check_overlap(src_fsp, dst_fsp, &state->dup_extents); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } status = fsctl_dup_extents_check_sparse(src_fsp, dst_fsp); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index 75e591d1332..133c990f0df 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -266,10 +266,9 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, in_output_buffer_length, in_completion_filter, recursive); - if (!NT_STATUS_IS_OK(status)) { + if (tevent_req_nterror(req, status)) { DEBUG(10, ("change_notify_create returned %s\n", nt_errstr(status))); - tevent_req_nterror(req, status); return tevent_req_post(req, ev); } } @@ -307,8 +306,7 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx, in_completion_filter, recursive, fsp, smbd_smb2_notify_reply); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } @@ -358,8 +356,7 @@ static void smbd_smb2_notify_reply(struct smb_request *smbreq, tevent_req_defer_callback(req, state->smb2req->sconn->ev_ctx); - if (!NT_STATUS_IS_OK(state->status)) { - tevent_req_nterror(req, state->status); + if (tevent_req_nterror(req, state->status)) { return; } diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index 81487a4d997..9b06bd4a12c 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -896,8 +896,7 @@ static void fetch_write_time_done(struct tevent_req *subreq) tevent_req_done(req); return; } - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return; } @@ -1008,8 +1007,7 @@ static void fetch_dos_mode_done(struct tevent_req *subreq) tevent_req_done(req); return; } - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return; } diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 14b806bc007..cd97f775eb5 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -782,14 +782,12 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx, smb2req->xconn, now, &c); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } status = smbXsrv_session_update(smb2req->session); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } } @@ -832,8 +830,7 @@ auth: status = smbXsrv_session_find_channel(smb2req->session, smb2req->xconn, &c); - if (!NT_STATUS_IS_OK(status)) { - tevent_req_nterror(req, status); + if (tevent_req_nterror(req, status)) { return tevent_req_post(req, ev); } diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 3be450b97bd..0de3d75e688 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -190,9 +190,14 @@ static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc static NTSTATUS cmd_readdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { + struct smb_Dir *currentdir = vfs->currentdir; + files_struct *dirfsp = dir_hnd_fetch_fsp(currentdir); + connection_struct *conn = dirfsp->conn; SMB_STRUCT_STAT st; const char *dname = NULL; + struct smb_filename *fname = NULL; char *talloced = NULL; + int ret; if (vfs->currentdir == NULL) { printf("readdir: error=-1 (no open directory)\n"); @@ -201,15 +206,25 @@ static NTSTATUS cmd_readdir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc -- Samba Shared Repository