Fail on user mismatch under root only. Just warn under non root user.

This commit is contained in:
Sergey V. Galtsev 2018-12-11 02:32:21 +03:00
parent 30acd5000e
commit c9b984285d

View File

@ -204,8 +204,14 @@ int Server::main(const std::vector<std::string> & /*args*/)
std::string message = "Effective user of the process (" + effective_user +
") does not match the owner of the data (" + data_owner + ").";
if (effective_user_id == 0)
{
message += " Run under 'sudo -u " + data_owner + "'.";
throw Exception(message, ErrorCodes::MISMATCHING_USERS_FOR_PROCESS_AND_DATA);
throw Exception(message, ErrorCodes::MISMATCHING_USERS_FOR_PROCESS_AND_DATA);
}
else
{
LOG_WARNING(log, message);
}
}
global_context->setPath(path);