-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugin can not find FORTIFY_HOME & PATH due to java.io.File.isFile not returning true when expected #61
Comments
I am having the same issue. Copying the scripts to the workspace was the only way to get the plugin to find them. My current workaround for this issue is executing these shell commands prior to executing the plugin step: cp --recursive ${FORTIFY_HOME}/bin/* .
ln -s ${FORTIFY_HOME}/Core ../Core This is obviously quite ugly, but it works. |
Caters for some unix based OS returning false when it should be true
Well, the .isFile() is not equivalent to !.isDirectory(). Basically, if !.exists(), then the .isFile() fails, but !.isDirectory() passes. I think there must be something wrong with checking for existing or, actually, for read permissions on the file. |
Seems to work for me now. Steps to reproduce:
|
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Red Hat's ubi8 image
Reproduction steps
FORTIFY_HOME is set to /opt/Fortify/bin
withEnv(['PATH+FORTIFY=/opt/Fortify/bin']) {
fortifyClean buildID: fortify_project
}
Expected Results
step is executed
Actual Results
Anything else?
This is similar to issue #49. I can only get this to work if I copy the files to the workspace. It does not respect the FORTIFY_HOME or PATH settings.
The access to the bin directory is:
The access to the files in the bin directory:
By calling java.io.File.isFile in a pipeline script to /opt/Fortify/bin/sourceanalyzer it returns false. Which seems to be related to unix environment
I know sourceanalyzer is accessible as I can call it directly with sh '/opt/Fortify/bin/sourceanalyzer' and it executes.
I have narrowed it down to File.isFile() in FindExecutableRemoteService.invoke and PathUtils.locateFileInPath not returning the expected result of true. I have seen forums regarding an issue in the jdk, it would appear that there is a workaround of changing it to !file.isDirectory() which will resolve the issue. I tested calling !File.isDirectory in pipeline script in my environment.
The text was updated successfully, but these errors were encountered: