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

  1. Xref: sparky comp.os.vms:20291 comp.lang.ada:3862
  2. Newsgroups: comp.os.vms,comp.lang.ada
  3. Path: sparky!uunet!gatech!rpi!usc!sdd.hp.com!elroy.jpl.nasa.gov!ames!saimiri.primate.wisc.edu!aplcen.apl.jhu.edu!ddsdx2.jhuapl.edu!dlc
  4. From: dlc@ddsdx2.jhuapl.edu (Dave Collard x7468)
  5. Subject: Re: VAX/VMS ACLs
  6. Message-ID: <1993Jan4.153639.7170@aplcen.apl.jhu.edu>
  7. Sender: news@aplcen.apl.jhu.edu (USENET News System)
  8. Organization: Johns Hopkins University
  9. References: <1993Jan4.042315.31541@iitmax.iit.edu>
  10. Distribution: usa
  11. Date: Mon, 4 Jan 93 15:36:39 GMT
  12. Lines: 44
  13.  
  14. In <1993Jan4.042315.31541@iitmax.iit.edu> LEDUC@MINNA.IIT.EDU (USERS) writes:
  15.  
  16. >I have the following program I am tring to set the
  17. >ACL on a file using system services. 
  18.  
  19. >with Condition_Handling;
  20. >with Lib;
  21. >with starlet;
  22. >with system;
  23. >procedure test is
  24. >   status : Condition_handling.Cond_Value_Type;
  25. >   ACL_List : Starlet.Item_List_Type (1..1);
  26. >   ACE_Entry: String (1..128);
  27. >   len : system.unsigned_word := 4;
  28. >begin
  29. >   Lib.Create_dir ( status => status,
  30. >            device_directory_spec => "[STUDENT.USERS.Z275.HELLO]" );
  31. >   Starlet.Parse_ACL ( status => status,
  32. >               aclstr => "(identifier=[users,leduc],access=" &
  33. >                "read+write+execute+delete+control)",
  34. >               aclent => ACE_Entry );
  35. >   ACL_List (1) := Starlet.Item_Rec_Type' (
  36. >        Buf_Len => len,
  37.  
  38. *** this is your problem.  the buf_len must be the length of the acl entry.  this is
  39.     in the first byte of the aclent.  so convert ace_entry(1) to an unsigned word and
  40.     use that value for buf_len. otherwise you will get a invalid access entry format error 
  41.  
  42. >        Item_Code => Starlet.ACL_C_ADDACLENT,
  43. >        Buf_Address => ACE_Entry'address,
  44. >        Ret_Address => System.Address_Zero );
  45.  
  46. *** your item list should also be terminated by a null item 
  47.     acl_list(2) := (0,0,system.address_zero,system.address_zero);  
  48.     if you don't do this, then will try to use the next area in memory
  49.     as another item, and *hopefully* you will get a bad parameter error.
  50.  
  51. >   Starlet.Change_ACL ( Status => Status,
  52. >            Objtyp => Starlet.ACL_C_FILE,
  53. >            Objnam => "[STUDENT.USERS.Z275]HELLO.DIR",
  54. >            Itmlst => ACL_List );
  55. >end test;
  56.  
  57.  
  58.