Merge pull request #455 from bob8677/master
Stop verification and print warning if video device does not exist.
This commit is contained in:
commit
03a2602780
2 changed files with 9 additions and 0 deletions
|
|
@ -40,6 +40,9 @@ timeout = 4
|
||||||
# Should be set automatically by an installer if your distro has one
|
# Should be set automatically by an installer if your distro has one
|
||||||
device_path = none
|
device_path = none
|
||||||
|
|
||||||
|
# Print a warning if the the video device is not found
|
||||||
|
warn_no_device = true
|
||||||
|
|
||||||
# Scale down the video feed to this maximum height
|
# Scale down the video feed to this maximum height
|
||||||
# Speeds up face recognition but can make it less precise
|
# Speeds up face recognition but can make it less precise
|
||||||
max_height = 320
|
max_height = 320
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,12 @@ def doAuth(pamh):
|
||||||
if any("closed" in open(f).read() for f in glob.glob("/proc/acpi/button/lid/*/state")):
|
if any("closed" in open(f).read() for f in glob.glob("/proc/acpi/button/lid/*/state")):
|
||||||
return pamh.PAM_AUTHINFO_UNAVAIL
|
return pamh.PAM_AUTHINFO_UNAVAIL
|
||||||
|
|
||||||
|
# Abort if the video device does not exist
|
||||||
|
if not os.path.exists(config.get("video", "device_path")):
|
||||||
|
if config.getboolean("video", "warn_no_device"):
|
||||||
|
print("Camera path is not configured correctly, please edit the 'device_path' config value.")
|
||||||
|
return pamh.PAM_AUTHINFO_UNAVAIL
|
||||||
|
|
||||||
# Set up syslog
|
# Set up syslog
|
||||||
syslog.openlog("[HOWDY]", 0, syslog.LOG_AUTH)
|
syslog.openlog("[HOWDY]", 0, syslog.LOG_AUTH)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue