Pass the requesting Linux Userid to the Command Exit
search cancel

Pass the requesting Linux Userid to the Command Exit

book

Article ID: 74030

calendar_today

Updated On:

Products

VM:Tape for z/VM

Issue/Introduction

We currently use the COMMAND EXIT for processing mounts but when we receive a mount for Linux, all we see is the Userid of th VM Linux Userid. 
We have looked at TCPAUTH but while this provides the requesting Linux Userid it appears that the only way to pass this is external and there is no tie up with the tape requested for mounting.  The Linux VMTAPE MOUNT command does not provide the SAVEFOR option to allow this . 

Ideally it would be nice to have the SAVEFOR option on the mount command that defaults to the requesting Linux Userid unless overridden. 

Or, is there another solution ?
 

Environment

Running VM:Tape in a zLinux environment.



 

Cause

We are in the process of implementing VM:Tape on Linux for our z/TPF Linux environment. 

For this we will be creating Tapes and require the ability to update the TMC with the creating User, ie the Linux requesting User, not the VM Userid of the Linux System. 



 

Resolution

The TCPIP/Linux command processor creates the MOUNT request that gets issued with the FOR and SAVEFOR options. The FOR UserID is set to the Linux ID (or what is passed in USER to TCPAUTH EXIT). The SAVEFOR UserID is set to the value of REQUESTER (as seen in the TCPAUTH EXIT). 


Customer had their VMTLI.USERMAP file specified incorrectly and advised him of needed change and provided sample. 

The USERNAME is the Linux server sending the MOUNT request. The REQUESTER is the UserID you want to "own" the tape (will appear in the SAVEFOR option on the generated MOUNT command). This is also the USERID that VM:Tape uses for authentication, what scratch pools it can get tapes from, etc. 


Also, found the TCPAUTH EXIT/EXEC is running in "ADDRESS 'CMS'" mode/environment, so, the SET BUFFER command is being interpreted as a CMS command instead of the VMTAPE Primitive "SET". 


Recommended a change to place the "SET BUFFER" at the end of the TCPAUTH EXIT, and just before issuing the command, add a line ... ADDRESS 'VMTAPE' ... to switch the mode/environment to VMTAPE. 

 

Additional Information


To get around this...
It appears that the TCPAUTH EXIT/EXEC is running in "ADDRESS 'CMS'" mode/environment. So the SET BUFFER command is being interpreted as a CMS command instead of the VMTAPE Primitive "SET". 

So what I did was to place the "SET BUFFER" at the end of the TCPAUTH EXIT, and just before issuing the command I added the line ... ADDRESS 'VMTAPE' ... to switch the mode/environment to VMTAPE: 

<<< snip >>> 
===== 
===== /* Show PARMs to us ... */ 
===== say 'TCPAUTH - User --->' User 
===== say 'TCPAUTH - Requestor --->' Requestor 
===== say 'TCPAUTH - Password --->' Password 
===== say 'TCPAUTH - UserData --->' UserData 
===== say 'TCPAUTH - RemoteIP --->' RemoteIP 
===== say 'TCPAUTH - RemotePort --->' RemotePort 
===== say 'TCPAUTH - RemoteDN --->' RemoteDN 
===== 
===== Allowed = 'LINUX12 LINUX45 LINUX078' 
===== if wordpos(User,Allowed)=0 then 
===== ReturnCode = 1 /* reject the request */ 
===== else 
===== ReturnCode = 2 /* let VM:Tape decide */ 
===== 
===== /* Pass necessary data in Common User Exit Buffer */ 
===== address 'VMTAPE' 
===== 'TEST SET BUFFER' 'TCPAUTH - UserData --->' UserData 
===== 
===== exit ReturnCode 
===== * * * End of File * * * 
<<< snip >>> 

This was the result (the BUFFER was passed to the COMMAND EXIT): 

<<< snip >>> 
TCPAUTH - User ---> LINUX078 
TCPAUTH - Requestor ---> IMLST01 
TCPAUTH - Password ---> IMLST01 
TCPAUTH - UserData ---> Test Data 
TCPAUTH - RemoteIP ---> 141.202.200.27 
TCPAUTH - RemotePort ---> 5774 
TCPAUTH - RemoteDN ---> linux078.ca.com 
13:35:56 VMTAPE 0013 VMTTTM0747I Command received over TCP/IP: MOUNT SCRATCH 0181 ( FOR LINUX078 SAVEFOR IMLST01 

--->> COMMAND EXIT entered ... 
--->> USER.1 = IMLST01 
--->> USER.2 = 
--->> BUFFER = TCPAUTH - UserData ---> Test Data 
--->> Original Command: MOUNT SCRATCH 0181 ( FOR LINUX078 SAVEFOR IMLST01 
--->> Command Updated: MOUNT SCRATCH 0181 ( FOR LINUX078 SAVEFOR IMLST01 POOL SCRATCH5 LOCATION SLVMVE02 
<<< snip >>>