From: Jeremy Allison Date: Mon, 28 Feb 2022 22:34:48 +0000 (-0800) Subject: s3: smbd: Rename OpenDir_ntstatus() -> OpenDir(). X-Git-Tag: tevent-0.12.0~585 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c113e652fea17cbbf7644e469abe0980789cf9c;p=thirdparty%2Fsamba.git s3: smbd: Rename OpenDir_ntstatus() -> OpenDir(). We now have a single OpenDir() function that returns an NTSTATUS. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Wed Mar 2 21:58:32 UTC 2022 on sn-devel-184 --- diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index ca188726ee9..d533b9479a3 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -236,12 +236,12 @@ static int ceph_snap_enum_snapdir(struct vfs_handle_struct *handle, * via readdir. */ - status = OpenDir_ntstatus(frame, - handle->conn, - snaps_dname, - NULL, - 0, - &dir_hnd); + status = OpenDir(frame, + handle->conn, + snaps_dname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { ret = -map_errno_from_nt_status(status); goto err_out; @@ -564,12 +564,12 @@ static int ceph_snap_gmt_convert_dir(struct vfs_handle_struct *handle, DBG_DEBUG("enumerating shadow copy dir at %s\n", snaps_dname->base_name); - status = OpenDir_ntstatus(tmp_ctx, - handle->conn, - snaps_dname, - NULL, - 0, - &dir_hnd); + status = OpenDir(tmp_ctx, + handle->conn, + snaps_dname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { ret = -map_errno_from_nt_status(status); goto err_out; diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c index 3b95337034b..75ddf3226b7 100644 --- a/source3/modules/vfs_fruit.c +++ b/source3/modules/vfs_fruit.c @@ -5076,12 +5076,12 @@ static bool fruit_get_num_bands(vfs_handle_struct *handle, return false; } - status = OpenDir_ntstatus(talloc_tos(), - handle->conn, - bands_dir, - NULL, - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + handle->conn, + bands_dir, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(bands_dir); errno = map_errno_from_nt_status(status); @@ -5221,12 +5221,12 @@ static uint64_t fruit_disk_free(vfs_handle_struct *handle, _dsize); } - status = OpenDir_ntstatus(talloc_tos(), - handle->conn, - smb_fname, - NULL, - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + handle->conn, + smb_fname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); return UINT64_MAX; diff --git a/source3/modules/vfs_shadow_copy.c b/source3/modules/vfs_shadow_copy.c index 739e3e9cb90..29163b179f7 100644 --- a/source3/modules/vfs_shadow_copy.c +++ b/source3/modules/vfs_shadow_copy.c @@ -191,12 +191,12 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, return -1; } - status = OpenDir_ntstatus(talloc_tos(), - handle->conn, - smb_fname, - NULL, - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + handle->conn, + smb_fname, + NULL, + 0, + &dir_hnd); TALLOC_FREE(smb_fname); if (!NT_STATUS_IS_OK(status)) { DBG_ERR("OpenDir() failed for [%s]\n", fsp->conn->connectpath); diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index f1ec5b9748a..3016cfcf19c 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -595,7 +595,7 @@ static NTSTATUS walk_streams(vfs_handle_struct *handle, orig_connectpath = handle->conn->connectpath; handle->conn->connectpath = rootdir; - status = OpenDir_ntstatus( + status = OpenDir( talloc_tos(), handle->conn, dir_smb_fname, NULL, 0, &dir_hnd); if (!NT_STATUS_IS_OK(status)) { handle->conn->connectpath = orig_connectpath; diff --git a/source3/modules/vfs_syncops.c b/source3/modules/vfs_syncops.c index 680d59c3c22..14c860127b3 100644 --- a/source3/modules/vfs_syncops.c +++ b/source3/modules/vfs_syncops.c @@ -79,12 +79,12 @@ static void syncops_sync_directory(connection_struct *conn, struct smb_filename smb_dname = { .base_name = dname }; NTSTATUS status; - status = OpenDir_ntstatus(talloc_tos(), - conn, - &smb_dname, - "*", - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + conn, + &smb_dname, + "*", + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); return; diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 04afa24428d..798a28c324c 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -855,12 +855,12 @@ bool recursive_rmdir(TALLOC_CTX *ctx, SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname)); - status = OpenDir_ntstatus(talloc_tos(), - conn, - smb_dname, - NULL, - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + conn, + smb_dname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); return False; @@ -1052,12 +1052,12 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp) * files non-visible to the client. If not, fail the delete. */ - status = OpenDir_ntstatus(talloc_tos(), - conn, - smb_dname, - NULL, - 0, - &dir_hnd); + status = OpenDir(talloc_tos(), + conn, + smb_dname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { /* * Note, we deliberately squash the error here diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 1fca65cc30d..431d4d72b5d 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1477,12 +1477,12 @@ static int smb_Dir_OpenDir_destructor(struct smb_Dir *dir_hnd) return 0; } -NTSTATUS OpenDir_ntstatus(TALLOC_CTX *mem_ctx, - connection_struct *conn, - const struct smb_filename *smb_dname, - const char *mask, - uint32_t attr, - struct smb_Dir **_dir_hnd) +NTSTATUS OpenDir(TALLOC_CTX *mem_ctx, + connection_struct *conn, + const struct smb_filename *smb_dname, + const char *mask, + uint32_t attr, + struct smb_Dir **_dir_hnd) { struct files_struct *fsp = NULL; struct smb_Dir *dir_hnd = NULL; @@ -1898,7 +1898,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp) struct connection_struct *conn = fsp->conn; struct smb_Dir *dir_hnd = NULL; - status = OpenDir_ntstatus( + status = OpenDir( talloc_tos(), conn, fsp->fsp_name, NULL, 0, &dir_hnd); if (!NT_STATUS_IS_OK(status)) { return status; diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 123fe951639..84548dce21d 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1606,7 +1606,7 @@ int get_real_filename_full_scan(connection_struct *conn, } /* open the directory */ - status = OpenDir_ntstatus( + status = OpenDir( talloc_tos(), conn, smb_fname, NULL, 0, &cur_dir); if (!NT_STATUS_IS_OK(status)) { DBG_NOTICE("scan dir didn't open dir [%s]: %s\n", diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index c9969d334d1..86dc3f4dd74 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1647,12 +1647,12 @@ static size_t count_dfs_links(TALLOC_CTX *ctx, } /* Now enumerate all dfs links */ - status = OpenDir_ntstatus(frame, - conn, - smb_fname, - NULL, - 0, - &dir_hnd); + status = OpenDir(frame, + conn, + smb_fname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); goto out; @@ -1790,12 +1790,12 @@ static int form_junctions(TALLOC_CTX *ctx, } /* Now enumerate all dfs links */ - status = OpenDir_ntstatus(frame, - conn, - smb_fname, - NULL, - 0, - &dir_hnd); + status = OpenDir(frame, + conn, + smb_fname, + NULL, + 0, + &dir_hnd); if (!NT_STATUS_IS_OK(status)) { errno = map_errno_from_nt_status(status); goto out; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 2c97a7f822f..63f78024101 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -231,12 +231,12 @@ bool get_dir_entry(TALLOC_CTX *ctx, bool ask_sharemode); struct smb_Dir; bool is_visible_fsp(files_struct *fsp); -NTSTATUS OpenDir_ntstatus(TALLOC_CTX *mem_ctx, - connection_struct *conn, - const struct smb_filename *smb_dname, - const char *mask, - uint32_t attr, - struct smb_Dir **_dir_hnd); +NTSTATUS OpenDir(TALLOC_CTX *mem_ctx, + connection_struct *conn, + const struct smb_filename *smb_dname, + const char *mask, + uint32_t attr, + struct smb_Dir **_dir_hnd); const char *ReadDirName(struct smb_Dir *dir_hnd, long *poffset, SMB_STRUCT_STAT *sbuf, char **talloced); void RewindDir(struct smb_Dir *dir_hnd, long *poffset); diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 54f123c5bb3..303d80fc766 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -166,12 +166,12 @@ static NTSTATUS cmd_opendir(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc return NT_STATUS_NO_MEMORY; } - status = OpenDir_ntstatus(vfs->conn, - vfs->conn, - smb_fname, - NULL, - 0, - &vfs->currentdir); + status = OpenDir(vfs->conn, + vfs->conn, + smb_fname, + NULL, + 0, + &vfs->currentdir); if (!NT_STATUS_IS_OK(status)) { int err = map_errno_from_nt_status(status); printf("opendir error=%d (%s)\n", err, strerror(err)); @@ -2111,12 +2111,12 @@ static NTSTATUS cmd_translate_name(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - status = OpenDir_ntstatus(vfs->conn, - vfs->conn, - smb_fname, - NULL, - 0, - &vfs->currentdir); + status = OpenDir(vfs->conn, + vfs->conn, + smb_fname, + NULL, + 0, + &vfs->currentdir); if (!NT_STATUS_IS_OK(status)) { int err = map_errno_from_nt_status(status); DEBUG(0, ("cmd_translate_name: opendir error=%d (%s)\n",