Re: [Tails-dev] [tails-greeter] password change on logout

Delete this message

Reply to this message
Autor: intrigeri
Data:  
Para: M
CC: The Tails public development discussion list
Assunto: Re: [Tails-dev] [tails-greeter] password change on logout
Hi,

† wrote (30 Aug 2011 05:53:03 GMT) :
> In order to fix one of the tails-greeter issues I've added script
> which is executed on user's logout to reset password to default
> value.


Great!

> Unfortunately it doesn't work: chpasswd returns error code 127.


First, I wonder what good the "postsession gdm prelogin default" line
is supposed to do in set-user-password-and-locale.

Second, I don't think chpasswd returns error code 127. My guess is
that whatever shell used to run this PostSession script of yours
returns 127, which generally means "command not found". Could it be
because chpasswd is in /usr/sbin (true) + PostSession run by the user
that is being logged-out with a non-root $PATH (pure guess)? If this
is the case, try invoking chpasswd with an absolute path; if it still
doesn't work, more trickery might be needed, as chpasswd doesn't seem
to work for me as non-root:

nonroot@machine:~$ echo nonroot:toto | /usr/sbin/chpasswd
Changing password for nonroot.
chpasswd: (user nonroot) pam_chauthtok() failed, error:
Authentication token manipulation error
chpasswd: (line 1, user nonroot) password not changed

nonroot@machine:~$ echo $?
1

To end with, the following:

echo "echo \"${LIVE_USERNAME}:${LIVE_PASSWORD}\" | chpasswd" > /etc/gdm3/PostSession/${DISPLAY}
echo "exit 0" >> /etc/gdm3/PostSession/${DISPLAY}

... would be a bit easier to read, as well as a bit less error-prone,
if written like this:

echo >/etc/gdm3/PostSession/${DISPLAY} <<EOF
echo "${LIVE_USERNAME}:${LIVE_PASSWORD}" | chpasswd
exit 0
EOF

Also, I wonder why this script has no "#!/bin/sh" shebang, contrary to
similar scripts. It may not help.

Bye,
--
intrigeri <intrigeri@???>
| GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
| OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc
| Do not be trapped by the need to achieve anything.
| This way, you achieve everything.