]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: turn (*orig_path != '/') assert into a normal if check
authorRalph Boehme <slow@samba.org>
Wed, 25 Mar 2020 06:56:37 +0000 (07:56 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 27 Mar 2020 01:06:30 +0000 (01:06 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/filename.c

index a03f206267da3509a4fea2ee854cd6c49d647789..4d173d4c2e9f273e7bd834569973ab968181dfe5 100644 (file)
@@ -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