DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e22bb2558⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Access_List_Tools, pragma Module_Name 4 3508, pragma Subsystem Os_Commands, seg_006436

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Simple_Status;
with Bounded_String;
with Directory;

with Machine;

package Access_List_Tools is

    subtype Name is String;  -- an object name

    subtype Access_Class is String;  -- of only the following characters:
    Read   : constant Character := 'R';  -- objects and worlds
    Write  : constant Character := 'W';  -- objects only
    Delete : constant Character := 'D';  -- worlds only; same bit as W
    Create : constant Character := 'C';  -- worlds only
    Owner  : constant Character := 'O';  -- worlds only


    -- An object string name is as defined by the directory
    -- package.  No wilcards are accepted;  each operation in this
    -- package operates on one object.

    subtype Acl is String;
    Max_Acl_Length : constant := 512;  -- max length for access list string
    -- The max size will not be exceeded when an Acl is returned.



    -- String representations of access lists have the following syntax:
    --  Acl       ::= Acl_Entry [',' Acl_Entry]*
    --  Acl_Entry ::= Group '=>' Access
    --  Group     ::= Identifier
    --  Access    ::= Acc_Type+
    --  Acc_Type  ::= 'R' | 'W' | 'D' | 'C' | 'O' |
    --                'r' | 'w' | 'd' | 'c' | 'o'
    --  Examples:  "Phil => R , TRW => rw",  "Public=>RCOD"

    Access_Tools_Error : exception;  -- Raised by functions

    function  Get (For_Object : Name)              return Acl;
    function  Get (For_Object : Directory.Version) return Acl;
    procedure Get (For_Object :        Name;
                   List       : out    Bounded_String.Variable_String;
                   Status     : in out Simple_Status.Condition);
    procedure Get (For_Object :        Directory.Version;
                   List       : out    Bounded_String.Variable_String;
                   Status     : in out Simple_Status.Condition);

    procedure Set (For_Object :        Name;
                   To_List    :        Acl;
                   Status     : in out Simple_Status.Condition);
    procedure Set (For_Object :        Directory.Version;
                   To_List    :        Acl;
                   Status     : in out Simple_Status.Condition);


    -- Get or Set the access list for the specified object.
    -- Setting the access list requires "Owner" access.
    -- function Get raises Access_Tools_Error if an error occurs.
    -- The procedure version should be called in that case to get the
    -- actual error information.
    -- ACL for world must be contain only R, C, O, or D access.  Others
    -- must be only R or W access.

    function Check (User_Name : String := "";
                    Object_Id : Directory.Version;
                    Desired   : Access_Class)   return Boolean;
    function Check (User_Name   : String := "";
                    Object_Name : String;
                    Desired     : Access_Class) return Boolean;
    function Check (User_Id   : Directory.Version;
                    Object_Id : Directory.Version;
                    Desired   : Access_Class)   return Boolean;
    function Check (Job       : Machine.Job_Id;
                    Object_Id : Directory.Version;
                    Desired   : Access_Class)   return Boolean;

    -- Check if the specified user has the indicated access to the
    -- specified object.  Only meaningful for Ada objects, Files, and Worlds.
    -- The null string for the User_Name parameter means the identity of
    -- the calling job.  If a user name is specified, the access control
    -- identity of that user (its member groups) is used for the test.
    -- If an error is detected during the test, the value false is returned.
    -- The most common errors are illegal values for Desired and references
    -- to objects that do not exist.  If an object that does not have an
    -- access list is referenced, the value true is returned.

    function  Get_Default (For_World : Name) return Acl;
    procedure Get_Default (For_World :        Name;
                           List      : out    Bounded_String.Variable_String;
                           Status    : in out Simple_Status.Condition);
    procedure Set_Default (For_World :        Name;
                           To_List   :        Acl;
                           Status    : in out Simple_Status.Condition);
    -- Get or set the default ACL for new objects created in the specified
    -- world.  The function raises the exception Access_Tools_Error if
    -- an error is detected.  The procedure version returns a status
    -- that indicates the cause of the error.


    procedure Check_Validity (For_List :        Acl;
                              Status   : in out Simple_Status.Condition);
    -- Check the validity of the specified access list.  Return status
    -- indicating that it is okay, or the error, if any.

    function Has_Operator_Capability return Boolean;
    -- Return true if the calling job has operator capability.  This is
    -- true if the job has an identity that includes the group
    -- "operator", is on the access list for "!machine.operator_capability",
    -- or is priviledged.

    function Normalize (Initial_Acl : Acl) return Acl;
    -- Scan the acl and eliminate any entries for groups that do
    -- not currently exist.  Return the revised acl.  If the
    -- acl is otherwise illegal, raise Access_Tools_Error.

    function Amend (Initial_Acl : Acl; New_Group : Name; Desired : Access_Class)
                   return Acl;
    -- Amend Initial_Acl so that New_Group is granted Desired access.  If
    -- necessary, the right-most acl entry is removed to do this.
    -- Raise Access_Tools_Error if any parameter is illegal.


    pragma Subsystem (Os_Commands);
    pragma Module_Name (4, 3508);

end Access_List_Tools;

E3 Meta Data

    nblk1=a
    nid=0
    hdr6=14
        [0x00] rec0=1f rec1=00 rec2=01 rec3=01c
        [0x01] rec0=00 rec1=00 rec2=0a rec3=008
        [0x02] rec0=15 rec1=00 rec2=02 rec3=030
        [0x03] rec0=00 rec1=00 rec2=09 rec3=01e
        [0x04] rec0=15 rec1=00 rec2=03 rec3=02a
        [0x05] rec0=00 rec1=00 rec2=08 rec3=004
        [0x06] rec0=11 rec1=00 rec2=04 rec3=026
        [0x07] rec0=00 rec1=00 rec2=07 rec3=00a
        [0x08] rec0=12 rec1=00 rec2=05 rec3=070
        [0x09] rec0=15 rec1=00 rec2=06 rec3=000
    tail 0x21701b02e81bf822d4181 0x42a00088462065003