Use absolute path for test command

This commit is contained in:
crschnick 2024-10-31 20:50:58 +00:00
parent 02b1d1325c
commit 7872da5e51
3 changed files with 4 additions and 4 deletions

View file

@ -127,7 +127,7 @@ public interface KittyTerminalType extends ExternalTerminalType {
var socket = getSocket();
try (var sc = LocalShell.getShell().start()) {
if (sc.executeSimpleBooleanCommand(
"test -w " + sc.getShellDialect().fileArgument(socket))) {
"/usr/bin/test -w " + sc.getShellDialect().fileArgument(socket))) {
return false;
}
@ -174,7 +174,7 @@ public interface KittyTerminalType extends ExternalTerminalType {
var socket = getSocket();
try (var sc = LocalShell.getShell().start()) {
if (sc.executeSimpleBooleanCommand(
"test -w " + sc.getShellDialect().fileArgument(socket))) {
"/usr/bin/test -w " + sc.getShellDialect().fileArgument(socket))) {
return false;
}

View file

@ -83,7 +83,7 @@ public class ShellTemp {
}
var d = proc.getShellDialect();
return proc.executeSimpleBooleanCommand("test -r %s && test -w %s && test -x %s"
return proc.executeSimpleBooleanCommand("/usr/bin/test -r %s && /usr/bin/test -w %s && /usr/bin/test -x %s"
.formatted(d.fileArgument(dir), d.fileArgument(dir), d.fileArgument(dir)));
}

View file

@ -22,7 +22,7 @@ public interface ElevationFunction {
return false;
}
var isRoot = shellControl.executeSimpleBooleanCommand("test \"${EUID:-$(id -u)}\" -eq 0");
var isRoot = shellControl.executeSimpleBooleanCommand("/usr/bin/test \"${EUID:-$(id -u)}\" -eq 0");
if (isRoot) {
return false;
}