From 2fd5569938b8970f3e9d761eecad5bc0b8bb267e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 18 Jul 2003 07:07:29 +0000 Subject: [PATCH] make sure we don't allow the creation of directories containing wildcard characters. I've only put this in mkdir at the moment, but I suspect this will apply to all places that can create new filenames. We need to allow the opening of existing filenames that contain wildcards, but not allow the creation of new ones. --- source/smbd/reply.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/smbd/reply.c b/source/smbd/reply.c index 44633b1db6e..5f3d6fa10e8 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -2836,7 +2836,11 @@ NTSTATUS mkdir_internal(connection_struct *conn, pstring directory) int ret= -1; unix_convert(directory,conn,0,&bad_path,&sbuf); - + + if (ms_has_wild(directory)) { + return NT_STATUS_OBJECT_NAME_INVALID; + } + if (check_name(directory, conn)) ret = vfs_MkDir(conn,directory,unix_mode(conn,aDIR,directory));