home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / vms / 12660 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  3.2 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!deccrl!news.crl.dec.com!news!nntpd.lkg.dec.com!Nephi.Enet.DEC.Com!coar
  2. From: coar@Nephi.Enet.DEC.Com (Rodent of Unusual Size)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: Am I in SYLOGIN?
  5. Summary: I use a bit in SITESPEC
  6. Keywords: one-time application, SYLOGIN, CTL$GL_SITESPEC
  7. Message-ID: <1992Jul22.181952.6698@nntpd.lkg.dec.com>
  8. Date: 22 Jul 92 19:00:31 GMT
  9. Sender: usenet@nntpd.lkg.dec.com (USENET News System)
  10. Distribution: comp
  11. Organization: Digital Equipment Corp.
  12. Lines: 58
  13. Organisation: Employed by (*NOT* speaker for) DEC, Boxborough, MA, U.S.A.
  14.  
  15.  
  16. In article <1992Jul22.113259.1@utxvms.cc.utexas.edu>, ccdk001@utxvms.cc.utexas.edu writes...
  17. >I have an installed privileged application that I want executed during the
  18. >login process, but I don't want users to be able to execute it directly.
  19. >It does "things" based on an assumed state of that process/environment at
  20. >that time particular time.  Allowing users to change their environment
  21. >(logical names, devices, etc.) and then rerunning this image could be
  22. >a problem in some instances.
  23.  
  24.     Well, this won't *quite* answer the question as asked, but..  how about a
  25.     method for a programme that only does its thing once, regardless of how
  26.     many times it's executed?
  27.  
  28.     I have a programme that is run twice during SYLOGIN on my systems.  Its
  29.     basic task is to boost the current priority (so the SYLOGIN runs quickly),
  30.     create a default diskquota and directory for the user, if necessary.  The
  31.     second and all subsequent times it is run, it merely sets the priority
  32.     back down to what it was at the first invocation.
  33.  
  34.     In a nutshell, it does a BBSS on an arbitrary bit in the CTL$GL_SITESPEC
  35.     longword.  The assumption made is that this cell is guaranteed zero on
  36.     process startup; this is a relatively safe assumption, though I'm not sure
  37.     it's documented.
  38.  
  39.     Details:
  40.  
  41.     In technical terms, it fetches the contents of cell CTL$GL_SITESPEC, and
  42.     checks a particular bit in it.  Then,
  43.  
  44.     o If is CLEAR, the programm:
  45.       - calls $GETJPI is called to get the current base priority
  46.       - calls $CMKRNL, and the kernel-mode routine
  47.         . saves the previous priority in a kernel-mode logical name in the
  48.           LNM$JOB table
  49.         . sets the bit in CTL$GL_SITESPEC
  50.       - exits from kernel mode, and uses $SETPRI to boost the priority
  51.       - creates the diskquota and SYS$LOGIN directory if necessary
  52.       - exits
  53.  
  54.     o If the bit is SET, the programm:
  55.       - translates the logical name mentioned above.  If it is not defined
  56.         in kernel mode, it is ignored, and the programme exits.  If it IS
  57.         defined in kernel mode, the equivalence name is fed to $SETPRI
  58.       - exits
  59.  
  60.     To do all its work, the programme needs to be installed with
  61.     (CMKRNL,ALTPRI,SYSPRV).  Subsets disable the related functionality
  62.     silently.
  63.  
  64. >David Barkelew                  Internet: barkelew@utxvms.cc.utexas.edu
  65.  
  66.     #ken    :-)}    Jeratol the Chaotic
  67.  
  68. Coar@Nephi.Enet.DEC.Com     | All opinions herein contained, stated or implied,
  69. Coar@DECUS.Org         | are solely those of the author.  And he's fullovem.
  70. Coar@Eisner.DECUS.Org     | `... it was mine art, ... that made gape the pine 
  71. Massachusetts, USA       | and let thee out.'  - Prospero (_The Tempest_)
  72.