Compare commits
3 commits
dev
...
wheel_grou
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1152ccad3 | ||
|
|
3d95b14fc1 | ||
|
|
6d176dcc2f |
1 changed files with 2 additions and 6 deletions
|
|
@ -751,10 +751,6 @@ ErrorCode ServerController::isServerPortBusy(const ServerCredentials &credential
|
|||
|
||||
ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, DockerContainer container)
|
||||
{
|
||||
if (credentials.userName == "root") {
|
||||
return ErrorCode::NoError;
|
||||
}
|
||||
|
||||
QString stdOut;
|
||||
auto cbReadStdOut = [&](const QString &data, libssh::Client &) {
|
||||
stdOut += data + "\n";
|
||||
|
|
@ -768,7 +764,7 @@ ErrorCode ServerController::isUserInSudo(const ServerCredentials &credentials, D
|
|||
const QString scriptData = amnezia::scriptData(SharedScriptType::check_user_in_sudo);
|
||||
ErrorCode error = runScript(credentials, replaceVars(scriptData, genVarsForScript(credentials)), cbReadStdOut, cbReadStdErr);
|
||||
|
||||
if (!stdOut.contains("sudo"))
|
||||
if (!stdOut.contains("root :") && !stdOut.contains(" sudo") && !stdOut.contains(" wheel"))
|
||||
return ErrorCode::ServerUserNotInSudo;
|
||||
|
||||
return error;
|
||||
|
|
@ -832,4 +828,4 @@ ErrorCode ServerController::getDecryptedPrivateKey(const ServerCredentials &cred
|
|||
{
|
||||
auto error = m_sshClient.getDecryptedPrivateKey(credentials, decryptedPrivateKey, callback);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue