user_chpasswd routine

Top  Previous  Next

When XCICS/TS auth_mode is set to "user", user may define an user_chpasswd routine to handle the operator password change SIGNOFF (CESN and EXEC CICS SIGNON NEWPASSWORD). If this routine is not declared operators will not be able to change their password.

After a succesfull SIGNON, if the a new password is requested, XCICS/TS calls the routine passing the USERID,  the old and new PASSWORDs entered by the operator and the pointer to the SNT entry of the user.

The routine may handle this information and return a return code to communicate to XCICS/TS whether the operation succeeded or not.

If the return code is not equal to CXE_OK (0), the condition INVREQ is raised.

Prototype

int function_name(char *userid, char *old_password, char *new_password, tCXsnt *snt_entry);

Passed parameters

name

type

description

userid

char *

a NULL terminated string, containing the USERID

old_password

char *

a NULL terminated string, containing the old password

new_password

char *

a NULL terminated string, containing the new password

snt_entry

tCXsnt *

a pointer to the SNT entry of the user

Return codes

0        OK
!=0      fault (INVREQ is raised)

Example declaration

define exit_program type=user_chpasswd, name=dfhep_chpasswd, library=libmysnt.so;

Example code

#include "cics.h"
int dfhep_chpasswd(char *userid, char *old_password, char *new_password, tCXsnt *snt_entry) {
 
if (strcmp(userid, "UI98736")==0) {
     /** I don't want UI98736 to change his password*/
     return 1;
}
if(my_store_password(userid, new_password)) {
     return 1;
}
return 0;
}