]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Simplify streams_xattr_openat()
authorVolker Lendecke <vl@samba.org>
Wed, 9 Oct 2024 09:59:58 +0000 (11:59 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 12 Nov 2024 12:09:35 +0000 (12:09 +0000)
Don't go via NTSTATUS in error handling

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_streams_xattr.c

index bfa5113a53070ed62ea17ddf9e2556c216358465..f422fae0a1f6a2403d83f5f1215de3fd4349af60 100644 (file)
@@ -316,7 +316,6 @@ static int streams_xattr_openat(struct vfs_handle_struct *handle,
                                files_struct *fsp,
                                const struct vfs_open_how *how)
 {
-       NTSTATUS status;
        struct streams_xattr_config *config = NULL;
        struct stream_io *sio = NULL;
        struct ea_struct ea;
@@ -360,11 +359,8 @@ static int streams_xattr_openat(struct vfs_handle_struct *handle,
        ret = get_ea_value_fsp(talloc_tos(), fsp->base_fsp, xattr_name, &ea);
        if (ret != 0) {
                DBG_DEBUG("get_ea_value_fsp returned %s\n", strerror(ret));
-               status = map_nt_error_from_unix(ret);
-       }
 
-       if (!NT_STATUS_IS_OK(status)) {
-               if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+               if (ret != ENOATTR) {
                        /*
                         * The base file is not there. This is an error even if
                         * we got O_CREAT, the higher levels should have created