From: Jeremy Allison Date: Fri, 12 Aug 2022 06:57:51 +0000 (-0700) Subject: s3: smbd: In get create_junction(), make sure check_path_syntax() is called on return... X-Git-Tag: talloc-2.4.0~1455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a92f4f7af0eaa035deebfb1c930ca0cc12d992d5;p=thirdparty%2Fsamba.git s3: smbd: In get create_junction(), make sure check_path_syntax() is called on returned reqpath. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 19160b03c3c..5a2413ed8b9 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1426,6 +1426,12 @@ bool create_junction(TALLOC_CTX *ctx, return False; } + /* Junction create paths are always non-POSIX. */ + status = check_path_syntax(reqpath); + if (!NT_STATUS_IS_OK(status)) { + return false; + } + jucn->service_name = talloc_strdup(ctx, servicename); jucn->volume_name = talloc_strdup(ctx, reqpath); jucn->comment = lp_comment(ctx, lp_sub, snum);