Commit a8e5a78
feat(setup): detect display managers and screen lockers; offer per-service opt-in
Replaces the hardcoded [sudo, polkit-1, hyprlock] list with a
PAM_CANDIDATES table that is filtered at runtime by /etc/pam.d/<service>
existence, then presented to the user one service at a time via
dialoguer::Confirm.
New services covered:
- swaylock (Sway/wlroots screen lock) — default YES
- kscreenlocker_greet (KDE Plasma screen lock) — default YES
- gdm-password (GNOME display manager login screen) — default NO
- sddm (KDE display manager login screen) — default NO
- lightdm (Ubuntu/Xfce/Mint display manager login screen) — default NO
Default-YES rationale: screen lockers have safe password fallback; worst
case is an extra Enter keypress.
Default-NO rationale: display manager login screens lock users out of the
system if face auth fails and they have no other recovery path; opt-in
should be explicit.
Explicit non-targets (never offered, even if /etc/pam.d/<name> exists):
- system-auth / common-auth: shared stacks that would spread face auth to
passwd, su, chsh, chfn, etc.
- login: TTY login; camera may not be initialized at boot.
- su, passwd, chsh, chfn: credential/privilege-change tools that must
require a real password.
Wizard flow change: replaces MultiSelect-all-at-once with individual
Confirm prompts so the user sees the default recommendation per service.
Non-interactive mode uses each candidate's default_enabled value.
Adds two unit tests:
- detect_candidates_filters_by_presence: verifies candidates_in() against
a TempDir; only services with a matching file are returned.
- no_excluded_services_in_candidates: asserts the excluded service list
never appears in PAM_CANDIDATES.
Adds tempfile as a dev-dependency of facelock-cli.
Note: PR #1 (uninstall cleanup) and PR #2 (PAM confirmation prompt) are
racing. This PR may have minor conflicts with #2 if both touch the
per-service iteration; resolve at merge time.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 67308e3 commit a8e5a78
3 files changed
Lines changed: 155 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | | - | |
| 929 | + | |
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
| 936 | + | |
942 | 937 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
| 938 | + | |
955 | 939 | | |
956 | 940 | | |
957 | 941 | | |
958 | 942 | | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | 943 | | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
977 | 961 | | |
978 | 962 | | |
979 | 963 | | |
980 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
981 | 969 | | |
982 | 970 | | |
983 | 971 | | |
| |||
1386 | 1374 | | |
1387 | 1375 | | |
1388 | 1376 | | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1389 | 1468 | | |
1390 | 1469 | | |
1391 | 1470 | | |
| |||
1815 | 1894 | | |
1816 | 1895 | | |
1817 | 1896 | | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
1818 | 1932 | | |
1819 | 1933 | | |
1820 | 1934 | | |
| |||
0 commit comments