home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / vms / 20276 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  10.9 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!purdue!vortex.gici.com!alien.gici.com!laut
  2. Newsgroups: comp.os.vms
  3. Subject: Re: TT_AccPorNam field remains null on a SHOW USERS output ?
  4. Message-ID: <1993Jan4.044118.1@alien.gici.com>
  5. From: laut@alien.gici.com (Bill Laut)
  6. Date: 4 Jan 93 04:41:18 EDT
  7. References: <1992Dec27.233720.1@woods.ulowell.edu> <28DEC199204082079@spades.aces.com>
  8. Organization: Gull Island Consultants, Inc.
  9. Nntp-Posting-Host: alien.gici.com
  10. Lines: 255
  11.  
  12. In article <28DEC199204082079@spades.aces.com>, Ehud writes:
  13. >In article <1992Dec27.233720.1@woods.ulowell.edu>, sabotkap@woods.ulowell.edu writes...
  14. >
  15. > [ misc. discussion deleted ]
  16. >
  17. >#When logged in from a non-hardwired terminal, when during login is the 
  18. >#TT_AccPorNam information obtained ?
  19. >
  20. >Before SYLOGIN gets control is enough that you need to know.
  21. >
  22.  
  23. In other words, Ehud doesn't know. In any case, since I'm experienced in
  24. these matters, I'll take a crack at it. 
  25.  
  26. Please refer to module $TTYUCBDEF in SYS$LIBRARY:LIB.MLB. This is the macro
  27. which symbolically defines the terminal-independent UCB extentions (not to
  28. be confused with port-specific extentions, such as DECnet, LAT, etc., which
  29. are indigenous to the port driver itself).
  30.  
  31. I don't know what your level of technical expertise is, so please do not be 
  32. offended if I either over-simplify or appear condescending.  And by all 
  33. means, PLEASE ASK QUESTIONS!  ESPECIALLY THE -DUMB- ONES, because they 
  34. usually are the ones that need to be asked.  If you are embarassed (or 
  35. frankly don't want to get flamed for asking), feel free to e-mail them to 
  36. me, and I'll either answer them privately or anonymously with a post.
  37.  
  38. By convention, device drivers use register five (R5) as a pointer to the 
  39. device's "unit control block" (UCB).  The UCB is a data structure contained 
  40. within S0 space, in a region known as "non-paged pool," and is used to
  41. identify any given device on the system.  Using your example, let's say you
  42. are logged in on terminal LTA2633:.  if you were to run the System Dump
  43. Analyzer via the "$ ANA/SYS" command, and then type in the command: 
  44.  
  45. SDA> show device lta17:
  46.  
  47. it would give you a display that roughly resembles:
  48.  
  49. +-----------------------------------------------------------------------------
  50. LTA17                                   VT300_Series      UCB address:  80B052C0
  51.  
  52. Device status:   00000010 online
  53. Characteristics: 0C040007 rec,ccl,trm,avl,idv,odv
  54.                  00000200 nnm
  55.  
  56. Owner UIC [000001,000004]   Operation count      20444   ORB address    80B05530
  57.       PID        001F0006   Error count              0   DDB address    80D9E600
  58. Class/Type          42/70   Reference count          5   DDT address    80B45041
  59. Def. buf. size         80   BOFF                  0001   CRB address    80D65680
  60. DEVDEPEND        180093A0   Byte count            0200   I/O wait queue    empty
  61. DEVDEPND2        F9E03004   SVAPTE            80B07190                          
  62. FLCK index             34   DEVSTS                0001                          
  63. DLCK address     80A176F0                                                       
  64.  
  65.     *** I/O request queue is empty ***
  66.  
  67.  
  68. SDA>
  69. +-----------------------------------------------------------------------------
  70.  
  71. Please note the far-right side of the first line, where it says
  72. "UCB address:".  This is the system virtual address in Non-Paged Pool of
  73. where the UCB is located.
  74.  
  75. Now, type in:
  76.  
  77.     SDA> read sys$system:sysdef.stb
  78.  
  79. this causes SDA to read in the symbolic offset definitions for various data 
  80. structures inside of VMS, including the UCB ones.
  81.  
  82. Note the eight-digit hexidecimal number, and type in:
  83.  
  84.     SDA> format xxxxxxxx
  85.  
  86. replacing the 'xxxxxxxx' with the eight-digit hex address of the UCB.  Be
  87. ready to press the HOLD SCREEN key!
  88.  
  89. There are two fields you will be interested in trying to find.  They are:
  90.  
  91.               UCB$W_TT_PRTCTL
  92.                    -and-
  93.             UCB$L_TT_ACCPORNAM
  94.  
  95. The first entry is a 16-bit word, and it stands for "Port Control."  It is
  96. used as a set of flags for denoting the operational status and 
  97. configuration of the port driver side of the paradigm.  One of the bit 
  98. flags (#13, actually) inside of PRTCTL is "TTY$V_PC_ACCPORNAM".  When this 
  99. bit is set, it denotes there is an Access name associated with the port.
  100.  
  101. The second entry, "UCB$L_TT_ACCPORNAM," is a 32-bit longword.  When 
  102. TTY$V_PC_AccPorNam is set, UCB$L_TT_AccPorNam contains the address (ie, "it 
  103. points to") of a "counted ASCII string."  A counted ASCII string simply 
  104. means that the first byte of the string is interpreted as a binary value 
  105. containing the number of ASCII characters to follow.
  106.  
  107. The address contained within UCB$L_TT_AccPorNam does not necessarily have 
  108. to be within the UCB.  It can be anywhere within a legimate non-paged pool 
  109. address.
  110.  
  111. Now, having said all of that, I'll answer your question:
  112.  
  113. >#When logged in from a non-hardwired terminal, when during login is the 
  114. >#TT_AccPorNam information obtained ?
  115.  
  116. That is left entirely up to the port driver, or port driver/ACP 
  117. combination.  Typically, it happens when the network connection is being 
  118. established.  This usually coincides with the creation of the UCB itself, 
  119. during a process called "UCB cloning."  I won't engorge into the details 
  120. here, but if there is enough interest, I'll be happy to start another 
  121. thread, illustrating the process with code fragments.
  122.  
  123. Anyway, when the application issues the $ASSIGN system service against the 
  124. root device (such as INET0:, NET0:, LTA0:, etc.), there is a flag 
  125. indicating the root as a "template device."  The appropriate Exec routine 
  126. then allocates the requisite amount of non-paged pool, copies the template 
  127. device into it, does all of the linkages and hocus-pocus, and you now have 
  128. a new device on the system!  The service then calls the device driver at 
  129. its "CLONEDUCB" entry point.  This is where the device driver gets to do 
  130. any specific housekeeping associated with the new device.  In the case of 
  131. your question, that includes generating a suitable port name.
  132.  
  133. Now, if you write your own device drivers, you can modify the port name at 
  134. any time.  One such driver I wrote dealt with reverse-TELNET printer 
  135. connections to Xylogics terminal servers, as well as auto-launching 
  136. applications without having to go through LOGINOUT.  In that case, the 
  137. formulation of the port name was NOT done inside of the driver, but was 
  138. passed from the server process via the IO$_TTY_PORT function code as a
  139. character string.
  140.  
  141.  
  142. >#It seems a SET TERMINAL/INQUIRE in our SYLOGIN.COM is responsible for 
  143. >#getting this field,
  144. >
  145. >Nope.  If the information is available, it is there long before
  146. >SYLOGIN.
  147. >
  148. >#but at other times, an otherwise normal login will not retreive this 
  149. >#information.
  150. >
  151. >Coincidence.
  152. >
  153.  
  154. Incorrect.  "Coincidence" implies that VMS collectively is somehow waffling
  155. on whether or not to insert the port name.  That is highly doubtful.  So,
  156. there must be an as-yet undetermined agent causing this behavior.  Or, as
  157. Sir Arthur Conan Doyle would say, "The game is afoot." 
  158.  
  159. Let's start with the basics.  On this dichotic behavior (sometimes it 
  160. shows, sometimes it doesn't),  can you narrow it down to a specific device 
  161. type or group of devices?  IE, can you narrow it down to "just LAT" devices 
  162. or "just DECnet," etc?  Or does it happen on all terminal devices, 
  163. regardless of type (IE, does it equally affect TCP/IP, DECnet, and LAT)?
  164.  
  165. Does it affect only one system, all systems, or only a subset of systems?
  166. If only a subset, is there anything (such as software) which is common to 
  167. all of them, and them alone?
  168.  
  169. Here's a biggie:  Are you running any sort of custom or third-party
  170. software that requires CMKRNL privilege, and/or utilizes its own drivers
  171. and/or ACPs?  And, have you INSURED that the software is CERTIFIED for VMS
  172. v5.4?  In particular, any sort of terminal or security monitoring
  173. application that allows you to transcribe a terminal's dialogue, or to
  174. force keystrokes into the input buffer? 
  175.  
  176.  
  177. >#My motives: We have a captive account which we would like to monitor by 
  178. >#            writing the login time, and any server/remote port information 
  179.                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  180. >#            to a log file.  
  181. ># 
  182.  
  183. That's perfectly legimate.  Go for it! 
  184.  
  185. In reviewing your examples above, I saw you refer to "TTA0:".  Do you have
  186. hard-wired terminal devices on your system, in addition to network-abstracted
  187. terminals?  Is the problem limited only to your hard-wired terminals?  If so,
  188. then I think we've narrowed down the problem.
  189.  
  190.  
  191. >#I apologise for going a bit overboard with info about this problem, but I 
  192. >#would rather explain it fully to any potential comp.os.vms.know-it-alls
  193. >#who would flame me for lack of information  8-).
  194. >
  195. > [ Unwarranted reprimand deleted ]
  196. >
  197.  
  198. Don't apologize.  If anything, -you- are owed an apology for being unjustly
  199. "slimed" by other inhabitants of this newsgroup.
  200.  
  201. >
  202. >SET TERM/INQ in SYLOGIN is a reason for you to be shot, by the way...
  203. >
  204.  
  205. Huhh??  Earth to Ehud, Earth to Ehud, start breathing, Ehud.  You're 
  206. running out of oxygen...
  207.  
  208. Now, way back in VMS v3.x or v4.x, you -could- invoke a system crash by 
  209. having an unfortunately-placed SET TERM command in either your SYLOGIN or
  210. LOGIN procs, assuming you have LOG_IO privilege, and then submit a batch 
  211. job where you end up attempting to do a SET TERM to a disk drive.  The last 
  212. time I saw that problem was, ohh, nine or ten years ago.
  213.  
  214. More commonly, the SET TERM verb is not properly screened against executing 
  215. in detached or network jobs.  For example, let's say you did:
  216.  
  217.     $ Dir VAXEN::
  218.  
  219. and it aborts with an error saying "Path to network object lost."  In that 
  220. case, wait for the server process on the remote node to exit, and then look 
  221. at the NETSERVER.LOG file to see where in the DCL script the thing died at.
  222.  
  223. Usually, something on the order of:
  224.  
  225.     $ IF (F$MODE() .EQS. "INTERACTIVE")
  226.     $    THEN
  227.     $    SET CONTROL=(T,Y)
  228.     $    SET TERM /LINE/INSERT/INQUIRE
  229.     $    ENDIF
  230.     $!
  231.  
  232. is sufficient  (%^/)  (<-- My "don't-quit-your-day-job" face.  Sheesh..)
  233.  
  234.  
  235. >#Any help would be appreciated.
  236. >#Pete
  237. ># 
  238.  
  239. A tree is known by the fruit that it bears.  Even if it means having to
  240. endure the reproach of a few blowhards, -please- continue to ask us
  241. questions.  There's lots of us who are genuinely interested in using our
  242. skills to help others via the Internet.  Besides, in time you will learn 
  243. who the truely-gifted are, as opposed to those who can only parrot from the
  244. Online Doc Set (and who have to hide behind their flaming because they have
  245. nothing else to contribute).
  246.  
  247.  
  248. >#-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v^-v-^
  249. >#Pete Sabotka, Meteorology Dept.           sabotkap@woods.ulowell.edu
  250. >#University of Massachusetts - Lowell      "I lost a buttonhole..." S. Wright
  251. >#^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v-^-v^-v-^
  252. >
  253. >    Ehud
  254. >
  255. >--
  256. >Ehud Gavron        (EG76)     
  257. >gavron@vesta.sunquest.com
  258. >
  259.  
  260. --
  261. Bill Laut            Internet:  laut@alien.gici.com
  262. Gull Island Consultants, Inc.    Phone:     (616) 780-3321
  263. Muskegon, MI  49440        >> "Usual disclaimers, apply within" <<
  264.  
  265. "Your majesty, I have a message from God for you."    -- Judges 3:20
  266.  
  267.