Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1-alpha-1
-
Fix Version/s: 2.1-alpha-2
-
Component/s: rpm
-
Labels:None
-
Environment:java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)
-
Patch Submitted:Yes
-
Number of attachments :
Description
When an attempt is made to add symbolic links to an RPM, and these symbolic links point at locations in the file system outside of the user's control (example: /usr/share/), when an attempt is made to build, rpm-maven-plugin calls FileUtils.cleanDirectory(), which in turn attempts to follow the symlink and delete the system files. This fails, terminating the build:
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-1:attached-rpm (default) on project platform-tomcat7-template: Unable to clear directory: buildroot: File /home/gatekeeper/minfrin/src/code/trunk/platform/platform-tomcat7/platform-tomcat7-template/target/rpm/platform-tomcat7-template/buildroot/usr/share/tomcat7-template/bin/tomcat-juli.jar unable to be deleted. -> [Help 1]
The component "bin" is a symlink to the filesystem:
[minfrin@gatekeeper platform-tomcat7-template]$ ls -al /home/gatekeeper/minfrin/src/code/trunk/platform/platform-tomcat7/platform-tomcat7-template/target/rpm/platform-tomcat7-template/buildroot/usr/share/tomcat7-template/ total 28 drwxr-xr-x 3 minfrin fma 4096 Jun 5 21:28 . drwxr-xr-x 3 minfrin fma 4096 Jun 5 21:28 .. lrwxrwxrwx 1 minfrin fma 22 Jun 5 21:28 bin -> /usr/share/tomcat7/bin drwxr-xr-x 2 minfrin fma 4096 Jun 5 21:28 lib
The error message is correct - the file is owned by root and cannot be deleted:
[minfrin@gatekeeper platform-tomcat7-template]$ ls -al /usr/share/tomcat7/bin/tomcat-juli.jar lrwxrwxrwx 1 root root 22 May 24 17:50 /usr/share/tomcat7/bin/tomcat-juli.jar -> tomcat-juli-7.0.22.jar
It looks like the symlink detection is not working.
Looks like the same problem bites continuum:
http://jira.codehaus.org/browse/CONTINUUM-1156