parent
0f4a1160bb
commit
517948d07a
2 changed files with 16 additions and 8 deletions
|
|
@ -1,12 +1,20 @@
|
|||
# Open the config file in gedit
|
||||
# Open the config file in an editor
|
||||
|
||||
# Import required modules
|
||||
import os
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
# Let the user know what we're doing
|
||||
print("Opening config.ini in the default editor")
|
||||
|
||||
# Open gedit as a subprocess and fork it
|
||||
subprocess.call(["/etc/alternatives/editor", os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])
|
||||
# Default to the nano editor
|
||||
editor = "/bin/nano"
|
||||
|
||||
# Use the user preferred editor if available
|
||||
if os.path.isfile("/etc/alternatives/editor"):
|
||||
editor = "/etc/alternatives/editor"
|
||||
elif "EDITOR" in os.environ:
|
||||
editor = os.environ["EDITOR"]
|
||||
|
||||
# Open the editor as a subprocess and fork it
|
||||
subprocess.call([editor, os.path.dirname(os.path.realpath(__file__)) + "/../config.ini"])
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ config = ConfigParser.ConfigParser()
|
|||
config.read(os.path.dirname(os.path.abspath(__file__)) + "/config.ini")
|
||||
|
||||
def doAuth(pamh):
|
||||
"""Start authentication in a seperate process"""
|
||||
"""Starts authentication in a seperate process"""
|
||||
|
||||
# Abort is Howdy is disabled
|
||||
if config.get("core", "disabled") == "true":
|
||||
|
|
@ -25,7 +25,7 @@ def doAuth(pamh):
|
|||
sys.exit(0)
|
||||
|
||||
# Run compare as python3 subprocess to circumvent python version and import issues
|
||||
status = subprocess.call(["python3", os.path.dirname(os.path.abspath(__file__)) + "/compare.py", pamh.get_user()])
|
||||
status = subprocess.call(["/usr/bin/python3", os.path.dirname(os.path.abspath(__file__)) + "/compare.py", pamh.get_user()])
|
||||
|
||||
# Status 10 means we couldn't find any face models
|
||||
if status == 10:
|
||||
|
|
@ -62,9 +62,9 @@ def pam_sm_open_session(pamh, flags, args):
|
|||
return doAuth(pamh)
|
||||
|
||||
def pam_sm_close_session(pamh, flags, argv):
|
||||
"""We don't need to clean anyting up at the end of a session, so return true"""
|
||||
"""We don't need to clean anyting up at the end of a session, so returns true"""
|
||||
return pamh.PAM_SUCCESS
|
||||
|
||||
def pam_sm_setcred(pamh, flags, argv):
|
||||
"""We don't need set any credentials, so return true"""
|
||||
"""We don't need set any credentials, so returns true"""
|
||||
return pamh.PAM_SUCCESS
|
||||
|
|
|
|||
Loading…
Reference in a new issue