#!/bin/sh # pam_exec helper for pam_visage: exit 0 when $PAM_USER already owns a login # session (this is a screen unlock), exit 1 when they do not (first login). # # Face auth cannot unlock the GNOME keyring, which needs the password. So on # a fresh login we skip pam_visage and let the password prompt run; once a # session exists the keyring is already open and face unlock is harmless. # # Install: install -D -m 755 visage-has-session /usr/local/libexec/visage-has-session # Then see README.md in this directory for the PAM lines. [ -n "$PAM_USER" ] || exit 1 for id in $(loginctl list-sessions --no-legend 2>/dev/null | awk '{print $1}'); do set -- $(loginctl show-session "$id" -p Name -p Class --value 2>/dev/null) [ "$1" = "$PAM_USER" ] && [ "$2" = "user" ] && exit 0 done exit 1