Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion omarchy-mac/entrypoints/enable-fingerprint
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ if [[ -e /etc/omarchy-mac/touchid-on ]]; then
if [[ ! -e $options ]]; then
# Under the Touch ID lock, so a removal running now can't be undone here.
lock=/run/omarchy-mac/touchid.lock
if ! { mkdir -p -m 0755 "${lock%/*}" && exec {lock_fd}>>"$lock"; } 2>/dev/null || ! flock -w 300 "$lock_fd"; then
if ! { mkdir -p -m 0755 "${lock%/*}" && exec {lock_fd}>>"$lock"; } 2>/dev/null; then
echo "Touch ID's driver options could not be written: its lock, $lock, could not be opened." >&2
exit 1
elif ! flock -w 300 "$lock_fd"; then
echo "Touch ID's driver options could not be written: another Touch ID setup or removal is still running." >&2
exit 1
fi
Expand Down
4 changes: 3 additions & 1 deletion omarchy-mac/test/touchid-consent-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,12 @@ flock "$held"
! ask ready '' && grep -q 'another Touch ID setup or removal is still running' "$fixture/out" && [[ ! -e $fixture/etc/modprobe.conf ]] ||
fail "an agreed Mac's options wait for the lock" "$(<"$fixture/out")"
exec {held}>&-
rm "$fixture/etc/touchid-on"
# A lock that can't be opened is said to be so, not taken for a setup running.
rm -f "$fixture/run/touchid.lock"
mkdir "$fixture/run/touchid.lock"
! ask ready '' && grep -q 'could not be opened' "$fixture/out" && [[ ! -e $fixture/etc/modprobe.conf ]] ||
fail "an agreed Mac whose lock can't be opened says so" "$(<"$fixture/out")"
rm "$fixture/etc/touchid-on"
! PATH="$fixture/bin:$PATH" "$entry/disable-fingerprint" >"$fixture/out" 2>&1 && grep -q 'could not be opened' "$fixture/out" ||
fail "a removal whose lock can't be opened says so" "$(<"$fixture/out")"
rmdir "$fixture/run/touchid.lock"
Expand Down
Loading