Changeset 1989
- Timestamp:
- 03/10/08 09:24:37 (9 months ago)
- Files:
-
- branches/custome_policy/framework-plugin/.options (modified) (1 diff)
- branches/custome_policy/framework-plugin/.settings/org.eclipse.jdt.ui.prefs (modified) (1 diff)
- branches/custome_policy/framework-plugin/META-INF/MANIFEST.MF (modified) (1 diff)
- branches/custome_policy/framework-plugin/libselinuxjava (deleted)
- branches/custome_policy/framework-plugin/plugin.properties (modified) (1 diff)
- branches/custome_policy/framework-plugin/plugin.xml (modified) (3 diffs)
- branches/custome_policy/framework-plugin/resources/build/Makefile (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/cdsframework.spt (modified) (2 diffs, 1 prop)
- branches/custome_policy/framework-plugin/resources/conf/framework_mls.xml (copied) (copied from trunk/framework-plugin/resources/conf/framework_mls.xml)
- branches/custome_policy/framework-plugin/resources/conf/selinux-policy.spec (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/dictionary/dictionary.fdic (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/MLSReadAllLevels.flnk (copied) (copied from trunk/framework-plugin/resources/link/MLSReadAllLevels.flnk)
- branches/custome_policy/framework-plugin/resources/link/MLSWriteAllLevels.flnk (copied) (copied from trunk/framework-plugin/resources/link/MLSWriteAllLevels.flnk)
- branches/custome_policy/framework-plugin/resources/link/etc_files.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/eth0.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/eth1.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/exec_bin.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/init.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/locale.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/read_all_files.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/root_d.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/run_x.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/unconfined.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/user.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/resources/link/write_log_file.flnk (modified) (1 prop)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/Compiler.java (modified) (6 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/ErrorHandler.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/PolicyGenerator.java (modified) (6 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/Linkage.java (modified) (19 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/flnkage/FLNKParser.jj (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/mls/MLSLevel.java (modified) (7 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/mls/MLSSupport.java (modified) (18 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/BaseDomain.java (modified) (5 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/ComponentWithDictObjects.java (modified) (5 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/EntrypointResource.java (modified) (9 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/IDomain.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/IMLSSetting.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/compiler/policy/IMLSSetting.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/PolicyParser.jj (modified) (17 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/PolicyValidator.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/policy/UserDomain.java (modified) (7 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/systemResources/DirResource.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/systemResources/FileResource.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/systemResources/SystemResource.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/SELinuxDictionary.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/SELinuxPolicy.java (modified) (17 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/translator/Translator.java (modified) (6 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/FrameworkNature.java (modified) (14 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/GUIErrorHandler.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/Messages.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/builder/Messages.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/SELinuxSystem.java (modified) (8 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/builder/messages.properties (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/builder/messages.properties)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/BaseDomainDataItem.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/BaseDomainRolePart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/linkage/FLNKGenerator.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditor.java (modified) (8 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/figure/PolicyComponentFigure.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/ControlResourceShape.java (modified) (6 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/DefaultMLSLevelUpdateVisitor.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/DefaultMLSLevelUpdateVisitor.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/DomainShape.java (modified) (9 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/EntryPointShape.java (modified) (9 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Messages.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/ModelElement.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/ResourceShape.java (modified) (7 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/Shape.java (modified) (8 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/UserDomainShape.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/model/messages.properties (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AbstractConnectionEditPart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AccessEditPart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ControlResourceEditPart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EditPartLocator.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EditPartLocator.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EntryEditPart.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/IEditPartVisitor.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/IEditPartVisitor.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerEditPart.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyDiagramEditPart.java (modified) (4 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java (modified) (7 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ShapeEditPart.java (modified) (5 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/editor/properties/ColorSelectorCellEditor.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/editor/properties/ColorSelectorCellEditor.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/AddAbilityResolution.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/AddAbilityResolution.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/PolicyMarkerResolutionGenerator.java (modified) (13 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSEclipseLevel.java (modified) (5 diffs, 1 prop)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSOrderingViewerComparator.java (copied) (copied from trunk/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSOrderingViewerComparator.java)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/MLSSettingsProjProperties.java (modified) (5 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/Messages.java (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/SEFPreferencePage.java (modified) (1 diff)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/preferences/messages.properties (modified) (2 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/wizards/NewProjectPage.java (modified) (9 diffs)
- branches/custome_policy/framework-plugin/src/com/tresys/framework/plugin/wizards/NewProjectWizard.java (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/custome_policy/framework-plugin/.options
r1764 r1989 9 9 com.tresys.cdsframework/debug/navigator=false 10 10 com.tresys.cdsframework/debug/graphiceditor=false 11 com.tresys.cdsframework/debug/accesschecks=false branches/custome_policy/framework-plugin/.settings/org.eclipse.jdt.ui.prefs
r1763 r1989 1 # Wed Nov 21 11:46:43 EST 20071 #Mon Mar 03 14:34:58 EST 2008 2 2 eclipse.preferences.version=1 3 3 formatter_profile=_Project Format branches/custome_policy/framework-plugin/META-INF/MANIFEST.MF
r1924 r1989 19 19 org.eclipse.help, 20 20 com.tresys.cdsframework.libselinuxjava, 21 com.tresys.slide;bundle-version="1.3. 7",21 com.tresys.slide;bundle-version="1.3.9", 22 22 com.tresys.cdsframework.doc.user;resolution:=optional, 23 23 com.tresys.setools;bundle-version="3.3.2.1", branches/custome_policy/framework-plugin/plugin.properties
r1987 r1989 44 44 ## builder 45 45 frameworkBuilder = CDS Framework Builder 46 AccessCheckBuilder = Access Check Builder 46 47 47 48 ## plugin Preferences branches/custome_policy/framework-plugin/plugin.xml
r1987 r1989 62 62 </editor> 63 63 </extension> 64 <extension 65 id="AccessCheckBuilder" 66 name="%AccessCheckBuilder" 67 point="org.eclipse.core.resources.builders"> 68 <builder 69 callOnEmptyDelta="false" 70 hasNature="false" 71 isConfigurable="false"> 72 <run 73 class="com.tresys.framework.plugin.builder.AccessCheckBuilder"> 74 </run> 75 </builder> 76 </extension> 64 77 65 78 <extension … … 67 80 name="%frameworkBuilder" 68 81 point="org.eclipse.core.resources.builders"> 69 <builder hasNature="true"> 82 <builder 83 hasNature="true" 84 isConfigurable="false"> 70 85 <run class="com.tresys.framework.plugin.builder.FrameworkBuilder"/> 71 86 </builder> … … 82 97 <requires-nature id="com.tresys.slide.SystemProjectNature"/> 83 98 <requires-nature id="com.tresys.slide.SLIDEProject"/> 99 <builder 100 id="com.tresys.framework.AccessCheckBuilder"> 101 </builder> 84 102 </extension> 85 103 branches/custome_policy/framework-plugin/resources/build/Makefile
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/cdsframework.spt
- Property svn:keywords set to Date Author Id Revision
r1949 r1989 1 # 2 # Support macros for CDS Framework 3 # 4 # Copyright (C) 2005-2008 Tresys Technology, LLC 5 # License: refer to COPYING file for license information. 6 # Authors: Spencer Shimko <sshimko@tresys.com> 7 # James Athey <jathey@tresys.com> 8 # Brian Williams <bwilliams@tresys.com> 9 # Dave Sugar <dsugar@tresys.com> 10 # 11 # $Rev$ 12 # $Date$ 13 # 14 1 15 define(`SEFramework_header',` 2 16 policy_module($1,1.0) … … 24 38 25 39 define(`SEFramework_dir_context',` 26 $1(/.*)? gen_context(system_u:object_r:$2, s0)40 $1(/.*)? gen_context(system_u:object_r:$2,$3) 27 41 ') 28 42 29 43 define(`SEFramework_file_context',` 30 $1 -- gen_context(system_u:object_r:$2, s0)44 $1 -- gen_context(system_u:object_r:$2,$3) 31 45 ') 32 46 branches/custome_policy/framework-plugin/resources/conf/selinux-policy.spec
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/dictionary/dictionary.fdic
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/etc_files.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/eth0.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/eth1.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/exec_bin.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/init.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/locale.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/read_all_files.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/root_d.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/run_x.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/unconfined.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/user.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/resources/link/write_log_file.flnk
- Property svn:keywords set to Date Author Id Revision
branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/Compiler.java
r1949 r1989 5 5 * James Athey <jathey@tresys.com> 6 6 * Brian Williams <bwilliams@tresys.com> 7 * Dave Sugar <dsugar@tresys.com> 7 8 * 8 9 * Compiler: Compiler main … … 25 26 import com.tresys.framework.compiler.dictionary.DictionaryValidator; 26 27 import com.tresys.framework.compiler.linkage.Linkage; 28 import com.tresys.framework.compiler.mls.MLSInitializationException; 29 import com.tresys.framework.compiler.mls.MLSSupport; 27 30 import com.tresys.framework.compiler.policy.Policy; 28 31 import com.tresys.framework.compiler.policy.PolicyValidator; … … 57 60 58 61 static String dictionarySupportFile = null; 62 63 static String mlsFilename = null; 59 64 60 65 static String libPath = System.getProperty ("user.dir") + "/libselinuxjava/libselinuxjava.so"; … … 155 160 } 156 161 } 157 else if (args[x].equals ("-s")) 162 else if (args[x].equals ("-m")) 163 { 164 x++; 165 if (x < args.length) 166 { 167 mlsFilename = args[x]; 168 } 169 else 170 { 171 printUsage (); 172 System.exit (1); 173 } 174 } 175 else if(args[x].equals("-s")) 158 176 { 159 177 x++; … … 307 325 System.out.println (" -if <interface file> specify interface file for linkage to reference policy"); 308 326 System.out.println (" and exposing an external API (defaults to stdout if not specified)"); 327 System.out.println (" -m <mls file> specify mls inforation file for linkage to translate MLS labels"); 328 System.out.println (" into real sensitivities (defaults to s0 for all if not specified)"); 309 329 System.out.println (); 310 330 System.out.println ("A dictionary file must be specified."); … … 337 357 Utility.SetProjectErrorHandler (new CLIProjectErrorHandler ()); 338 358 359 MLSSupport mlsSupport = null; 360 try 361 { 362 if (mlsFilename != null) 363 { 364 if (debug) 365 System.out.println ("load MLS file: " + mlsFilename); 366 File mlsFile = new File (mlsFilename); 367 if (!mlsFile.exists ()) 368 System.err.println ("Specified MLS file not found: " + mlsFilename); 369 else 370 mlsSupport = new MLSSupport (mlsFile); 371 372 } 373 } 374 catch (MLSInitializationException mie) 375 { 376 System.err.println ("Error initializing MLS information from: " + mlsFilename); 377 System.err.println (" Reason: " + mie.getMessage ()); 378 if (debug) 379 mie.printStackTrace (System.out); 380 mlsSupport = null; 381 } 382 339 383 // create linkage interface depending on compilation targets 340 linkage = new Linkage (flaskPath);384 linkage = new Linkage(flaskPath, mlsSupport); 341 385 342 386 // attempt to create Dictionary branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/ErrorHandler.java
r1949 r1989 39 39 static final public int ERROR_UNABLE_TO_GET_TYPE_FROM_PATH = 30; 40 40 41 41 static final public int ERROR_TE_ACCESS_DENIED = 31; 42 static final public int ERROR_CONSTRAINT_ACCESS_DENIED = 32; 43 static final public int ERROR_RBAC_ACCESS_DENIED = 33; 44 42 45 protected int warningCount = 0; 43 46 … … 52 55 { 53 56 return errorCount; 57 } 58 59 public void resetErrorCounts () 60 { 61 warningCount = 0; 62 errorCount = 0; 54 63 } 55 64 branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/PolicyGenerator.java
r1949 r1989 22 22 import com.tresys.framework.compiler.linkage.flnkage.BaseAccessDefn; 23 23 import com.tresys.framework.compiler.policy.Ability; 24 import com.tresys.framework.compiler.mls.MLSLevel; 24 25 import com.tresys.framework.compiler.policy.AccessBaseResource; 25 26 import com.tresys.framework.compiler.policy.AccessBoolean; … … 33 34 import com.tresys.framework.compiler.policy.Enter; 34 35 import com.tresys.framework.compiler.policy.EntrypointResource; 36 import com.tresys.framework.compiler.policy.IMLSSetting; 35 37 import com.tresys.framework.compiler.policy.IPolicyVisitor; 36 38 import com.tresys.framework.compiler.policy.Policy; … … 73 75 buf.append(" }"); 74 76 } 77 78 appendMLSLevel (buf, i_resource); 79 75 80 buf.append(";"); 76 81 buf.append(newLine); … … 115 120 buf.append("}"); 116 121 } 122 123 appendMLSLevel (buf, i_domain); 124 117 125 buf.append(";"); 118 126 buf.append(newLine); … … 125 133 StringBuffer buf = new StringBuffer(); 126 134 127 buf.append("entrypoint " + i_ep.getName() + ";"); 135 buf.append("entrypoint "); 136 buf.append(i_ep.getName()); 137 138 appendMLSLevel (buf, i_ep); 139 140 buf.append(";"); 128 141 buf.append(newLine); 129 142 … … 399 412 return fullResult.toString(); 400 413 } 414 415 private void appendMLSLevel (StringBuffer i_buf, IMLSSetting i_mlsLevel) 416 { 417 if (i_mlsLevel == null) 418 return; 419 420 MLSLevel mlsLevel = i_mlsLevel.getMLSLevel (); 421 if (mlsLevel == null) 422 return; 423 424 i_buf.append (" \""); 425 i_buf.append (mlsLevel.getName ()); 426 i_buf.append ('"'); 427 } 401 428 } branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/Linkage.java
r1949 r1989 6 6 * 7 7 * Linkage.java: Contains linkage class for framework->t.e. conversion 8 * Version: @version@ 8 * 9 * $Rev$ 10 * $Date$ 9 11 */ 10 12 … … 18 20 19 21 import com.tresys.framework.compiler.policy.Ability; 22 import com.tresys.framework.compiler.mls.MLSLevel; 23 import com.tresys.framework.compiler.mls.MLSSupport; 20 24 import com.tresys.framework.compiler.policy.BaseDomain; 21 25 import com.tresys.framework.compiler.policy.BaseResource; 22 26 import com.tresys.framework.compiler.policy.Conditional; 27 import com.tresys.framework.compiler.policy.IMLSSetting; 23 28 24 29 /** … … 28 33 * separation was done to aide in policy version independence. 29 34 */ 30 public final class Linkage { 35 public final class Linkage 36 { 31 37 32 38 /** delimiter that separates rdef names from id's in type names */ … … 46 52 47 53 private final BasePolicy BasePolicy; 48 54 private final MLSSupport m_MLSSupport; 55 56 49 57 /** 50 58 * Linkage to base policy. … … 54 62 * @throws Exception If memory allocation fails 55 63 */ 56 public Linkage (String flaskPath)64 public Linkage (String flaskPath, MLSSupport i_support) 57 65 { 58 66 BasePolicy = new BasePolicy(flaskPath); … … 60 68 availableBaseResources = new HashMap/*<String, BaseResource>*/(); 61 69 capabilities = new HashMap(); 70 m_MLSSupport = i_support; 62 71 } 63 72 … … 67 76 } 68 77 78 public MLSSupport getMLSSupport () 79 { 80 return m_MLSSupport; 81 } 82 69 83 /** 70 84 * This method should return a string that may perform some basic … … 72 86 * policy translation is performed. 73 87 */ 74 public void InitPolicy(PrintStream ps, String moduleName) { 88 public void InitPolicy(PrintStream ps, String moduleName) 89 { 75 90 ps.print("SEFramework_header(" + moduleName + ")\n"); 76 91 } … … 80 95 * interface initialization tasks. 81 96 */ 82 public void InitInterface(PrintStream ps) { 97 public void InitInterface(PrintStream ps) 98 { 83 99 ps.print("## <summary>SEFramework generated interface.</summary>\n"); 84 100 } … … 89 105 * translation is performed. 90 106 */ 91 public void InitFileContext(PrintStream ps) {} 107 public void InitFileContext(PrintStream ps) 108 {} 92 109 93 110 /** … … 96 113 * translation is performed. 97 114 */ 98 public void InitNetwork(PrintStream ps) {} 115 public void InitNetwork(PrintStream ps) 116 {} 99 117 100 118 /** … … 106 124 * @return String defining the domain in the underlying policy language. 107 125 */ 108 public void MakeDomain(String name, PrintStream ps) { 126 public void MakeDomain(String name, PrintStream ps) 127 { 109 128 // TODO currently only allows the system to start our domains 110 129 ps.print("SEFramework_domain(" + name + ")\n"); … … 119 138 * @return String defining the domain in the underlying policy language. 120 139 */ 121 public void MakeResource(String name, PrintStream ps) { 140 public void MakeResource(String name, PrintStream ps) 141 { 122 142 ps.print("SEFramework_resource(" + name + ")\n"); 123 143 } … … 131 151 * @return String defining the domain in the underlying policy language. 132 152 */ 133 public void MakeEntrypoint(String name, PrintStream ps) { 153 public void MakeEntrypoint(String name, PrintStream ps) 154 { 134 155 ps.print("SEFramework_entrypoint(" + name + ")\n"); 135 156 } … … 141 162 * @return Assignment statement 142 163 */ 143 public void MakeFileType(String type, PrintStream ps) { 164 public void MakeFileType(String type, PrintStream ps) 165 { 144 166 ps.print("SEFramework_files_type(" + type + ")\n"); 145 167 } … … 151 173 * @param con The context for the context entry. 152 174 */ 153 public void MakeDirContext(String path, String con, PrintStream ps) { 154 ps.print("SEFramework_dir_context(" + path + ", " + con + ")\n"); 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"); 155 187 } 156 188 … … 160 192 * @param con The context for the context entry. 161 193 */ 162 public void MakeBoolean(Conditional bool, PrintStream ps) { 194 public void MakeBoolean(Conditional bool, PrintStream ps) 195 { 163 196 ps.print("bool " + bool.getName() + " " + bool.getDefaultState() 164 197 + ";\n"); … … 173 206 * @param con The context for the context entry. 174 207 */ 175 public void MakeFileContext(String path, String con, PrintStream ps) { 176 ps.print("SEFramework_file_context(" + path + ", " + con + ")\n"); 177 } 178 179 public void MakeUserDomain(String name, PrintStream ps) { 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 { 180 223 ps.print("SEFramework_user_domain(" + name + ")\n"); 181 224 } 182 225 183 public void CanReadBoolean(String domain, String boolType, PrintStream ps) { 226 public void CanReadBoolean(String domain, String boolType, PrintStream ps) 227 { 184 228 ps 185 229 .print("SEFramework_read_boolean(" + domain + ", " + boolType … … 187 231 } 188 232 189 public void CanWriteBoolean(String domain, String boolType, PrintStream ps) { 233 public void CanWriteBoolean(String domain, String boolType, PrintStream ps) 234 { 190 235 ps.print("SEFramework_set_boolean(" + domain + ", " + boolType + ")\n"); 191 236 } branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/linkage/flnkage/FLNKParser.jj
r1949 r1989 414 414 <SEMICOLON> 415 415 { 416 domain. SetType(type.image);416 domain.setType(type.image); 417 417 Utility.Debug("Type " + type.image + " added to BaseDomain " + domain.getName()); 418 418 } … … 429 429 role = <ID> 430 430 { 431 domain. SetRole(role.image);431 domain.setRole(role.image); 432 432 } 433 433 <SEMICOLON> branches/custome_policy/framework-plugin/src/com/tresys/framework/compiler/mls/MLSLevel.java
r1915 r1989 23 23 import org.w3c.dom.Document; 24 24 import org.w3c.dom.Element; 25 import org.w3c.dom.NamedNodeMap; 26 import org.w3c.dom.Node; 25 27 26 28 /** … … 32 34 * 33 35 */ 34 public class MLSLevel 36 public class MLSLevel 35 37 { 38 private static final String COLOR_ATTRIBUTE_NAME = "color"; 39 40 public static final String EMPTY_STRING = new String (); 41 42 private static final String LEVEL_ELEMENT_NAME = "level"; 43 44 private static final String NAME_ATTRIBUTE_NAME = "name"; 45 46 private static final String ORDER_ATTRIBUTE_NAME = "order"; 47
