vfs_commit: Reset fsp->fd->fd to -1 after SMB_VFS_CLOSE
authorVolker Lendecke <vl@samba.org>
Tue, 28 Dec 2021 17:42:00 +0000 (18:42 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 30 Dec 2021 11:03:35 +0000 (11:03 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_commit.c

index a933a5982e50954fa5e3ffcd195b1ea0f4c9f93d..6d64896c7e044d89149a67a2efc02fb99c7b3382 100644 (file)
@@ -244,6 +244,7 @@ static int commit_openat(struct vfs_handle_struct *handle,
                if (SMB_VFS_FSTAT(fsp, &st) == -1) {
                        int saved_errno = errno;
                        SMB_VFS_CLOSE(fsp);
+                       fsp_set_fd(fsp, -1);
                        errno = saved_errno;
                         return -1;
                 }