This program retrieves a profile handle, swaps to that profile, and then deletes the profile handle.
The program is called from the command line with the following parameter:
The program call looks like this:
call cp1500r (QSECOFR)
The program uses the following APIs:
It should be pointed out that, using these techniques, anyone with *USE rights to QSECOFR can swap to the QSECOFR profile. This could be considered a security exposure. The purpose I use this program for is to replace adopted object authority within JDEdwards.
The following link takes you to the source code, written in beautiful /free ILE/RPG. The source is
distributed under a creative commons license.
Here is another version using different APIs:
The preceding APIs are all procedures in the Service Program QSYPHANDLE, which we bind to through the binding directory QUSAPIBD.