home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 20238 < prev    next >
Encoding:
Internet Message Format  |  1993-01-03  |  8.4 KB

  1. Path: sparky!uunet!news.claremont.edu!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
  2. From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
  3. Newsgroups: comp.os.vms
  4. Subject: re: Re: HELP!!! Security problem for gurus. [Directories]
  5. Date: 3 Jan 1993 09:58:58 GMT
  6. Organization: HST Wide Field/Planetary Camera
  7. Lines: 141
  8. Distribution: world
  9. Message-ID: <1i6dd2INNrct@gap.caltech.edu>
  10. References: <9212290242.AA00964@uu3.psi.com>,<72764@cup.portal.com>
  11. Reply-To: carl@SOL1.GPS.CALTECH.EDU
  12. NNTP-Posting-Host: sol1.gps.caltech.edu
  13.  
  14. In article <72764@cup.portal.com>, Chris_F_Chiesa@cup.portal.com writes:
  15. =>Interesting.  The ODS-II specs, as best I can recall, define two possible
  16. =>entry types:  Files and links.  Files are what you would expect.  A link is
  17. =>a like a Unix "soft link":  A text string that replaces the file specifica-
  18. =>tion being parsed.  While specified way back when ODS-II was first designed
  19. =>(i.e., when VMS was designed), this feature has never been implemented.
  20. =
  21. =Being unfamiliar as I am with the specific behavior of "a Unix 'soft link',"
  22. =can you elaborate on the intended behavior of this interesting-sounding 
  23. =never-implemented feature?  I'm just wondering what we're missing out on.
  24.  
  25. OK.  A normal directory entry contains a file name and a file ID.  This allows
  26. directory lookups to find the file header.  It also means that the file must
  27. exist on the same disk (or at least in the same volume set) as the directory
  28. entry.  A link, on the other hand, consists of a file name and a string
  29. containing the *REAL* name of the file.  The real name is intended to include
  30. the device name.  So, for example, you could have a directory entry on DUA0
  31. that associated the name FOO.BAR in the directory [SOMETHING_OR_OTHER] with a
  32. file name like DUA1:[SPAM]SOME_OTHER.FILE_NAME.  Then, if you tried to open
  33. file DUA0:[SOMETHING_OR_OTHER]FOO.BAR, RMS (or the disk ACP) would
  34. transparently open the file DUA1:[SPAM]SOME_OTHER.FILE_NAME for you.
  35. =
  36. =Very interesting!  What's a "hashed" file type?  Again, can you elaborate?
  37. =This may be a loaded question, but: how does it happen that features can 
  38. =BE "spec'd but never implemented?"
  39.  
  40. A specification (either rather vague or quite specific) is written and,
  41. sometimes, fields allocated in data structures in order to allow for the future
  42. implementation of the feature.  A good example of this is file ACLs:  There was
  43. a somewhat general specification for them as early as 1978, and file headers
  44. had fields in them to allow the implementation of this feature, but it wasn't
  45. until VMS version 4 that it was actually implemented.
  46.  
  47. =What determines whether a particular
  48. =feature gets implemented right away, or after a long delay (how long has
  49. =ODS-II been in existence with spec'ed-but-never-implemented features?),
  50.  
  51. It's been in existence for something like 15 years now with such features.  How
  52. soon they're implemented depends on how important DEC considers the features. 
  53. I fear that links will never be implemented, since DEC has implemented volume
  54. sets and seems to believe that they're sufficient for dealing with directories
  55. that span volumes.
  56.  
  57. =or never?  And, finally, how do YOU find out about these things, Jerry?
  58. =Inquiring minds... etc. ;-)
  59.  
  60. I don't know how Jerry found out, but in my case, I had a disk that held
  61. important data that hadn't yet been backed up fail.  Someone connected an
  62. (unkeyed) cable upside-down, which caused the system to overwrite part of the
  63. disk when it tried to mount it.  In an effort to recover the data, I started
  64. reading through a specification of ODS-2 that my predecessor had lying around.
  65. Unfortunately, the day he photocopied the manual, the fuser on the photocopier
  66. was running at below the proper temperature, and the print was rubbing off the
  67. pages.  In order to guarantee that I'd have a legible copy next time I wanted
  68. one, I typed the whole thing into the computer.  In the process of trying to
  69. decipher the parts that were on the verge of illegibility, I learned more about
  70. ODS-II than I thought I'd ever want to know (ever wonder about the actual
  71. organization of an indexed file?).
  72. =>    I also found that if I put an INVALID value [...] into that field 
  73. =>    in the FIRST entry in the .DIR file [...] I was able to do a DIRECTORY
  74. =>    operation on the  directory represented by the patched .DIR file, but
  75. =>    was UNABLE to access any of the FILES THEMSELVES.  
  76. =>
  77. =>I believe DIRECTORY accesses the directory files directly, rather than going
  78. =>through RMS.  It probably doesn't check the validity of the entries it sees.
  79. =
  80. =It seems evident from what I've observed, that DIRECTORY doesn't (currently) 
  81. =validate at least the contents of the "type" field I played with -- but I'm
  82. =afraid I don't see how it makes any difference whether one "accesses the
  83. =directory files directly" OR "(goes) through RMS."
  84.  
  85. Ah, that's easy.  If you don't go through RMS, you're dealing with separately
  86. maintained code.  That means that some things RMS doesn't like might be
  87. perfectly acceptable to DIRECTORY.
  88.  
  89. =If I open "filespec.DIR"
  90. =as a FILE, I can read it just fine using RMS -or- "directly."  Do I mis-
  91. =understand you, Jerry?
  92.  
  93. I think so.  If you open filespec.DIR using RMS and read it, RMS will be happy
  94. to pass the information it gets to you, uninterpreted.  However, when you try
  95. to open a file that's IN [filespec], RMS tries to interpret it as a directory
  96. entry, and may not be happy with what it sees.  The (separately maintained)
  97. code in DIRECTORY might, however, be somewhat more forgiving.
  98.  
  99. =Didn't think of that.  I can count the number of times I've done an 
  100. =ANALYZE/DISK in my six-year VMS career (four of them as a system manager
  101. =of a very small system) on the fingers of one hand, and I don't think 
  102. =I've EVER used /REPAIR... 
  103.  
  104. If you're not doing a BACKUP/RESTORE every month, then you *SHOULD* be doing an
  105. ANALYZE/DISK/REPAIR that often.
  106.  
  107. =I remember seeing RMS bugs in the past that would delete the erring process
  108. =upon encountering certain errors in on-disk or file structure.  I was always
  109. =surprised to find such dramatic bugs in RMS, an otherwise extremely robust-
  110. =seeming entity...  
  111.  
  112. You shouldn't be surprised.  You see, RMS is also a *CRITICAL* entity.  If it
  113. runs across something that it doesn't understand, there are a few
  114. possibilities:
  115.     1)  The disk is corrupted;
  116.     2)  The user's address space is corrupted;
  117.     3)  The system address space  is corrupted;
  118.     4)  The system disk is corrupted.
  119.  
  120. Now, case 1 might not warrant a bugcheck.  Case 2 should, at the very least,
  121. result in process deletion;  Cases 3 and 4 both warrant a system crash before
  122. corrupted memory/system disk can do any more damage.  The idea is to have the
  123. system fail safe:  When in doubt, do whatever's most likely to insure the
  124. integrity of the system;  if that means getting the system manager's attention
  125. with a >>> prompt on the console, so be it.
  126.  
  127. =>Also, the future direction of VMS seems to be
  128. =>to forbid direct access to directory files (at least direct write access).
  129. =>You could find your modified directory entries completely inaccessible after
  130. =>the next upgrade!
  131. =
  132. =That's VERY interesting!  At what level of the system would this be imple-
  133. =mented?  Disk driver (mark certain media blocks /NOWRITE)?  $QIO-ACP inter-
  134. =face ("don't allow access to any file whose "I'm a directory" bit is set")?
  135. =Write-Logical-(or-Physical)-Block $QIO request?  Blocking directory-write
  136. =access at any level would pose difficulties and paradoxes.  For example,
  137. =RMS needs to be able to update directories, which would seem to preclude
  138. =blocking directory-writing at the driver or $QIO levels, but NOT blocking
  139. =such access at those levels would hardly prevent "illegal" modifications
  140. =in the intended manner, as simply bypassing RMS would be sufficient...
  141. =Ah well, some combination of access-mode and file-attribute check could
  142. =be applied that would at least make "illegal" modification MORE DIFFICULT 
  143. =than it is today.
  144.  
  145. Most likely, this would be done by implementing the access-mode checks that
  146. Jerry referred to as an umplemented feature earlier.
  147. --------------------------------------------------------------------------------
  148. Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL
  149.  
  150. Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
  151. understanding of astronomy is purely at the amateur level (or below).  So
  152. unless what I'm saying is directly related to VAX/VMS, don't hold me or my
  153. organization responsible for it.  If it IS related to VAX/VMS, you can try to
  154. hold me responsible for it, but my organization had nothing to do with it.
  155.