- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
* Change the semantics of the `-s' option somewhat. If specified, allow
either Kerberos or S/Key login, but not a plain password.
* Eliminate the special `s/key' password; just type it at the prompt.
* Remove the root instance special case. This is a serious security hole
waiting to happen, and no other system works this way.
* Don't force a password change if Kerberos was used. Also, don't call
/bin/passwd at all if the password change isn't required.
set the pw_change field of the user to -1 (defined in <pwd.h> as
_PASSWORD_CHGNOW). based on [bin/936] by Simon Gerraty <sjg@quick.com.au>
* clean up for WARNS?=1
Only information leaks now are:
* if '-s -s' is used (only allow s/key users, and force s/key use),
then "login incorrect" will be given if a non-s/key user (or
non-existant user) attempts to login; no password will be prompted
for.
XXX: maybe this should be fixed, but further analysis is required.
* an s/key user will be reminded in the "Password" prompt that they
have an s/key. Therefore it would be possible to determine if a user
is active on the machine if they have an s/key.
XXX: maybe an option is required to control this behaviour
* if the user has an s/key, provide a reminder in the password prompt
* if '-s' is given once, force a user that has an s/key to use it
* if '-s' is given more than once, only permit s/key logins
Suggested by Havard Eidnes <Havard.Eidnes@runit.sintef.no>, but reimplemented
due to bugs in his patch.
Also, don't display `root login refused ...' if the password was mistyped.