The event loop (even after it was brought into one place in _run in the previous commit) was hard to follow. The states and transitions weren't clear or documented, and the privilege escalation code was non-blocking while the rest was blocking. Now we have a state machine with four states: awaiting_prompt, awaiting_escalation, ready_to_send (initial data), and awaiting_exit. The actions in each state and the transitions between then are clearly documented. The check_incorrect_password() method no longer checks for empty strings (since they will always match), and check_become_success() uses equality rather than a substring match to avoid thinking an echoed command is an indication of successful escalation. Also adds a check_missing_password connection method to detect the error from sudo -n/doas -n.
Name |
Last commit
|
Last update |
---|---|---|
bin | Loading commit data... | |
contrib | Loading commit data... | |
docs/man | Loading commit data... | |
docsite | Loading commit data... | |
examples | Loading commit data... | |
hacking | Loading commit data... | |
lib/ansible | Loading commit data... | |
packaging | Loading commit data... | |
samples | Loading commit data... | |
test | Loading commit data... | |
ticket_stubs | Loading commit data... | |
.coveragerc | Loading commit data... | |
.gitattributes | Loading commit data... | |
.gitignore | Loading commit data... | |
.gitmodules | Loading commit data... | |
.travis.yml | Loading commit data... | |
CHANGELOG.md | Loading commit data... | |
CODING_GUIDELINES.md | Loading commit data... | |
CONTRIBUTING.md | Loading commit data... | |
COPYING | Loading commit data... | |
ISSUE_TEMPLATE.md | Loading commit data... | |
MANIFEST.in | Loading commit data... | |
Makefile | Loading commit data... | |
README.md | Loading commit data... | |
RELEASES.txt | Loading commit data... | |
VERSION | Loading commit data... | |
setup.py | Loading commit data... | |
test-requirements.txt | Loading commit data... | |
tox.ini | Loading commit data... |