Version 1202 changes reverted.
This commit is contained in:
		| @@ -51,27 +51,6 @@ | |||||||
| #include <sys/syslog.h> | #include <sys/syslog.h> | ||||||
| #include <security/pam_modules.h> | #include <security/pam_modules.h> | ||||||
| #include <security/_pam_macros.h> | #include <security/_pam_macros.h> | ||||||
| #include <setjmp.h> |  | ||||||
|  |  | ||||||
| static jmp_buf tout; |  | ||||||
|  |  | ||||||
| /* timeout signal hander */ |  | ||||||
| void sig_timeout(int signum) |  | ||||||
| { |  | ||||||
|     if(signum == SIGALRM ) |  | ||||||
|         pam_sscs_log(LOG_ERR, "micasad is not responding\n"); |  | ||||||
|  |  | ||||||
|     signal( SIGALRM, SIG_IGN ); |  | ||||||
|     alarm(0); |  | ||||||
|     longjmp(tout, 1); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /* set timeout */ |  | ||||||
| void set_timeout(int timeout) |  | ||||||
| { |  | ||||||
|     signal(SIGALRM, (void *)sig_timeout); |  | ||||||
|     alarm( timeout ); |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /*  | /*  | ||||||
|  * Running (micasad_status = 1) |  * Running (micasad_status = 1) | ||||||
| @@ -162,7 +141,6 @@ void set_micasa_password(const char *user, const char *password) | |||||||
| 			    SSCS_CRED_TYPE_BASIC_F, | 			    SSCS_CRED_TYPE_BASIC_F, | ||||||
| 			    &basicCredential, | 			    &basicCredential, | ||||||
| 			    NULL); | 			    NULL); | ||||||
|  |  | ||||||
| 		if( retval != 0) { | 		if( retval != 0) { | ||||||
| 		    pam_sscs_log( LOG_ERR,"Setting the default credential failed.Errcode = %d\n",retval); | 		    pam_sscs_log( LOG_ERR,"Setting the default credential failed.Errcode = %d\n",retval); | ||||||
| 		    break; | 		    break; | ||||||
| @@ -171,6 +149,7 @@ void set_micasa_password(const char *user, const char *password) | |||||||
| 	} while (0); | 	} while (0); | ||||||
| 	seteuid(saved_uid); | 	seteuid(saved_uid); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     return; |     return; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -211,15 +190,9 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc,const c | |||||||
|             return (retval); |             return (retval); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 	if(setjmp(tout)) { |  | ||||||
| 	    goto clean_exit; |  | ||||||
| 	} |  | ||||||
| 	set_timeout (TIMEOUT); |  | ||||||
|  |  | ||||||
| 	/* Set the password in micasad*/ | 	/* Set the password in micasad*/ | ||||||
| 	set_micasa_password(user, wkstnPasswd); | 	set_micasa_password(user, wkstnPasswd); | ||||||
|  |  | ||||||
| clean_exit: |  | ||||||
| 	return PAM_SUCCESS; | 	return PAM_SUCCESS; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -277,11 +250,6 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) | |||||||
|             return (retval); |             return (retval); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| 	if(setjmp(tout)) { |  | ||||||
| 	    goto clean_exit; |  | ||||||
| 	} |  | ||||||
| 	set_timeout (TIMEOUT); |  | ||||||
|  |  | ||||||
| 	/* Set the new password in micasad*/ | 	/* Set the new password in micasad*/ | ||||||
| 	set_micasa_password(user, new_passwd); | 	set_micasa_password(user, new_passwd); | ||||||
|  |  | ||||||
| @@ -291,7 +259,6 @@ int pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) | |||||||
| 	return (PAM_AUTH_ERR); | 	return (PAM_AUTH_ERR); | ||||||
|     } /* End of some other flag (Other than PAM_PRELIM_CHECK or PAM_UPDATE_AUTHTOK */ |     } /* End of some other flag (Other than PAM_PRELIM_CHECK or PAM_UPDATE_AUTHTOK */ | ||||||
|  |  | ||||||
| clean_exit: |  | ||||||
|     return PAM_SUCCESS; |     return PAM_SUCCESS; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -49,8 +49,6 @@ extern void pam_sscs_log(int priority, const char *format,...); | |||||||
| #define MICASAD_PID_SIZE 32 | #define MICASAD_PID_SIZE 32 | ||||||
| #define MICASAD_PID_FILE "/var/run/micasad.pid" | #define MICASAD_PID_FILE "/var/run/micasad.pid" | ||||||
|  |  | ||||||
| #define TIMEOUT 5 |  | ||||||
|  |  | ||||||
| #ifdef DEBUG | #ifdef DEBUG | ||||||
| #define PRINT_FN_NAME pam_sscs_log(LOG_DEBUG,"In function : %s\n",__func__); | #define PRINT_FN_NAME pam_sscs_log(LOG_DEBUG,"In function : %s\n",__func__); | ||||||
| #else | #else | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user