home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17502 < prev    next >
Encoding:
Internet Message Format  |  1992-11-05  |  5.9 KB

  1. Path: sparky!uunet!portal!cup.portal.com!Chris_F_Chiesa
  2. From: Chris_F_Chiesa@cup.portal.com
  3. Newsgroups: comp.os.vms
  4. Subject: Q: Homegrown COPY? FAQ?
  5. Message-ID: <68931@cup.portal.com>
  6. Date: Thu,  5 Nov 92 06:29:45 PDT
  7. Organization: The Portal System (TM)
  8. References: <1992Nov2.043637.29321@netcom.com> <bjVRf?se@twinsun.com>
  9. Lines: 93
  10.  
  11. Hi Gang...
  12.  
  13.   I'm getting embroiled in a programming project that I'm almost certain has 
  14. to be fairly common, if not actually a VMS FAQ.  Namely, writing something to
  15. emulate VMS COPY, with local extensions.  Has anybody done such a thing?  Is
  16. there anything available for FTP?  Anything on a DECUS tape?  If so, stop
  17. reading right here and write me mail.  If not, read on and I'll tell you what
  18. I've tried, why it doesn't satisfy me, and what I'm thinking of trying next,
  19. and THEN write me and tell me what I've overlooked or haven't thought of.
  20.  
  21.   Basically, I want to allow non-privileged users to copy files to which the
  22. existing baseline VMS protections/ACLs don't allow them access, subject to
  23. "permissions" "granted" by the owners of the files.  VMS protections/ACLs could
  24. probably do the job IF they could be made to take effect, and expire (and the
  25. corresponding ACL disappear from the file), at predetermined dates-and-times.) 
  26.  
  27.  
  28.   My current concept, still far from final, is a "privileged COPY.EXE" that can
  29. copy any file, but which refers to a database of "which files are copiable by
  30. holders of which identifiers during which time periods" in order to determine
  31. whether to go ahead and perform any given request.  A separate utility will
  32. manage the permission-granting database itself.  (I also face a number of
  33. problems in figuring out how to handle permission-specifications which include
  34. wildcards: do I resolve them into the list of files matching the spec at
  35. "permission granting time," or at "copy-attempt time?"  Either way I have to be
  36. able to take a copy-attempt file specification and search the database for any
  37. and all records, including individual and possibly-overlapping wildcard specs,
  38. which might permit a copy of that particular file.  I'm working with plain ol'
  39. indexed files (I don't know anything about the supposed bundled interface to
  40. Rdb -- is there info available?).)
  41.  
  42.   Ideally I'd like to tack my own copy-attempt-permitting-or-rejecting front
  43. end onto the existing VMS "COPY.EXE" image, and install the result with READALL
  44. privilege.  (I'm aware of the issues surrounding the writing of code to be
  45. installed with privileges; I've followed and downloaded the discussions here.)
  46. This would let me support all of COPY's file-selection qualifiers (/EXCLUDE, 
  47. /SINCE, /UNTIL, et al) without having to parse and process them myself.  A 
  48. posting here a couple of years ago gave the outlines of a technique for using 
  49. unsupported/undocumented system service $IMGACT to "merge another executable 
  50. image into your program's address space, and call that merged image as a 
  51. subroutine"; I believe the author and his company had put their own front ends
  52. onto DELETE, DIRECTORY, etc.  I've successfully used the described technique
  53. to merge one small "test" program into another and call it, but the program-
  54. being-merged must not contain statically-declared address data because those
  55. declared references apparently DON'T get fixed-up to account for the address
  56. where the merged image actually winds up.  (It appears that address references
  57. in executable code get fixed up, but references in declared data DON'T.  How
  58. does one get around that?  Declare one's data psect as position-independent
  59. when writing the original source code?  Hmmm.  How does the image activator 
  60. NORMALLY ensure that static declarations "actually point to where they
  61. should?" Anyway, when the image being merged is COPY.EXE, the call-as-a-
  62. subroutine fails because COPY contains static descriptor declarations that
  63. don't get fixed up properly.)  It's probably a good thing this DIDN'T work, 
  64. because if it DID I would be tempted to use it even though it's highly 
  65. unsupported.
  66.  
  67.   Barring use of actual COPY.EXE, I next thought I vaguely remembered a
  68. "LIB$COPY_FILE" RTL routine!  Yeah, right.  As you know, there is no such
  69. animal.  Digital recommends using callable CONVERT, which is a poor substitute
  70. for the functionality of the VMS COPY command: files actually "get converted,"
  71. which isn't always (in fact, in my case, usually ISN'T) a good thing, and you 
  72. can't use wildcard specifications at all.  I have my own reasons for preferring
  73. $QIO over RMS, too.  Callable CONVERT might be usable as a feeble, poor man's
  74. solution to my problem, but--- EEEEEEEEeeeeeeeewwwwwww....
  75.  
  76.   Some other solutions I've thought of but haven't tried yet:
  77.  
  78.   * Writing an in-house equivalent to the mythical LIB$COPY_FILE.  Would 
  79.     seem to involve declaring and copying an uncomfortably large number of
  80.     data structures, either RMS or QIO-ACP, to obtain and propagate file 
  81.     attributes information, even if I use $QIO to actually copy the file
  82.     contents.
  83.  
  84.   * Implementing my project as a client which communicates with a detached
  85.     server process running a DCL command procedure which verifies the client
  86.     commands and then issues actual VMS COPY commands.  Has the advantage
  87.     that it uses "real VMS COPY," and can therefore support the full normal
  88.     behavior of same.  Has the disadvantage that now I have to deal with 
  89.     security-of-interprocess-communication issues.  What's the most secure
  90.     way to have these things talk to each other?  Mailboxes?  Shared global
  91.     sections?  Lock manager?
  92.  
  93.   It is at this point that I solicit any and all suggestions or discussions
  94. from this newsgroup.  Tell me what I've overlooked, or what products or PD
  95. wares already exist, or which of my possible options is best (or how to make
  96. $IMGACT (I'm following the $IMGACT call with a call to $IMGFIX, btw; what 
  97. does $IMGFIX _do_, anyway?  It takes no arguments and seems to have no observ-
  98. able effect) fix up data references as nicely as it does code references!
  99.  
  100.   Thanks in advance,
  101.  
  102.     Chris Chiesa
  103.     Chris_F_Chiesa@cup.portal.com
  104.