/* Program name..... CRTPRFEXIT */ /* You may freely use this code as long as the Copyright */ /* and authorship Information is retained in this source member */ /* No warranty of any kind is expressed or implied. */ /* Copyright 2011-2014 IT Security and Compliance Group */ /* Author….. Dan Riehl www.SecureMyi.com */ /* If the program will be used by a user that does not have */ /* *SECADM and *ALLOBJ special authority, this */ /* Exit program must Adopt QSECOFR USRPRF(*Owner) */ /* AUT(*EXCLUDE), AUT(*USE) for GROUP that Creates Profiles */ /* This program will set the owner of newly created */ /* User profiles to QSECOFR. */ /* The IBM Registered Exit point is QIBM_QSY_CRT_PROFILE */ /* CL Command to add the exit program to the exit point */ /* ADDEXITPGM EXITPNT(QIBM_QSY_CRT_PROFILE) + */ /* FORMAT(CRTP0100) PGMNBR(*HIGH) + */ /* PGM(Library-name/CRTPRFEXIT) TEXT('Change the + */ /* owner of new profiles to QSECOFR') */ PGM PARM(&Exit_Info) DCLPRCOPT USRPRF(*OWNER) AUT(*EXCLUDE) DCL &Exit_info *CHAR 38 DCL &user *CHAR 10 DCL &curuser *CHAR 10 /* Message handling variables */ DCL &msgid *CHAR 7 DCL &msgf *CHAR 10 DCL &msgflib *CHAR 10 DCL &msgdta *CHAR 100 MONMSG MSGID(CPF0000) EXEC(GOTO ERROR) RTVJOBA CURUSER(&CURUSER) IF COND(&CURUSER = 'QSECOFR') THEN(GOTO + CMDLBL(ENDIT)) CHGVAR VAR(&USER) VALUE(%SST(&EXIT_INFO 29 10)) CHGOBJOWN OBJ(&USER) OBJTYPE(*USRPRF) NEWOWN(QSECOFR) Endit: RETURN /* Normal end of program */ ERROR: RCVMSG MSGTYPE(*LAST) MSGDTA(&msgdta) MSGID(&msgid) + MSGF(&msgf) SNDMSGFLIB(&msgflib) MONMSG CPF0000 /* Just in case */ SNDPGMMSG MSGID(&msgid) MSGF(&msgflib/&msgf) + MSGDTA(&msgdta) MSGTYPE(*ESCAPE) MONMSG CPF0000 /* Just in case */ ENDPGM