diff options
Diffstat (limited to 'lib/pwauth.c')
-rw-r--r-- | lib/pwauth.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/pwauth.c b/lib/pwauth.c index bfa5c91f..9e24fbf2 100644 --- a/lib/pwauth.c +++ b/lib/pwauth.c @@ -33,7 +33,7 @@ #include <config.h> #ifndef USE_PAM -#ident "$Id: pwauth.c 2782 2009-04-23 20:46:01Z nekral-guest $" +#ident "$Id$" #include <errno.h> #include <fcntl.h> @@ -73,6 +73,7 @@ int pw_auth (const char *cipher, char prompt[1024]; char *clear = NULL; const char *cp; + const char *encrypted; int retval; #ifdef SKEY @@ -177,7 +178,12 @@ int pw_auth (const char *cipher, * the results there as well. */ - retval = strcmp (pw_encrypt (input, cipher), cipher); + encrypted = pw_encrypt (input, cipher); + if (NULL != encrypted) { + retval = strcmp (encrypted, cipher); + } else { + retval = -1; + } #ifdef SKEY /* |