]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Use PATH_MAX as symlink target buffer
authorVolker Lendecke <vl@samba.org>
Wed, 7 Sep 2022 08:39:26 +0000 (10:39 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 19 Sep 2022 17:23:31 +0000 (17:23 +0000)
We use that instead of the arbitrary 4k in open.c as well

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

index 9dc4e2a805b299e6e4e427eb26ffdda8ac4a03a3..87c1f0f6301ca76123f6714942403a7c31e46034 100644 (file)
@@ -685,7 +685,7 @@ NTSTATUS readlink_talloc(
        struct smb_filename *smb_relname,
        char **_substitute)
 {
-       char buf[4096];
+       char buf[PATH_MAX];
        ssize_t ret;
        char *substitute;
        NTSTATUS status;
@@ -718,7 +718,7 @@ NTSTATUS readlink_talloc(
 
        if ((size_t)ret == sizeof(buf)) {
                /*
-                * Do we need symlink targets >4k?
+                * Do we need symlink targets longer than PATH_MAX?
                 */
                DBG_DEBUG("Got full %zu bytes from readlink, too long\n",
                          sizeof(buf));