Because that is the way I prefer to do it because it is easier for me. One could make the argument that one doesn't need a GUI at all, for anything, if one wants to make it harder on themselves. One could even argue that no one even needs a computer at all. Right? That's not the question tho is it? The question is, how do I make dolphin work as root like it did before the update?Hu wrote:What's wrong with /bin/su - to get root and ${EDITOR:-/usr/bin/vim} /path/to/config/file to edit the file? You don't need a working root Dolphin, or even a working GUI of any sort, for either of those steps.
Code: Select all
alias kdol="export XDG_CURRENT_DESKTOP=kde && dolphin" Code: Select all
alias su="su -" 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'
qt.accessibility.core: Cannot create accessible child interface for object: PlacesView(0xc79d00) index: 12
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'
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'Anyway,back to dolphin. What happens if you open a konsole terminal, su to root, and then try running:Konqueror the File Manager
View Modes
In File Manager mode, Konqueror lists which files and subfolders are contained within a given folder and can provide you with some information about them. The “path” of the current folder is shown in the Location Toolbar. The way that Konqueror displays the files and folders depends mainly on your choice of view mode which can be selected from the View → View Mode sub menu. The view modes Konqueror provides are outlined below.
Note
In File Manager mode, Konqueror uses an embedded Dolphin component.
Code: Select all
export XDG_CURRENT_DESKTOP=kde && dolphinOne could also lash out in response to an innocent question. You wrote:dalek wrote:Because that is the way I prefer to do it because it is easier for me. One could make the argument that one doesn't need a GUI at all, for anything, if one wants to make it harder on themselves. One could even argue that no one even needs a computer at all. Right? That's not the question tho is it? The question is, how do I make dolphin work as root like it did before the update?Hu wrote:What's wrong with /bin/su - to get root and ${EDITOR:-/usr/bin/vim} /path/to/config/file to edit the file? You don't need a working root Dolphin, or even a working GUI of any sort, for either of those steps.
I might add, I use dolphin as root for other things as well. Either way, I need it to work. If I needed a GUI to hold my hand and protect me from myself, I'd use windoze. lol
While true, that seemed to me like you were equating the inability to use your favorite GUI as root with the complete inability to administer the system. That is not true. It may be less convenient for you if your favorite GUI will not let you use root, but unless using /bin/su - and $EDITOR are broken, system administration is still possible. I asked the question I did because I wanted to know why the inconvenient option was impossible for you. Based on your rather confrontational response, it appears that the answer is that it's possible, you just don't like it.dalek wrote:one can not update Gentoo without being root and editing files that only root can access.
It works, sort of, when typed into a Konsole but does not work from a menu entry which is what I've used for years. When dealing with things as root, I like consistency to help prevent me from doing things I'm not used to having to do. When one starts changing the way they do things, it can lead to trouble.wrc1944 wrote: Anyway,back to dolphin. What happens if you open a konsole terminal, su to root, and then try running:You still don't get a root dolphin window popping up, with kde icons?Code: Select all
export XDG_CURRENT_DESKTOP=kde && dolphin
Once I set this up, all I now need to do in a root terminal is type my "kdol" alias, and my root dolphin opens,
My attitude was sort of making a joke of your reply because the whole thing is silly which is why I mentioned windoze and even put a "lol" on the end. To be honest, I wish we could still login to KDE as root as well. As with the current issue, I can see why it should be disabled with other distros but this is Gentoo. We should be able to disable "features" we don't want. So, my attitude was making a joke of it and saying it is silly to make it work this way when the old way worked just fine and was a lot less trouble. In the end, it will likely lead to me doing less updates which can have its own security problems than me using GUI programs as root ever would, given I've used Gentoo for over a decade with no problems.Hu wrote:One could also lash out in response to an innocent question. You wrote:dalek wrote:Because that is the way I prefer to do it because it is easier for me. One could make the argument that one doesn't need a GUI at all, for anything, if one wants to make it harder on themselves. One could even argue that no one even needs a computer at all. Right? That's not the question tho is it? The question is, how do I make dolphin work as root like it did before the update?Hu wrote:What's wrong with /bin/su - to get root and ${EDITOR:-/usr/bin/vim} /path/to/config/file to edit the file? You don't need a working root Dolphin, or even a working GUI of any sort, for either of those steps.
I might add, I use dolphin as root for other things as well. Either way, I need it to work. If I needed a GUI to hold my hand and protect me from myself, I'd use windoze. lolWhile true, that seemed to me like you were equating the inability to use your favorite GUI as root with the complete inability to administer the system. That is not true. It may be less convenient for you if your favorite GUI will not let you use root, but unless using /bin/su - and $EDITOR are broken, system administration is still possible. I asked the question I did because I wanted to know why the inconvenient option was impossible for you. Based on your rather confrontational response, it appears that the answer is that it's possible, you just don't like it.dalek wrote:one can not update Gentoo without being root and editing files that only root can access.
I expect your attitude will contribute strongly to your success getting this resolved.
I don't think anyone is going to fix the patches. I suspect if anyone was, they would have by now. You may want to read my post right above yours to see how I worked around this problem. It also has ideas for other long term fixes. Basically, I'm sort of moving away from the main KDE file manager(s) which in the long term, means they won't break them. That's my theory at least.natrix wrote:Hi!
I used the patchs in Kate and Dolphin 17.* and it works very fine!!!
But in the new update, the patchs not work with 18.04.3 version: Portage lauch a compile fail
How I must modify the patchs to both apps?
Thanks a lot!

Something to keep in mind, even if someone fixes the current patch, it will almost certainly break again. At some point, it could be done in a way that it can't even be patched out without breaking something else. The devs for Dolphin have made it clear that they don't want it running as root. As I've pointed out before, that may be reasonable for other distros but not good for Gentoo and those of us who need a file manager as root. At some point, it will either become a pain to keep it working or they will make it where patches won't fix it.Blind_Sniper wrote:Crusader isn't a serious option

May be it's not so bad as you wrote:dalek wrote:Something to keep in mind, even if someone fixes the current patch, it will almost certainly break again. At some point, it could be done in a way that it can't even be patched out without breaking something else. The devs for Dolphin have made it clear that they don't want it running as root..Blind_Sniper wrote:Crusader isn't a serious option
One can hope. It just seems that KDE keeps doing things that don't work well for me. I'm still not happy with the way they did the switch from KDE3 to KDE4. They did better with the switch to 5 tho. Maybe they figured out they need a better plan. If Dolphin gets a proper fix to use it as root, great. I'll switch back and use it. In the meantime, Krusader, while different, works without me having to reinvent the wheel.Blind_Sniper wrote:
May be it's not so bad as you wrote:
https://pointieststick.wordpress.com/20 ... ty-part-21
Have to wait and once dolphin-18.08 will be landed we can see, how to deal with it (if it will require at all)
Anyway we have a sources, isn't it?

Code: Select all
$ su -
# KDE_SESSION_VERSION=5 KDE_FULL_SESSION=false dolphin &>/dev/null &

Code: Select all
PATCHES=(
"${FILESDIR}"/${P}-memleak-{1,2}.patch
)
Code: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild digest --forceCode: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild unpackCode: Select all
#ifndef Q_OS_WIN
// Check whether we are running as root
if (getuid() == 0) {
std::cout << "Executing Dolphin as root is not possible." << std::endl;
return EXIT_FAILURE;
}
#endifCode: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild digest --forceCode: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild compileCode: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild installCode: Select all
ebuild /usr/portage/kde-apps/dolphin/dolphin-18.04.3-r1.ebuild qmergeCode: Select all
kdesu dolphinCode: Select all
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -108,14 +108,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
-
m_view = new DolphinView(url, this);
connect(m_view, &DolphinView::urlChanged,
m_urlNavigator, &KUrlNavigator::setLocationUrl);
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,26 +35,8 @@
#include <QApplication>
#include <QCommandLineParser>
-#ifndef Q_OS_WIN
-#include <unistd.h>
-#endif
-#include <iostream>
-
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()));
Code: Select all
sudo KDE_SESSION_VERSION=5 KDE_FULL_SESSION=false dolphinCode: Select all
sudo konqueror --profile filemanagementCode: Select all
sudo konqueror --profile midnightcommander Code: Select all
>>> Emerging (1 of 1) kde-apps/dolphin-18.04.3-r1::gentoo
* dolphin-18.04.3.tar.xz BLAKE2B SHA512 size ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking dolphin-18.04.3.tar.xz to /var/tmp/portage/kde-apps/dolphin-18.04.3-r1/work
>>> Source unpacked in /var/tmp/portage/kde-apps/dolphin-18.04.3-r1/work
>>> Preparing source in /var/tmp/portage/kde-apps/dolphin-18.04.3-r1/work/dolphin-18.04.3 ...
* Applying dolphin-18.04.1-flto.patch ... [ ok ]
* Applying dolphin-18.04.3-root-user.patch ... [ ok ]
* Applying dolphin-18.04.3-root-warn.patch ... [ ok ]
* Applying dolphin-18.04.3-memleak-1.patch ... [ ok ]
* Applying dolphin-18.04.3-memleak-2.patch ... [ ok ]
>>> Source prepared.Code: Select all
diff -Naur dolphin-17.04.0.old/src/main.cpp dolphin-17.04.0/src/main.cppI assume this means they are still trying to prevent kdesu dolphin, so hopefully your patch will work on 18.08 and beyond for at least a while like Nsane457's did on 17.04->..+Summary:
+Prohibiting the use of Dolphin as the actual root user (not using `sudo` or `kdesu`) breaks legitimate use cases for using the root user. An example is Kali, a distro that logs in as the root user by default as a deliberate design choice.
+
+In such an environment, there is no additional security vulnerability beyond what you're already potentially exposing yourself to. So, let's re-enable it.
+
+BUG: 387974
+FIXED-IN: 18.08.0
+
+Test Plan:
+- Log in as normal user and run `sudo dolphin`: you get an error message.
+- Log in as normal user and run `kdesu dolphin`: you get an error message.
+- Log in as the root user and run dolphin normally: it works.
+
+Reviewers: markg, elvisangelaccio, #dolphin
+
+Reviewed By: markg
+
+Subscribers: chinmoyr, cfeck, elvisangelaccio, mmustac, Fuchs, markg, graesslin, nicolasfella, zzag, kfm-devel, emmanuelp

Code: Select all
--- a/kate/main.cpp
+++ b/kate/main.cpp
@@ -52,26 +52,9 @@
#include "qtsingleapplication/qtsingleapplication.h"
#endif
-#ifndef Q_OS_WIN
-#include <unistd.h>
-#endif
-#include <iostream>
-
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 Kate with sudo is not possible due to unfixable security vulnerabilities." << std::endl;
- return EXIT_FAILURE;
- } else if (!qEnvironmentVariableIsEmpty("KDESU_USER")) {
- std::cout << "Executing Kate with kdesu is not possible due to unfixable security vulnerabilities." << std::endl;
- return EXIT_FAILURE;
- }
- }
-#endif
/**
* init resources from our static lib
*/
Code: Select all
* ERROR: kde-apps/kate-18.04.3::gentoo failed (prepare phase):
* patch -p1 failed with /etc/portage/patches/kde-apps/kate/root.patch
*
* Call stack:
* ebuild.sh, line 124: Called src_prepare
* environment, line 3856: Called kde5_src_prepare
* environment, line 2881: Called cmake-utils_src_prepare
* environment, line 1336: Called default_src_prepare
* phase-functions.sh, line 932: Called __eapi6_src_prepare
* environment, line 393: Called eapply_user
* environment, line 1579: Called eapply '/etc/portage/patches/kde-apps/kate/root.patch'
* environment, line 1549: Called _eapply_patch '/etc/portage/patches/kde-apps/kate/root.patch'
* environment, line 1487: Called __helpers_die 'patch -p1 failed with /etc/portage/patches/kde-apps/kate/root.patch'
* isolated-functions.sh, line 121: Called die
* The specific snippet of code:
* die "$@"