fix: V-001 security vulnerability (#5951)
Automated security fix generated by OrbisAI Security
This commit is contained in:
@@ -26,10 +26,11 @@ object RootShell {
|
||||
writeText(script)
|
||||
setExecutable(true, false)
|
||||
}
|
||||
return exec("sh ${file.absolutePath}")
|
||||
val safePath = file.absolutePath.replace("'", "'\\''")
|
||||
return exec("sh '$safePath'")
|
||||
}
|
||||
|
||||
fun exec(command: String, timeoutSeconds: Long = 30): Result {
|
||||
private fun exec(command: String, timeoutSeconds: Long = 30): Result {
|
||||
return try {
|
||||
val process = ProcessBuilder("su", "-c", command)
|
||||
.redirectErrorStream(true)
|
||||
|
||||
Reference in New Issue
Block a user