Skip to content

Commit

Permalink
Don't ask for sudo when user is already root
Browse files Browse the repository at this point in the history
  • Loading branch information
emilsvennesson committed Oct 15, 2017
1 parent 40309fb commit af220c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/inputstreamhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down

0 comments on commit af220c8

Please sign in to comment.