// Prohibit using sudo or kdesu (but allow using the root user directly)
if (getuid() == 0) {
if (!qEnvironmentVariableIsEmpty("SUDO_USER")) {
// 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;
- 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;
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin"));
migrate.setConfigFiles(QStringList() << QStringLiteral("dolphinrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("dolphinpart.rc") << QStringLiteral("dolphinui.rc"));
migrate.migrate();
Kdelibs4ConfigMigrator migrate(QStringLiteral("dolphin"));
migrate.setConfigFiles(QStringList() << QStringLiteral("dolphinrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("dolphinpart.rc") << QStringLiteral("dolphinui.rc"));
migrate.migrate();
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);