]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Save errno around unbecome_root()
authorVolker Lendecke <vl@samba.org>
Mon, 16 Oct 2023 10:00:39 +0000 (12:00 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 1 Nov 2023 18:55:32 +0000 (18:55 +0000)
Probably not required, but better safe than sorry.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c

index 052b0a4d21d9cdda1a58016b62319c76d53216c6..fe9b87929532f2bb47c4d4d0ce9eb567d7a23733 100644 (file)
@@ -738,7 +738,9 @@ static int vfswrap_openat(vfs_handle_struct *handle,
                        mode);
 
        if (became_root) {
+               int err = errno;
                unbecome_root();
+               errno = err;
        }
 
 done: