From 3cfa63750d7e82e0e4b94f7f7b67639bdbd016af Mon Sep 17 00:00:00 2001 From: John Denker Date: Sun, 3 Jun 2012 00:43:55 -0700 Subject: optional debugging features in checkpassword --- checkpasswd/checkpassword.c | 9 +++++++++ checkpasswd/exit.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/checkpasswd/checkpassword.c b/checkpasswd/checkpassword.c index 7e5ee18..6056525 100644 --- a/checkpasswd/checkpassword.c +++ b/checkpasswd/checkpassword.c @@ -19,6 +19,10 @@ static struct spwd *spw; static struct userpw *upw; #endif +#ifdef NASTY_DEBUG +# include +#endif + static char up[513]; static int uplen; @@ -57,6 +61,11 @@ main(int argc,char **argv) if (i >= uplen) _exit(2); while (up[i++]) if (i >= uplen) _exit(2); +#ifdef NASTY_DEBUG + fprintf(stderr, "checkpassw called with '%s' '%s'\n", + login, password); +#endif + pw = getpwnam(login); if (pw) stored = pw->pw_passwd; diff --git a/checkpasswd/exit.h b/checkpasswd/exit.h index 39011c8..614f9d1 100644 --- a/checkpasswd/exit.h +++ b/checkpasswd/exit.h @@ -1,6 +1,6 @@ #ifndef EXIT_H #define EXIT_H -extern void _exit(); +extern void _exit(int); #endif -- cgit v1.2.3