[comp.os.vms] Problems defining MAIL$EDIT to be CALLABLE_TPU

TOLLIVER%ORN.MFENET@NMFECC.ARPA (08/09/87)

I recall seeing a couple of messages a few months ago about how to define
MAIL$EDIT to be CALLABLE_TPU in order to invoke TPU as the editor of choice
from within MAIL.  Well, that works fine.  Now suppose that one is using
a private TPU$SECTION file by having properly defined the TPUSECINI logical
name to be that private file.  That still works fine.

Now for the problem:  Suppose one's private section file uses the TPU
built-in CALL_USER to invoke some external routine whose identity is
defined by the TPU$CALLUSER logical name.  That works fine normally, i.e.,
when invoking TPU directly from DCL via EDIT/TPU.  But when trying MAIL/EDIT,
the proper section file is picked up (i.e., properly translating TPUSECINI)
but "it" doesn't seem to know about the TPU$CALLUSER definition and
complains of (approximately) "error activating SYS$LIBRARY:TPU$CALLUSER.EXE"
and then says something like "Could not find a routine for CALL_USER to
invoke."

In summary, "it" (i.e., callable_TPU (or somebody)), can translate TPUSECINI
from the process table, but it seems unable to translate TPU$CALLUSER from
the same table.

Has anyone else seen this problem?  More importantly, does anyone
understand it and/or have a solution?

Thanks,

John Tolliver (TOLLIVER%ORN.MFENET@NMFECC.ARPA)

LEICHTER-JERRY@YALE.ARPA (08/10/87)

    ...Suppose one's private section file uses the TPU built-in CALL_USER to
    invoke some external routine whose identity is defined by the TPU$CALLUSER
    logical name.  That works fine normally, i.e., when invoking TPU directly
    from DCL via EDIT/TPU.  But when trying MAIL/EDIT, [with MAIL$EDIT defined
    as CALLABLE_TPU] the proper section file is picked up (i.e., properly
    translating TPUSECINI) but "it" doesn't seem to know about the
    TPU$CALLUSER definition and complains of (approximately) "error activating
    SYS$LIBRARY:TPU$CALLUSER.EXE" and then says something like "Could not find
    a routine for CALL_USER to invoke."
    
    In summary, "it" (i.e., callable_TPU (or somebody)), can translate
    TPUSECINI from the process table, but it seems unable to translate
    TPU$CALLUSER from the same table....

The MAIL image is installed with elevated privileges.  Such an image, when
it attempts to map a shareable image - either statically, by being linked
against it, or dynamically, using LIB$FIND_IMAGE_SYMBOL (which is what TPU
does to find your CALL_USER code) - is subject to two restrictions:

	- Only EXEC mode logicals are examined;
	- The shareable image found must itself be INSTALL'ed.

(The reason for this is security:  If I could cause MAIL to run my own code, I
could have it use MAIL's installed privileges - which include SYSPRV - to do
whatever I wanted to the system.  TPU section files don't contain executable
code as such - they are interpreted by TPU - so these restrictions don't
apply.)

I can't think of any work-arounds, other than using a spawned editor, or
INSTALL'ing image containing your CALL_USER code (which might be practical
in some situtations, e.g., a private workstation).
							-- Jerry
-------

carl@CITHEX.CALTECH.EDU (Carl J Lydick) (08/10/87)

 > Now for the problem:  Suppose one's private section file uses the TPU
 > built-in CALL_USER to invoke some external routine whose identity is
 > defined by the TPU$CALLUSER logical name.  That works fine normally, i.e.,
 > when invoking TPU directly from DCL via EDIT/TPU.  But when trying MAIL/EDIT,
 > the proper section file is picked up (i.e., properly translating TPUSECINI)
 > but "it" doesn't seem to know about the TPU$CALLUSER definition and
 > complains of (approximately) "error activating SYS$LIBRARY:TPU$CALLUSER.EXE"
 > and then says something like "Could not find a routine for CALL_USER to
 > invoke."
 > 
 > In summary, "it" (i.e., callable_TPU (or somebody)), can translate TPUSECINI
 > from the process table, but it seems unable to translate TPU$CALLUSER from
 > the same table.
 > 
 > Has anyone else seen this problem?  More importantly, does anyone
 > understand it and/or have a solution?

No, I don't understand it, and I'm not sure I have a solution, but I DO
have a suggestion.  Try defining sys$library to be a searchlist including
both SYS$SHARE: (ok, if you want to be safe, SYS$SYSROOT:[SYSLIB]) and the
directory in which your image (named TPU$CALLUSER.EXE, of course) resides).
I admit, it's not elegant, but it should work.