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 2022/07/05 17:17:03 UTC

[Bug 66164] New: build/install from source changes file permissions throughout my home directory

https://bz.apache.org/bugzilla/show_bug.cgi?id=66164

            Bug ID: 66164
           Summary: build/install from source changes file permissions
                    throughout my home directory
           Product: Ant
           Version: unspecified
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Build Process
          Assignee: notifications@ant.apache.org
          Reporter: hvandam@bnl.gov
  Target Milestone: ---

I have downloaded the source code distribution apache-ant-1.10.12-src.tar.gz.
After unpacking it and setting the JAVA related environment variables
JAVA_HOME, JAVAC, and JAVACMD I run:

   cd apache-ant-1.10.12
   sh build.sh -Ddist.dir=<my_home_directory> dist

The build script builds and installs ant in my home directory. However, it also
goes through my entire home directory and changes the file permissions on any
executable file except:

   ant executables and scripts
   Python scripts

all other files have their executable permission removed including:

   shell scripts (*.sh *.csh)
   binary executables

This has done major damage to my working environment and I have no idea how
many packages I will have to reinstall to undo this mayhem. 

Suggested fix: Ant should only touch files and directories associated with
itself and keep its fingers off anything else.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66164] build/install from source changes file permissions throughout my home directory

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

Jaikiran Pai <ja...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.10.13
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jaikiran Pai <ja...@apache.org> ---
I've now committed this changes to upstream master branch. As suggested by
Stefan, I've also updated our documentation (the building Ant section) to
include the following:

<b>It is highly recommended that the directory path that you pass to dist.dir,
in the following commands, points to an empty directory</b>

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66164] build/install from source changes file permissions throughout my home directory

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

--- Comment #2 from Jaikiran Pai <ja...@apache.org> ---
Do note that the proposed change continues to update the permissions of
specific files in dist.dir/bin directory, since those files belong to Ant.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66164] build/install from source changes file permissions throughout my home directory

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

--- Comment #1 from Jaikiran Pai <ja...@apache.org> ---
This appears to be a genuine issue. I had a look at our build.xml which does
this and there a couple of places where we blindly update these permissions on
files/dirs of the "dist.dir". I have a proposed fix for this which looks as
below, but looking at the commit history, the current behaviour has been around
for more than 2 decades, so I will wait for a few days to see if anyone has any
inputs/objections to the change below, before I commit it:

diff --git a/build.xml b/build.xml
index 8d401aac7..48378b078 100644
--- a/build.xml
+++ b/build.xml
@@ -1057,14 +1057,6 @@
       <include name="*.pl"/>
     </fixcrlf>

-    <setpermissions mode="755" failonerror="${setpermissions.fail}"
-                    nonPosixMode="${setpermissions.nonposixmode}">
-      <dirset dir="${dist.dir}"/>
-    </setpermissions>
-    <setpermissions mode="644" failonerror="${setpermissions.fail}"
-                    nonPosixMode="${setpermissions.nonposixmode}">
-      <fileset dir="${dist.dir}"/>
-    </setpermissions>
     <setpermissions mode="755" failonerror="${setpermissions.fail}"
                     nonPosixMode="${setpermissions.nonposixmode}">
       <fileset dir="${dist.bin}">
@@ -1158,14 +1150,6 @@
       </fileset>
     </copy>

-    <setpermissions mode="755" failonerror="${setpermissions.fail}"
-                    nonPosixMode="${setpermissions.nonposixmode}">
-      <dirset dir="${dist.dir}"/>
-    </setpermissions>
-    <setpermissions mode="644" failonerror="${setpermissions.fail}"
-                    nonPosixMode="${setpermissions.nonposixmode}">
-      <fileset dir="${dist.dir}"/>
-    </setpermissions>
     <setpermissions mode="755" failonerror="${setpermissions.fail}"
                     nonPosixMode="${setpermissions.nonposixmode}">
       <fileset dir="${dist.bin}">

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 66164] build/install from source changes file permissions throughout my home directory

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

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
The change looks fine to me Jaikiran (decades ago it would have been <chmod>
though :-))

I think this part of the build file simply assumes the dist.dir belongs to Ant
and thus there is no other pre-existing content. I'm not sure using an existing
home directory is a good idea in either case. So in addition to fixing this we
should probably add a word of warning or two to the docmuentation.

-- 
You are receiving this mail because:
You are the assignee for the bug.