Skip to content

Commit b5a58ef

Browse files
committed
fprintd should enroll to a user while not uid.
$ 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'.
1 parent 702da66 commit b5a58ef

File tree

1 file changed

+7
-7
lines changed
  • providers/base/units/fingerprint

1 file changed

+7
-7
lines changed

providers/base/units/fingerprint/jobs.pxu

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ category_id: com.canonical.plainbox::fingerprint
33
id: fingerprint/detect
44
flags: also-after-suspend
55
user: root
6-
command: fprintd-list "${SUDO_UID:-$NORMAL_USER}"
6+
command: fprintd-list "${SUDO_USER:-$NORMAL_USER}"
77
estimated_duration: 1.0
88
_summary: Check if at least one fingerprint reader is detected
99
imports: from com.canonical.plainbox import manifest
@@ -18,9 +18,9 @@ user: root
1818
command:
1919
set -e
2020
echo 'Removing existing signatures...'
21-
fprintd-delete "${SUDO_UID:-$NORMAL_USER}" > /dev/null
21+
fprintd-delete "${SUDO_USER:-$NORMAL_USER}" > /dev/null
2222
sleep 3
23-
fprintd-enroll "${SUDO_UID:-$NORMAL_USER}"
23+
fprintd-enroll "${SUDO_USER:-$NORMAL_USER}"
2424
estimated_duration: 20.0
2525
_summary: Enroll a fingerprint
2626
_purpose:
@@ -43,7 +43,7 @@ depends: fingerprint/enroll
4343
user: root
4444
command:
4545
sleep 2
46-
fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-no-match
46+
fprintd-verify "${SUDO_USER:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-no-match
4747
estimated_duration: 20.0
4848
_summary: Fingerprint negative match
4949
_purpose:
@@ -69,7 +69,7 @@ command:
6969
for i in {1..3}
7070
do
7171
# shellcheck disable=SC2015
72-
fprintd-verify "${SUDO_UID:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-match && break || sleep 3
72+
fprintd-verify "${SUDO_USER:-$NORMAL_USER}" | tee /dev/stderr | grep -o verify-match && break || sleep 3
7373
[[ $i -eq 3 ]] && exit 1
7474
echo "Attempts left: $((3-i))"
7575
done
@@ -117,8 +117,8 @@ id: fingerprint/delete
117117
flags: also-after-suspend
118118
after: fingerprint/unlock
119119
user: root
120-
command: fprintd-delete "${SUDO_UID:-$NORMAL_USER}"
120+
command: fprintd-delete "${SUDO_USER:-$NORMAL_USER}"
121121
estimated_duration: 1.0
122122
_summary: Remove existing fingerprint signatures
123123
imports: from com.canonical.plainbox import manifest
124-
requires: manifest.has_fingerprint_reader == 'True'
124+
requires: manifest.has_fingerprint_reader == 'True'

0 commit comments

Comments
 (0)