]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Improve sudo/kdesu error message
authorNate Graham <nate@kde.org>
Fri, 31 Dec 2021 17:36:31 +0000 (10:36 -0700)
committerNate Graham <nate@kde.org>
Fri, 31 Dec 2021 17:38:19 +0000 (10:38 -0700)
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.

CMakeLists.txt
src/main.cpp

index 92b311bfc4936966e4f98488b2d9d3548f5ae181..6ab68cc9329944539fdf57cb9fcae118a56b2ebf 100644 (file)
@@ -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)
index 779690c1c5de280c9742f2d432e0a3c395156986..cda28c80c709ad67ed729ef51236ee0852139156 100644 (file)
@@ -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;
         }
     }