Skip to content

Commit 1f3f36a

Browse files
committed
Fix exitCode check for elevation
1 parent e3cb106 commit 1f3f36a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bool Cmd::run(const QString &cmd, bool quiet, bool asRoot, bool waitForFinish)
5151

5252
// Check for permission denied or command not found errors when running as root
5353
// These can occur when elevation fails (canceled dialog or incorrect password)
54-
if (asRoot && getuid() != 0) {
54+
if (asRoot && getuid() != 0 && exitCode() != 0) {
5555
if (exitCode() == EXIT_CODE_PERMISSION_DENIED || exitCode() == EXIT_CODE_COMMAND_NOT_FOUND) {
5656
handleElevationError();
5757
} else {

0 commit comments

Comments
 (0)