From b90ddbc383799b49b68ec90492de86db882a4d7d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Sep 2019 15:19:01 -0400 Subject: [PATCH] enable-tor: Use pkexec to run command as root when gksu and kdesu are not available. gksu is no longer in debian, even stable kdesu in debian is not installed in PATH any longer, though the executable is still present under /usr/lib pkexec is packagekit's replacement for those older commands. --- CHANGELOG | 2 ++ Utility/Su.hs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c079ff757f..2e69a73b01 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,8 @@ git-annex (7.20190913) UNRELEASED; urgency=medium * adjust --lock: This enters an adjusted branch where files are locked. * remotedaemon: Don't list --stop in help since it's not supported. * enable-tor: Run kdesu with -c option. + * enable-tor: Use pkexec to run command as root when gksu and kdesu are not + available. -- Joey Hess Thu, 19 Sep 2019 11:11:19 -0400 diff --git a/Utility/Su.hs b/Utility/Su.hs index 9d26aac09a..d9ec5e8eed 100644 --- a/Utility/Su.hs +++ b/Utility/Su.hs @@ -77,6 +77,8 @@ mkSuCommand cmd ps = firstM (\(SuCommand _ p _) -> inPath p) =<< selectcmds [Param shellcmd] , SuCommand (MayPromptPassword SomePassword) "kdesu" [Param "-c", Param shellcmd] + , SuCommand (MayPromptPassword SomePassword) "pkexec" + ([Param cmd] ++ ps) -- Available in Debian's menu package; knows about lots of -- ways to gain root. , SuCommand (MayPromptPassword SomePassword) "su-to-root"