s3-pam_smbpass: Remove obsolete signal type cast.
authorAndreas Schneider <asn@redhat.com>
Fri, 19 Feb 2010 14:25:09 +0000 (15:25 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Feb 2010 11:23:42 +0000 (12:23 +0100)
source3/pam_smbpass/pam_smb_acct.c
source3/pam_smbpass/pam_smb_auth.c
source3/pam_smbpass/pam_smb_passwd.c

index 9ad74788f07d20197dd2c483b2fd0ecf93bf6cca..650d322b356a6e866f5a6d71b68d46baa1d23333 100644 (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;
 }
 
index 88ff9851f5b1d803fa12b9d4d63d81354d4cf60b..feb469792d3756e264a150f6d2567e3972561601 100644 (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: " );
index 0563af383cfd7afc1f916b88455765bcde14109e..473a55e0657c64b5af714d9e5c2ee270222392e1 100644 (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;
 }