Change the process title as soon as possible to mask information passed on

the command line by getty(8).  This is not a perfect fix, but drastically
reduces the window of exposure.

Approved by:	re (rwatson)
MFC after:	1 week
This commit is contained in:
des 2002-12-04 15:00:10 +00:00
parent b24c667092
commit 719f445a6e

View File

@ -228,6 +228,8 @@ main(int argc, char *argv[])
ask = 1;
}
setproctitle("-%s", getprogname());
for (cnt = getdtablesize(); cnt > 2; cnt--)
(void)close(cnt);
@ -504,6 +506,7 @@ main(int argc, char *argv[])
* Parent: wait for child to finish, then clean up
* session.
*/
setproctitle("-%s [pam]", getprogname());
wait(NULL);
bail(NO_SLEEP_EXIT, 0);
}