You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/06/05 19:15:22 UTC

DO NOT REPLY [Bug 45142] New: Delete Action does not delete unix path with "\" in it

https://issues.apache.org/bugzilla/show_bug.cgi?id=45142

           Summary: Delete Action does not delete unix path with "\" in it
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Build Process
        AssignedTo: notifications@ant.apache.org
        ReportedBy: tkrah@fachschaft.imn.htwk-leipzig.de


Hi.

My build.xml got something like this:

<delete dir="${java.io.tmpdir}/${user.name}/antmod/${notastupidwindowspath}"/>

That path looks like this after variable replacement:

[1] /tmp/FRIENDS/krah/antmod/home/krah/Development/src/testproject/util

But my username is "FRIENDS\krah" so it must look like this:

[2] /tmp/FRIENDS\krah/antmod/home/krah/Development/src/testproject/util

[2] is a valid unix path and if it could be created it should be possible to
remove it.
The "\" must not be replaced to / on Unix, as its a valid char.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Build Process               |Core tasks




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ces.fci@gmail.com




--- Comment #6 from Stefan Bodewig <bo...@apache.org>  2008-08-18 08:16:38 PST ---
*** Bug 44347 has been marked as a duplicate of this bug. ***


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142





--- Comment #4 from Steve Loughran <st...@apache.org>  2008-06-10 06:57:14 PST ---
This is going to be trouble. Actually, I'm surprised lots of unixy things don't
break with a \ in the usernam; I know spaces cause grief.

1. We cant say '\ is legitimate on unix', because we want build files to be
cross platform.

2. we cant add double \\ escaping, as it comes from the property ${user.name},
which is JVM-generated. 

3. any task attribute that takes a file reference is going to be trouble.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142





--- Comment #2 from Peter Reilly <pe...@apache.org>  2008-06-05 12:59:06 PST ---
The only problem with the patch is that it would not be backward compatible.
There are a lot of ant scripts that start on windows machines, with \ used
line <... dir="build\aba".. etch.
These currennty work on unix.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142


Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |45136




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142





--- Comment #3 from Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>  2008-06-05 14:12:11 PST ---
Thats right.
Hm how to solve this? 
Apply the patch anyway in a "future" version - if thats a possible way for ant
developers and drop backward compatibility - or ignore this bug and make the
valid "\" char on unix systems unusable?
Is it possible to implement some "hinting" to ant, to not "replace" the "\", if
e.g. "noescape="true"" is set for that task? This sounds to me like a possible
solution, isn't it?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142





--- Comment #5 from Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>  2008-06-10 07:29:43 PST ---
>From my view i did not find any app which make trouble with the "\".
Although its "winbindd" default separator i changed it to be a "+" sign which
results i a working ant without any fix to FileUtils.

But the problem still remains, with "\" as default domain - user separator the
username gets a "\" which breaks ant file actions if username if involved.
Any other proposals how this can be fixed (without changing the username to be
without a "\")?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 45142] Delete Action does not delete unix path with "\" in it

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45142





--- Comment #1 from Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>  2008-06-05 11:18:52 PST ---
A suggested fix, it seems ok for me, maybe i've missed something, is to check
for '/' as separatorChar and if true, skip the "\" replacement, something like
this:


if(File.separatorChar != '/') {
 path = path.replace('\\', File.separatorChar);
}

Applying this to resolveFile and normalize Methods of FileUtils.java did the
trick.
Good or bad idea?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.