You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/22 14:30:41 UTC

[jira] [Commented] (WAGON-363) wagon-ftp fails to create non-existing directory when path contains "/../"

    [ https://issues.apache.org/jira/browse/WAGON-363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15936399#comment-15936399 ] 

ASF GitHub Bot commented on WAGON-363:
--------------------------------------

GitHub user lbreuss opened a pull request:

    https://github.com/apache/maven-wagon/pull/33

    WAGON-363 wagon-ftp omit duplicate CWD

    I incorporated the suggested patch and built it inhouse at our company, as version 2.12-WAGON-363. It resolves the problem. (The logic in the code could be restructured a bit to be more readable, but it does the job)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lbreuss/maven-wagon WAGON-363

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-wagon/pull/33.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #33
    
----
commit 0b42bb261e1444d1dbd7ebcd6e9604415e1293ed
Author: Leo Breuss <lb...@e3ag.ch>
Date:   2017-03-21T00:50:43Z

    WAGON-363 wagon-ftp omit duplicate CWD

----


> wagon-ftp fails to create non-existing directory when path contains "/../"
> --------------------------------------------------------------------------
>
>                 Key: WAGON-363
>                 URL: https://issues.apache.org/jira/browse/WAGON-363
>             Project: Maven Wagon
>          Issue Type: Bug
>          Components: wagon-ftp
>    Affects Versions: 2.1
>         Environment: Maven 3.0.3
> Java 6u29
> Windows 7x64
>            Reporter: Falko Modler
>
> Creating non-existent parent folders as described in WAGON-265 does not work for the following scenario (real ftp-server replaced with "someurl.com"):
> I want to upload the site for a module named "exec-listeners-extension".
> This module inherits from mms-modules-parent (direct parent) which inherits from mms-parent ("transitive" parent).
> All modules/parents have site-urls, whereas the url of exec-listeners-extension is defined as:
> {code}<url>${distributionManagement.site.urlBase}/maven/${project.artifactId}</url>{code}
> ${distributionManagement.site.urlBase} is defined in mms-parent ("transitive" parent of exec-listeners-extension):
> {code}<distributionManagement.site.urlBase>ftp://reuse-sites.mms-at-work.de/mms/www/reuse-sites</distributionManagement.site.urlBase>{code}
> So the final site location sould be:
> ftp://someurl.com/mms/www/reuse-sites/maven/exec-listeners-extension
> This folder/path does already exist and is writable:
> ftp://someurl.com/mms/www/reuse-sites
> The folder mms-parent within reuse-sites also does already exist.
> The "maven" folder (and it's subfolder "exec-listeners-extension") do not exist and thus need to be created.
> But this is what happens when calling mvn site-deploy:
> {code}
> Command sent: SYST
> Reply received: 215 UNIX Type: L8 Version: SUNOS
> Remote system is UNIX Type: L8 Version: SUNOS
> Command sent: TYPE I
> Reply received: 200 Type set to I.
> ftp://someurl.com/mms/www/reuse-sites/mms-parent/ - Session: Opened
> [INFO] Pushing c:\Develop\_dev\mms-modules\maven\exec-listeners-extension\trunk\target\site
> [INFO]    >>> to ftp://someurl.com/mms/www/reuse-sites/mms-parent/../maven/exec-listeners-extension
> Command sent: CWD /mms/www/reuse-sites/mms-parent/
> Reply received: 250 CWD command successful.
> Recursively uploading directory c:\Develop\_dev\mms-modules\maven\exec-listeners-extension\trunk\target\site as ../maven/exec-listeners-extension
> processing = c:\Develop\_dev\mms-modules\maven\exec-listeners-extension\trunk\target\site as ../maven/exec-listeners-extension
> Command sent: CWD ../maven/exec-listeners-extension
> Reply received: 550 ../maven/exec-listeners-extension: No such file or directory.
> Command sent: PWD
> Reply received: 257 "/mms/www/reuse-sites/mms-parent" is current directory.
> Command sent: CWD ..
> Reply received: 250 CWD command successful.
> Command sent: CWD ..
> Reply received: 250 CWD command successful.
> Command sent: PWD
> Reply received: 257 "/mms/www" is current directory.
> Command sent: CWD maven
> Reply received: 550 maven: No such file or directory.
> Command sent: MKD maven
> Reply received: 550 maven: Permission denied.
> Command sent: CWD /mms/www
> Reply received: 250 CWD command successful.
> Command sent: CWD /mms/www/reuse-sites/mms-parent
> Reply received: 250 CWD command successful.
> ftp://someurl.com/mms/www/reuse-sites/mms-parent/ - Session: Disconnecting
> ftp://someurl.com/mms/www/reuse-sites/mms-parent/ - Session: Disconnected
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 47.461s
> [INFO] Finished at: Fri Dec 09 20:56:09 CET 2011
> [INFO] Final Memory: 33M/961M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:deploy (default-deploy) on project exec-listeners-extension: Error uploading site: Unable to create directory ../maven/exec-listeners-extension when processing c:\Develop\_dev\mms-modules\maven\exec-listeners-extension\trunk\target\site -> [Help 1]
> {code}
> Wagon-ftp executes "CWD .." twice which leads to a "Permission denied" later on when trying to create the "maven" folder in "www" (not writable!) instead of "reuse-sites".
> I guess this is because WAGON-265 added an automatic "CWD .." (?) and the path being uses by wagon-ftp already contains "/../":
> {code}[INFO]    >>> to ftp://someurl.com/mms/www/reuse-sites/mms-parent/../maven/exec-listeners-extension{code}
> I don't know why the path already contains a "/../". I guess this is because of the parent relationship?!



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)