Skip to content

Commit

Permalink
fprintd should enroll a user, not a uid (BugFix) (#813)
Browse files Browse the repository at this point in the history
fprintd should enroll to a user while not uid. (BugFix) (#813)
$ sudo env | grep SUDO
SUDO_COMMAND=/usr/bin/env
SUDO_USER=ubuntu
SUDO_UID=1001
SUDO_GID=1001

when running checkbox with sudo, it will 'fprintd-enroll 1001'
and the test case will lock screen to let 'ubuntu' user to login,
but at that time, it will not work because the user is not 'ubuntu'.
  • Loading branch information
binli authored Jan 10, 2024
1 parent f5179b5 commit 72fbb87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions providers/base/units/fingerprint/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ category_id: com.canonical.plainbox::fingerprint
id: fingerprint/detect
flags: also-after-suspend
user: root
command: fprintd-list "${SUDO_UID:-$NORMAL_USER}"
command: fprintd-list "${SUDO_USER:-$NORMAL_USER}"
estimated_duration: 1.0
_summary: Check if at least one fingerprint reader is detected
imports: from com.canonical.plainbox import manifest
Expand All @@ -18,9 +18,9 @@ user: root
command:
set -e
echo 'Removing existing signatures...'
fprintd-delete "${SUDO_UID:-$NORMAL_USER}" > /dev/null
fprintd-delete "${SUDO_USER:-$NORMAL_USER}" > /dev/null
sleep 3
fprintd-enroll "${SUDO_UID:-$NORMAL_USER}"
fprintd-enroll "${SUDO_USER:-$NORMAL_USER}"
estimated_duration: 20.0
_summary: Enroll a fingerprint
_purpose:
Expand All @@ -43,7 +43,7 @@ depends: fingerprint/enroll
user: root
command:
sleep 2
fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-no-match
fprintd-verify "${SUDO_USER:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-no-match
estimated_duration: 20.0
_summary: Fingerprint negative match
_purpose:
Expand All @@ -69,7 +69,7 @@ command:
for i in {1..3}
do
# shellcheck disable=SC2015
fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-match && break || sleep 3
fprintd-verify "${SUDO_USER:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-match && break || sleep 3
[[ $i -eq 3 ]] && exit 1
echo "Attempts left: $((3-i))"
done
Expand Down Expand Up @@ -117,8 +117,8 @@ id: fingerprint/delete
flags: also-after-suspend
after: fingerprint/unlock
user: root
command: fprintd-delete "${SUDO_UID:-$NORMAL_USER}"
command: fprintd-delete "${SUDO_USER:-$NORMAL_USER}"
estimated_duration: 1.0
_summary: Remove existing fingerprint signatures
imports: from com.canonical.plainbox import manifest
requires: manifest.has_fingerprint_reader == 'True'
requires: manifest.has_fingerprint_reader == 'True'

0 comments on commit 72fbb87

Please sign in to comment.