summaryrefslogtreecommitdiff
path: root/modules/pam_unix/unix_chkpwd.c
diff options
context:
space:
mode:
authorSebastien Tricaud <toady@gscore.org>2004-11-16 14:27:40 +0000
committerSebastien Tricaud <toady@gscore.org>2004-11-16 14:27:40 +0000
commit6d6eebcafec81d696b621d8453b13d55a1f9be1d (patch)
tree441c3d1fc820ffa2d83b3e1cd592715a3724d0ed /modules/pam_unix/unix_chkpwd.c
parentf135e2b8bca4998e100d412690e493dfff90dbbd (diff)
Applied debian patches
Diffstat (limited to 'modules/pam_unix/unix_chkpwd.c')
-rw-r--r--modules/pam_unix/unix_chkpwd.c13
1 files changed, 9 insertions, 4 deletions
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;