On Mon, Aug 29, 2016 at 6:29 AM, Paul Nicolay <paul.nicolay@xxxxxxxxxx> wrote:
?Hi,
I wonder if it is possible to replace the OS/400 command processor ?
I would like to be able to control the command (ie. additional verifications and/or change) before it is executed.
Kind regards,
Paul
A replacement for QCMD? Absolutely. What does QCMD do? It attempts to
retrieve a *RQS message from the *EXT message queue. If any requests
are there, QCMD executes them(1). If the message queue does not have
any requests, the command entry screen is displayed. After a string is
typed and enter is hit, it (essentially) drops the string into a
QCMDEXC and executes it. You can do all of this yourself, inserting
whatever behavior you want, and defaulting to executing the command as
entered (essentially a giant Select, with the Other clause executing
the string). Search on writing a request-processor program.
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rbam6/wrppg.htm
I haven't used QCMD since it was QCL (I learned how to do all of this
from the CPF 3.0 Programmer's Guide). A stripped down bare bones
example can be found at:
http://code.midrange.com/35edc13a37.html). It was pointed out
elsewhere that allowing a System Request could result if falling out
to the (true) command entry screen, which would constitute a security
vulnerability - the referenced program does *not* allow this.
My command processor is considerably more complicated than the
contrived example (I've been working on it more than 30 years), but I
included the logic for 'stealth' mode (I can turn logging on and off),
and the logic for command prompting (the trickiest part of all of
this).
(1) This makes writing a CL source member interpreter trivial:
http://brilligware.com/cp0050.html
Hope some of the above is useful.
Chris Pando
chris@xxxxxxxxx
www.brilligware.com - the home of MineSweeper5250!
As an Amazon Associate we earn from qualifying purchases.