From af220c8ec759df8e088257ec0c8aba0c1228ca74 Mon Sep 17 00:00:00 2001 From: emilsvennesson Date: Sun, 15 Oct 2017 23:22:27 +0200 Subject: [PATCH] Don't ask for sudo when user is already root --- lib/inputstreamhelper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/inputstreamhelper.py b/lib/inputstreamhelper.py index ab34e622..0c914ea1 100644 --- a/lib/inputstreamhelper.py +++ b/lib/inputstreamhelper.py @@ -154,7 +154,7 @@ def _parse_chromeos_offset(self, bin_path): def _run_cmd(self, cmd, sudo=False, ask=True): dialog = xbmcgui.Dialog() - if ask and not dialog.yesno(self._language(30001), self._language(30030), yeslabel=self._language(30029), nolabel=self._language(30028)): + if ask and os.getuid() != 0 and not dialog.yesno(self._language(30001), self._language(30030), yeslabel=self._language(30029), nolabel=self._language(30028)): self._log('User refused to give sudo permissions.') return cmd if sudo and os.getuid() != 0 and self._cmd_exists('sudo'):