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 2009/02/17 04:45:21 UTC

DO NOT REPLY [Bug 46718] New: Move task resets file owner when targeting different volume

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

           Summary: Move task resets file owner when targeting different
                    volume
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ed@belisle.com


Moving a file to a differet volume resets owner.group to current user.

Example:
1) Run as root
2) Current directory is on a different volume then /tmp.
3) Ant task (movefail.xml attached, bash pseudo code shown):
   a) touch /tmp/movefile_from
   b) chown ed /tmp/movefile_from
   c) mv /tmp/movefile_from ./movefile_to
4) owner of movefile_to is now root.

Notes: 
1) Move task attempts to rename file, but ends up copying file instead.
2) OS (rhel5) is able to move file to new volume and preserve owner


-- 
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 46718] Move task resets file owner when targeting different volume

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





--- Comment #2 from Ed Belisle <ed...@belisle.com>  2009-02-16 19:51:31 PST ---
[root@server3 ~]# clear; ant -f movefail.xml -v; ls -l movefile_to
/tmp/movefile_to

Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: movefail.xml
Detected Java version: 1.6 in: /usr/java/jdk1.6.0_10/jre
Detected OS: Linux
parsing buildfile /root/movefail.xml with URI = file:/root/movefail.xml
Project base dir set to: /root
Build sequence for target(s) `test' is [test]
Complete build sequence is [test, ]

test:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
    [touch] Creating /root/movefile_from
    [chown] Current OS is Linux
    [chown] Executing 'chown' with arguments:
    [chown] 'ed'
    [chown] '/root/movefile_from'
    [chown] 
    [chown] The ' characters around the executable and arguments are
    [chown] not part of the command.
    [chown] Applied chown to 1 file and 0 directories.
     [move] Moving 1 file to /root
     [move] Attempting to rename: /root/movefile_from to /root/movefile_to
    [touch] Creating /root/movefile_from
    [chown] Current OS is Linux
    [chown] Executing 'chown' with arguments:
    [chown] 'ed'
    [chown] '/root/movefile_from'
    [chown] 
    [chown] The ' characters around the executable and arguments are
    [chown] not part of the command.
    [chown] Applied chown to 1 file and 0 directories.
     [move] Moving 1 file to /tmp
     [move] Attempting to rename: /root/movefile_from to /tmp/movefile_to
     [move] Copying /root/movefile_from to /tmp/movefile_to

BUILD SUCCESSFUL
Total time: 0 seconds
-rw-r--r-- 1 ed   root 0 Feb 16 21:11 movefile_to
-rw-r--r-- 1 root root 0 Feb 16 21:11 /tmp/movefile_to


-- 
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 46718] Move task resets file owner when targeting different volume

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


Ed Belisle <ed...@belisle.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ed@belisle.com




--- Comment #1 from Ed Belisle <ed...@belisle.com>  2009-02-16 19:50:06 PST ---
<project default="test">
        <target name="test">
        <!-- assumes current directory on differnt volume then /tmp -->
                <touch file="movefile_from"/>
                <chown file="movefile_from" owner="ed"/>
                <move  file="movefile_from" tofile="movefile_to"/>

                <touch file="movefile_from"/>
                <chown file="movefile_from" owner="ed"/>
                <move  file="movefile_from" tofile="/tmp/movefile_to"/>
        </target>
</project>


-- 
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 46718] Move task resets file owner when targeting different volume

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #3 from Stefan Bodewig <bo...@apache.org>  2009-02-18 08:14:24 PST ---
This is true, and unfortunately it is something we cannot fix without leaving
the world of Java - because Java's file system API is too poor to even provide
us with the current owner information, much less allow us to set it.

In a scenario like your's, using <exec> and the native mv command really is the
only option, I'm afraid.

CANTFIX rather than WONTFIX


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