Issue Type: Bug Bug
Affects Versions: 2.1-alpha-1
Assignee: Unassigned
Components: rpm
Created: 05/Jun/12 2:25 PM
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.

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)
Project: Mojo RPM Plugin
Priority: Major Major
Reporter: Graham Leggett
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

Reply via email to