]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Simplify symlink_target_below_conn()
authorVolker Lendecke <vl@samba.org>
Sun, 4 Dec 2022 11:16:39 +0000 (12:16 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 5 Dec 2022 16:06:51 +0000 (16:06 +0000)
readlink_talloc() deals exactly the same way with a NULL relname

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Dec  5 16:06:51 UTC 2022 on sn-devel-184

source3/smbd/open.c

index 0081f454ed8b44eb78ef68e66188ec787ac7f22b..5c26ea190ff7e7d394f6a92b0a2507c3150a2602 100644 (file)
@@ -588,11 +588,7 @@ static NTSTATUS symlink_target_below_conn(
                 * fsp is an O_PATH open, Linux does a "freadlink"
                 * with an empty name argument to readlinkat
                 */
-               struct smb_filename null_fname = {
-                       .base_name = discard_const_p(char, ""),
-               };
-               status = readlink_talloc(
-                       talloc_tos(), fsp, &null_fname, &target);
+               status = readlink_talloc(talloc_tos(), fsp, NULL, &target);
        } else {
                status = readlink_talloc(
                        talloc_tos(), dirfsp, symlink_name, &target);