Remove check for File.fileSeparatorChar from MKD command. Will fail incorrectly on...
authorNiklas Gustavsson <ngn@apache.org>
Sat, 27 Feb 2010 20:43:03 +0000 (20:43 +0000)
committerNiklas Gustavsson <ngn@apache.org>
Sat, 27 Feb 2010 20:43:03 +0000 (20:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@917039 13f79535-47bb-0310-9956-ffa450edef68

core/src/main/java/org/apache/ftpserver/command/impl/MKD.java
core/src/test/java/org/apache/ftpserver/clienttests/DirectoryTest.java

index 40d6115..19c118d 100644 (file)
@@ -61,10 +61,7 @@ public class MKD extends AbstractCommand {
 
         // argument check
         String fileName = request.getArgument();
-        //TODO perhaps we do not need to check if the given argument contains 
-        //path separator. Windows allows to create a dir like "a;b". Why should 
-        //we restrict creation of such a folder?
-        if (fileName == null || fileName.indexOf(File.pathSeparatorChar) > -1) {
+        if (fileName == null) {
             session.write(LocalizedFileActionFtpReply.translate(session, request, context,
                     FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
                     "MKD", null, null));
index a062578..976b8c7 100644 (file)
@@ -57,10 +57,6 @@ public class DirectoryTest extends ClientTestTemplate {
         assertEquals(501, client.sendCommand("MKD"));
     }
 
-    public void testMkdirInValidDirectoryName() throws Exception {
-        assertEquals(501, client.sendCommand("MKD foo:bar;foo"));
-    }
-
     /**
      * FTPSERVER-233, we should not recursively create directories  
      */