Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37704344
en ru br
ALT Linux repos
S:5.110.0-alt1

Group :: System/Libraries
RPM: kf5-kdesu

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: alt-fix-su-to-different-non-root-user.patch
Download


diff --git a/kdesu/src/suprocess.cpp b/kdesu/src/suprocess.cpp
index 0e653f1..3413bfd 100644
--- a/kdesu/src/suprocess.cpp
+++ b/kdesu/src/suprocess.cpp
@@ -103,6 +103,9 @@ int SuProcess::exec(const char *password, int check)
     }
 
     QList<QByteArray> args;
+    if (d->superUserCommand == QLatin1String("su")) {
+        args += "-l"; // krazy:exclude=doublequote_chars (QList, not QString)
+    }
     if (d->superUserCommand == QLatin1String("sudo")) {
         args += "-u";
     }
@@ -122,7 +125,6 @@ int SuProcess::exec(const char *password, int check)
     const QString defaultPath = QStringLiteral(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5) + QStringLiteral("/kdesu_stub");
     const QString kdesuStubPath = group.readEntry("kdesu_stub_path", defaultPath);
     args += kdesuStubPath.toLocal8Bit();
-    args += "-"; // krazy:exclude=doublequote_chars (QList, not QString)
 
     const QString commandString = group.readEntry("command", QStandardPaths::findExecutable(d->superUserCommand));
     const QByteArray command = commandString.toLocal8Bit();
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin