RE: Buffer overflow and code execution on iSeries (Off Topic)

Njal Fisketjon <njal.fisketjon-gyXR7Lt7FVk/[email protected]>
Newsgroups gmane.comp.lang.as400.mi
Message-ID <[email protected]>
> [Marvin Radding:] 
> What I have done is create a library named QUSRJOB where I create the
> message queue.  Then I can execute CL commands in any job that has
> created the message queue.  This is especially helpful in batch jobs
> where a minor adjustment needs to be made that cannot be made any other
> way.  Like changing the current library or overriding a database as a
> temporary fix to get the job to run.  (Month end only comes once a
> month).  At one job, I went so far as to create a program to look at the
> message queues, select the queue to send the message to, and syntax
> check each command sent to a message queue.  I left the code there and
> have never attempt to recreate it.  But this message queue technique has
> CMA several times while I fixed the problem at my leisure.

What I have done is to run a simple MI program that sets a workstation message 
queue in break mode with a break handling program 'on-the-fly':

ENTRY      *(XPLIST)    EXT
DCL SPCPTR WRKSTN-SPP   PARM
DCL DD     WRKSTN       CHAR(10) BAS(WRKSTN-SPP)
DCL OL     XPLIST(WRKSTN-SPP) PARM EXT

DCL SYSPTR MSGQ-SYP     AUTO
DCL SPCPTR MSGQ-SPP     AUTO
DCL DD     BRKPGM       CHAR(10) BAS(MSGQ-SPP) POS(H'5E')
DCL DD     BRKPGMLIB    CHAR(10) BAS(MSGQ-SPP) POS(H'68')
DCL DD     MODE         CHAR(1)  BAS(MSGQ-SPP) POS(H'72')

DCL DD     MSGQ-DS      CHAR(34) AUTO
DCL DD     *            CHAR(2)  POS(1)  DEF(MSGQ-DS) INIT(X'1902')
DCL DD     MSGQ-NAME    CHAR(30) POS(3)  DEF(MSGQ-DS) INIT(' ')
DCL DD     *            CHAR(2)  POS(33) DEF(MSGQ-DS) INIT(X'0000')

           CPYBLA       MSGQ-NAME,WRKSTN
           RSLVSP       MSGQ-SYP,MSGQ-DS,*,*
           SETSPPFP     MSGQ-SPP,MSGQ-SYP
           CPYBLA       BRKPGM,'CDSPBRKMSG'
           CPYBLAP      BRKPGMLIB,'UTLSYS',' '
           CPYBLA       MODE,'B'            /* *BREAK */
           DEACTPG      *
           RTX          *

           PEND

Then I can execute commands at will in any interactive job. It would of course
not be a nice thing to do the above if the job already had a break handling program :)




_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.