You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Niels Basjes (JIRA)" <ji...@apache.org> on 2011/01/30 00:16:43 UTC

[jira] Created: (HADOOP-7127) Bug in login error handling in org.apache.hadoop.fs.ftp.FTPFileSystem

Bug in login error handling in org.apache.hadoop.fs.ftp.FTPFileSystem
---------------------------------------------------------------------

                 Key: HADOOP-7127
                 URL: https://issues.apache.org/jira/browse/HADOOP-7127
             Project: Hadoop Common
          Issue Type: Bug
          Components: fs
            Reporter: Niels Basjes


I was playing around with PMD, just to see what kind of messages it gives on hadoop.
I noticed a message about "Dead code" in org.apache.hadoop.fs.ftp.FTPFileSystem

Starting at about line 80:

   String userAndPassword = uri.getUserInfo();
   if (userAndPassword == null) {
     userAndPassword = (conf.get("fs.ftp.user." + host, null) + ":" + conf
         .get("fs.ftp.password." + host, null));
     if (userAndPassword == null) {
       throw new IOException("Invalid user/passsword specified");
     }
   }

The last "if" block is the dead code as the string will always contain at least the text ":" or "null:null"

This means that the error handling fails to work as intended.
It will probably fail a bit later when really trying to login with a wrong uid/password.

P.S. Fix the silly typo "passsword" in the exception message too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.