|
|
|
@ -101,6 +101,17 @@ class BecomeModule(BecomeBase):
|
|
|
|
fail = ('Sorry, try again.',)
|
|
|
|
fail = ('Sorry, try again.',)
|
|
|
|
missing = ('Sorry, a password is required to run sudo', 'sudo: a password is required')
|
|
|
|
missing = ('Sorry, a password is required to run sudo', 'sudo: a password is required')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def check_password_prompt(self, b_output):
|
|
|
|
|
|
|
|
matched = super().check_password_prompt(b_output)
|
|
|
|
|
|
|
|
if not matched:
|
|
|
|
|
|
|
|
# might be using sudo-rs, lets try again
|
|
|
|
|
|
|
|
prompt = self.prompt
|
|
|
|
|
|
|
|
self.prompt = f"[sudo: {prompt}] Password:"
|
|
|
|
|
|
|
|
matched = super().check_password_prompt(b_output)
|
|
|
|
|
|
|
|
self.prompt = prompt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return matched
|
|
|
|
|
|
|
|
|
|
|
|
def build_become_command(self, cmd, shell):
|
|
|
|
def build_become_command(self, cmd, shell):
|
|
|
|
super(BecomeModule, self).build_become_command(cmd, shell)
|
|
|
|
super(BecomeModule, self).build_become_command(cmd, shell)
|
|
|
|
|
|
|
|
|
|
|
|
|