]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Fix returning symlink stat info in the NO_OPATH case
authorVolker Lendecke <vl@samba.org>
Sun, 4 Feb 2024 17:50:47 +0000 (18:50 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 Mar 2024 08:05:35 +0000 (08:05 +0000)
Our callers don't look at symlink_err's struct stat anymore, they look
at the fname's one since we return them properly even for symlinks. So
don't bother filling in symlink_err->st, nobody reads it anyways.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/smbd/files.c

index f4548e417251a40279ce7b35e6b93c5908ff8fcc..7886f206a810c5b960c3c923643744b0a13278a8 100644 (file)
@@ -1258,7 +1258,7 @@ next:
                ret = SMB_VFS_FSTATAT(conn,
                                      dirfsp,
                                      &rel_fname,
-                                     &symlink_err->st,
+                                     &full_fname.st,
                                      AT_SYMLINK_NOFOLLOW);
                if (ret == -1) {
                        status = map_nt_error_from_unix(errno);
@@ -1270,7 +1270,7 @@ next:
                        goto fail;
                }
 
-               if (!S_ISLNK(symlink_err->st.st_ex_mode)) {
+               if (!S_ISLNK(full_fname.st.st_ex_mode)) {
                        /*
                         * Hit a race: readlink_talloc() worked before
                         * the fstatat(), but rel_fname changed to