From: Ralph Boehme Date: Wed, 25 Mar 2020 06:56:37 +0000 (+0100) Subject: smbd: turn (*orig_path != '/') assert into a normal if check X-Git-Tag: ldb-2.2.0~1197 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=855a354686e2c27015fd8f49d8733c7835bea729;p=thirdparty%2Fsamba.git smbd: turn (*orig_path != '/') assert into a normal if check Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index a03f206267d..4d173d4c2e9 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -478,9 +478,10 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, DEBUG(5, ("unix_convert called on file \"%s\"\n", orig_path)); -#ifdef DEVELOPER - SMB_ASSERT(*orig_path != '/'); -#endif + if (orig_path[0] == '/') { + DBG_ERR("Path [%s] starts with '/'\n", orig_path); + return NT_STATUS_OBJECT_NAME_INVALID; + } /* * If we trimmed down to a single '\0' character