The do_pwchange() function in session.c needs to pass the username as an argument to the passwd command. Without it, passwd always fails with something like "passwd: unknown user" as if its getting a blank user arg. It's strange but so are many other things in SCO, which BTW was NOT my OS of choice :( To make it work I simply changed line 1317 to this: execl(_PATH_PASSWD_PROG, "passwd", s->pw->pw_name, (char*)NULL);
Mike Thompson wrote:> The do_pwchange() function in session.c needs to pass the username as an > argument to the passwd command. Without it, passwd always fails with > something like "passwd: unknown user" as if its getting a blank user > arg. It's strange but so are many other things in SCO, which BTW was NOT > my OS of choice :( > > To make it work I simply changed line 1317 to this: > execl(_PATH_PASSWD_PROG, "passwd", s->pw->pw_name, (char*)NULL);FWIW my old password expiry patches did this: permanently_set_uid(pw); if (geteuid() == 0) execl(PASSWD_PROGRAM_PATH, "passwd", pw->pw_name, (char *)NULL); else execl(PASSWD_PROGRAM_PATH, "passwd", (char *)NULL); so it only provided the user name when running as root. From memory, various platforms didn't like having the username supplied to passwd when run as a non-root user so it would need to be optional and enabled in configure only on the platforms that need it. -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Mike Thompson wrote:> The do_pwchange() function in session.c needs to pass the username as an > argument to the passwd command. Without it, passwd always fails with > something like "passwd: unknown user" as if its getting a blank user > arg. It's strange but so are many other things in SCO, which BTW was NOT > my OS of choice :( > > To make it work I simply changed line 1317 to this: > execl(_PATH_PASSWD_PROG, "passwd", s->pw->pw_name, (char*)NULL);Does the attached patch fix it properly? (Note: you will need to run "autoreconf" to rebuild configure after applying the patch, the rerun ./configure && make). -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: openssh-sco-passwd.patch Url: http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20041206/803c8961/attachment.ksh
Tim Rice wrote:> On Sat, 4 Dec 2004, Darren Tucker wrote: >> execl(PASSWD_PROGRAM_PATH, "passwd", (char *)NULL); > ^^^^^^^^^^^^^^^^^^^^^^ > Wouldn't that be equivilent to > $ passwd ""No, it's just the null termination that execl requires. The cast is to keep the compiler quiet.> UnixWare does complain anout this. > ... > UX:passwd: ERROR: Unknown logname:Perhaps it's complaining about something else? Missing $LOGNAME or something?> Running passwd with no args works and "passwd user_name" works too.BTW changing all users' passwords with "passwd user_name" as root can have other unpleasant side effects (eg on AIX it will set the ADMCHG flag which will force the user to change it again next login). -- Darren Tucker (dtucker at zip.com.au) GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.