Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

kdesu dolphin as root not possible [SOLVED-again]

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
164 posts
  • Page 5 of 7
    • Jump to page:
  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next
Author
Message
Hu
Administrator
Administrator
Posts: 24401
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Jul 28, 2019 8:22 pm

That is what the patches do for you, so you don't have to edit it by hand every time.

For someone who has an unpatched version, if you run dolphin started by root, but in a separate user namespace, does it work?

Code: Select all

/usr/bin/sudo /usr/bin/unshare --user -- dolphin
Similarly, based on the check that everyone keeps patching out, you could just make a wrapper that unsets the environment variables that it uses to detect this path, as I suggested back in February.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Jul 28, 2019 8:43 pm

Hu wrote:That is what the patches do for you, so you don't have to edit it by hand every time.
It works if source files are unchanged, but it doesn't work if something was changed and you have to re-write patch. This case it easier to edit source file than re-create patch every time. I just editing main.cpp and do not waiting when someone will re-create and share patch suitable for new file version.
Top
wrc1944
Advocate
Advocate
Posts: 3467
Joined: Thu Aug 15, 2002 10:33 am
Location: Gainesville, Florida

  • Quote

Post by wrc1944 » Sun Jul 28, 2019 9:03 pm

Blind_Sniper,
Thanks for the reply.
Sounds like from what you say if I just remove or rename the old dolphin patch and rebuild dolphin without the patch I shoud be able to get the old behavior from years ago.
That is : as user type kdesu dolphin (or use the kdol alias) in a konsole, and the dialog box for entering the root password will pop up.
Will give it a try.
Last edited by wrc1944 on Sun Jul 28, 2019 9:36 pm, edited 1 time in total.
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.41-r2, gcc-15.1.0
kernel-6.15.6 USE=experimental python3.13.3
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Jul 28, 2019 9:08 pm

I do not know how it will work at your side.
I just shared my expirience.
And it works for me on every update.
Hope it will work for you too.
Top
Fitzcarraldo
Advocate
Advocate
User avatar
Posts: 2057
Joined: Sat Aug 30, 2008 9:49 pm
Location: United Kingdom
Contact:
Contact Fitzcarraldo
Website

  • Quote

Post by Fitzcarraldo » Mon Jul 29, 2019 9:45 pm

It is possible to launch Dolphin 19.04.3 as root from your user account by using the pkexec command:

Code: Select all

$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
Dolphin first displays an orange-coloured box with the warning message 'Running Dolphin as root can be dangerous. Please be careful.' and you can then browse and open root-owned directories and files.

You can also launch Kate 19.04.3 and KWrite 19.04.3 as root from your user account in the same way:

Code: Select all

$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true kate

Code: Select all

$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true kwrite
You can set an alias in your ~/.bashrc for the three commands:

Code: Select all

$ tail -n 3 ~/.bashrc
alias dolroot="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin"
alias kateroot="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true kate"
alias kwriteroot="pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true kwrite"
Makes it easy to launch them as root from e.g. Konsole or Yakuake:

Code: Select all

$ dolroot
$ kateroot
$ kwriteroot
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Mon Jul 29, 2019 10:52 pm

Code: Select all

~ $ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/env' as the super user
Authenticating as: root
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.
It seems that a SWAT team is on its way now.
Top
Fitzcarraldo
Advocate
Advocate
User avatar
Posts: 2057
Joined: Sat Aug 30, 2008 9:49 pm
Location: United Kingdom
Contact:
Contact Fitzcarraldo
Website

  • Quote

Post by Fitzcarraldo » Tue Jul 30, 2019 1:12 am

proteusx wrote:

Code: Select all

~ $ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/env' as the super user
Authenticating as: root
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.
1. GDBus? Isn't that in GNOME or one of the other desktop environments that uses GNOME's GLib? Are you by any chance using Dolphin in a different desktop environment to KDE?

2. Is the applicable Polkit authentication agent running?:

Code: Select all

ps -ef | grep -E 'polkit.*agent' | grep -v grep
fitzcar+   828     1  0 01:37 ?        00:00:00 /usr/lib64/libexec/polkit-kde-authentication-agent-1
3. Are you using systemd or OpenRC?

4. If you're using OpenRC, are you using ConsoleKit or elogind?


EDIT: These pkexec commands work for me with Dolphin/Kate/KWrite 19.04.3 in KDE on two machines: one is running OpenRC+elogind & Plasma 5.16.3, the other is running systemd & Plasma 5.16.3.
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Tue Jul 30, 2019 1:58 pm

@Fitzcarraldo

I apologize for causing you to write all that.
My post was meant to be humorous and not seeking help.

My system is a bit weird so I know better than ask for help in the forum.

I am using OpenRC-0.17 and Plasma 4. On top of that I can run most of
the latest kde-apps/*:5 and some gnomy apps I like (e.g. Gucharmap).

I use "startx" to start Xwindows. I have deleted all /etc/xdg/autostart/* unless there is
something I really need (e.g. kmix). I have no use for the
polkit, consolekit crapware but these are pulled in as a dependencies by apps
I need (e.g. AnyDesk). I let them live on my system as long as they do not
interfere with what I do.

Occasionally I need to run Dolphin as root and the simple patch does what I need.
I almost never use kate or kwrite but having them at hand does no harm.

PS. I am an avid reader of your blog page.
Top
Fitzcarraldo
Advocate
Advocate
User avatar
Posts: 2057
Joined: Sat Aug 30, 2008 9:49 pm
Location: United Kingdom
Contact:
Contact Fitzcarraldo
Website

  • Quote

Post by Fitzcarraldo » Tue Jul 30, 2019 3:05 pm

Ah, OK, if you don't have Polkit installed then the Polkit command pkexec is obviously not going to work.

But for 'normal' KDE Plasma 5 users it will work as shown in my earlier post. And, with either an alias or a two-line wrapper script, this method is as easy as the old method of using sudo or kdesu that KDE's Martin Gräßlin disabled*:

Code: Select all

$ dolroot

Code: Select all

$ sudo dolphin

Code: Select all

$ kdesu dolphin
If an alias is used, rooted-Dolphin can be launched from the command line but cannot be launched via KDE's Application Launcher menu or KRunner. If a wrapper script is used, rooted-Dolphin can be launched from the user's command line and via KDE's Application Launcher menu (and therefore via KRunner too):

Code: Select all

$ ls -la *root
-rwx------ 1 fitzcarraldo fitzcarraldo 115 Jul 30 15:33 dolroot
-rwx------ 1 fitzcarraldo fitzcarraldo 112 Jul 30 15:34 kateroot
-rwx------ 1 fitzcarraldo fitzcarraldo 114 Jul 30 15:34 kwriteroot

Code: Select all

$ cat dolroot
#!/bin/bash
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
After adding entries for dolroot, kateroot and kwriteroot to the KDE Application Launcher's menu, you can press Alt+F2 as usual to display the KRunner launcher then enter 'dolroot', 'kateroot' or 'kwriteroot' (without the quotes, obviously) in the KRunner window to launch Dolphin/Kate/KWrite as root. A window will pop-up for you to enter the root user's password.


* Thankfully KDE's Nathaniel Graham is pragmatic, unlike KDE's Martin Gräßlin:

D12795 - Re-allow running Dolphin as the root user (but still not using sudo)
D12732 - Show a warning when running as the root user
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Top
jhon987
Guru
Guru
Posts: 302
Joined: Mon Nov 18, 2013 1:23 am

  • Quote

Post by jhon987 » Tue Jul 30, 2019 9:29 pm

Fitzcarraldo wrote:Ah, OK, if you don't have Polkit installed then the Polkit command pkexec is obviously not going to work.

But for 'normal' KDE Plasma 5 users it will work as shown in my earlier post. And, with either an alias or a two-line wrapper script, this method is as easy as the old method of using sudo or kdesu that KDE's Martin Gräßlin disabled*:

Code: Select all

$ dolroot

Code: Select all

$ sudo dolphin

Code: Select all

$ kdesu dolphin
If an alias is used, rooted-Dolphin can be launched from the command line but cannot be launched via KDE's Application Launcher menu or KRunner. If a wrapper script is used, rooted-Dolphin can be launched from the user's command line and via KDE's Application Launcher menu (and therefore via KRunner too):

Code: Select all

$ ls -la *root
-rwx------ 1 fitzcarraldo fitzcarraldo 115 Jul 30 15:33 dolroot
-rwx------ 1 fitzcarraldo fitzcarraldo 112 Jul 30 15:34 kateroot
-rwx------ 1 fitzcarraldo fitzcarraldo 114 Jul 30 15:34 kwriteroot

Code: Select all

$ cat dolroot
#!/bin/bash
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
After adding entries for dolroot, kateroot and kwriteroot to the KDE Application Launcher's menu, you can press Alt+F2 as usual to display the KRunner launcher then enter 'dolroot', 'kateroot' or 'kwriteroot' (without the quotes, obviously) in the KRunner window to launch Dolphin/Kate/KWrite as root. A window will pop-up for you to enter the root user's password.


* Thankfully KDE's Nathaniel Graham is pragmatic, unlike KDE's Martin Gräßlin:

D12795 - Re-allow running Dolphin as the root user (but still not using sudo)
D12732 - Show a warning when running as the root user
This is great mate, even though it wasn't necessarily meant for me, still, i'd like to thank you for posting.
For now, @proteusx's patch is working fine for me. but I might use your solution in the future instead.
Hopefully, the hole you found wouldn't be covered by that time...
Top
papu
l33t
l33t
Posts: 772
Joined: Fri Jan 25, 2008 3:04 pm
Location: Sota algun pi o alzina...

  • Quote

Post by papu » Tue Jul 30, 2019 11:22 pm

this is amazing! :) very thanks!

Code: Select all

pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin
~amd64 && systemd && plasma --cpu 7700 --ram 2x32GB --gpu RX 6600
Top
sdr
n00b
n00b
Posts: 12
Joined: Sun Jun 18, 2006 8:17 pm

  • Quote

Post by sdr » Mon Aug 05, 2019 12:34 pm

Code: Select all

alias kdesu='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true'
Top
psands
n00b
n00b
Posts: 19
Joined: Mon Aug 12, 2019 12:40 am

  • Quote

Post by psands » Mon Aug 12, 2019 12:52 am

I can not get the updated kwrite patch to work. I can get the dolphin and kate patch to work. Here is my build log for kwrite.

Code: Select all

[32;01m * [39;49;00mPackage:    kde-apps/kwrite-19.04.3
[32;01m * [39;49;00mRepository: gentoo
[32;01m * [39;49;00mMaintainer: kde@gentoo.org
[32;01m * [39;49;00mUSE:        abi_x86_64 amd64 elibc_glibc handbook kernel_linux userland_GNU
[32;01m * [39;49;00mFEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking kate-19.04.3.tar.xz to /var/tmp/portage/kde-apps/kwrite-19.04.3/work
>>> Source unpacked in /var/tmp/portage/kde-apps/kwrite-19.04.3/work
>>> Preparing source in /var/tmp/portage/kde-apps/kwrite-19.04.3/work/kate-19.04.3 ...
 [32;01m*[0m Applying kwrite-allow-root.patch ...
1 out of 1 hunk FAILED -- saving rejects to file kwrite/main.cpp.rej
[A[95C [34;01m[ [31;01m!![34;01m ][0m
 [31;01m*[0m ERROR: kde-apps/kwrite-19.04.3::gentoo failed (prepare phase):
 [31;01m*[0m   patch -p1  failed with /etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch
 [31;01m*[0m
 [31;01m*[0m Call stack:
 [31;01m*[0m               ebuild.sh, line  125:  Called src_prepare
 [31;01m*[0m             environment, line 2644:  Called kde5_src_prepare
 [31;01m*[0m             environment, line 2092:  Called cmake-utils_src_prepare
 [31;01m*[0m             environment, line 1191:  Called default_src_prepare
 [31;01m*[0m      phase-functions.sh, line  937:  Called __eapi6_src_prepare
 [31;01m*[0m             environment, line  309:  Called eapply_user
 [31;01m*[0m             environment, line 1406:  Called eapply '/etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 [31;01m*[0m             environment, line 1376:  Called _eapply_patch '/etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 [31;01m*[0m             environment, line 1314:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 [31;01m*[0m   isolated-functions.sh, line  119:  Called die
 [31;01m*[0m The specific snippet of code:
 [31;01m*[0m   		die "$@"
 [31;01m*[0m
 [31;01m*[0m If you need support, post the output of `emerge --info '=kde-apps/kwrite-19.04.3::gentoo'`,
 [31;01m*[0m the complete build log and the output of `emerge -pqv '=kde-apps/kwrite-19.04.3::gentoo'`.
 [31;01m*[0m The complete build log is located at '/var/log/portage/kde-apps:kwrite-19.04.3:20190812-001053.log'.
 [31;01m*[0m For convenience, a symlink to the build log is located at '/var/tmp/portage/kde-apps/kwrite-19.04.3/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/kde-apps/kwrite-19.04.3/temp/environment'.
 [31;01m*[0m Working directory: '/var/tmp/portage/kde-apps/kwrite-19.04.3/work/kate-19.04.3'
 [31;01m*[0m S: '/var/tmp/portage/kde-apps/kwrite-19.04.3/work/kate-19.04.3'
[Moderator edit: added [code] tags to preserve output layout. -Hu]
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Mon Aug 12, 2019 5:33 am

@psands

Please post your patch file.
But make sure that you applied the latest kwrite patch.

Alternatively you may edit main.cpp by hand as described in this post.
Top
psands
n00b
n00b
Posts: 19
Joined: Mon Aug 12, 2019 12:40 am

  • Quote

Post by psands » Mon Aug 12, 2019 4:42 pm

I used the code in the latest patch you posted. I will look at the link for doing it manually and give that a try.

Code: Select all

--- a/kwrite/main.cpp
+++ b/kwrite/main.cpp
@@ -50,18 +50,6 @@

 extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
 {
-#ifndef Q_OS_WIN
-    // 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." << std::endl;
-            return EXIT_FAILURE;
-        } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
-            std::cout << "Executing KWrite with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
-            return EXIT_FAILURE;
-        }
-    }
-#endif
     /**
      * Create application first
      * Enforce application name even if the executable is renamed
[Moderator edit: added [code] tags to preserve output layout. -Hu]
Top
psands
n00b
n00b
Posts: 19
Joined: Mon Aug 12, 2019 12:40 am

  • Quote

Post by psands » Mon Aug 12, 2019 7:38 pm

I was able to patch manually and everything worked great. I have no idea why your patch didn't work. It has always worked for me before. Thanks for the help.
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Fri Aug 16, 2019 6:07 am

Dolphin as root, patch updated for version 19.08.0

Code: Select all

--- a/src/main.cpp
+++ b/src/main.cpp
@@ -46,19 +46,6 @@
 
 extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 {
-#ifndef Q_OS_WIN
-    // 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;
-            return EXIT_FAILURE;
-        } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
-            std::cout << "Executing Dolphin with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
-            return EXIT_FAILURE;
-        }
-    }
-#endif
-
     QApplication app(argc, argv);
     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Sun Sep 15, 2019 11:44 am

Dolphin as root, patch updated for version 19.08.1

Code: Select all

diff -Naur orig/src/dolphinviewcontainer.cpp patched/src/dolphinviewcontainer.cpp
--- orig/src/dolphinviewcontainer.cpp	2019-09-03 00:15:08.000000000 +0300
+++ patched/src/dolphinviewcontainer.cpp	2019-09-15 12:45:14.451444593 +0300
@@ -136,13 +136,6 @@
     m_messageWidget->setCloseButtonVisible(true);
     m_messageWidget->hide();
 
-#ifndef Q_OS_WIN
-    if (getuid() == 0) {
-
-        // We must be logged in as the root user; show a big scary warning
-        showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
-    }
-#endif
 
     // Initialize filter bar
     m_filterBar = new FilterBar(this);
diff -Naur orig/src/main.cpp patched/src/main.cpp
--- orig/src/main.cpp	2019-09-03 00:15:08.000000000 +0300
+++ patched/src/main.cpp	2019-09-15 12:43:55.923439868 +0300
@@ -46,19 +46,6 @@
 
 extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 {
-#ifndef Q_OS_WIN
-    // 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;
-            return EXIT_FAILURE;
-        } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
-            std::cout << "Executing Dolphin with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
-            return EXIT_FAILURE;
-        }
-    }
-#endif
-
     QApplication app(argc, argv);
     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
Top
wrc1944
Advocate
Advocate
Posts: 3467
Joined: Thu Aug 15, 2002 10:33 am
Location: Gainesville, Florida

  • Quote

Post by wrc1944 » Sun Sep 15, 2019 4:58 pm

proteusx,
Sorry to report, but none of the last few dolphin patches have worked on my systems. In past years, I just used a little user .bash.rc

Code: Select all

alias kdol="kdesu dolphin" 
and the dialog window popped up for the root password, and then dolphin opened as root. No fuss, No muss. Sure miss those old days when it just worked great.

Since at least 18.04 dolphin with patch, I always get "bash: kdesu: command not found" as user or as root, despite rebuilding both dolphin and kdesu and the fact that both are installed.

Only thing that has and still is working (after rebuilding dolphin without the patch) is my current /root/.bash.rc alias, which never fails, although it still has the annoying "Running Dolphin as root can be dangerous. Please be careful" message.

Code: Select all

alias kdol="export XDG_CURRENT_DESKTOP=kde && dolphin"
I get the root dolphin, but also in the root konsole I have output like:

Code: Select all

gentoo-main ~ # kdol
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
kf5.kservice.services: The desktop entry file "/usr/share/applications/org.gnupg.pinentry-qt.desktop" has Type= "Application" but no Exec line
kf5.kservice.sycoca: Invalid Service :  "/usr/share/applications/org.gnupg.pinentry-qt.desktop"
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
kf5.kio.core: "Could not enter folder tags:/."
This output varies and extends depending on what I'm doing in dolphin.
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.41-r2, gcc-15.1.0
kernel-6.15.6 USE=experimental python3.13.3
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Tue Sep 17, 2019 8:35 pm

wrc1944 wrote:Sorry to report, but none of the last few dolphin patches have worked on my systems.
Did the patch fail?

Maybe something is amiss with your kdesu. Is kde-cli-tools compiled with USE=kdesu?

In my case, dolphin compiled with patch, I run

Code: Select all

~$ kdesu dolphin
as user and I get a root dolphin without that irritating "be careful" warning.
The only warning I see is in the terminal is

Code: Select all

Don't need password!!
but this may be related to the fact that I have crippled pam so I can get to root without a password.

When I run dolphin from a root konsole like so:

Code: Select all

~$ su -
~# dolphin
I again get a root dolphin, with the same warning messages you report, but this time dolphin appears to be running under root's desktop environment.
Top
wrc1944
Advocate
Advocate
Posts: 3467
Joined: Thu Aug 15, 2002 10:33 am
Location: Gainesville, Florida

  • Quote

Post by wrc1944 » Wed Sep 18, 2019 5:01 am

proteusx,
Thanks much for the reply. Yes, the patches have always applied fine. However, I just checked, and sure enough :
gentoo-main ~ # emerge kde-cli-tools -pv

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] kde-plasma/kde-cli-tools-5.16.5:5::gentoo USE="X handbook -debug -kdesu -test" 0 KiB
I'll re-apply the patch, and rebuild dolphin. and rebuild kde-plasma/kde-cli-tools with the kdesu flag enabled.

Hmm... Just checked the ebuild, and found:

Code: Select all

IUSE="kdesu X"

REQUIRED_USE="kdesu? ( X )"
Is kdesu the default, and if so, why the REQUIRED_USE="kdesu? with the question mark? Does this mean kdesu flag must be used with X?

Wonder why my system portage says -kdesu? Will check my package.use file, but don't think I've ever had much kde stuff in it. Nope- nothing there.

https://packages.gentoo.org/packages/kd ... -cli-tools doesn't mention the kdesu flag, only handbook and test.
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.41-r2, gcc-15.1.0
kernel-6.15.6 USE=experimental python3.13.3
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Wed Sep 18, 2019 8:09 am

wrc1944 wrote:
Hmm... Just checked the ebuild, and found:

Code: Select all

IUSE="kdesu X"

REQUIRED_USE="kdesu? ( X )"
Is kdesu the default, and if so, why the REQUIRED_USE="kdesu? with the question mark? Does this mean kdesu flag must be used with X?
I think it means you can have kdesu only with X.
Probably because wayland cannot do kdesu.
Top
wrc1944
Advocate
Advocate
Posts: 3467
Joined: Thu Aug 15, 2002 10:33 am
Location: Gainesville, Florida

  • Quote

Post by wrc1944 » Thu Sep 19, 2019 5:29 pm

proteusx,
Placing kde-plasma/kde-cli-tools kdesu in /etc/portage/package.use, and rebuilding kde-plasma/kde-cli-tools, kdesu, and dolphin with your latest 19.08.01-root.patch solved my problems! :D

I can now use my original /home/wrc/.bashrc

Code: Select all

alias kdol="kdesu dolphin"
as in years past, where typing kdol in a user konsole popped up a root password dialog box, and typing my root password opened dolphin as root, without the annoying warning message. Many thanks to proteusx for maintaining this patch, and pointing out kde-plasma/kde-cli-tools needed the kdesu USE flag.

I'm still wondering why my three Gentoo systems kde-plasma/kde-cli-tools packages apparently began defaulting to -kdesu sometime around version >=17.04. :?
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.41-r2, gcc-15.1.0
kernel-6.15.6 USE=experimental python3.13.3
Top
psands
n00b
n00b
Posts: 19
Joined: Mon Aug 12, 2019 12:40 am

  • Quote

Post by psands » Wed Dec 04, 2019 10:49 pm

Has anyone tried the dolphin-19.08.1 patch with 19.08.3? I haven't had any luck.
Top
proteusx
Guru
Guru
User avatar
Posts: 340
Joined: Mon Jan 21, 2008 11:35 am

  • Quote

Post by proteusx » Thu Dec 05, 2019 12:41 am

dolphin-as-root-19.08.3.patch

Code: Select all

diff -Naur orig/src/dolphinviewcontainer.cpp patched/src/dolphinviewcontainer.cpp
--- orig/src/dolphinviewcontainer.cpp	2019-09-03 00:15:08.000000000 +0300
+++ patched/src/dolphinviewcontainer.cpp	2019-09-15 12:45:14.451444593 +0300
@@ -136,13 +136,6 @@
     m_messageWidget->setCloseButtonVisible(true);
     m_messageWidget->hide();
 
-#ifndef Q_OS_WIN
-    if (getuid() == 0) {
-
-        // We must be logged in as the root user; show a big scary warning
-        showMessage(i18n("Running Dolphin as root can be dangerous. Please be careful."), Warning);
-    }
-#endif
 
     // Initialize filter bar
     m_filterBar = new FilterBar(this);
diff -Naur orig/src/main.cpp patched/src/main.cpp
--- orig/src/main.cpp	2019-09-03 00:15:08.000000000 +0300
+++ patched/src/main.cpp	2019-09-15 12:43:55.923439868 +0300
@@ -46,19 +46,6 @@
 
 extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
 {
-#ifndef Q_OS_WIN
-    // 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;
-            return EXIT_FAILURE;
-        } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
-            std::cout << "Executing Dolphin with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
-            return EXIT_FAILURE;
-        }
-    }
-#endif
-
     QApplication app(argc, argv);
     app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
Top
Post Reply

164 posts
  • Page 5 of 7
    • Jump to page:
  • Previous
  • 1
  • …
  • 3
  • 4
  • 5
  • 6
  • 7
  • Next

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic