Merge pull request #117 from mrkmg/add-checking-notification

Added notice that facial detection is occurring
This commit is contained in:
boltgolt 2019-01-05 01:11:45 +01:00 committed by GitHub
commit 6e1085110b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -2,6 +2,9 @@
# Press CTRL + X to save in the nano editor
[core]
# Print that face detection is being attempted
show_detection_attempt = false
# Do not print anything when a face verification succeeds
no_confirmation = false

View file

@ -25,6 +25,10 @@ def doAuth(pamh):
if "SSH_CONNECTION" in os.environ or "SSH_CLIENT" in os.environ or "SSHD_OPTS" in os.environ:
sys.exit(0)
# Alert the user that we are doing face detection
if config.get("core", "show_detection_attempt") == "true":
pamh.conversation(pamh.Message(pamh.PAM_TEXT_INFO, "Attempting face detection"))
# Run compare as python3 subprocess to circumvent python version and import issues
status = subprocess.call(["/usr/bin/python3", os.path.dirname(os.path.abspath(__file__)) + "/compare.py", pamh.get_user()])