I run xtrlock on a machine which doesn't store all its passwd/shadow
entries locally. So xtrlock is unable to verify my password by the usual
method.
To get around this, I added a feature which replaces the passwd/shadow
based check with a user-provided subprogram. xtrlock pipes the password
into the subprogram's standard input, and unlocks the screen if the
program exits with a success status.
I can make this check my real login password by using a subprogram based
on 'su $USERNAME -c true' (with some plumbing to run it in a pty and
pipe the password through). Another obvious approach would be to define
a 'screen-unlock password' separate from my login password, and a
subprogram that checks that (say, against a file containing a crypt(3)ed
version). This also means that xtrlock can do something useful even in
situations where someone is not able to give it set-id access of any
kind.
The only problem I've found with this is that the su-based check takes
noticeable time (several seconds in the environment where I use this),
so that I start wondering whether I got my password wrong, or whether
it's just being slow to check. To work around _that_, I've also arranged
to temporarily turn the mouse pointer from a padlock to an hourglass
while the check program is running.
Both patches are attached. At the moment, they lack documentation, and
also the hourglass-pointer patch is unconditional rather than
configurable. I'm prepared to do extra polishing effort if it's useful!
Cheers,
Simon