Changeset 2010
- Timestamp:
- 03/25/08 11:32:05 (8 months ago)
- Files:
-
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/custom/CPolicyRefresher.java (modified) (6 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/Linkage.java (modified) (3 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Component.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/IResource.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/SELinuxPolicy.java (modified) (45 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/Translator.java (deleted)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/CDSEditorActionConstants.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditor.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditorContextMenuProvider.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/custom/CPolicyRefresher.java
r2009 r2010 31 31 import com.tresys.framework.compiler.policy.IDomain; 32 32 import com.tresys.framework.compiler.policy.IPolicyVisitor; 33 import com.tresys.framework.compiler.policy.IResource; 33 34 import com.tresys.framework.compiler.policy.Policy; 34 35 import com.tresys.framework.compiler.policy.Resource; … … 67 68 { 68 69 IDomain domain = i_access.getDomain (); 69 Resource resource = (Resource)i_access.getResource ();70 IResource resource = i_access.getResource (); 70 71 71 72 for (Iterator rdefitr = i_access.GetAccessRdefs ().iterator (); rdefitr.hasNext (); ) … … 100 101 public void Visit(ControlResource i_resource) 101 102 { 102 //TODO::implement 103 String sCustomName = m_sPrefix + m_sModuleName + "_" + i_resource.getOutputName (); 104 boolean state = mKey.contains(sCustomName); 105 if (state) 106 i_resource.markCustomized(); 107 else 108 i_resource.removeCustomization(); 103 109 } 104 110 … … 115 121 public void Visit(Enter i_enter) 116 122 { 117 //TODO::implement 118 boolean state = mKey.contains(i_enter.getEndDomain().getOutputName()); 119 if( state ) 123 IDomain startDomain = i_enter.getStartDomain (); 124 Domain endDomain = i_enter.getEndDomain (); 125 EntrypointResource enter = i_enter.getEntryPoint (); 126 127 StringBuffer sCustomName = new StringBuffer (100); 128 sCustomName.append (m_sPrefix).append ("transition_").append (m_sModuleName).append ("_"); 129 sCustomName.append (startDomain.getOutputName ()).append ("_").append (endDomain.getOutputName ()); 130 sCustomName.append ("_").append (enter.getOutputName ()); 131 132 boolean state = mKey.contains(sCustomName.toString ()); 133 if (state) 120 134 i_enter.markCustomized(); 121 135 else … … 125 139 public void Visit(EntrypointResource point) 126 140 { 127 //TODO::implement128 boolean state = mKey.contains( point.getOutputName());129 if ( state)141 String sName = m_sPrefix + m_sModuleName + "_" + point.getOutputName(); 142 boolean state = mKey.contains(sName); 143 if (state) 130 144 point.markCustomized(); 131 145 else … … 171 185 } 172 186 173 public void Visit(UserDomain dom)187 public void Visit(UserDomain i_domain) 174 188 { 189 String sCustomName = m_sPrefix + m_sModuleName + "_" + i_domain.getOutputName (); 190 boolean state = mKey.contains(sCustomName); 191 if (state) 192 i_domain.markCustomized(); 193 else 194 i_domain.removeCustomization(); 175 195 } 176 196 } branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/Linkage.java
r1989 r2010 14 14 15 15 import java.io.IOException; 16 import java.io.PrintStream;17 16 import java.util.Collection; 18 17 import java.util.HashMap; … … 20 19 21 20 import com.tresys.framework.compiler.policy.Ability; 22 import com.tresys.framework.compiler.mls.MLSLevel;23 21 import com.tresys.framework.compiler.mls.MLSSupport; 24 22 import com.tresys.framework.compiler.policy.BaseDomain; 25 23 import com.tresys.framework.compiler.policy.BaseResource; 26 import com.tresys.framework.compiler.policy.Conditional;27 import com.tresys.framework.compiler.policy.IMLSSetting;28 24 29 25 /** … … 81 77 } 82 78 83 /**84 * This method should return a string that may perform some basic85 * policy initialization tasks. It will be called once before any86 * policy translation is performed.87 */88 public void InitPolicy(PrintStream ps, String moduleName)89 {90 ps.print("SEFramework_header(" + moduleName + ")\n");91 }92 93 /*94 * This method should return a string that may perform some basic95 * interface initialization tasks.96 */97 public void InitInterface(PrintStream ps)98 {99 ps.print("## <summary>SEFramework generated interface.</summary>\n");100 }101 102 /**103 * This method should return a string that may perform some basic104 * file context initialization tasks. It will be called once before any105 * translation is performed.106 */107 public void InitFileContext(PrintStream ps)108 {}109 110 /**111 * This method should return a string that may perform some basic112 * initialization tasks. It will be called once before any113 * translation is performed.114 */115 public void InitNetwork(PrintStream ps)116 {}117 118 /**119 * This takes a string (domain name) and returns120 * a string defining that domain relative to the underlying121 * policy.122 *123 * @param name Name of domain to define in underlying policy language.124 * @return String defining the domain in the underlying policy language.125 */126 public void MakeDomain(String name, PrintStream ps)127 {128 // TODO currently only allows the system to start our domains129 ps.print("SEFramework_domain(" + name + ")\n");130 }131 132 /**133 * This takes a string (resource name) and appends134 * a string defining that resource relative to the underlying135 * policy.136 *137 * @param name Name of resource to define in underlying policy language.138 * @return String defining the domain in the underlying policy language.139 */140 public void MakeResource(String name, PrintStream ps)141 {142 ps.print("SEFramework_resource(" + name + ")\n");143 }144 145 /**146 * This takes a string (entrypoint name) and returns147 * a string defining that entrypoint relative to the underlying148 * policy.149 *150 * @param name Name of ep to define in underlying policy language.151 * @return String defining the domain in the underlying policy language.152 */153 public void MakeEntrypoint(String name, PrintStream ps)154 {155 ps.print("SEFramework_entrypoint(" + name + ")\n");156 }157 158 /**159 * Assign a type to the file attribute.160 *161 * @param String type162 * @return Assignment statement163 */164 public void MakeFileType(String type, PrintStream ps)165 {166 ps.print("SEFramework_files_type(" + type + ")\n");167 }168 169 /**170 * Makes a file context entry for a directory171 *172 * @param path The path for the context entry.173 * @param con The context for the context entry.174 */175 public void MakeDirContext(String path, String con, IMLSSetting i_mls, PrintStream ps)176 {177 String sSensitivity = "s0";178 if (i_mls != null && m_MLSSupport != null)179 {180 MLSLevel level = m_MLSSupport.getLevel (i_mls.getMLSLabel ());181 if (level != null)182 sSensitivity = level.getRange ();183 }184 185 186 ps.print("SEFramework_dir_context(" + path + ", " + con + ", " + sSensitivity + ")\n");187 }188 189 /**190 * Makes a boolean in the base policy191 *192 * @param con The context for the context entry.193 */194 public void MakeBoolean(Conditional bool, PrintStream ps)195 {196 ps.print("bool " + bool.getName() + " " + bool.getDefaultState()197 + ";\n");198 ps.print("genfscon selinuxfs /boolean/" + bool.getName()199 + " system_u:object_r:" + bool.getType());200 }201 202 /**203 * Makes a file context entry204 *205 * @param path The path for the context entry.206 * @param con The context for the context entry.207 */208 public void MakeFileContext(String path, String con, IMLSSetting i_mls, PrintStream ps)209 {210 String sSensitivity = "s0";211 if (i_mls != null && m_MLSSupport != null)212 {213 MLSLevel level = m_MLSSupport.getLevel (i_mls.getMLSLabel ());214 if (level != null)215 sSensitivity = level.getRange ();216 }217 218 ps.print("SEFramework_file_context(" + path + ", " + con + ", " + sSensitivity + ")\n");219 }220 221 public void MakeUserDomain(String name, PrintStream ps)222 {223 ps.print("SEFramework_user_domain(" + name + ")\n");224 }225 226 public void CanReadBoolean(String domain, String boolType, PrintStream ps)227 {228 ps229 .print("SEFramework_read_boolean(" + domain + ", " + boolType230 + ")\n");231 }232 233 public void CanWriteBoolean(String domain, String boolType, PrintStream ps)234 {235 ps.print("SEFramework_set_boolean(" + domain + ", " + boolType + ")\n");236 }237 238 79 public void SetBaseResources(Collection newBaseResources) 239 80 { branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/Component.java
r2009 r2010 303 303 public String getOutputName () 304 304 { 305 return getName ().replaceAll("\\.", "_") ;305 return getName ().replaceAll("\\.", "_").replaceAll ("@", "_AT_"); 306 306 } 307 307 branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/IResource.java
r1825 r2010 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Date$ 7 8 |*| 8 9 |*| Simple interface to be able to group the various resource type classes in a common interface … … 22 23 public boolean IsDescendant (IDomain i_domain); 23 24 public String getName (); 25 public String getOutputName (); 24 26 public Domain getParent (); 25 27 branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/SELinuxPolicy.java
r2009 r2010 61 61 import com.tresys.framework.compiler.linkage.libselinuxjava.selinux; 62 62 import com.tresys.framework.compiler.linkage.libselinuxjava.selinuxConstants; 63 import com.tresys.framework.compiler.mls.MLSLevel; 63 64 import com.tresys.framework.compiler.policy.Ability; 64 65 import com.tresys.framework.compiler.policy.Access; … … 98 99 private final static String XML_PARAM_OPEN = "## <param name = "; 99 100 private final static String XML_PARAM_CLOSE = "## </param>"; 101 private final static String SINGLE_INDENT = "\t"; 100 102 101 103 public final static String CUSTOM_PREFIX = "cds_custom_"; … … 128 130 m_bGeneratePolicyTemplate = false; 129 131 130 if (fcFile != null && fcFile.exists())132 if (fcFile != null && fcFile.exists()) 131 133 { 132 134 selinux.framework_ignore_invalid_con(); … … 189 191 public void PreVisit (Policy i_policy) 190 192 { 191 m_linkage.InitInterface(m_bufferInterfaces); 192 m_bufferInterfaces.print("\n# SEFramework generated interface\n\n"); 193 194 195 m_bufferPolicy.print("# SEFramework policy output\n"); 196 m_linkage.InitPolicy(m_bufferPolicy, m_sModuleName); 193 InitInterface (m_bufferInterfaces, null); 194 m_bufferInterfaces.println("# SEFramework generated interface"); 195 m_bufferInterfaces.println (); 196 197 198 m_bufferPolicy.println ("# SEFramework policy output"); 199 InitPolicy(m_bufferPolicy, m_sModuleName, null); 197 200 m_bufferPolicy.print("# These types are generated by the framework for internal use\n"); 198 201 199 202 for (Iterator iter = i_policy.getFrameworkBooleans().values().iterator(); iter.hasNext(); ) 200 203 { 201 m_linkage.MakeBoolean((Conditional) iter.next(), m_bufferPolicy);204 MakeBoolean((Conditional) iter.next(), m_bufferPolicy, null); 202 205 } 203 206 } … … 235 238 outStream.println ("## Type of resource being customized"); 236 239 outStream.println (XML_PARAM_CLOSE); 237 outStream.println ();238 240 outStream.println ("template(`" + sCustomName + "',`"); 239 241 } 240 242 243 String sIndent = null; 241 244 if (m_bGeneratePolicyTemplate) 245 { 242 246 sType = "$1"; 247 sIndent = SINGLE_INDENT; 248 } 243 249 244 250 … … 254 260 else 255 261 { 256 m_linkage.MakeResource(sType, outStream);262 MakeResource(sType, outStream, sIndent); 257 263 258 264 if (rdef.GetSysResourceState (SystemResourceTypes.dir) != SysResourceState.No 259 265 || rdef.GetSysResourceState (SystemResourceTypes.file) != SysResourceState.No) 260 266 { 261 m_linkage.MakeFileType(sType, outStream);267 MakeFileType(sType, outStream, sIndent); 262 268 Domain currComp = i_resource.getParent (); 263 269 while (currComp != null) 264 270 { 265 m_linkage.MakeFileType(currComp.getType (), outStream);271 MakeFileType(currComp.getType (), outStream, sIndent); 266 272 currComp = currComp.getParent(); 267 273 } … … 294 300 outStream.println ("## Type for domain being customized"); 295 301 outStream.println (XML_PARAM_CLOSE); 296 outStream.println ();297 302 outStream.println ("template(`" + sCustomName + "',`"); 298 303 } 299 304 305 String sType = i_domain.getType (); 306 String sIndent = new String (); 307 if (m_bGeneratePolicyTemplate) 308 { 309 sType = "$1"; 310 sIndent = SINGLE_INDENT; 311 } 312 313 outStream.print (sIndent); 300 314 outStream.println("#Framework domain: " + i_domain.getName()); 301 315 … … 305 319 } 306 320 307 String sType = i_domain.getType ();308 if (m_bGeneratePolicyTemplate)309 sType = "$1";310 321 311 322 if (!m_bGeneratePolicyTemplate && i_domain.hasCustomization ()) … … 319 330 if (m_bGeneratePolicyTemplate || !i_domain.hasCustomization ()) 320 331 { 321 m_linkage.MakeDomain (sType, outStream);322 OutputAbilities (i_domain, outStream );323 } 324 325 if ( i_domain.GetChildren().isEmpty())332 MakeDomain (sType, outStream, sIndent); 333 OutputAbilities (i_domain, outStream, sIndent); 334 } 335 336 if ((m_bGeneratePolicyTemplate || !i_domain.hasCustomization ()) && i_domain.GetChildren().isEmpty()) 326 337 { 327 338 for (Iterator iter = i_domain.GetRdefs().values().iterator(); iter.hasNext(); ) … … 370 381 if (targParent == i_domain) 371 382 { 383 outStream.print (sIndent); 372 384 outStream.println ("framework_" + rdef.GetOutputName () + "_owner_resource(" + sSrcType + ", " + sRdefType + ")"); 373 385 // policyStream.print("allow " + srcParent.getType() + " " … … 379 391 if (srcParent.getType().equals (targParent.getType())) 380 392 { 393 outStream.print (sIndent); 381 394 outStream.println ("framework_" + rdef.GetOutputName () + "_owner_resource(" + sSrcType + ", self)"); 382 395 // policyStream.print("allow " + srcParent.getType() + " self:" + classAndPerms + ";\n"); … … 384 397 else 385 398 { 399 outStream.print (sIndent); 386 400 outStream.println ("framework_" + rdef.GetOutputName () + "_owner_resource(" + sSrcType + ", " + sTargType + ")"); 387 401 // policyStream.print("allow " + srcParent.getType() + " " + targParent.getType() + ":" + classAndPerms + ";\n"); … … 394 408 if (i_domain.GetChildren().size() > 0) 395 409 { 396 makeAllowsOnSelf(i_domain, rdef.getAccessAllResource(), outStream );410 makeAllowsOnSelf(i_domain, rdef.getAccessAllResource(), outStream, sIndent); 397 411 } 398 412 } … … 404 418 if (i_domain.GetChildren().size() == 0) 405 419 { 406 m_linkage.MakeFileType(i_domain.GetTypeWithDictionaryObject(rdef.GetName()), outStream);420 MakeFileType(i_domain.GetTypeWithDictionaryObject(rdef.GetName()), outStream, sIndent); 407 421 } 408 422 else 409 423 { 410 m_linkage.MakeFileType(i_domain.getType(), outStream);424 MakeFileType(i_domain.getType(), outStream, sIndent); 411 425 } 412 426 … … 414 428 while (currDom != null) 415 429 { 416 m_linkage.MakeFileType(currDom.getType(), outStream);430 MakeFileType(currDom.getType(), outStream, sIndent); 417 431 currDom = currDom.getParent(); 418 432 } … … 420 434 } 421 435 } 422 outStream.println("#End of Framework domain: " + i_domain.getName()); 436 437 438 if (m_bGeneratePolicyTemplate || !i_domain.hasCustomization ()) 439 { 440 outStream.print (sIndent); 441 outStream.println("#End of Framework domain: " + i_domain.getName()); 442 } 423 443 424 444 if (m_bGeneratePolicyTemplate) … … 457 477 } 458 478 479 480 IDomain endDomain = i_enter.getEndDomain (); 481 EntrypointResource enter = i_enter.getEntryPoint (); 482 483 String sStartType = startDomain.getType (); 484 String sEndType = endDomain.getType (); 485 String sEntryType = enter.getType (); 486 487 PrintStream outStream = m_bufferPolicy; 488 489 StringBuffer sCustomName = new StringBuffer (100); 490 sCustomName.append (CUSTOM_PREFIX).append ("transition_").append (m_sModuleName).append ("_"); 491 sCustomName.append (startDomain.getOutputName ()).append ("_").append (endDomain.getOutputName ()); 492 sCustomName.append ("_").append (enter.getOutputName ()); 493 494 if (m_bGeneratePolicyTemplate) 495 { 496 sStartType = "$1"; 497 sEndType = "$2"; 498 sEntryType = "$3"; 499 500 outStream = m_bufferInterfaces; 501 outStream.println (); 502 outStream.println (XML_START); 503 outStream.println (XML_SUMMARY_OPEN); 504 outStream.print ("## Customization for enter from domain: " + startDomain.getName () + " to: "); 505 outStream.println (endDomain.getName () + " through entry point : " + enter.getName()); 506 outStream.println (XML_SUMMARY_CLOSE); 507 outStream.print (XML_PARAM_OPEN); 508 outStream.println ("'start_domain'>"); 509 outStream.println ("## Source Domain type"); 510 outStream.println (XML_PARAM_CLOSE); 511 outStream.print (XML_PARAM_OPEN); 512 outStream.println ("'end_domain'>"); 513 outStream.println ("## Ending Domain Type"); 514 outStream.println (XML_PARAM_CLOSE); 515 outStream.print (XML_PARAM_OPEN); 516 outStream.println ("'entrypoint'>"); 517 outStream.println ("## Entry Point type"); 518 outStream.println (XML_PARAM_CLOSE); 519 outStream.println ("template(`" + sCustomName + "',`"); 520 } 521 522 String sIndent = ""; 523 if (m_bGeneratePolicyTemplate) 524 sIndent = SINGLE_INDENT; 525 459 526 for (Iterator itr = i_enter.GetEntryAccessDefns().iterator(); itr.hasNext(); ) 460 527 { 461 528 EntryAccessDefn entryDef = (EntryAccessDefn) itr.next(); 462 m_bufferPolicy.print("framework_enter_" + entryDef.getName () + "("); 463 m_bufferPolicy.print(i_enter.getStartDomain().getType() + ", "); 464 m_bufferPolicy.print(i_enter.getEndDomain().getType() + ", "); 465 m_bufferPolicy.println(i_enter.getEntryPoint().getType() + ")"); 529 if (m_bGeneratePolicyTemplate || !i_enter.hasCustomization ()) 530 { 531 outStream.print (sIndent); 532 outStream.print ("framework_enter_" + entryDef.getName () + "("); 533 outStream.print (sStartType + ", "); 534 outStream.print (sEndType + ", "); 535 outStream.println (sEntryType + ")"); 536 } 466 537 } 467 538 468 539 // only create type transition rules for non-decomposed domains 469 if (i_enter.getStartDomain().GetChildren().size() == 0540 if (i_enter.getStartDomain().GetChildren().size() == 0 470 541 && i_enter.getEndDomain().GetChildren().size() == 0) 471 542 { 472 m_bufferPolicy.print("type_transition " 473 + i_enter.getStartDomain().getType() + " " 474 + i_enter.getEntryPoint().getType() + ":process " 475 + i_enter.getEndDomain().getType() + ";\n"); 476 if(i_enter.getStartDomain() instanceof BaseDomain) 477 { 478 propogateRole(i_enter.getEndDomain(), ((BaseDomain) i_enter.getStartDomain()).getRole()); 543 if (m_bGeneratePolicyTemplate || !i_enter.hasCustomization ()) 544 { 545 outStream.print (sIndent); 546 outStream.println ("type_transition " 547 + sStartType + " " 548 + sEntryType + ":process " 549 + sEndType + ";"); 550 } 551 552 if (i_enter.getStartDomain() instanceof BaseDomain) 553 { 554 propogateRole (i_enter.getEndDomain(), ((BaseDomain) i_enter.getStartDomain()).getRole()); 479 555 } 480 else if(i_enter.getStartDomain() instanceof UserDomain) 481 { 482 propogateRole(i_enter.getEndDomain(), ((UserDomain) i_enter.getStartDomain()).getRole()); 483 } 484 } 485 556 else if (i_enter.getStartDomain() instanceof UserDomain) 557 { 558 propogateRole (i_enter.getEndDomain(), ((UserDomain) i_enter.getStartDomain()).getRole()); 559 } 560 } 561 562 if (!m_bGeneratePolicyTemplate && i_enter.hasCustomization ()) 563 { 564 outStream.print (sCustomName); 565 outStream.print ("("); 566 outStream.print (sStartType); 567 outStream.print (","); 568 outStream.print (sEndType); 569 outStream.print (","); 570 outStream.print (sEntryType); 571 outStream.println (")"); 572 } 573 574 if (m_bGeneratePolicyTemplate) 575 outStream.println ("')"); 576 486 577 if (i_enter.getStartDomain() instanceof BaseDomain) 487 578 { 488 m_bufferPolicy.println("\n')"); 489 } 490 491 if(isBoolean) 579 m_bufferPolicy.println (); 580 m_bufferPolicy.println ("')"); 581 } 582 583 if (isBoolean) 492 584 { 493 585 m_bufferPolicy.println ("}"); … … 499 591 PrintStream outStream = m_bufferPolicy; 500 592 501 String sCustomName = CUSTOM_PREFIX + m_sModuleName + i_entryPoint.getOutputName ();593 String sCustomName = CUSTOM_PREFIX + m_sModuleName + "_" + i_entryPoint.getOutputName (); 502 594 503 595 if (m_bGeneratePolicyTemplate) … … 513 605 outStream.println ("## Entrypoint Resource being customized"); 514 606 outStream.println (XML_PARAM_CLOSE); 515 outStream.print ("template(` '");607 outStream.print ("template(`"); 516 608 outStream.print (sCustomName); 517 609 outStream.println ("',`"); … … 519 611 520 612 String sType = i_entryPoint.getType (); 613 String sIndent = null; 521 614 if (m_bGeneratePolicyTemplate) 615 { 522 616 sType = "$1"; 617 sIndent = SINGLE_INDENT; 618 } 523 619 524 620 if (!m_bGeneratePolicyTemplate) … … 536 632 } 537 633 538 // this call obtains the actual definition of the type 539 m_linkage.MakeEntrypoint(sType, outStream); 540 m_linkage.MakeFileType(sType, outStream); 541 634 if (m_bGeneratePolicyTemplate || !i_entryPoint.hasCustomization ()) 635 { 636 // this call obtains the actual definition of the type 637 MakeEntrypoint(sType, outStream, sIndent); 638 MakeFileType(sType, outStream, sIndent); 639 } 640 542 641 if (m_bGeneratePolicyTemplate) 543 642 { … … 567 666 568 667 // This gets all global interface calls in the verb 569 callInterfaces(domain, i_access.GetInterfaces(), m_bufferPolicy );668 callInterfaces(domain, i_access.GetInterfaces(), m_bufferPolicy, null); 570 669 571 670 // for each AccessDefn associated with this AccessResource bundle … … 575 674 BaseAccessDefn axxDefn = (BaseAccessDefn) accessDefns.next(); 576 675 577 callInterfaces(domain, axxDefn.GetAllInterfaces().values(), m_bufferPolicy );676 callInterfaces(domain, axxDefn.GetAllInterfaces().values(), m_bufferPolicy, null); 578 677 579 678 // for each AccessTarget associated with this AccessDefn … … 587 686 { 588 687 case Target.self: 589 makeAllowsOnSelf(domain, axxTarget.GetPermVectors(), m_bufferPolicy );688 makeAllowsOnSelf(domain, axxTarget.GetPermVectors(), m_bufferPolicy, null); 590 689 break; 591 690 case Target.other_read: … … 606 705 { 607 706 Component entry = (Component) iter4.next(); 608 makeAllows(domain, entry, axxTarget.GetPermVectors(), m_bufferPolicy );707 makeAllows(domain, entry, axxTarget.GetPermVectors(), m_bufferPolicy, null); 609 708 } 610 709 } … … 648 747 Resource resource = (Resource) i_access.getResource (); 649 748 String sDomType = domain.getType (); 749 String sIndent = new String (); 650 750 if (m_bGeneratePolicyTemplate) 751 { 651 752 sDomType = "$1"; 753 sIndent = SINGLE_INDENT; 754 } 652 755 653 756 // for each AccessTarget associated with this AccessDefn … … 685 788 } 686 789 687 688 790 Collection accessDefns = i_access.GetAccessDefns (rdef); 689 791 for (Iterator axxDefs = accessDefns.iterator (); axxDefs.hasNext (); ) 690 691 { 692 AccessDefn axxDefn = (AccessDefn) axxDefs.next(); 693 AccessDefnGroup axxGroup = axxDefn.getAccessDefnGroup (); 694 695 StringBuffer templateName = new StringBuffer(90); 696 templateName.append("framework_"); 697 templateName.append(axxGroup.getRdef().GetOutputName ()).append("_"); 698 templateName.append(axxGroup.getName()).append("_"); 699 templateName.append(axxDefn.getName()); 700 701 if (!m_bGeneratePolicyTemplate && i_access.hasCustomization ()) 702 { 703 templateName = new StringBuffer(sCustomName); 704 } 705 templateName.append("(").append(sDomType).append(","); 706 String sResType = "$2"; 707 708 if (!m_bGeneratePolicyTemplate) 709 { 710 if (resource instanceof ControlResource) 711 { 712 sResType = ((ControlResource)resource).getType(); 713 } 714 else 715 { 716 sResType = resource.GetTypeWithDictionaryObject(axxDefn.getAccessDefnGroup().getRdef().GetName()); 717 } 718 } 719 templateName.append(sResType).append(")"); 720 outStream.println (templateName); 721 722 if (!(resource instanceof ControlResource)) 723 { 724 // Rdef rdef = axxDefn.getAccessDefnGroup ().getRdef (); 725 if (rdef.GetSysResourceState (SystemResourceTypes.file) != SysResourceState.No) 726 generateParentSearchPerms (i_access.getDomain (), resource, false, outStream); 727 &
