From: Volker Lendecke Date: Wed, 7 Sep 2022 08:39:26 +0000 (+0200) Subject: smbd: Use PATH_MAX as symlink target buffer X-Git-Tag: talloc-2.4.0~933 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46f4d64596729bf665c92fd8ca3fe57e780c1018;p=thirdparty%2Fsamba.git smbd: Use PATH_MAX as symlink target buffer We use that instead of the arbitrary 4k in open.c as well Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 9dc4e2a805b..87c1f0f6301 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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));