Fix Linux elevation magic marker comparison
This commit is contained in:
parent
799fd96680
commit
71aced589a
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -175,7 +175,7 @@ function Linux(instance, end) {
|
|||
//
|
||||
// However, we do not rely on pkexec's return of 127 since our magic
|
||||
// marker is more reliable, and we already use it for kdesudo.
|
||||
var elevated = stdout ? stdout.toString('utf8', 0, magic.length) : '';
|
||||
var elevated = stdout && stdout.slice(0, magic.length) === magic;
|
||||
if (elevated) stdout = stdout.slice(magic.length);
|
||||
// Only normalize the error if it is definitely not a command error:
|
||||
// In other words, if we know that the command was never elevated.
|
||||
|
|
Loading…
Reference in a new issue