Patch for user checking. (#1481)
* Direct use of the $HOME variable.
* Sudo check witch variable $HOME.
Direct use of the $HOME variable.
* Changing for Error 208
Changing description and title for error 208
* Revert "Changing for Error 208"
This reverts commit f45624c023
.
* Changing for Error 207
Changing description and title for Error 207
This commit is contained in:
parent
fcb75e837d
commit
00f314039d
5 changed files with 5 additions and 5 deletions
|
@ -771,7 +771,7 @@ ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, D
|
|||
ErrorCode error = runScript(credentials, replaceVars(scriptData, genVarsForScript(credentials)), cbReadStdOut, cbReadStdErr);
|
||||
|
||||
if (credentials.userName != "root" && stdOut.contains("sudo:") && !stdOut.contains("uname:") && stdOut.contains("not found"))
|
||||
return ErrorCode::SudoPackageIsNotPreinstalled;
|
||||
return ErrorCode::ServerSudoPackageIsNotPreinstalled;
|
||||
if (credentials.userName != "root" && !stdOut.contains("sudo") && !stdOut.contains("wheel"))
|
||||
return ErrorCode::ServerUserNotInSudo;
|
||||
if (stdOut.contains("can't cd to") || stdOut.contains("Permission denied") || stdOut.contains("No such file or directory"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue