4 May 2007 20:28
changing root's password changes login user instead
Jeremy C. Reed <reed <at> reedmedia.net>
2007-05-04 18:28:55 GMT
2007-05-04 18:28:55 GMT
On NetBSD, logging in as a non-root user and then "su" to root followed by "passwd" will reset the original logged in user's password. I was using NetBSD 3.1. But I tested on a more recent -current also. It is often suggested that to change root's password to use "passwd root". It doesn't display the "Changing local password for ...". Can we re-add that? (Does this need to be done in PAM?) It appears to use getlogin(2) while other implementations use getuid(3) and getpwuid(3). It doesn't check if there is a login/uid mismatch. Can we add a check for that? So the behaviour in this example of passwd # no arguments is different between FreeBSD and NetBSD. I am not sure if "passwd(1)" is even covered by Open Group's Single UNIX specification or POSIX. (Does anyone know?) Any comments on the differences of behaviour? Should we have it output what username is being changed? If we don't fix this to abort on login/uid mismatch, we should add a(Continue reading)

RSS Feed