15 views

Description


Restricting find commands to run using sudo can fail in some patterns that use commands returned from scripts that run without appending sudo.

Example


Pattern: Tomcat war

Connection: Connectivity to Relational Database Systems

Step: 1.4. Find "jdbc" in all files for specific app

It executes:

EVAL(return ctx.getCommandManager().scanDirectoriesForPattern(ctx,java.util.Collections.singletonList(${install_directory}),"jdbc:"); )

which runs:

find /apps/bmc/ARSystem/midtier -type f | xargs grep 'jdbc:' 2>/dev/null

Solution


To run the example with sudo, add a new step as opposed to using the eval script.

"sudo find" + $install_directory + " -type f | xargs grep '" + "jdbc:" + "' 2>/dev/null"

 

Article Information

Last Updated:2018-06-13 00:25:39
Published:2018-06-13