From 6d6eebcafec81d696b621d8453b13d55a1f9be1d Mon Sep 17 00:00:00 2001 From: Sebastien Tricaud Date: Tue, 16 Nov 2004 14:27:40 +0000 Subject: Applied debian patches --- modules/pam_unix/unix_chkpwd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'modules/pam_unix/unix_chkpwd.c') diff --git a/modules/pam_unix/unix_chkpwd.c b/modules/pam_unix/unix_chkpwd.c index e65728d8..ff1d1bff 100644 --- a/modules/pam_unix/unix_chkpwd.c +++ b/modules/pam_unix/unix_chkpwd.c @@ -77,6 +77,11 @@ static int _unix_shadowed(const struct passwd *pwd) static void su_sighandler(int sig) { +#ifndef SA_RESETHAND + /* emulate the behaviour of the SA_RESETHAND flag */ + if ( sig == SIGILL || sig == SIGTRAP || sig == SIGBUS || sig = SIGSERV ) + signal(sig, SIG_DFL); +#endif if (sig > 0) { _log_err(LOG_NOTICE, "caught signal %d.", sig); exit(sig); @@ -92,7 +97,9 @@ static void setup_signals(void) */ (void) memset((void *) &action, 0, sizeof(action)); action.sa_handler = su_sighandler; +#ifdef SA_RESETHAND action.sa_flags = SA_RESETHAND; +#endif (void) sigaction(SIGILL, &action, NULL); (void) sigaction(SIGTRAP, &action, NULL); (void) sigaction(SIGBUS, &action, NULL); @@ -153,12 +160,10 @@ static int _unix_verify_password(const char *name, const char *p, int nullok) } salt_len = strlen(salt); - if (salt_len == 0) { + if (salt_len == 0) return (nullok == 0) ? UNIX_FAILED : UNIX_PASSED; - } - if (p == NULL) { + else if (p == NULL || strlen(p) == 0) return UNIX_FAILED; - } /* the moment of truth -- do we agree with the password? */ retval = UNIX_FAILED; -- cgit v1.2.3