Changeset 108

Show
Ignore:
Timestamp:
06/02/05 11:36:55 (4 years ago)
Author:
sshimko
Message:

-Constraint tests, compilation shell script, and random other changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/com/tresys/framework/policy/Domain.java

    r85 r108  
    1010package com.tresys.framework.policy; 
    1111 
    12 import java.util.Set
     12import java.util.*
    1313 
    1414import com.tresys.framework.dictionary.Verb; 
     
    2323 */ 
    2424public final class Domain extends ComponentWithFobjects{ 
     25        public List<Component> Children; 
     26         
    2527        /** 
    2628         * Default domain constructor. 
     
    3234        { 
    3335                super(n, verbSet); 
     36                Children = new LinkedList<Component>(); 
    3437        } 
    3538 
     
    4548                super(n, par, verbSet); 
    4649        } 
     50         
     51        /** 
     52         * Add a child component to this domain. 
     53         *  
     54         * @param child Child component 
     55         */ 
     56        public void AddChild(Component child){ 
     57                Children.add(child); 
     58        } 
    4759} 
  • trunk/src/com/tresys/framework/policy/PolicyParser.jj

    r107 r108  
    5252         * @param errmsg        Error message to display on stdout 
    5353         */ 
    54         static void ErrorGenerate (Token tok, String errmsg)
     54        static void ErrorGenerate (Token tok, String errmsg)
    5555                Config.Error("Line "+ tok.beginLine +  
    5656                                " Column " + tok.beginColumn); 
     
    6767         * @param errmsg        Error message to display on stdout 
    6868         */ 
    69         static void WarnGenerate ( Token tok, String errmsg )
     69        static void WarnGenerate ( Token tok, String errmsg )
    7070                Config.Warn("Line "+ tok.beginLine +  
    7171                                " Column " + tok.beginColumn ); 
     
    7979         * @param errmsg        Error message to display on stdout 
    8080         */ 
    81         static void ErrorGenerate (String errmsg)
     81        static void ErrorGenerate (String errmsg)
    8282                Config.Error(errmsg); 
    8383                had_error = true; 
     
    9090         *            Error message to display on stdout 
    9191         */ 
    92         static void WarnGenerate ( String errmsg )
     92        static void WarnGenerate ( String errmsg )
    9393                Config.Warn( errmsg ); 
    9494                had_warning = true; 
     
    146146                } 
    147147                 
    148                 if ( had_warning )
     148                if ( had_warning )
    149149                        Config.Warn("Policy parsed but warnings were generated!  " +  
    150150                                        "Generated policy may be erroneous.\n"); 
    151151                } 
    152152                 
    153                 if ( had_error )
     153                if ( had_error )
    154154                        System.out.println("Errors were generated!\n" + 
    155155                        "The policy will NOT be translated.  Please fix the errors and try again."); 
     
    268268        { 
    269269                // construct domain w/ parent reference 
    270                 if ((parentStr != "") && (parentStr != null))
     270                if ((parentStr != "") && (parentStr != null))
    271271                        // get parent domain 
    272272                        parent = genPolicy.Domains.get(parentStr); 
     
    274274                        // due to checks in the Parent() production that _should_ always  
    275275                        // succeed but just in case... 
    276                         if (parent == null)
     276                        if (parent == null)
    277277                                ErrorGenerate(tokDomainName, "A domain \""  
    278278                                                + parentStr +  "\" does not appear to be "  
     
    285285                        } 
    286286                // construct domain w/out parent 
    287                 } else if ( parentStr == "" )
     287                } else if ( parentStr == "" )
    288288                        domain = new Domain(tokDomainName.image, dictionary.Verbs); 
    289289                        Config.Debug("Domain created: " + tokDomainName.image); 
     
    301301        {  
    302302                if (domain != null) { 
    303                         if (genPolicy.Add(domain)){ 
     303                        if (genPolicy.Add(domain)) { 
     304                                if (domain.Parent != null) { 
     305                                        domain.Parent.AddChild(domain); 
     306                                } 
    304307                                Config.Debug("Domain added to policy: " + domain.Name); 
    305308                        } else { 
     
    328331        { 
    329332                // construct resource w/ parent reference 
    330                 if ((parentStr != "") && (parentStr != null))
     333                if ((parentStr != "") && (parentStr != null))
    331334                        // get parent domain 
    332335                        parent = genPolicy.Domains.get(parentStr); 
     
    334337                        // due to checks in the Parent() production that _should_ always  
    335338                        // succeed but just in case... 
    336                         if (parent == null)
     339                        if (parent == null)
    337340                                ErrorGenerate(tokResourceName, "A domain \""  
    338341                                                + parentStr +  "\" does not appear to be "  
     
    345348                        } 
    346349                // construct resource w/out parent 
    347                 } else if ( parentStr == "" )
     350                } else if ( parentStr == "" )
    348351                        resource = new Resource(tokResourceName.image, dictionary.Verbs); 
    349352                        Config.Debug("Resource created: " + tokResourceName.image); 
     
    362365        {  
    363366                if (resource != null) { 
    364                         if (genPolicy.Add(resource))
     367                        if (genPolicy.Add(resource))
    365368                                Config.Debug("Resource added to policy: " + resource.Name); 
     369                                if (resource.Parent != null) { 
     370                                        resource.Parent.AddChild(resource); 
     371                                } 
    366372                        } else { 
    367373                                WarnGenerate(tokResourceName, "Failed attempt to insert resource \""  
     
    389395        { 
    390396                // construct entrypoint w/ parent reference 
    391                 if ((parentStr != "") && (parentStr != null))
     397                if ((parentStr != "") && (parentStr != null))
    392398                        // get parent domain 
    393399                        parent = genPolicy.Domains.get(parentStr); 
     
    395401                        // due to checks in the Parent() production that _should_ always  
    396402                        // succeed but just in case... 
    397                         if (parent == null)
     403                        if (parent == null)
    398404                                ErrorGenerate(tokEntrypointName, "A domain \""  
    399405                                                + parentStr +  "\" does not appear to be "  
     
    406412                        } 
    407413                // construct entrypoint w/out parent 
    408                 } else if ( parentStr == "" )
     414                } else if ( parentStr == "" )
    409415                        entrypoint = new Entrypoint(tokEntrypointName.image, dictionary.entrypoint); 
    410416                        Config.Debug("Entrypoint created: " + tokEntrypointName.image); 
     
    420426        {  
    421427                if (entrypoint != null) { 
    422                         if (genPolicy.Add(entrypoint)){ 
     428                        if (genPolicy.Add(entrypoint)) { 
     429                                if (entrypoint.Parent != null) { 
     430                                        entrypoint.Parent.AddChild(entrypoint); 
     431                                } 
    423432                                Config.Debug("Entrypoint added to policy: " + entrypoint.Name); 
    424433                        } else { 
     
    458467        { 
    459468                // remove trailing "." 
    460                 if ( ancestors.length() > 0 )
     469                if ( ancestors.length() > 0 )
    461470                        ancestors.deleteCharAt(ancestors.length() - 1); 
    462471                        return ancestors.toString(); 
     
    489498                 
    490499                // control fobjects require special treatment (creation of control resources) 
    491                 if (tokAt != null)
     500                if (tokAt != null)
    492501                        fobject = dictionary.GetFobject(tokFobjName.image + tokAt.image); 
    493                         if (fobject != null)
     502                        if (fobject != null)
    494503                                // check constraint (parent associated w/ same fobject) then add 
    495504                                if ((domain.Parent != null) &&  
    496                                                 (!domain.Parent.GetFobjects().containsKey(fobject.Name)))
     505                                                (!domain.Parent.GetFobjects().containsKey(fobject.Name)))
    497506                                        ErrorGenerate(tokFobjName, "Constraint check failed in Fobject association: "  
    498507                                                        + fobject.Name + " --  Children can only be associated with a subset of "  
    499508                                                        + "the parent's Fobjects."); 
    500509                                } 
    501                                 else if (domain.AddFobject(fobject))
     510                                else if (domain.AddFobject(fobject))
    502511                                        Config.Debug("\tControl Fobject \"" + fobject.Name  
    503512                                                        + "\" added to domain \"" + domain.Name + "\"."); 
    504513                                        // create a control resource 
    505514                                        ControlResource conRes = new ControlResource(fobject.Name + domain.Name, dictionary.Verbs); 
    506                                         if (genPolicy.Add(conRes))
     515                                        if (genPolicy.Add(conRes))
    507516                                                Config.Debug("\tControl resource created: " + conRes.Name ); 
    508517                                        } else { 
     
    519528                } else { 
    520529                        fobject = dictionary.GetFobject(tokFobjName.image); 
    521                         if (fobject != null)
     530                        if (fobject != null)
    522531                                // check constraint (parent associated w/ same fobject) then add 
    523532                                if ((domain.Parent != null) &&  
    524                                                 (!domain.Parent.GetFobjects().containsKey(fobject.Name)))
     533                                                (!domain.Parent.GetFobjects().containsKey(fobject.Name)))
    525534                                        ErrorGenerate(tokFobjName, "Constraint check failed in Fobject association: "  
    526535                                                + fobject.Name + " --  Children can only be associated with a subset of "  
    527536                                                + "the parent's Fobjects."); 
    528                                 } else if (domain.AddFobject(fobject))
     537                                } else if (domain.AddFobject(fobject))
    529538                                        Config.Debug("\tFobject \"" + fobject.Name  
    530539                                                        + "\" added to domain " + domain.Name + "."); 
     
    555564        tokFobjName=<ID>{ 
    556565                fobject = dictionary.GetFobject(tokFobjName.image); 
    557                 if (fobject != null)
     566                if (fobject != null)
    558567                        // check constraint (parent associated w/ same fobject) then add 
    559568                        if ((resource.Parent != null) &&  
    560                                         (!resource.Parent.GetFobjects().containsKey(fobject.Name)))
     569                                        (!resource.Parent.GetFobjects().containsKey(fobject.Name)))
    561570                                ErrorGenerate(tokFobjName, "Constraint check failed in Fobject association: "  
    562571                                        + fobject.Name + " --  Children can only be associated with a subset of "  
    563572                                        + "the parent's Fobjects."); 
    564                         } else if (resource.AddFobject(fobject))
     573                        } else if (resource.AddFobject(fobject))
    565574                                Config.Debug("\tFobject \"" + fobject.Name  
    566575                                                + "\" added to domain " + resource.Name + "."); 
     
    599608                // verify verb 
    600609                verb = dictionary.GetVerb(tokVerbName.image); 
    601                 if (verb != null)
     610                if (verb != null)
    602611                        // if all if kopasetic create an access 
    603                         if ((domain != null) && (resource != null))
     612                        if ((domain != null) && (resource != null))
    604613                                access = new Access(domain, resource, verb); 
    605614                        }else { 
     
    632641                 * domain can only access resources at the same level or higher. 
    633642                 */   
    634                 if (resource.Parent != null)
     643                if (resource.Parent != null)
    635644                        // if the domain has a parent then the resource's parent must be a  
    636645                        //superset of the domain's parent   
    637646                        if ( (domain.Parent == null ) || 
    638                                 (!domain.Name.startsWith(resource.Parent.Name + ".")))
     647                                (!domain.Name.startsWith(resource.Parent.Name + ".")))
    639648                                ErrorGenerate(tokAccess,  
    640649                                                "Constraint violation!  Domain \""  + domain.Name  
     
    650659                 *  constraints). 
    651660                 */ 
    652                 if ((domain.Parent != null) && (resource.Parent != domain.Parent))
     661                if ((domain.Parent != null) && (resource.Parent != domain.Parent))
    653662                        /* 
    654663                         * if no access defined for this verb in parent 
     
    656665                         */ 
    657666                        if ((domain.Parent.Accesses.get(verb) == null) ||  
    658                                         (domain.Parent.Accesses.get(verb).get(resource) == null))
     667                                        (domain.Parent.Accesses.get(verb).get(resource) == null))
    659668                                ErrorGenerate(tokAccess,  
    660669                                        "Constraint violation!  Access must be defined "  
     
    663672                                return; 
    664673                        // if valid parent and verb access but not a correct subset 
    665                         } else if (!access.IsSubsetOf(domain.Parent.Accesses.get(verb).get(resource)))
     674                        } else if (!access.IsSubsetOf(domain.Parent.Accesses.get(verb).get(resource)))
    666675                                ErrorGenerate(tokAccess,  
    667676                                        "Constraint violation!  Must use subset of parent's access.");  
     
    672681                        } 
    673682                } 
    674                 if (genPolicy.Add(access))
     683                if (genPolicy.Add(access))
    675684                        // update graph links for information flow 
    676685                        domain.Accesses.get(verb).put(resource, access); 
     
    701710        AccessDefnEP axxDefnEP = null; 
    702711        String key; 
     712        String keyParent; 
    703713        LinkedList<Enter> list; 
     714        LinkedList<Enter> listParent; 
    704715} 
    705716{ 
     
    714725        { 
    715726                // tweak or choose default 
    716                 if (tokTweakName != null)
     727                if (tokTweakName != null)
    717728                        axxDefnEP = dictionary.entrypoint.GetAccessDefnEP(tokTweakName.image); 
    718729                } else { 
     
    721732                } 
    722733                 
    723                 if (axxDefnEP == null)
    724                         if (tokTweakName != null)
     734                if (axxDefnEP == null)
     735                        if (tokTweakName != null)
    725736                                ErrorGenerate(tokTweakName, "Invalid entrypoint access: "  
    726737                                        + tokTweakName.image); 
     
    737748                 * domain can only access entrypoints at the same level or higher. 
    738749                 */   
    739                 if (entrypoint.Parent != null)
     750                if (entrypoint.Parent != null)
    740751                        // if the domain has a parent then the resource's parent must be a  
    741752                        //superset of the domain's parent   
    742                         if ( (domainSrc.Parent == null ) || 
    743                                 (!domainSrc.Name.startsWith(entrypoint.Parent.Name + "."))){ 
     753                        if (domainSrc.Parent == null || 
     754                                !domainSrc.Name.startsWith(entrypoint.Parent.Name + ".")) 
     755                        { 
    744756                                ErrorGenerate(tokEntry,  
    745757                                                "Constraint violation!  Domain \""  + domainSrc.Name  
     
    747759                                                + "\" which is hidden inside of another domain."); 
    748760                                return; 
    749                         }else if ( (domainDest.Parent == null ) || 
    750                                         (!domainDest.Name.startsWith(entrypoint.Parent.Name + "."))){ 
     761                        } 
     762                        else if ( (domainDest.Parent == null ) || 
     763                                        (!domainDest.Name.startsWith(entrypoint.Parent.Name + "."))) 
     764                        { 
    751765                                ErrorGenerate(tokEntry,  
    752766                                                "Constraint violation!  Domain \""  + domainDest.Name  
     
    760774                key = domainSrc.toString() + Config.DELIM  
    761775                        + entrypoint.toString(); 
     776 
    762777                // pull list if already created 
    763778                list = genPolicy.Entries.get(key); 
    764779                 
    765780                /* 
    766                  *  
    767781                 * TODO: clean this mess up 
    768782                 */ 
    769                 if (list != null)
    770                         // no need to check if parent is null... null in list is impossible 
    771                         if (list.getLast().DomainEnd == domainDest.Parent)
     783                if (list != null)
     784                        // no need to check if domain dest. parent is null... null in list is impossible 
     785                        if (list.getLast().DomainEnd == domainDest.Parent)
    772786                                list.add(enter); 
    773                         } else
     787                        } else
    774788                                ErrorGenerate(tokEntry,  
    775789                                                "Constraint violation!  Parent domain of \""  + domainDest.Name  
     
    777791                                return; 
    778792                        } 
    779                 } else if (domainSrc.Parent != null){ 
    780                         ErrorGenerate(tokEntry,  
     793                // if the source domain has a parent 
     794                } else if (domainSrc.Parent != null) { 
     795                        keyParent = domainSrc.Parent.toString() + Config.DELIM  
     796                                + entrypoint.toString(); 
     797                        listParent = genPolicy.Entries.get(keyParent); 
     798                         
     799                        // if the entry has already been defined for the parent 
     800                        if (listParent != null || domainSrc.Parent == domainDest.Parent) { 
     801                                list = new LinkedList<Enter>(); 
     802                                list.add(enter); 
     803                        } else { 
     804                                ErrorGenerate(tokEntry,  
    781805                                        "Constraint violation!  Parent domain \""  + domainSrc.Parent.Name  
    782806                                        + "\" must enter domain \"" + domainDest.Name  
    783807                                        + "\" before its child \"" + domainSrc.SubName + "\"."); 
    784                         return; 
     808                                return; 
     809                        } 
    785810                // if we don't have a list then create one w/ no other constraint checks 
    786811                } else { 
     
    810835        { 
    811836                // domain w/ parent reference 
    812                 if ((domParentStr != "") && (domParentStr != null))
     837                if ((domParentStr != "") && (domParentStr != null))
    813838                        // retrieve domain 
    814839                        domain = genPolicy.Domains.get(domParentStr  
    815840                                        + "." + tokDomainName.image); 
    816841                         
    817                         if (domain == null)
     842                        if (domain == null)
    818843                                ErrorGenerate(tokDomainName, "The domain \""  
    819844                                                + domParentStr + "." + tokDomainName.image  
     
    824849                        } 
    825850                // domain w/out parent 
    826                 } else if ( domParentStr == "" )
     851                } else if ( domParentStr == "" )
    827852                        domain = genPolicy.Domains.get(tokDomainName.image); 
    828853                         
    829                         if (domain == null)
     854                        if (domain == null)
    830855                                ErrorGenerate(tokDomainName, "The domain \"" + tokDomainName.image   
    831856                                                +  "\" does not appear to be defined before use."); 
     
    876901        { 
    877902                // if this is a control resource 
    878                 if (tokAt != null)
     903                if (tokAt != null)
    879904                        /* 
    880905                         *  Parent() doesn't recognize a single domain w/ no "." 
    881906                         *  which is only possible in a control resource attached to a TLD 
    882907                         */ 
    883                         if (tokNoParent != null)
     908                        if (tokNoParent != null)
    884909                                resParentStr = tokNoParent.image; 
    885910                        } 
     
    889914                                        + tokAt.image + resParentStr); 
    890915                 
    891                         if (resource == null)
     916                        if (resource == null)
    892917                                ErrorGenerate(tokResourceName, "The control resource \""  
    893918                                                + tokResourceName.image + tokAt.image + resParentStr 
     
    898923                        } 
    899924                // resource w/ parent reference 
    900                 }else if ((resParentStr != "") && (resParentStr != null))
     925                }else if ((resParentStr != "") && (resParentStr != null))
    901926                        // get resource from policy 
    902927                        resource = genPolicy.Resources.get(resParentStr  
    903928                                        + "." + tokResourceName.image); 
    904929                 
    905                         if (resource == null)
     930                        if (resource == null)
    906931                                ErrorGenerate(tokResourceName, "The resource \""  
    907932                                                + resParentStr + "." + tokResourceName.image  
     
    912937                        } 
    913938                // domain w/out parent 
    914                 } else if ( resParentStr == "" )
     939                } else if ( resParentStr == "" )
    915940                        resource = genPolicy.Resources.get(tokResourceName.image); 
    916941                 
    917                         if (resource == null)
     942                        if (resource == null)
    918943                                ErrorGenerate(tokResourceName, "The resource \"" + tokResourceName.image 
    919944                                                + "\" does not appear to be defined before use."); 
     
    946971        { 
    947972                // domain w/ parent reference 
    948                 if ((domParentStr != "") && (domParentStr != null))
     973                if ((domParentStr != "") && (domParentStr != null))
    949974                        // retrieve domain 
    950975                        entrypoint = genPolicy.Entrypoints.get(domParentStr  
    951976                                        + "." + tokEPName.image); 
    952977                         
    953                         if (entrypoint == null)
     978                        if (entrypoint == null)
    954979                                ErrorGenerate(tokEPName, "The domain \""  
    955980                                                + domParentStr + "." + tokEPName.image  
     
    960985                        } 
    961986                // domain w/out parent 
    962                 } else if ( domParentStr == "" )
     987                } else if ( domParentStr == "" )
    963988                        entrypoint = genPolicy.Entrypoints.get(tokEPName.image); 
    964989                         
    965                         if (entrypoint == null)
     990                        if (entrypoint == null)
    966991                                ErrorGenerate(tokEPName, "The entrypoint \"" + tokEPName.image   
    967992                                                +  "\" does not appear to be defined before use in an enter statement."); 
     
    9941019                        return; 
    9951020                 
    996                 if (access.TweakAccess(tokFobjName.image, tokAccessName.image))
     1021                if (access.TweakAccess(tokFobjName.image, tokAccessName.image))
    9971022                        Config.Debug("\tAccess tweaked (Fobject Access): "  
    9981023                                        + tokFobjName.image + " " + tokAccessName.image); 
  • trunk/test/dictionary

    r105 r108  
    22verbs { read write }             
    33fobject dirFiles { 
    4 [desc: a directory full of files
     4[desc: "a directory full of files"
    55        all { 
    66                file { append create execute getattr ioctl link lock read rename setattr unlink write } 
     
    1010        read { 
    1111                default { 
    12                         [desc: default read access
     12                        [desc: "default read access"
    1313                        [flow: 9] 
    1414                        resource { 
     
    2121        write { 
    2222                default { 
    23                         [desc: default write access
     23                        [desc: "default write access"
    2424                        [flow: 9] 
    2525                        resource { 
     
    3030                } 
    3131                append { 
    32                         [desc: limited write that only allows append
     32                        [desc: "limited write that only allows append"
    3333                        [flow: 8] 
    3434                        resource { 
     
    3939                } 
    4040                delete { 
    41                         [desc: delete a file
     41                        [desc: "delete a file"
    4242                        [flow: 2] 
    4343                        resource { 
     
    5151 
    5252fobject namedPipes { 
    53 [desc: named pipe and the directory it lives in
     53[desc: "named pipe and the directory it lives in"
    5454        all { 
    5555                dir { add_name append create execute getattr ioctl link lock read remove_name rename reparent rmdir search setattr unlink write } 
     
    5858        read { 
    5959                default { 
    60                         [desc: default read access
     60                        [desc: "default read access"
    6161                        [flow: 9] 
    6262                        resource { 
     
    6868        write { 
    6969                default { 
    70                         [desc: default write access
     70                        [desc: "default write access"
    7171                        [flow: 9] 
    7272                        resource { 
     
    7979 
    8080fobject unixStreamSockets { 
    81 [desc: unix stream sockets with sockfiles and the directory they live in
     81[desc: "unix stream sockets with sockfiles and the directory they live in"
    8282        all { 
    8383                dir { add_name read remove_name search write } 
     
    8787        read { 
    8888                default { 
    89                         [desc: create sockfile, bind to socket, listen, and read socket
     89                        [desc: "create sockfile, bind to socket, listen, and read socket"
    9090                        [flow: 9] 
    9191                        resource { 
     
    100100        write { 
    101101                default { 
    102                         [desc: connect to and write to a socket
     102                        [desc: "connect to and write to a socket"
    103103                        [flow: 9] 
    104104                        resource { 
     
    117117 
    118118fobject tcpNetwork { 
    119 [desc: tcp network interface, including interface, node, and socket permissions
     119[desc: "tcp network interface, including interface, node, and socket permissions"
    120120        all { 
    121121                netif { tcp_recv tcp_send } 
     
    125125        read { 
    126126                default { 
    127                         [desc: read from a tcp socket
     127                        [desc: "read from a tcp socket"
    128128                        [flow: 9] 
    129129                        resource { 
     
    137137                } 
    138138                serverRead { 
    139                         [desc: bind, listen, accept, and read from a tcp socket
     139                        [desc: "bind, listen, accept, and read from a tcp socket"
    140140                        resource { 
    141141                                netif { tcp_recv tcp_send } 
     
    150150        write { 
    151151                default { 
    152                         [desc: connect and write to a tcp socket
     152                        [desc:" connect and write to a tcp socket"
    153153                        resource { 
    154154                                netif { tcp_recv tcp_send } 
     
    161161                } 
    162162                serverWrite { 
    163                         [desc: bind, listen, accept, and write to a tcp socket
     163                        [desc: "bind, listen, accept, and write to a tcp socket"
    164164                        resource { 
    165165                                netif { tcp_recv tcp_send } 
     
    176176#this is a test fobject to exercise the parsers ability to understand control fobjects and resources 
    177177fobject mqueues@ { 
     178[desc: "message queues control fobject"] 
    178179        all {  
    179180                msgq { enqueue create destroy }  
     
    182183        read { 
    183184                default { 
    184                         resource { 
    185                                 msgq { enqueue create destroy }  
    186                                 ipc { write destroy } 
    187                         } 
    188                 } 
    189         } 
    190         write { 
    191                 default { 
     185                [desc: "default message queue read access"] 
     186                        resource { 
     187                                msgq { enqueue create destroy }  
     188                                ipc { write destroy } 
     189                        } 
     190                } 
     191        } 
     192        write { 
     193                default { 
     194                [desc: "default message queue write access"] 
    192195                        resource { 
    193196                                msgq { enqueue create destroy }  
     
    200203#this is a test fobject to exercise the parsers ability to understand control fobjects and resources 
    201204fobject mqueues { 
     205[desc: "message queues control fobject"] 
    202206        all {  
    203207                msgq { enqueue create destroy }  
     
    206210        read { 
    207211                default { 
    208                         resource { 
    209                                 msgq { enqueue create destroy }  
    210                                 ipc { write destroy } 
    211                         } 
    212                 } 
    213         } 
    214         write { 
    215                 default { 
     212                [desc: "default message queue read access"] 
     213                        resource { 
     214                                msgq { enqueue create destroy }  
     215                                ipc { write destroy } 
     216                        } 
     217                } 
     218        } 
     219        write { 
     220                default { 
     221                        [desc: "default message queue read access"] 
    216222                        resource { 
    217223                                msgq { enqueue create destroy }  
     
    224230                         
    225231entrypoint { 
    226        [desc:"resource that is executed to enter a domain"] 
     232[desc:"resource that is executed to enter a domain"] 
    227233        default { 
    228234                start resource { 
  • trunk/test/policy

    r107 r108  
    33domain out; 
    44domain guard { namedPipes unixStreamSockets dirFiles }; 
    5  
    6 # TEST: entry constraint checking 
    7 domain in.test1; 
    8 domain out.test2; 
    9 entrypoint exec; 
    10 enter in out exec {test}; 
    11 enter in.test1 out.test2 exec; 
    12  
    13 # TEST: for domain accessing a hidden resource 
    14 #domain foo; 
    15 #domain fob {dirFiles}; 
    16 #resource fob.bar {dirFiles}; 
    17 #access foo fob.bar write; 
    18  
    19 # TEST: for exceeding permissions granted to the parent (PermVector fails subset test) 
    20 #domain foo; 
    21 #domain foo.bar; 
    22 #resource baz {dirFiles}; 
    23 #access foo baz write { dirFiles:append }; 
    24 #access foo.bar baz write; 
    255 
    266resource eth1 { tcpNetwork };