make sure we don't allow the creation of directories containing
authorAndrew Tridgell <tridge@samba.org>
Fri, 18 Jul 2003 07:07:29 +0000 (07:07 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Jul 2003 07:07:29 +0000 (07:07 +0000)
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.
(This used to be commit 2fd5569938b8970f3e9d761eecad5bc0b8bb267e)

source3/smbd/reply.c

index 44633b1db6e0c2644fa5025dfa7b0ee111d51ba0..5f3d6fa10e87f937c7b408e6e0d7e94203fc4f63 100644 (file)
@@ -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));