Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kdesu dolphin as root not possible [SOLVED-again]
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14382

PostPosted: Sun Jul 28, 2019 8:22 pm    Post subject: Reply with quote

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:
/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.
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 123

PostPosted: Sun Jul 28, 2019 8:43 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3271
Location: Gainesville, Florida

PostPosted: Sun Jul 28, 2019 9:03 pm    Post subject: Reply with quote

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.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 1700, 3.0GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.30-r2, gcc-9.2.0 kernel-5.4.1-gentoo USE=experimental


Last edited by wrc1944 on Sun Jul 28, 2019 9:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Blind_Sniper
Tux's lil' helper
Tux's lil' helper


Joined: 20 Apr 2018
Posts: 123

PostPosted: Sun Jul 28, 2019 9:08 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Mon Jul 29, 2019 9:45 pm    Post subject: Reply with quote

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

Code:
$ 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:
$ pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true kate


Code:
$ 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:
$ 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:
$ dolroot
$ kateroot
$ kwriteroot

_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Mon Jul 29, 2019 10:52 pm    Post subject: Reply with quote

Code:
~ $ 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.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Tue Jul 30, 2019 1:12 am    Post subject: Reply with quote

proteusx wrote:
Code:
~ $ 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:
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 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Tue Jul 30, 2019 1:58 pm    Post subject: Reply with quote

@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.
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Tue Jul 30, 2019 3:05 pm    Post subject: Reply with quote

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:
$ dolroot

Code:
$ sudo dolphin

Code:
$ 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:
$ 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:
$ 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 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
jhon987
Apprentice
Apprentice


Joined: 18 Nov 2013
Posts: 250

PostPosted: Tue Jul 30, 2019 9:29 pm    Post subject: Reply with quote

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:
$ dolroot

Code:
$ sudo dolphin

Code:
$ 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:
$ 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:
$ 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...
Back to top
View user's profile Send private message
papu
l33t
l33t


Joined: 25 Jan 2008
Posts: 605
Location: Sota algun pi o alzina...

PostPosted: Tue Jul 30, 2019 11:22 pm    Post subject: Reply with quote

this is amazing! :) very thanks!
Code:
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin

_________________
--Intel i5 6600 --GA-Z170-HD3P --Ripjaws V 2x8 2400 --Radeon RX 470 G1 4G --Gentoo & Windows
Back to top
View user's profile Send private message
sdr
n00b
n00b


Joined: 18 Jun 2006
Posts: 12

PostPosted: Mon Aug 05, 2019 12:34 pm    Post subject: Reply with quote

Code:

alias kdesu='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true'
Back to top
View user's profile Send private message
psands
n00b
n00b


Joined: 12 Aug 2019
Posts: 6

PostPosted: Mon Aug 12, 2019 12:52 am    Post subject: Reply with quote

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:
 * Package:    kde-apps/kwrite-19.04.3
 * Repository: gentoo
 * Maintainer: kde@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc handbook kernel_linux userland_GNU
 * FEATURES:   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 ...
 * Applying kwrite-allow-root.patch ...
1 out of 1 hunk FAILED -- saving rejects to file kwrite/main.cpp.rej
 [ !! ]
 * ERROR: kde-apps/kwrite-19.04.3::gentoo failed (prepare phase):
 *   patch -p1  failed with /etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch
 *
 * Call stack:
 *               ebuild.sh, line  125:  Called src_prepare
 *             environment, line 2644:  Called kde5_src_prepare
 *             environment, line 2092:  Called cmake-utils_src_prepare
 *             environment, line 1191:  Called default_src_prepare
 *      phase-functions.sh, line  937:  Called __eapi6_src_prepare
 *             environment, line  309:  Called eapply_user
 *             environment, line 1406:  Called eapply '/etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 *             environment, line 1376:  Called _eapply_patch '/etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 *             environment, line 1314:  Called __helpers_die 'patch -p1  failed with /etc/portage/patches/kde-apps/kwrite-19.04.3/kwrite-allow-root.patch'
 *   isolated-functions.sh, line  119:  Called die
 * The specific snippet of code:
 *         die "$@"
 *
 * If you need support, post the output of `emerge --info '=kde-apps/kwrite-19.04.3::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=kde-apps/kwrite-19.04.3::gentoo'`.
 * The complete build log is located at '/var/log/portage/kde-apps:kwrite-19.04.3:20190812-001053.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/kde-apps/kwrite-19.04.3/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/kde-apps/kwrite-19.04.3/temp/environment'.
 * Working directory: '/var/tmp/portage/kde-apps/kwrite-19.04.3/work/kate-19.04.3'
 * 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]
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Mon Aug 12, 2019 5:33 am    Post subject: Reply with quote

@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.
Back to top
View user's profile Send private message
psands
n00b
n00b


Joined: 12 Aug 2019
Posts: 6

PostPosted: Mon Aug 12, 2019 4:42 pm    Post subject: Reply with quote

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:
--- 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]
Back to top
View user's profile Send private message
psands
n00b
n00b


Joined: 12 Aug 2019
Posts: 6

PostPosted: Mon Aug 12, 2019 7:38 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Fri Aug 16, 2019 6:07 am    Post subject: Reply with quote

Dolphin as root, patch updated for version 19.08.0
Code:
--- 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()));
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Sun Sep 15, 2019 11:44 am    Post subject: Reply with quote

Dolphin as root, patch updated for version 19.08.1
dolphin-19.08.01-root.patch:

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()));
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3271
Location: Gainesville, Florida

PostPosted: Sun Sep 15, 2019 4:58 pm    Post subject: Reply with quote

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:
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:
alias kdol="export XDG_CURRENT_DESKTOP=kde && dolphin"

I get the root dolphin, but also in the root konsole I have output like:
Code:
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 1700, 3.0GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.30-r2, gcc-9.2.0 kernel-5.4.1-gentoo USE=experimental
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Tue Sep 17, 2019 8:35 pm    Post subject: Reply with quote

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:
~$ 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:
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:
~$ 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.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3271
Location: Gainesville, Florida

PostPosted: Wed Sep 18, 2019 5:01 am    Post subject: Reply with quote

proteusx,
Thanks much for the reply. Yes, the patches have always applied fine. However, I just checked, and sure enough :
Quote:
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:
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/kde-plasma/kde-cli-tools doesn't mention the kdesu flag, only handbook and test.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 1700, 3.0GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.30-r2, gcc-9.2.0 kernel-5.4.1-gentoo USE=experimental
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Wed Sep 18, 2019 8:09 am    Post subject: Reply with quote

wrc1944 wrote:


Hmm... Just checked the ebuild, and found:
Code:
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.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3271
Location: Gainesville, Florida

PostPosted: Thu Sep 19, 2019 5:29 pm    Post subject: Reply with quote

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:
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 1700, 3.0GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.30-r2, gcc-9.2.0 kernel-5.4.1-gentoo USE=experimental
Back to top
View user's profile Send private message
psands
n00b
n00b


Joined: 12 Aug 2019
Posts: 6

PostPosted: Wed Dec 04, 2019 10:49 pm    Post subject: Reply with quote

Has anyone tried the dolphin-19.08.1 patch with 19.08.3? I haven't had any luck.
Back to top
View user's profile Send private message
proteusx
Apprentice
Apprentice


Joined: 21 Jan 2008
Posts: 257

PostPosted: Thu Dec 05, 2019 12:41 am    Post subject: Reply with quote

dolphin-as-root-19.08.3.patch
Code:

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()));
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum