From 140c8db081e32bcd7d37ce979db28c6f8c9b6c44 Mon Sep 17 00:00:00 2001 From: Kevin Date: Wed, 2 Jan 2019 13:56:02 -0500 Subject: [PATCH 1/2] Added notice that facial detection is occuring Added a pam conversation message that the facial detection is being performed. --- src/pam.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pam.py b/src/pam.py index 42ee919..ebc7a0e 100644 --- a/src/pam.py +++ b/src/pam.py @@ -24,6 +24,9 @@ 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 + 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()]) From de6dac1fd10389ef16ac26381ea8506a4d03ea8e Mon Sep 17 00:00:00 2001 From: Kevin Gravier Date: Fri, 4 Jan 2019 15:26:38 -0500 Subject: [PATCH 2/2] Added config option to enable/disable notification Default is off --- src/config.ini | 3 +++ src/pam.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.ini b/src/config.ini index 1f577e9..0d09d1e 100644 --- a/src/config.ini +++ b/src/config.ini @@ -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 diff --git a/src/pam.py b/src/pam.py index ebc7a0e..c49cb5c 100644 --- a/src/pam.py +++ b/src/pam.py @@ -24,8 +24,9 @@ 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 - pamh.conversation(pamh.Message(pamh.PAM_TEXT_INFO, "Attempting face detection")) + # 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()])