File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
agent_api/src/main/java/dev/aikido/agent_api/vulnerabilities/sql_injection Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 22
33import dev .aikido .agent_api .helpers .logging .LogManager ;
44import dev .aikido .agent_api .helpers .logging .Logger ;
5+ import jnr .ffi .Library ;
56
67import java .io .BufferedReader ;
78import java .io .IOException ;
89import java .io .InputStreamReader ;
910import java .io .InterruptedIOException ;
11+ import java .lang .annotation .Native ;
1012
1113public final class GetBinaryPath {
1214 private GetBinaryPath () {}
@@ -50,20 +52,18 @@ private static String getLibCVariant() {
5052 try {
5153 // ldd --version, if supported, returns something like `musl libc (aarch64)` for musl
5254 // or `ldd (Ubuntu GLIBC 2.39-0ubuntu8.6) 2.39` for GNU
53- Process process = Runtime .getRuntime ().exec ("ldd `which ls` " );
55+ Process process = Runtime .getRuntime ().exec ("ldd --version " );
5456 BufferedReader reader = new BufferedReader (new InputStreamReader (process .getInputStream ()));
55- String line ;
57+ String line = "" ;
5658 while ((line = reader .readLine ()) != null ) {
57- logger .error (line ); // Debug
5859 if (line .toLowerCase ().contains ("musl" )) {
5960 return "musl" ;
6061 } else if (line .toLowerCase ().contains ("gnu" ) || line .toLowerCase ().contains ("glibc" )) {
6162 return "gnu" ;
6263 }
6364 }
64- logger .error ("No data to command" );
6565 } catch (IOException e ) {
66- logger .error (e );
66+ logger .debug (e );
6767 }
6868 return "gnu" ;
6969 }
You can’t perform that action at this time.
0 commit comments