def check_sudoers(self): ''' Check sudoers file (/etc/sudoers) ''' result = [] sfile = '/etc/sudoers' fm = FileManager(sfile, is_sudoers=True) if fm.file.is_readable: result = fm.parse_sudoers(sfile) return 'sudoers_file', result
def check_sudoers(self): ''' Check sudoers file - /etc/sudoers ''' result = [] sfile = '/etc/sudoers' fm = FileManager(sfile) if fm.file.is_readable: result = fm.parse_sudoers(sfile) return 'sudoers_file', result
def check_sudoers(self): ''' Check sudoers file - /etc/sudoers ''' result = ([], False) sfile = '/etc/sudoers' fm = FileManager(sfile) if fm.file.is_readable: result = fm.parse_sudoers(sfile) return 'sudoers_file', result
def check_sudo_rules(self): """ Check sudoers file - /etc/sudoers If not possible (permission denied), try using sudo -l """ result = ([], False) sfile = '/etc/sudoers' fm = FileManager(sfile) if fm.file.is_readable: result = fm.parse_sudoers(sfile) else: result = SudoList().parse() return 'sudo_rules', result