]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Cleanup. open_file(). This returns NTSTATUS, don't set errno explicitly...
authorJeremy Allison <jra@samba.org>
Mon, 7 Jun 2021 19:18:13 +0000 (12:18 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:29 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index bba7dcbad01c5858cffd4a0a43c12529da131f12..ec0757e664bca778ab9d3f96429869066584709f 100644 (file)
@@ -1310,8 +1310,6 @@ static NTSTATUS open_file(files_struct *fsp,
        bool truncating = (flags & O_TRUNC);
        bool open_fd = false;
 
-       errno = EPERM;
-
        /* Check permissions */
 
        /*
@@ -1620,7 +1618,6 @@ static NTSTATUS open_file(files_struct *fsp,
 
        if(S_ISDIR(smb_fname->st.st_ex_mode)) {
                fd_close(fsp);
-               errno = EISDIR;
                return NT_STATUS_FILE_IS_A_DIRECTORY;
        }
 
@@ -1649,7 +1646,6 @@ static NTSTATUS open_file(files_struct *fsp,
                 BOOLSTR(fsp->fsp_flags.can_write),
                 conn->num_files_open));
 
-       errno = 0;
        return NT_STATUS_OK;
 }