From: Volker Lendecke Date: Sun, 4 Feb 2024 17:50:47 +0000 (+0100) Subject: smbd: Fix returning symlink stat info in the NO_OPATH case X-Git-Tag: tdb-1.4.11~1307 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=331a49ca394f185473d0b5ba1c566a32ab01b6ff;p=thirdparty%2Fsamba.git smbd: Fix returning symlink stat info in the NO_OPATH case 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 Reviewed-by: Andreas Schneider --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index f4548e41725..7886f206a81 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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