Changeset 1940
- Timestamp:
- 02/18/08 15:23:31
(9 months ago)
- Author:
- dsugar
- Message:
added some needed linkage files for my testing
some cleanup
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1939 |
r1940 |
|
| 225 | 225 | } |
|---|
| 226 | 226 | write { |
|---|
| 227 | | default { create write } |
|---|
| | 227 | default { write } |
|---|
| 228 | 228 | write |
|---|
| 229 | 229 | [desc: "Write to a named pipe"] |
|---|
| r1769 |
r1940 |
|
| 1 | | baseresource etc_files { |
|---|
| 2 | | read { |
|---|
| | 1 | baseresource etc_files |
|---|
| | 2 | { |
|---|
| | 3 | read |
|---|
| | 4 | { |
|---|
| 3 | 5 | default { read } |
|---|
| 4 | 6 | read |
|---|
| r1265 |
r1940 |
|
| 1 | 1 | ability read_all_files |
|---|
| 2 | | [ desc: "Read all files"] |
|---|
| | 2 | [ desc: "Read all files"] |
|---|
| 3 | 3 | { |
|---|
| 4 | 4 | files_read_all_files($) |
|---|
| r1718 |
r1940 |
|
| 1 | | basedomain unconfined { |
|---|
| | 1 | basedomain unconfined |
|---|
| | 2 | [desc : "Access to the unconfined domain - only available in targeted"] |
|---|
| | 3 | { |
|---|
| 2 | 4 | type unconfined_t; |
|---|
| 3 | 5 | role system_r; |
|---|
| r1263 |
r1940 |
|
| 1 | | basedomain user { |
|---|
| | 1 | basedomain user |
|---|
| | 2 | [desc: "reference generic user"] |
|---|
| | 3 | { |
|---|
| 2 | 4 | type user_t; |
|---|
| 3 | 5 | role user_r; |
|---|
| r1938 |
r1940 |
|
| 21 | 21 | public final static int other_write = 3; |
|---|
| 22 | 22 | public final static int other_readwrite = 4; |
|---|
| 23 | | |
|---|
| 24 | 23 | |
|---|
| 25 | 24 | public final static String TARGET_SELF = "self"; |
|---|
| r1939 |
r1940 |
|
| 452 | 452 | else |
|---|
| 453 | 453 | { |
|---|
| 454 | | m_bufferPolicy.println (((Resource)i_access.getResource()).GetTypeWithDictionaryObject(axxDefn.getAccessDefnGroup().getRdef().GetName()) + ")"); |
|---|
| | 454 | Resource resource = (Resource) i_access.getResource (); |
|---|
| | 455 | |
|---|
| | 456 | m_bufferPolicy.println ((resource).GetTypeWithDictionaryObject(axxDefn.getAccessDefnGroup().getRdef().GetName()) + ")"); |
|---|
| | 457 | generateParentSearchPerms (i_access.getDomain (), resource, m_bufferPolicy); |
|---|
| 455 | 458 | } |
|---|
| 456 | 459 | |
|---|
| … | … | |
| 528 | 531 | m_bufferPolicy.println("\t\ttype " + sTarget + ";"); |
|---|
| 529 | 532 | m_bufferPolicy.println("\t')"); |
|---|
| 530 | | m_bufferPolicy.println("\tfiletrans_add_pattern(" + sProcessType + ", " + sTarget |
|---|
| | 533 | m_bufferPolicy.println("\tfiletrans_pattern(" + sProcessType + ", " + sTarget |
|---|
| 531 | 534 | + ", " + sResType + ", " + sObjClass + ");"); |
|---|
| 532 | 535 | m_bufferPolicy.println("')"); |
|---|
| … | … | |
| 621 | 624 | return; |
|---|
| 622 | 625 | |
|---|
| 623 | | Iterator itr2 = systemResources.iterator(); |
|---|
| 624 | | while(itr2.hasNext()) |
|---|
| | 626 | for (Iterator itr2 = systemResources.iterator(); itr2.hasNext(); ) |
|---|
| 625 | 627 | { |
|---|
| 626 | 628 | SystemResource sr = (SystemResource) itr2.next(); |
|---|
| … | … | |
| 709 | 711 | private void makeAllows(IDomain source, Component target, Map permVectors, PrintStream policyStream) |
|---|
| 710 | 712 | { |
|---|
| 711 | | Iterator permList = permVectors.entrySet().iterator(); |
|---|
| 712 | | while(permList.hasNext()) |
|---|
| | 713 | for (Iterator permList = permVectors.entrySet().iterator(); permList.hasNext(); ) |
|---|
| 713 | 714 | { |
|---|
| 714 | 715 | Map.Entry vector = (Map.Entry) permList.next(); |
|---|
| 715 | 716 | |
|---|
| 716 | 717 | String classAndPerms = vector.getKey() + " { "; |
|---|
| 717 | | Iterator perms = ((PermVector) vector.getValue()).getPermissions().iterator(); |
|---|
| 718 | | while(perms.hasNext()) |
|---|
| | 718 | for (Iterator perms = ((PermVector) vector.getValue()).getPermissions().iterator(); perms.hasNext(); ) |
|---|
| 719 | 719 | { |
|---|
| 720 | 720 | classAndPerms += (String) perms.next() + " "; |
|---|
| r1885 |
r1940 |
|
| 11 | 11 | package com.tresys.framework.plugin.wizards.shape; |
|---|
| 12 | 12 | |
|---|
| 13 | | import java.util.Iterator; |
|---|
| 14 | | import java.util.Vector; |
|---|
| 15 | | |
|---|
| | 13 | import org.eclipse.jface.viewers.ArrayContentProvider; |
|---|
| | 14 | import org.eclipse.jface.viewers.ComboViewer; |
|---|
| | 15 | import org.eclipse.jface.viewers.ISelection; |
|---|
| | 16 | import org.eclipse.jface.viewers.ISelectionChangedListener; |
|---|
| | 17 | import org.eclipse.jface.viewers.IStructuredSelection; |
|---|
| | 18 | import org.eclipse.jface.viewers.SelectionChangedEvent; |
|---|
| 16 | 19 | import org.eclipse.jface.wizard.WizardPage; |
|---|
| 17 | 20 | import org.eclipse.osgi.util.NLS; |
|---|
| 18 | 21 | import org.eclipse.swt.SWT; |
|---|
| 19 | | import org.eclipse.swt.events.ModifyEvent; |
|---|
| 20 | | import org.eclipse.swt.events.ModifyListener; |
|---|
| 21 | 22 | import org.eclipse.swt.layout.GridData; |
|---|
| 22 | 23 | import org.eclipse.swt.layout.GridLayout; |
|---|
| 23 | | import org.eclipse.swt.widgets.Combo; |
|---|
| 24 | 24 | import org.eclipse.swt.widgets.Composite; |
|---|
| 25 | 25 | import org.eclipse.swt.widgets.Label; |
|---|
| 26 | 26 | |
|---|
| | 27 | import com.tresys.framework.compiler.dictionary.INameValue; |
|---|
| | 28 | import com.tresys.framework.compiler.dictionary.NameValuePair; |
|---|
| 27 | 29 | import com.tresys.framework.compiler.policy.Component; |
|---|
| 28 | 30 | import com.tresys.framework.plugin.editor.policy.graphic.model.IBaseShape; |
|---|
| … | … | |
| 31 | 33 | extends WizardPage |
|---|
| 32 | 34 | { |
|---|
| 33 | | private Combo m_combo; |
|---|
| | 35 | private ComboViewer m_combo; |
|---|
| 34 | 36 | private IBaseShape m_shape; |
|---|
| | 37 | protected Label m_description; |
|---|
| 35 | 38 | |
|---|
| 36 | | private ModifyListener m_modifyText = new ModifyListener() |
|---|
| 37 | | { |
|---|
| 38 | | public void modifyText(ModifyEvent e) |
|---|
| 39 | | { |
|---|
| 40 | | DialogChanged(); |
|---|
| 41 | | } |
|---|
| 42 | | }; |
|---|
| 43 | 39 | |
|---|
| 44 | 40 | public BaseItemPropertyPage(IBaseShape i_shape) |
|---|
| … | … | |
| 52 | 48 | { |
|---|
| 53 | 49 | Composite composite = new Composite(parent, SWT.NONE); |
|---|
| 54 | | GridLayout layout = new GridLayout(); |
|---|
| 55 | | composite.setLayout(layout); |
|---|
| 56 | | layout.numColumns = 2; |
|---|
| 57 | | layout.verticalSpacing = 7; |
|---|
| 58 | | |
|---|
| 59 | | //Setting up entrypoint drop-down menu |
|---|
| 60 | | Label label = new Label(composite, SWT.NULL); |
|---|
| 61 | | label.setText(NLS.bind(Messages.BasePropertyPage_item_label, m_shape.getType())); |
|---|
| 62 | | |
|---|
| 63 | | GridData data = new GridData(); |
|---|
| 64 | | data.widthHint = 150; |
|---|
| 65 | | m_combo = new Combo (composite, SWT.DROP_DOWN | SWT.READ_ONLY); |
|---|
| 66 | | |
|---|
| 67 | | //Get the base domains for the drop-down menu |
|---|
| 68 | | Vector items = m_shape.getAvailableBaseItems(); |
|---|
| 69 | | |
|---|
| 70 | | int i = 0; |
|---|
| 71 | | for (Iterator iter = items.iterator(); iter.hasNext(); i++) |
|---|
| 72 | 50 | { |
|---|
| 73 | | Component item = (Component) iter.next (); |
|---|
| 74 | | m_combo.add (item.getName()); |
|---|
| 75 | | m_combo.setData(item.getName(), item); |
|---|
| 76 | | |
|---|
| 77 | | if (m_shape.getComponent().getName().equals(item.getName())) |
|---|
| 78 | | m_combo.select(i); |
|---|
| | 51 | GridLayout layout = new GridLayout(); |
|---|
| | 52 | composite.setLayout(layout); |
|---|
| | 53 | layout.numColumns = 2; |
|---|
| | 54 | layout.verticalSpacing = 7; |
|---|
| 79 | 55 | } |
|---|
| 80 | 56 | |
|---|
| 81 | | m_combo.setLayoutData(data); |
|---|
| 82 | | m_combo.addModifyListener(m_modifyText); |
|---|
| | 57 | //Setting up base resource drop-down menu |
|---|
| | 58 | { |
|---|
| | 59 | Label label = new Label(composite, SWT.NULL); |
|---|
| | 60 | label.setText(NLS.bind(Messages.BasePropertyPage_item_label, m_shape.getType())); |
|---|
| | 61 | } |
|---|
| | 62 | |
|---|
| | 63 | { |
|---|
| | 64 | m_combo = new ComboViewer (composite, SWT.DROP_DOWN | SWT.READ_ONLY); |
|---|
| | 65 | m_combo.setContentProvider (new ArrayContentProvider ()); |
|---|
| | 66 | m_combo.addSelectionChangedListener (new ChangeListener ()); |
|---|
| | 67 | |
|---|
| | 68 | GridData data = new GridData(); |
|---|
| | 69 | data.widthHint = 150; |
|---|
| | 70 | m_combo.getCombo ().setLayoutData(data); |
|---|
| | 71 | |
|---|
| | 72 | //Get the base items for the drop-down menu |
|---|
| | 73 | m_combo.setInput (m_shape.getAvailableBaseItems ()); |
|---|
| | 74 | } |
|---|
| | 75 | |
|---|
| | 76 | |
|---|
| | 77 | { |
|---|
| | 78 | GridData layoutData = new GridData (); |
|---|
| | 79 | layoutData.horizontalSpan = 2; |
|---|
| | 80 | layoutData.widthHint = 300; |
|---|
| | 81 | |
|---|
| | 82 | m_description = new Label (composite, SWT.NONE); |
|---|
| | 83 | m_description.setLayoutData (layoutData); |
|---|
| | 84 | } |
|---|
| 83 | 85 | |
|---|
| 84 | 86 | setControl(composite); |
|---|
| … | … | |
| 86 | 88 | } |
|---|
| 87 | 89 | |
|---|
| | 90 | protected class ChangeListener |
|---|
| | 91 | implements ISelectionChangedListener |
|---|
| | 92 | { |
|---|
| | 93 | public void selectionChanged (SelectionChangedEvent event) |
|---|
| | 94 | { |
|---|
| | 95 | IStructuredSelection selection = (IStructuredSelection) event.getSelection (); |
|---|
| | 96 | String sDescription = new String (); |
|---|
| | 97 | if (selection != null) |
|---|
| | 98 | { |
|---|
| | 99 | Component selected = (Component) selection.getFirstElement (); |
|---|
| | 100 | if (selected instanceof INameValue) |
|---|
| | 101 | { |
|---|
| | 102 | NameValuePair nvp = ((INameValue) selected).GetNameValuePair (INameValue.DESCRIPTION); |
|---|
| | 103 | if (nvp != null) |
|---|
| | 104 | sDescription = nvp.GetValue ().toString (); |
|---|
| | 105 | } |
|---|
| | 106 | } |
|---|
| | 107 | |
|---|
| | 108 | m_description.setText (sDescription); |
|---|
| | 109 | DialogChanged (); |
|---|
| | 110 | } |
|---|
| | 111 | } |
|---|
| | 112 | |
|---|
| 88 | 113 | //Get the BaseDomain selected from the drop-down menu |
|---|
| 89 | 114 | public Component getSelection () |
|---|
| 90 | 115 | { |
|---|
| 91 | | int nSelected = m_combo.getSelectionIndex(); |
|---|
| 92 | | |
|---|
| 93 | | if (nSelected < 0) |
|---|
| | 116 | ISelection selection = m_combo.getSelection (); |
|---|
| | 117 | if (selection instanceof IStructuredSelection) |
|---|
| 94 | 118 | { |
|---|
| 95 | | return null; |
|---|
| | 119 | return (Component) ((IStructuredSelection) selection).getFirstElement (); |
|---|
| 96 | 120 | } |
|---|
| 97 | | |
|---|
| 98 | | return (Component) m_combo.getData(m_combo.getText()); |
|---|
| | 121 | |
|---|
| | 122 | return null; |
|---|
| 99 | 123 | } |
|---|
| 100 | 124 | |
|---|
| … | … | |
| 105 | 129 | { |
|---|
| 106 | 130 | Component baseDom = getSelection(); |
|---|
| 107 | | |
|---|
| 108 | | if ( baseDom == null ) |
|---|
| | 131 | if (baseDom == null) |
|---|
| 109 | 132 | { |
|---|
| 110 | 133 | updateStatus(NLS.bind(Messages.BasePropertyPage_err_must_select, m_shape.getType())); |
|---|
Download in other formats:
* Generating other formats may take time.