Commit 7f087a8a authored by Nate Graham's avatar Nate Graham Committed by Christoph Cullmann
Browse files

Show a less patronizing message when trying to run with sudo or kdesu

parent db468760
Pipeline #116475 passed with stage
in 4 minutes and 12 seconds
......@@ -49,15 +49,15 @@ int main(int argc, char **argv)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if (getuid() == 0) {
if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
std::cout << "Executing Kate with sudo is not possible due to unfixable security vulnerabilities. "
"It is also not necessary; simply use Kate normally, and you will be prompted for "
"elevated privileges when saving documents if needed."
std::cout << "Running Kate with sudo can cause bugs and expose you to security vulnerabilities. "
"Instead use Kate normally and you will be prompted for elevated privileges when "
"saving documents if needed."
<< std::endl;
return EXIT_FAILURE;
} else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
std::cout << "Executing Kate with kdesu is not possible due to unfixable security vulnerabilities. "
"It is also not necessary; simply use Kate normally, and you will be prompted for "
"elevated privileges when saving documents if needed."
std::cout << "Running Kate with kdesu can cause bugs and expose you to security vulnerabilities. "
"Instead use Kate normally and you will be prompted for elevated privileges when "
"saving documents if needed."
<< std::endl;
return EXIT_FAILURE;
}
......
......@@ -41,15 +41,15 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if (getuid() == 0) {
if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
std::cout << "Executing KWrite with sudo is not possible due to unfixable security vulnerabilities. "
"It is also not necessary; simply use KWrite normally, and you will be prompted for "
"elevated privileges when saving documents if needed."
std::cout << "Running KWrite with sudo can cause bugs and expose you to security vulnerabilities. "
"Instead use KWrite normally and you will be prompted for elevated privileges when "
"saving documents if needed."
<< std::endl;
return EXIT_FAILURE;
} else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
std::cout << "Executing KWrite with kdesu is not possible due to unfixable security vulnerabilities. "
"It is also not necessary; simply use KWrite normally, and you will be prompted for "
"elevated privileges when saving documents if needed."
std::cout << "Running KWrite with kdesu can cause bugs and expose you to security vulnerabilities. "
"Instead use KWrite normally and you will be prompted for elevated privileges when "
"saving documents if needed."
<< std::endl;
return EXIT_FAILURE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment