Commit 28ecfd5a authored by Nate Graham's avatar Nate Graham
Browse files

Improve sudo/kdesu error message

Now that you can get elevated privileges while using the app, we can
display a more useful and descriptive error message when people try to
run Dolphin using `sudo` or `kdesu`.

Also bump the frameworks dependency to 5.90 since that's the KIO
version that includes this change, so we can be sure that the message is
always accurate.
parent c40fe3b8
Pipeline #116892 passed with stage
in 5 minutes and 36 seconds
......@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.89.0")
set(KF5_MIN_VERSION "5.90.0")
# ECM setup
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
......
......@@ -44,10 +44,16 @@ 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 Dolphin with sudo is not possible due to unfixable security vulnerabilities." << std::endl;
std::cout << "Running Dolphin with sudo can cause bugs and expose you to security vulnerabilities. "
"Instead use Dolphin normally and you will be prompted for elevated privileges when "
"performing file operations that require them."
<< std::endl;
return EXIT_FAILURE;
} else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
std::cout << "Executing Dolphin with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
std::cout << "Running Dolphin with kdesu can cause bugs and expose you to security vulnerabilities. "
"Instead use Dolphin normally and you will be prompted for elevated privileges when "
"performing file operations that require them."
<< 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