1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3-pam_smbpass: Remove obsolete signal type cast.

This commit is contained in:
Andreas Schneider 2010-02-19 15:25:09 +01:00 committed by Stefan Metzmacher
parent b9cf55cfea
commit 069350d7e4
3 changed files with 21 additions and 21 deletions

View File

@ -82,30 +82,30 @@ int pam_sm_acct_mgmt( pam_handle_t *pamh, int flags,
/* Getting into places that might use LDAP -- protect the app
from a SIGPIPE it's not expecting */
oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
if (!initialize_password_db(True, NULL)) {
_log_err(pamh, LOG_ALERT, "Cannot access samba password database" );
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_AUTHINFO_UNAVAIL;
}
/* Get the user's record. */
if (!(sampass = samu_new( NULL ))) {
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
/* malloc fail. */
return nt_status_to_pam(NT_STATUS_NO_MEMORY);
}
if (!pdb_getsampwnam(sampass, name )) {
_log_err(pamh, LOG_DEBUG, "acct: could not identify user");
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_USER_UNKNOWN;
}
/* check for lookup failure */
if (!strlen(pdb_get_username(sampass)) ) {
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_USER_UNKNOWN;
}
@ -118,13 +118,13 @@ int pam_sm_acct_mgmt( pam_handle_t *pamh, int flags,
, "Your account has been disabled; "
"please see your system administrator." );
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_ACCT_EXPIRED;
}
/* TODO: support for expired passwords. */
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_SUCCESS;
}

View File

@ -44,7 +44,7 @@
#define AUTH_RETURN \
do { \
/* Restore application signal handler */ \
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler); \
CatchSignal(SIGPIPE, oldsig_handler); \
if(ret_data) { \
*ret_data = retval; \
pam_set_data( pamh, "smb_setcred_return" \
@ -92,7 +92,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
/* we need to do this before we call AUTH_RETURN */
/* Getting into places that might use LDAP -- protect the app
from a SIGPIPE it's not expecting */
oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
/* get the username */
retval = pam_get_user( pamh, &name, "Username: " );

View File

@ -133,23 +133,23 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
/* Getting into places that might use LDAP -- protect the app
from a SIGPIPE it's not expecting */
oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
oldsig_handler = CatchSignal(SIGPIPE, SIG_IGN);
if (!initialize_password_db(False, NULL)) {
_log_err(pamh, LOG_ALERT, "Cannot access samba password database" );
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_AUTHINFO_UNAVAIL;
}
/* obtain user record */
if ( !(sampass = samu_new( NULL )) ) {
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return nt_status_to_pam(NT_STATUS_NO_MEMORY);
}
if (!pdb_getsampwnam(sampass,user)) {
_log_err(pamh, LOG_ALERT, "Failed to find entry for user %s.", user);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_USER_UNKNOWN;
}
if (on( SMB_DEBUG, ctrl )) {
@ -167,7 +167,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (_smb_blankpasswd( ctrl, sampass )) {
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_SUCCESS;
}
@ -181,7 +181,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (Announce == NULL) {
_log_err(pamh, LOG_CRIT, "password: out of memory");
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return PAM_BUF_ERR;
}
strncpy( Announce, greeting, sizeof(greeting) );
@ -197,7 +197,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
_log_err(pamh, LOG_NOTICE,
"password - (old) token not obtained");
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
}
@ -212,7 +212,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
pass_old = NULL;
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
} else if (flags & PAM_UPDATE_AUTHTOK) {
@ -242,7 +242,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
if (retval != PAM_SUCCESS) {
_log_err(pamh, LOG_NOTICE, "password: user not authenticated");
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
}
@ -270,7 +270,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
}
pass_old = NULL; /* tidy up */
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
}
@ -290,7 +290,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
_log_err(pamh, LOG_NOTICE, "new password not acceptable");
pass_new = pass_old = NULL; /* tidy up */
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
}
@ -339,7 +339,7 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags,
}
TALLOC_FREE(sampass);
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
CatchSignal(SIGPIPE, oldsig_handler);
return retval;
}