1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

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 <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-09-07 10:39:26 +02:00 committed by Jeremy Allison
parent 9d5f456383
commit 46f4d64596

View 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));