[mod.computers.vax] AST delivery to spawned processes, VMS version 5.0, 4.x VAX Internals

bingham%artic.DECnet@ARI-HQ1.ARPA.UUCP (04/10/87)

1.  AST delivery and spawned processes.


	Recently some questions have been raised about how AST delivery
to various processes your process tree is controlled.  The AST delivery 
code in the terminal driver uses a field called the Control PID (CTLPID) 
to determine whom to deliver AST's to.  The AST delivery code checks this
field and determines what processes to deliver  AST's to.  If the CTLPID 
is zero then deliver all AST's to all process that presently have them 
queued.  If it is not zero deliver it to the process whoes PID matches 
CTLPID.  (Note: CTLPID is the IPID not the EPID displayed by show system) 

	The CTLPID field starts out as zero when a user logs in, and is
manipulated by the DCL spawn and attach commands. The example below 
shows how once a SPAWN command is issued the CTLPID gets filled in and 
remains filled in.

	1) Login and do a SPAWN/NOWAIT/PROMPT="FOO> "
	2) Type a CTRL/T and status information for both processes will 
	   be displayed.
	3) From the parent process to a SPAWN/PROMPT="FOO_1> "
	4) Type a CTRL/T and status information for the process 
	   associated with FOO_1> will be displayed.
	5) Logout of FOO_1> and type CTRL/T and information for the 
	   parent process will be displayed.
	6) Logout of FOO> and do a SPAWN/NOWAIT/PROMPT="FOO_2> "
	7) Type a CTLR/T once again and status information for the 
	   parent will be displayed but not for the subprocess

	The CTLPID is changed by both the SPAWN and ATTACH commands.  
The SPAWN command changes it when a SUBPROCESS is created and fills in 
the subprocesses IPID.  When a SUBPROCESS terminates the cleanup code 
changes the CTLPID back to the parent's IPID.  The CTLPID can also be 
filled in by the ATTACH command.  When you attach to another process 
in your process tree, ATTACH fills in the IPID of the process being 
attached to.  Finally when a SPAWN/NOWIAT is used the CTLPID is left 
alone both at process creation and deletion time.

	DCL uses an undocumented SET QIO to the terminal driver to
manipulate the CTLPID.  The function modifier is IO$M_TT_PROCESS the
TTDRIVER then copies PCB$L_PID of process issuing the QIO to
UCB$L_TL_CTLPID.  It would be very easy for a user to write a simple
program to set their CTLPID initially to prevent AST delivery to mulitple 
processes without having go through the SPAWN, LOGOUT procedure.


2.  Change to CTRLPID useage.

	I understand that in V5.0 VMS the useage of CTLPID will be changed.
Specifically CTLPID will be filled in at login time.  This means that AST's 
will only be delivered to one process at a time.


3. LOGINOUT

	Another change reportedly coming in VMS v5.0 involves LOGINOUT.
If appropriate modem signals are not set within 30 seconds of starting a 
login sequence on a port with the MODEM qualifier set a message - something 
like "THE HOST'S MODEM IS INCORRECTLY WIRED - CONTACT YOUR SYSTEM MANAGER" 
- will be displayed and the process will be logged out.  The required modem 
signals will probably be CD, DSR, and CTS.  They may leave you a way to
bypass this security feature.  That is if you have NOHANGUP set (presumably
indicating that you are aware of the consequences of having MODEM and HANGUP
set) the above actions would be be bypassed.  (DEC, if yor are listening,
I vote for the bypass feature - I don't intend to use it but I think people
should be able to.)

	Here is the scenario they are trying to prevent:

	The system manager dials in and starts working.  The line drops 
	so he dials back in and gets a different line,  logs back in 
	and picks up where left off.  Meanwhile an unprivileged user 
	logs in, gets the system managers old session and has fun.  This 
	can actually happen if the modem lines are not correctly wired.  
	It can also happen on lines wired correctly that do not have 
	HANGUP set.

	The V4.6 release notes should have a note warning people that this
feature is coming.

	4.  Word is that the Internals and Data Structures manual for version
4.x will be available at the Spring DECUS in Nashville.  It will be labeled
"Preliminary and Partial" (about 2/3 complete) with the full manual due
out a few months later.  The order number is EY-6741E-DP.

joe bingham
bingham@ari-hq1.arpa
------