ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10994] New: - FTP chmod bug
Date Thu, 15 Aug 2002 22:14:24 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10994>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10994

FTP chmod bug

           Summary: FTP chmod bug
           Product: Ant
           Version: 1.5
          Platform: Other
        OS/Version: Other
            Status: RESOLVED
          Severity: Major
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: cmcfarland@onebox.com


FTP chmod from Windows to UNIX-style environment does not work. Verbose output 
of the execution of this task shows ant attempting to chmod remote files using 
Windows style separator ("\") instead of the UNIX-style ("/") separator. I 
noticed a potential problem in the optional task FTP.java file, which I will 
cover at the bottom of this message. Here is stripped down ant script which I 
can use to duplicate the problem. Note that you must be executing from Windows 
to the target environment requiring "/" separators.

EXAMPLE SCRIPT:
<target name="chmod">
    <ftp action="chmod"
        server="${remote.server}"
        remotedir="${target.dir}"
        userid="${remote.username}"
        password="${remote.password}"
        separator="/"
        chmod="775"
    >
        <fileset>
            <include name="**/*"/>
        </fileset>
    </ftp>
</target>

Looking in FTP.java source, I noticed recursive FTP.FTPDirectoryScanner.scandir
() method implements hard-coded File.separator as path separator, where I would 
have expected the FTP instance attribute remoteFileSep (which I set in script) 
to be used instead. Obviously, since I am executing the script on Windows, the 
File.separator will be Windows style, but we are doing our directory scan for 
remote platform. As an interim solution I replaced the File.separator 
occurances w/ remoteFileSep, and it works. Of course, I don't feel good about 
this because I don't know if I'm breaking something else, but it seems like 
scandir() is only used against remote platform.

A possibly separate, but related bug: following ftp "put/send" script does not 
work for same reason; that is, verbose output shows windows separators for 
chmod on remote machine. The interim fix above did not fix this.

EXAMPLE SCRIPT:
<target>
    <ftp server="${remote.server}"
        remotedir="${target.dir}"
        userid="${remote.username}"
        password="${remote.password}"
        binary="no"
        action="put"
        chmod="775"
        verbose="yes"
        depends="no"
        ignoreNoncriticalErrors="true"
    >
        <fileset dir="${deploy.dir}">
            <!-- xfer these files in ascii -->
            <include name="**/CHILDCARE.webapp"/>
            <include name="**/version.txt"/>
            <include name="**/gass.properties"/>
            <include name="**/user.profiles"/>
        </fileset>
    </ftp>
</target>

------- Additional Comments From sbailliez@apache.org  2002-08-15 22:14 -------


*** This bug has been marked as a duplicate of 11044 ***

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message