-
Bug
-
Resolution: Done
-
Critical
-
JWS 3.1.0 ER3
-
None
-
User Experience
-
-
-
-
-
Issue:
Tomcat-vault installed from RPM has problem to calculate path to JAR file when run under sudo. One needs to manually set variable JBOSS_HOME to /usr/share/java.
Reproduce:
- Install tomcat-vault from rpm
- run command
sudo tomcat-vault.sh
Expected: tomcat-vault.sh starts
Now: tomcat-vault crashes withError: Unable to access jarfile //modules/system/layers/base/tomcat-vault/main/tomcat-vault.jar
Verbose:
sudo uses path defined in visudoDefaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
/bin is symbolic link to the usr/bin where tomcat-vault.sh is located (/bin -> usr/bin)
tomcat-vault is using dirname on script path ($0)
When run with sudo path ($0) is /bin/tomcat-vault.sh
When run with no sudo path ($0) is /usr/share/tomcat-vault.sh
Example of repair that is working on RHEL but it will break solaris
https://github.com/S4n60w3n/tomcat-vault/commit/846018c17f2c15a778ec68f5ec74b6c83ee4a984