Changeset 1941

Show
Ignore:
Timestamp:
02/19/08 08:34:10 (9 months ago)
Author:
dsugar
Message:

add missing optional block

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/dictionary_changes/src/com/tresys/framework/compiler/translator/TranslatorSELinux.java

    r1940 r1941  
    299299                        m_bufferPolicy.println("\t')"); 
    300300                } 
    301                  
     301 
    302302                for (Iterator itr = i_enter.GetEntryAccessDefns().iterator(); itr.hasNext(); )  
    303303                { 
     
    326326                        } 
    327327                } 
    328          
     328 
    329329                if (i_enter.getStartDomain() instanceof BaseDomain) 
    330330                { 
    331331                        m_bufferPolicy.println("\n')"); 
    332332                } 
    333          
     333 
    334334                if(isBoolean) 
    335335                { 
     
    435435                m_bufferPolicy.println("# CDSFramework access (domain resource verb): " + i_access.toString().replace(Utility.DELIM, ' ')); 
    436436 
     437                IDomain domain = i_access.getDomain (); 
     438                if (domain instanceof BaseDomain) 
     439                { 
     440                        m_bufferPolicy.println ("optional_policy(`");  
     441                        m_bufferPolicy.println ("\tgen_require(`");  
     442                        m_bufferPolicy.println ("\t\ttype " + domain.getType() + ";");  
     443                        m_bufferPolicy.println ("\t\trole " + ((BaseDomain) domain).GetRole() + ";");  
     444                        m_bufferPolicy.println ("\t')"); 
     445                } 
     446 
    437447                // for each AccessTarget associated with this AccessDefn 
    438448                Collection accessDefns = i_access.GetAccessDefns(); 
     
    446456                        m_bufferPolicy.print(templateName + "(" + i_access.getDomain().getType() + ","); 
    447457                         
    448                         if(i_access.getResource() instanceof ControlResource)  
     458                        if (i_access.getResource() instanceof ControlResource)  
    449459                        { 
    450460                                m_bufferPolicy.println (((ControlResource)i_access.getResource()).getType() + ")"); 
     
    531541                                        m_bufferPolicy.println("\t\ttype " + sTarget + ";"); 
    532542                                        m_bufferPolicy.println("\t')"); 
     543 
    533544                                        m_bufferPolicy.println("\tfiletrans_pattern(" + sProcessType + ", " + sTarget  
    534545                                                + ", " + sResType + ", " + sObjClass + ");"); 
     546                                         
    535547                                        m_bufferPolicy.println("')"); 
    536548                                } 
    537549                        } 
    538550                } 
    539                  
    540                 if(isBoolean) 
     551 
     552                if (domain instanceof BaseDomain) 
     553                        m_bufferPolicy.println ("\n')"); 
     554 
     555                if (isBoolean) 
    541556                { 
    542557                        m_bufferPolicy.println ("}"); 
     
    546561        public void Visit (BaseDomain domain) 
    547562        { 
    548 /* 
    549                 m_bufferPolicy.print("optional_policy(`\n" +  
    550                         "\tgen_require(`\n" +  
    551                         "\t\ttype " + domain.getType() + ";\n" +  
    552                         "\t\trole " + domain.GetRole() + ";\n" +  
    553                         "\t')\n" + "\n')\n"); 
    554 */ 
     563                m_bufferPolicy.println("optional_policy(`");  
     564                m_bufferPolicy.println("\tgen_require(`");  
     565                m_bufferPolicy.println("\t\ttype " + domain.getType() + ";");   
     566                m_bufferPolicy.println("\t\trole " + domain.GetRole() + ";");  
     567                m_bufferPolicy.println("\t')");  
     568                 
     569                // anything here? 
     570                 
     571                m_bufferPolicy.println("\n')"); 
    555572        } 
    556573