HP 3000 Manuals

JOBINFO Intrinsic Enhancements [ COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00) ] MPE/iX Communicators


COMMUNICATOR 3000 MPE/iX General Release 5.0 (Core Software Release C.50.00)

JOBINFO Intrinsic Enhancements 

by Barbara Dubbert 
Commercial Systems Division 

Overview 

The JOBINFO intrinsic has been enhanced to support the longer command
lines available in Release 5.0.  In addition, more stringent security
measures affect both who is allowed to read command lines and what may be
read.

Longer Command Lines 

In MPE/iX Release 5.0, the maximum command line length has been increased
from 279 bytes to 511 bytes.  The JOBINFO intrinsic enhancement supports
this new maximum size as well as any future increases in command line
sizes.

To provide this capability, one existing JOBINFO item has been modified
(item 11) and one new item (item 49) has been added.  Descriptions of
these items follows, plus a brief explanation of how item 34 relates to
changes in item 11.  Item 34 has not been modified as part of this
enhancement.

Item 11 (Current Job Step).   

Prior to Release 5.0, item 11 callers were required to handle up to 283
bytes of command line information.  This requirement continues to be true
for Release 5.0 and later.

Item 11 returns Command Interpreter (CI) command line images up to 283
bytes long.  If the actual command line exceeds 283 bytes, a "$"
(truncation character) is placed in byte 283 of the buffer returned to
the caller.  Byte 283 is the last byte in the buffer where the first byte
is byte 1 (not byte 0).  In this way, item 11 silently truncates the
command line image.

Current item 11 callers need not change their code if they do not expect
or care about line lengths greater than 283 bytes.  An example of this
might be when a command line is used for display logging.  Callers who
want or need the full command line must use the new item 49.

Item 34 (Current Job Step Length).   

The behavior and usage of item 34 are unchanged for Release 5.0.  Item 34
still returns the number of bytes in your buffer and is, therefore, never
larger than 283 bytes.  The byte count returned by item 34 includes the
truncation character ($) for command lines greater than 283 bytes.

When the command line is 283 bytes or less, item 11 contains the entire
command line image with no truncation character.  Item 34 returns the
number of bytes in the command line (283 or less).  The truncation
character is not part of the byte count since there is no truncation
character in the buffer.

When the command line is greater than 283 bytes, item 11 contains the
first 282 bytes of the command line image, the truncation character is
placed in byte 283, and item 34 returns a value of 283.  In this case,
the truncation character is counted as the 283rd byte.

Item 34 continues to be valid only with item 11.

Item 49 (New Current Job Step).   

Item 49 is a new item which should be used by callers wanting to retrieve
the full command line image, regardless of its size.

Implementation Characteristics.   

The implementation of item 49 includes the functions of both item 11 and
item 34 combined in a single buffer.  That is, item 49 returns the
command line image as well as the command line length.  The following are
the characteristics of the item 49 buffer and its usage:

   *   It is an input/output buffer.

   *   The first four bytes of the buffer are reserved for a size or
       length.

   *   On input, the first four bytes hold your buffer size (in bytes,
       not including the 4-byte size).

   *   On output, the first four bytes hold the command length (in
       bytes).

   *   A NULL is appended to all command lines (to accommodate C-string
       users).

   *   The output length of the command line does not include the NULL
       terminator.

   *   The output length contains the number of bytes in the full command
       line image, regardless of the size of your buffer.

   *   Callers must pass a buffer of 512 bytes to be guaranteed to
       retrieve the entire command line.

Format of the buffer on input:

          +---------+---------------------------+...+---+
          | size=   |                                   |
          |   N     |                                   |
          +---------+---------------------------+...+---+
     byte #1      #4 #1                                #N

  Format of the buffer on output:

          +---------+------------------------+--+...+---+
          | length= |                        |\0|       |
          | (L - 1) |                        |  |
          +---------+------------------------+--+...+---+
     byte #1      #4 #1                       #L       #N

Input Usage.   

When calling JOBINFO with item 49, you must fill in the first four bytes
of the item buffer with the size of the item buffer being passed.  This
buffer size must not include the four bytes of the size field.  The
remainder of the buffer should be at least as large as the expected
command line and include an additional byte for the NULL terminator.

Output Usage.   

On output, the first four bytes of the item buffer are filled in by
JOBINFO and contain the length of the full command line image.  The
command line, up to the input buffer size minus one byte, is placed in
your buffer.  The extra byte is used by the NULL character which is
appended to the end of the command line.  The caller must do a compare of
the actual command line length (strlen) and the buffer size (strmax) to
determine if the command line has been truncated.  If truncation has
occurred, then the following comparison is true.

     strlen > strmax-1

Note that strmax must be decremented by one to account for the presence
of the NULL terminator.

Revised Itemerror.   

For Release 5.0 and later, an itemerror of 1 means that an "Invalid item
or itemnum" has been found.  This definition expands on the previous
itemerror definition which only applied to an "Invalid itemnum".

When JOBINFO finds a negative value for the item 49 buffer size (in the
first four bytes of the item buffer), an itemerror value of 1 is returned
to the caller.

Greater Security 

An additional set of security measures affects what is (or is not)
returned to the caller when attempting to read command line images with
JOBINFO. These measures affect both item 11 and item 49 and are in
addition to the capability checking that already exists in JOBINFO for
reading command line images.  These new measures include the following:

   *   File lockwords are never returned to the caller, regardless of the
       caller's capabilities.  Instead, lockwords are replaced by blanks,
       including the "/".

   *   If JOBSECURITY is low, the caller can retrieve the entire command
       line (except lockwords) for their own job or session and for other
       jobs and sessions with the same user.account.

   *   If JOBSECURITY is high, the caller can retrieve the entire command
       line (except lockwords) only for their own job or session.

The net effect of these additional security measures is that lockwords
are never seen and that the level of JOBSECURITY now plays a role in the
overall JOBINFO security scheme.  Failure to pass these new security
measures (for example, trying to retrieve the command line of a matching
user.account that is not the caller's own job or session when JOBSECURITY
is high) results in the following:

   *   Item 11 returns an empty item buffer and item 34 returns a zero
       length.

   *   Item 49 returns an empty item buffer (a NULL character) and a
       command length of zero (in the first four bytes of the buffer).



MPE/iX Communicators