Skip to content

Commit 8827afa

Browse files
committed
Cleanup & fix mistake
1 parent d12e421 commit 8827afa

File tree

1 file changed

+5
-5
lines changed
  • agent_api/src/main/java/dev/aikido/agent_api/vulnerabilities/sql_injection

1 file changed

+5
-5
lines changed

agent_api/src/main/java/dev/aikido/agent_api/vulnerabilities/sql_injection/GetBinaryPath.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
import dev.aikido.agent_api.helpers.logging.LogManager;
44
import dev.aikido.agent_api.helpers.logging.Logger;
5+
import jnr.ffi.Library;
56

67
import java.io.BufferedReader;
78
import java.io.IOException;
89
import java.io.InputStreamReader;
910
import java.io.InterruptedIOException;
11+
import java.lang.annotation.Native;
1012

1113
public 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
}

0 commit comments

Comments
 (0)