From c974d088c0609ead6aac9c790b090c2b74669459 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Tue, 20 Jun 2023 17:28:11 -0400 Subject: [PATCH] GP-3544 various changes --- .../core/datamgr/DataTypeManagerPlugin.java | 2 +- .../FunctionComparisonPlugin.java | 17 +- .../FunctionComparisonProvider.java | 9 +- .../FunctionComparisonProviderManager.java | 18 +- .../MultiFunctionComparisonPanel.java | 5 +- .../MultiFunctionComparisonProvider.java | 13 +- .../AbstractApplyFunctionSignatureAction.java | 9 +- .../services/FunctionComparisonService.java | 13 +- .../ghidra/program/util/FunctionUtility.java | 90 ++++++-- .../ghidra/util/table/GhidraFilterTable.java | 32 ++- .../java/docking/DialogComponentProvider.java | 8 +- .../widgets/textfield/IntegerTextField.java | 38 +++- .../framework/client/ClientAuthenticator.java | 2 +- .../client/DefaultClientAuthenticator.java | 17 +- .../framework/LoggingInitialization.java | 2 +- .../DefaultLocalGhidraProtocolConnector.java | 4 +- .../ghidra/GhidraProtocolConnector.java | 6 +- .../framework/protocol/ghidra/GhidraURL.java | 37 +++- .../ghidra/program/database/ProgramDB.java | 3 +- licenses/H2_Mozilla_License_2.0.html | 197 ++++++++++++++++++ licenses/certification.manifest | 1 + 21 files changed, 452 insertions(+), 71 deletions(-) create mode 100644 licenses/H2_Mozilla_License_2.0.html diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java index f3e1b3804a..dffa8e537f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java @@ -364,7 +364,7 @@ public class DataTypeManagerPlugin extends ProgramPlugin public DataTypesProvider createProvider() { DataTypesProvider newProvider = new DataTypesProvider(this, SEARCH_PROVIDER_NAME, true); - newProvider.setIncludeDataTypeMembersInFilter(provider.includeDataMembersInSearch()); + newProvider.setIncludeDataTypeMembersInFilter(provider.isIncludeDataMembersInSearch()); newProvider.setFilteringArrays(provider.isFilteringArrays()); newProvider.setFilteringPointers(provider.isFilteringPointers()); return newProvider; diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonPlugin.java index dac1846608..761d2b1b06 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonPlugin.java @@ -57,7 +57,7 @@ import ghidra.util.Swing; ) //@formatter:on public class FunctionComparisonPlugin extends ProgramPlugin - implements DomainObjectListener, FunctionComparisonService { + implements DomainObjectListener, FunctionComparisonService { static final String MENU_PULLRIGHT = "CompareFunctions"; static final String POPUP_MENU_GROUP = "CompareFunction"; @@ -132,7 +132,7 @@ public class FunctionComparisonPlugin extends ProgramPlugin } private FunctionComparisonProvider getFromSwingBlocking( - Supplier comparer) { + Supplier comparer) { if (Swing.isSwingThread()) { return comparer.get(); @@ -147,13 +147,13 @@ public class FunctionComparisonPlugin extends ProgramPlugin @Override public void addFunctionComparisonProviderListener( - ComponentProviderActivationListener listener) { + ComponentProviderActivationListener listener) { runOnSwingNonBlocking(() -> functionComparisonManager.addProviderListener(listener)); } @Override public void removeFunctionComparisonProviderListener( - ComponentProviderActivationListener listener) { + ComponentProviderActivationListener listener) { runOnSwingNonBlocking(() -> functionComparisonManager.removeProviderListener(listener)); } @@ -167,9 +167,14 @@ public class FunctionComparisonPlugin extends ProgramPlugin runOnSwingNonBlocking(() -> functionComparisonManager.removeFunction(function, provider)); } + @Override + public FunctionComparisonProvider createFunctionComparisonProvider() { + return getFromSwingBlocking(() -> functionComparisonManager.createProvider()); + } + @Override public FunctionComparisonProvider compareFunctions(Function source, - Function target) { + Function target) { return getFromSwingBlocking( () -> functionComparisonManager.compareFunctions(source, target)); } @@ -187,7 +192,7 @@ public class FunctionComparisonPlugin extends ProgramPlugin @Override public void compareFunctions(Function source, Function target, - FunctionComparisonProvider provider) { + FunctionComparisonProvider provider) { runOnSwingNonBlocking( () -> functionComparisonManager.compareFunctions(source, target, provider)); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProvider.java index 9493e5a06e..c7d6a9cd87 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProvider.java @@ -42,7 +42,7 @@ import ghidra.util.HelpLocation; * creates instances of this provider as-needed. */ public class FunctionComparisonProvider extends ComponentProviderAdapter - implements PopupActionProvider, FunctionComparisonModelListener { + implements PopupActionProvider, FunctionComparisonModelListener { protected static final String HELP_TOPIC = "FunctionComparison"; protected FunctionComparisonPanel functionComparisonPanel; @@ -73,7 +73,7 @@ public class FunctionComparisonProvider extends ComponentProviderAdapter * @param contextType the type of context supported by this provider; may be null */ public FunctionComparisonProvider(Plugin plugin, String name, String owner, - Class contextType) { + Class contextType) { super(plugin.getTool(), name, owner, contextType); this.plugin = plugin; model = new FunctionComparisonModel(); @@ -264,4 +264,9 @@ public class FunctionComparisonProvider extends ComponentProviderAdapter addLocalAction(dockingAction); } } + + public void removeAddFunctionsAction() { + //TODO this is stupid merge multi and this into one + + } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProviderManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProviderManager.java index 9f4ce4ea6e..011149430c 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProviderManager.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/FunctionComparisonProviderManager.java @@ -59,6 +59,14 @@ public class FunctionComparisonProviderManager implements FunctionComparisonProv listeners.stream().forEach(l -> l.componentProviderActivated(provider)); } + public FunctionComparisonProvider createProvider() { + FunctionComparisonProvider provider = new MultiFunctionComparisonProvider(plugin); + provider.addToTool(); + providers.add(provider); + provider.setVisible(true); + return provider; + } + /** * Creates a new comparison between the given set of functions * @@ -69,11 +77,8 @@ public class FunctionComparisonProviderManager implements FunctionComparisonProv if (functions.isEmpty()) { return null; } - FunctionComparisonProvider provider = new MultiFunctionComparisonProvider(plugin); - provider.addToTool(); + FunctionComparisonProvider provider = createProvider(); provider.getModel().compareFunctions(functions); - providers.add(provider); - provider.setVisible(true); return provider; } @@ -85,7 +90,7 @@ public class FunctionComparisonProviderManager implements FunctionComparisonProv * @return the new comparison provider */ public FunctionComparisonProvider compareFunctions(Function source, - Function target) { + Function target) { FunctionComparisonProvider provider = new MultiFunctionComparisonProvider(plugin); provider.addToTool(); provider.getModel().compareFunctions(source, target); @@ -118,7 +123,7 @@ public class FunctionComparisonProviderManager implements FunctionComparisonProv * @param provider the provider to add the functions to */ public void compareFunctions(Function source, Function target, - FunctionComparisonProvider provider) { + FunctionComparisonProvider provider) { if (provider == null) { return; } @@ -221,4 +226,5 @@ public class FunctionComparisonProviderManager implements FunctionComparisonProv } } } + } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonPanel.java index 2c666f2b15..b100e5b3dd 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonPanel.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonPanel.java @@ -67,7 +67,7 @@ public class MultiFunctionComparisonPanel extends FunctionComparisonPanel { * @param tool the active plugin tool */ public MultiFunctionComparisonPanel(MultiFunctionComparisonProvider provider, - PluginTool tool) { + PluginTool tool) { super(provider, tool, null, null); JPanel choicePanel = new JPanel(new GridLayout(1, 2)); @@ -79,6 +79,7 @@ public class MultiFunctionComparisonPanel extends FunctionComparisonPanel { // comparison panel because the name of the function/data being shown // is already visible in the combo box getComparisonPanels().forEach(p -> p.setShowTitles(false)); + setPreferredSize(new Dimension(1200, 600)); } /** @@ -311,7 +312,7 @@ public class MultiFunctionComparisonPanel extends FunctionComparisonPanel { @Override public Component getListCellRendererComponent(JList list, Object value, int index, - boolean isSelected, boolean cellHasFocus) { + boolean isSelected, boolean cellHasFocus) { if (value == null) { // It's possible during a close program operation to have this diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonProvider.java index e03d1f5ce2..b65e860833 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/MultiFunctionComparisonProvider.java @@ -26,13 +26,15 @@ import ghidra.framework.plugintool.Plugin; */ public class MultiFunctionComparisonProvider extends FunctionComparisonProvider { + private DockingAction openFunctionTableAction; + /** * Constructor * * @param plugin the parent plugin */ - public MultiFunctionComparisonProvider(Plugin plugin) { - super(plugin, "functioncomparisonprovider", plugin.getName()); + protected MultiFunctionComparisonProvider(Plugin plugin) { + super(plugin, "Functions Comparison Provider", plugin.getName()); } @Override @@ -55,7 +57,7 @@ public class MultiFunctionComparisonProvider extends FunctionComparisonProvider DockingAction nextFunctionAction = new NextFunctionAction(this); DockingAction previousFunctionAction = new PreviousFunctionAction(this); DockingAction removeFunctionsAction = new RemoveFunctionsAction(this); - DockingAction openFunctionTableAction = getOpenFunctionTableAction(); + openFunctionTableAction = getOpenFunctionTableAction(); DockingAction navigateToAction = new NavigateToFunctionAction(this); addLocalAction(nextFunctionAction); @@ -75,4 +77,9 @@ public class MultiFunctionComparisonProvider extends FunctionComparisonProvider protected DockingAction getOpenFunctionTableAction() { return new OpenFunctionTableAction(tool, this); } + + @Override + public void removeAddFunctionsAction() { + removeLocalAction(openFunctionTableAction); + } } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/actions/AbstractApplyFunctionSignatureAction.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/actions/AbstractApplyFunctionSignatureAction.java index 9464f12602..09d7876003 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/actions/AbstractApplyFunctionSignatureAction.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/functioncompare/actions/AbstractApplyFunctionSignatureAction.java @@ -22,8 +22,7 @@ import docking.action.MenuData; import docking.widgets.fieldpanel.internal.FieldPanelCoordinator; import ghidra.app.util.viewer.util.CodeComparisonPanel; import ghidra.app.util.viewer.util.CodeComparisonPanelActionContext; -import ghidra.program.model.listing.Function; -import ghidra.program.model.listing.Program; +import ghidra.program.model.listing.*; import ghidra.program.util.FunctionUtility; import ghidra.util.*; import ghidra.util.exception.DuplicateNameException; @@ -109,7 +108,7 @@ public abstract class AbstractApplyFunctionSignatureAction extends DockingAction * @return true if the non-focused panel is read-only */ protected boolean hasReadOnlyNonFocusedSide( - CodeComparisonPanel codeComparisonPanel) { + CodeComparisonPanel codeComparisonPanel) { Function leftFunction = codeComparisonPanel.getLeftFunction(); Function rightFunction = codeComparisonPanel.getRightFunction(); @@ -134,7 +133,7 @@ public abstract class AbstractApplyFunctionSignatureAction extends DockingAction * @return true if the operation was successful */ protected boolean updateFunction(ComponentProvider provider, Function destinationFunction, - Function sourceFunction) { + Function sourceFunction) { Program program = destinationFunction.getProgram(); int txID = program.startTransaction(ACTION_NAME); @@ -144,7 +143,7 @@ public abstract class AbstractApplyFunctionSignatureAction extends DockingAction FunctionUtility.updateFunction(destinationFunction, sourceFunction); commit = true; } - catch (InvalidInputException | DuplicateNameException e) { + catch (InvalidInputException | DuplicateNameException | CircularDependencyException e) { String message = "Couldn't apply the function signature from " + sourceFunction.getName() + " to " + destinationFunction.getName() + " @ " + destinationFunction.getEntryPoint().toString() + ". " + e.getMessage(); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/services/FunctionComparisonService.java b/Ghidra/Features/Base/src/main/java/ghidra/app/services/FunctionComparisonService.java index af8e0f7efe..d3059f5199 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/services/FunctionComparisonService.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/services/FunctionComparisonService.java @@ -39,6 +39,13 @@ import ghidra.program.model.listing.Function; @ServiceInfo(defaultProvider = FunctionComparisonPlugin.class) public interface FunctionComparisonService { + /** + * Creates a comparison provider that allows comparisons between a functions. + * + * @return the new comparison provider + */ + public FunctionComparisonProvider createFunctionComparisonProvider(); + /** * Creates a comparison between a set of functions, where each function * in the list can be compared against any other. @@ -84,7 +91,7 @@ public interface FunctionComparisonService { * @param provider the provider to add the comparisons to */ public void compareFunctions(Set functions, - FunctionComparisonProvider provider); + FunctionComparisonProvider provider); /** * Creates a comparison between two functions and adds it to a given @@ -99,7 +106,7 @@ public interface FunctionComparisonService { * @param provider the provider to add the comparison to */ public void compareFunctions(Function source, Function target, - FunctionComparisonProvider provider); + FunctionComparisonProvider provider); /** * Removes a given function from all comparisons across all comparison @@ -132,5 +139,5 @@ public interface FunctionComparisonService { * @param listener the listener to remove */ public void removeFunctionComparisonProviderListener( - ComponentProviderActivationListener listener); + ComponentProviderActivationListener listener); } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java index b20294bdee..95ac91a1c6 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java @@ -39,6 +39,24 @@ public class FunctionUtility { private FunctionUtility() { } + /** + * Applies the name and namespace from source function to the target function + * @param target the function whose name is being changed. + * @param source the source function from which to get name and namespace. The source function + * can be from another program. + * @throws DuplicateNameException if creating a namespace would create a invalid duplicate name + * @throws InvalidInputException if the name or namespace from the source function is invalid + * @throws CircularDependencyException if this function is an ancestor of + * the target namespace. This probably can't happen + */ + public static void applyNameAndNamespace(Function target, Function source) + throws DuplicateNameException, InvalidInputException, CircularDependencyException { + String name = source.getName(); + Namespace targetNamespace = getOrCreateSourceNamespaceInTarget(target, source); + Symbol symbol = target.getSymbol(); + symbol.setNameAndNamespace(name, targetNamespace, source.getSymbol().getSource()); + } + /** * Updates the destination function so its signature will match the source function's signature * as closely as possible. This method will try to create conflict names if necessary for the @@ -50,16 +68,17 @@ public class FunctionUtility { * @throws DuplicateNameException This shouldn't happen since it will try to create conflict * names for the function and its variables if necessary. Otherwise, this would be because * the function's name or a variable name already exists. + * @throws CircularDependencyException if namespaces have circular references */ public static void updateFunction(Function destinationFunction, Function sourceFunction) - throws InvalidInputException, DuplicateNameException { + throws InvalidInputException, DuplicateNameException, CircularDependencyException { updateFunctionExceptName(destinationFunction, sourceFunction); - setFunctionName(destinationFunction, sourceFunction); + applyNameAndNamespace(destinationFunction, sourceFunction); } private static void updateFunctionExceptName(Function destinationFunction, - Function sourceFunction) throws InvalidInputException, DuplicateNameException { + Function sourceFunction) throws InvalidInputException, DuplicateNameException { Program sourceProgram = sourceFunction.getProgram(); Program destinationProgram = destinationFunction.getProgram(); @@ -78,7 +97,7 @@ public class FunctionUtility { setUniqueParameterNames(destinationFunction, newParams); destinationFunction.updateFunction(callingConventionName, returnValue, newParams, useCustomStorage ? FunctionUpdateType.CUSTOM_STORAGE - : FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, + : FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS, force, source); applyInline(destinationFunction, sourceFunction); applyNoReturn(destinationFunction, sourceFunction); @@ -98,7 +117,7 @@ public class FunctionUtility { * @throws DuplicateNameException */ public static void setUniqueParameterNames(Function function, List parameters) - throws DuplicateNameException, InvalidInputException { + throws DuplicateNameException, InvalidInputException { SymbolTable symbolTable = function.getProgram().getSymbolTable(); // Create a set containing all the unique parameter names determined so far so they can @@ -127,7 +146,7 @@ public class FunctionUtility { * @return a unique parameter name */ private static String getUniqueReplacementParameterName(SymbolTable symbolTable, - Function function, String name, Set namesNotToBeUsed) { + Function function, String name, Set namesNotToBeUsed) { if (name == null || SymbolUtilities.isDefaultParameterName(name)) { return name; } @@ -147,7 +166,7 @@ public class FunctionUtility { * that doesn't conflict with any in the set of names not to be used. */ private static String getUniqueNameIgnoringCurrentParameters(SymbolTable symbolTable, - Function function, String baseName, Set namesNotToBeUsed) { + Function function, String baseName, Set namesNotToBeUsed) { String name = baseName; if (name != null) { // establish unique name @@ -192,7 +211,7 @@ public class FunctionUtility { } private static void applyCallFixup(Function destinationFunction, Function sourceFunction, - boolean sameLanguage) { + boolean sameLanguage) { String sourceCallFixup = sourceFunction.getCallFixup(); String destCallFixup = destinationFunction.getCallFixup(); if (SystemUtilities.isEqual(destCallFixup, sourceCallFixup)) { @@ -214,7 +233,7 @@ public class FunctionUtility { * already exists. */ static void setFunctionName(Function destinationFunction, Function sourceFunction) - throws InvalidInputException, DuplicateNameException { + throws InvalidInputException, DuplicateNameException { String sourceName = sourceFunction.getName(); Address sourceEntryPoint = sourceFunction.getEntryPoint(); Namespace sourceNamespace = sourceFunction.getParentNamespace(); @@ -288,13 +307,13 @@ public class FunctionUtility { } private static String determineCallingConventionName(Function destinationFunction, - Function sourceFunction, boolean sameLanguageAndCompilerSpec) { + Function sourceFunction, boolean sameLanguageAndCompilerSpec) { return sameLanguageAndCompilerSpec ? sourceFunction.getCallingConventionName() - : destinationFunction.getCallingConventionName(); + : destinationFunction.getCallingConventionName(); } private static boolean determineCustomStorageUse(Function destinationFunction, - Function sourceFunction, boolean sameLanguage) { + Function sourceFunction, boolean sameLanguage) { boolean useCustomStorage = sourceFunction.hasCustomVariableStorage(); if (useCustomStorage) { return sameLanguage; // only use for same language. @@ -303,19 +322,19 @@ public class FunctionUtility { } private static Variable determineReturnValue(Function destinationFunction, - Function sourceFunction, boolean useCustomStorage) throws InvalidInputException { + Function sourceFunction, boolean useCustomStorage) throws InvalidInputException { Program destinationProgram = destinationFunction.getProgram(); Parameter sourceReturn = sourceFunction.getReturn(); DataType dataType = sourceReturn.getDataType(); VariableStorage storage = (useCustomStorage) ? sourceReturn.getVariableStorage().clone(destinationProgram) - : VariableStorage.UNASSIGNED_STORAGE; + : VariableStorage.UNASSIGNED_STORAGE; Parameter returnValue = new ReturnParameterImpl(dataType, storage, destinationProgram); return returnValue; } private static List determineParameters(Function destinationFunction, - Function sourceFunction, boolean useCustomStorage) throws InvalidInputException { + Function sourceFunction, boolean useCustomStorage) throws InvalidInputException { Program destinationProgram = destinationFunction.getProgram(); List parameters = new ArrayList<>(); Parameter[] sourceParameters = sourceFunction.getParameters(); @@ -324,7 +343,7 @@ public class FunctionUtility { DataType dataType = sourceParameter.getDataType(); VariableStorage storage = (useCustomStorage) ? sourceParameter.getVariableStorage().clone(destinationProgram) - : VariableStorage.UNASSIGNED_STORAGE; + : VariableStorage.UNASSIGNED_STORAGE; SourceType source = sourceParameter.getSource(); Parameter parameter = new ParameterImpl(name, dataType, storage, destinationProgram, source); @@ -378,4 +397,43 @@ public class FunctionUtility { } return HTMLUtilities.wrapAsHTML(buf.toString()); } + + private static Namespace getOrCreateSourceNamespaceInTarget(Function target, Function source) + throws DuplicateNameException, InvalidInputException { + + Namespace targetNamespace = target.getParentNamespace(); + Namespace sourceNamespace = source.getParentNamespace(); + if (targetNamespace.getName(true).equals(sourceNamespace.getName(true))) { + return targetNamespace; + } + return getOrCreateTargetNamespace(target.getProgram(), sourceNamespace); + } + + private static Namespace getOrCreateTargetNamespace(Program program, Namespace otherNamespace) + throws DuplicateNameException, InvalidInputException { + if (otherNamespace.isGlobal()) { + return program.getGlobalNamespace(); + } + Namespace otherParent = otherNamespace.getParentNamespace(); + Namespace parent = getOrCreateTargetNamespace(program, otherParent); + + SymbolTable symbolTable = program.getSymbolTable(); + String otherName = otherNamespace.getName(); + + Namespace namespace = symbolTable.getNamespace(otherName, parent); + if (namespace != null) { + return namespace; + } + + // not there, we need to create it. + SourceType source = otherNamespace.getSymbol().getSource(); + if (otherNamespace instanceof GhidraClass) { + return symbolTable.createClass(parent, otherName, source); + } + else if (otherNamespace instanceof Library) { + return symbolTable.createExternalLibrary(otherName, source); + } + return symbolTable.createNameSpace(parent, otherName, source); + } + } diff --git a/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraFilterTable.java b/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraFilterTable.java index eb54fed488..374e1e5006 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraFilterTable.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/util/table/GhidraFilterTable.java @@ -18,6 +18,9 @@ package ghidra.util.table; import docking.widgets.table.*; import docking.widgets.table.threaded.GThreadedTablePanel; import docking.widgets.table.threaded.ThreadedTableModel; +import ghidra.app.nav.Navigatable; +import ghidra.app.services.GoToService; +import ghidra.framework.plugintool.ServiceProvider; public class GhidraFilterTable extends GFilterTable { @@ -33,15 +36,40 @@ public class GhidraFilterTable extends GFilterTable { @Override protected GTableFilterPanel createTableFilterPanel(GTable gTable, - RowObjectTableModel tableModel) { + RowObjectTableModel tableModel) { return new GhidraTableFilterPanel(gTable, tableModel); } @Override protected GThreadedTablePanel createThreadedTablePanel( - ThreadedTableModel threadedModel) { + ThreadedTableModel threadedModel) { return new GhidraThreadedTablePanel(threadedModel); } + @Override + public GhidraTable getTable() { + return (GhidraTable) super.getTable(); + } + + public void installNavigation(GoToService goToService, Navigatable nav) { + getTable().installNavigation(goToService, nav); + } + + public void installNavigation(GoToService goToService) { + getTable().installNavigation(goToService, goToService.getDefaultNavigatable()); + } + + public void installNavigation(ServiceProvider provider) { + getTable().installNavigation(provider); + } + + public void removeNavigation() { + getTable().removeNavigation(); + } + + public void setNavigateOnSelectionEnabled(boolean b) { + getTable().setNavigateOnSelectionEnabled(b); + } + } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/DialogComponentProvider.java b/Ghidra/Framework/Docking/src/main/java/docking/DialogComponentProvider.java index 23a0c11edd..15e8b4fe47 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/DialogComponentProvider.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/DialogComponentProvider.java @@ -45,7 +45,7 @@ import utility.function.Callback; * all the gui elements to appear in the dialog, then use tool.showDialog() to display your dialog. */ public class DialogComponentProvider - implements ActionContextProvider, StatusListener, TaskListener { + implements ActionContextProvider, StatusListener, TaskListener { private static final Color FG_COLOR_ALERT = new GColor("color.fg.dialog.status.alert"); private static final Color FG_COLOR_ERROR = new GColor("color.fg.dialog.status.error"); @@ -134,7 +134,7 @@ public class DialogComponentProvider * doing so. */ protected DialogComponentProvider(String title, boolean modal, boolean includeStatus, - boolean includeButtons, boolean canRunTasks) { + boolean includeButtons, boolean canRunTasks) { this.modal = modal; this.title = title; rootPanel = new JPanel(new BorderLayout()) { @@ -736,7 +736,7 @@ public class DialogComponentProvider } protected void showProgressBar(String localTitle, boolean hasProgress, boolean canCancel, - int delay) { + int delay) { taskMonitorComponent.reset(); Runnable r = () -> { if (delay <= 0) { @@ -852,7 +852,7 @@ public class DialogComponentProvider * @see #hideTaskMonitorComponent() */ public TaskMonitor showTaskMonitorComponent(String localTitle, boolean hasProgress, - boolean canCancel) { + boolean canCancel) { showProgressBar(localTitle, hasProgress, canCancel, DEFAULT_DELAY); return taskMonitorComponent; } diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java index 26711c5433..2b9e8959cd 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/textfield/IntegerTextField.java @@ -68,6 +68,7 @@ public class IntegerTextField { private boolean allowsHexPrefix = true; private boolean showNumbericDecoration = true; private BigInteger maxValue; + private BigInteger minValue; private List listeners = new ArrayList<>(); @@ -366,6 +367,31 @@ public class IntegerTextField { } } + /** + * Sets the minimum allowed value. The minimum must be a positive number. Null indicates that + * there is no minimum value. + *

+ * If negative values are permitted (see {@link #setAllowNegativeValues(boolean)}) this value + * will establish the minimum limit of the absolute value. + * + * @param minValue the minimum value to allow. + */ + public void setMinValue(BigInteger minValue) { + if (minValue != null && minValue.signum() < 0) { + throw new IllegalArgumentException("Min value must be positive"); + } + BigInteger currentValue = getValue(); + this.minValue = minValue; + if (minValue != null && !passesMinCheck(currentValue)) { + if (currentValue.signum() < 0) { + setValue(minValue.negate()); + } + else { + setValue(minValue); + } + } + } + /** * Returns the JTextField component that this class manages. * @@ -492,6 +518,16 @@ public class IntegerTextField { return value.abs().compareTo(maxValue) <= 0; } + private boolean passesMinCheck(BigInteger value) { + if (value == null) { + return true; + } + if (minValue == null) { + return true; + } + return value.abs().compareTo(minValue) >= 0; + } + private boolean shouldParseAsHex(String text) { if (allowsHexPrefix) { // if allowing "0x" prefix, let the incoming text determine if we should parse as hex @@ -596,7 +632,7 @@ public class IntegerTextField { if (isNonAllowedNegativeNumber(value)) { return false; } - if (passesMaxCheck(value)) { + if (passesMaxCheck(value) && passesMinCheck(value)) { // When the input is valid, update the hex mode to match how the text was parsed. // See parseAsHex variable comment above. isHexMode = parseAsHex; diff --git a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ClientAuthenticator.java b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ClientAuthenticator.java index eb215593d9..7e123e3598 100644 --- a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ClientAuthenticator.java +++ b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/ClientAuthenticator.java @@ -48,7 +48,7 @@ public interface ClientAuthenticator extends KeyStorePasswordProvider { * @see ChoiceCallback#setSelectedIndex(int) * A null is specified if no choice is available (password authenticator determined by server configuration). * @see AnonymousCallback#setAnonymousAccessRequested(boolean) - * @return + * @return true if password provided, false if entry cancelled */ public boolean processPasswordCallbacks(String title, String serverType, String serverName, NameCallback nameCb, PasswordCallback passCb, ChoiceCallback choiceCb, diff --git a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/DefaultClientAuthenticator.java b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/DefaultClientAuthenticator.java index ff6f5ebe9a..b41a615b6b 100644 --- a/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/DefaultClientAuthenticator.java +++ b/Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/client/DefaultClientAuthenticator.java @@ -45,12 +45,17 @@ public class DefaultClientAuthenticator extends PopupKeyStorePasswordProvider prompt = "Password:"; } PasswordCallback passCb = new PasswordCallback(prompt, false); - ServerPasswordPrompt pp = new ServerPasswordPrompt("Connection Authentication", - "Server", getRequestingHost(), nameCb, passCb, null, null, null); - SystemUtilities.runSwingNow(pp); - if (pp.okWasPressed()) { - return new PasswordAuthentication(nameCb != null ? nameCb.getName() : null, - passCb.getPassword()); + try { + ServerPasswordPrompt pp = new ServerPasswordPrompt("Connection Authentication", + "Server", getRequestingHost(), nameCb, passCb, null, null, null); + SystemUtilities.runSwingNow(pp); + if (pp.okWasPressed()) { + return new PasswordAuthentication(nameCb != null ? nameCb.getName() : null, + passCb.getPassword()); + } + } + finally { + passCb.clearPassword(); } return null; } diff --git a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/LoggingInitialization.java b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/LoggingInitialization.java index fe7b5fe740..5441342f59 100644 --- a/Ghidra/Framework/Generic/src/main/java/ghidra/framework/LoggingInitialization.java +++ b/Ghidra/Framework/Generic/src/main/java/ghidra/framework/LoggingInitialization.java @@ -27,7 +27,7 @@ import ghidra.util.exception.AssertException; public class LoggingInitialization { - private static final String LOG4J2_CONFIGURATION_PROPERTY = "log4j.configurationFile"; + public static final String LOG4J2_CONFIGURATION_PROPERTY = "log4j.configurationFile"; private static final String PRODUCTION_LOGGING_CONFIGURATION_FILE = "generic.log4j.xml"; private static final String DEVELOPMENT_LOGGING_CONFIGURATION_FILE = "generic.log4jdev.xml"; diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/DefaultLocalGhidraProtocolConnector.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/DefaultLocalGhidraProtocolConnector.java index cbd62b6290..218991b68a 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/DefaultLocalGhidraProtocolConnector.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/DefaultLocalGhidraProtocolConnector.java @@ -65,8 +65,8 @@ public class DefaultLocalGhidraProtocolConnector extends GhidraProtocolConnector } @Override - protected String parseRepositoryName() throws MalformedURLException { - return null; + public String getRepositoryName() { + return localStorageLocator.getName(); } @Override diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraProtocolConnector.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraProtocolConnector.java index f41706b2ca..0d048988fb 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraProtocolConnector.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraProtocolConnector.java @@ -35,7 +35,7 @@ public abstract class GhidraProtocolConnector { protected final URL url; - protected final String repositoryName; + protected String repositoryName; // only valid for server repository protected final String itemPath; // trailing "/" signifies explicit folder path protected String folderPath; @@ -56,7 +56,7 @@ public abstract class GhidraProtocolConnector { checkProtocol(); checkUserInfo(); checkHostInfo(); - this.repositoryName = parseRepositoryName(); + this.repositoryName = GhidraURL.isServerRepositoryURL(url) ? parseRepositoryName() : null; this.itemPath = parseItemPath(); } @@ -105,7 +105,7 @@ public abstract class GhidraProtocolConnector { * @return repository name or null if not specified * @throws MalformedURLException if URL is invalid */ - protected String parseRepositoryName() throws MalformedURLException { + private String parseRepositoryName() throws MalformedURLException { String path = url.getPath(); diff --git a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraURL.java b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraURL.java index b6ac57f582..08837d4e77 100644 --- a/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraURL.java +++ b/Ghidra/Framework/Project/src/main/java/ghidra/framework/protocol/ghidra/GhidraURL.java @@ -37,6 +37,9 @@ public class GhidraURL { private static final String PROTOCOL_URL_START = PROTOCOL + ":/"; + private static Pattern IS_REMOTE_URL_PATTERN = + Pattern.compile("^" + PROTOCOL_URL_START + "/[^/].*"); // e.g., ghidra://path + private static Pattern IS_LOCAL_URL_PATTERN = Pattern.compile("^" + PROTOCOL_URL_START + "[^/].*"); // e.g., ghidra:/path @@ -68,6 +71,28 @@ public class GhidraURL { return str != null && str.startsWith(PROTOCOL_URL_START); } + /** + * Determine if URL string uses a local format (e.g., {@code ghidra:/path...}). + * Extensive validation is not performed. This method is intended to differentiate + * from a server URL only. + * @param str URL string + * @return true if string appears to be local Ghidra URL, else false + */ + public static boolean isLocalGhidraURL(String str) { + return IS_LOCAL_URL_PATTERN.matcher(str).matches(); + } + + /** + * Determine if URL string uses a remote server format (e.g., {@code ghidra://host...}). + * Extensive validation is not performed. This method is intended to differentiate + * from a local URL only. + * @param str URL string + * @return true if string appears to be remote server Ghidra URL, else false + */ + public static boolean isServerURL(String str) { + return IS_REMOTE_URL_PATTERN.matcher(str).matches(); + } + /** * Determine if the specified URL is a local project URL. * No checking is performed as to the existence of the project. @@ -76,7 +101,7 @@ public class GhidraURL { * project (ghidra:/path/projectName...) */ public static boolean isLocalProjectURL(URL url) { - return IS_LOCAL_URL_PATTERN.matcher(url.toExternalForm()).matches(); + return isLocalGhidraURL(url.toExternalForm()); } /** @@ -92,7 +117,7 @@ public class GhidraURL { } String path = localProjectURL.getPath(); // assume path always starts with '/' - + // if (path.indexOf(":/") == 2 && Character.isLetter(path.charAt(1))) { // check for drive letter after leading '/' // if (Platform.CURRENT_PLATFORM.getOperatingSystem() == OperatingSystem.WINDOWS) { // path = path.substring(1); // Strip-off leading '/' @@ -105,7 +130,7 @@ public class GhidraURL { int index = path.lastIndexOf('/'); String dirPath = index != 0 ? path.substring(0, index) : "/"; - + String name = path.substring(index + 1); if (name.length() == 0) { return null; @@ -177,7 +202,7 @@ public class GhidraURL { } /** - * Determine if the specified URL is any type of server URL. + * Determine if the specified URL is any type of supported server Ghidra URL. * No checking is performed as to the existence of the server or repository. * @param url ghidra URL * @return true if specified URL refers to a Ghidra server @@ -424,7 +449,7 @@ public class GhidraURL { public static URL makeURL(String dirPath, String projectName) { return makeURL(dirPath, projectName, null, null); } - + /** * Create a URL which refers to a local Ghidra project * @param projectLocator absolute project location @@ -434,7 +459,7 @@ public class GhidraURL { public static URL makeURL(ProjectLocator projectLocator) { return makeURL(projectLocator, null, null); } - + /** * Create a URL which refers to a local Ghidra project with optional project file and ref * @param projectLocation absolute path of project location directory diff --git a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java index 4540f3ebf9..aacc76cf90 100644 --- a/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java +++ b/Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/ProgramDB.java @@ -473,6 +473,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM pl.getString(PREFERRED_ROOT_NAMESPACE_CATEGORY_PROPERTY, null)); } + @Override protected boolean propertyChanged(String propertyName, Object oldValue, Object newValue) { if (propertyName.equals(PREFERRED_ROOT_NAMESPACE_CATEGORY_PROPERTY_PATHNAME)) { String path = (String) newValue; @@ -2028,7 +2029,7 @@ public class ProgramDB extends DomainObjectAdapterDB implements Program, ChangeM Msg.info(this, "Updating language version for Program " + getName() + ": " + language.getLanguageDescription() + " (Version " + - language.getVersion() + "." + language.getMinorVersion()); + language.getVersion() + "." + language.getMinorVersion() + ")"); } if (newCompilerSpecID != null) { diff --git a/licenses/H2_Mozilla_License_2.0.html b/licenses/H2_Mozilla_License_2.0.html new file mode 100644 index 0000000000..b536866f11 --- /dev/null +++ b/licenses/H2_Mozilla_License_2.0.html @@ -0,0 +1,197 @@ + + + + + + Mozilla Public License, version 2.0 + + + + +

+

H2 Database Source Distribution

+

The H2 source distribution which corresponds to the jar file contained with this distribution +can be found on the h2database + release site. +

+ +

Mozilla Public License
Version 2.0

+

1. Definitions

+
+
1.1. “Contributor”
+

means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.

+
+
1.2. “Contributor Version”
+

means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor’s Contribution.

+
+
1.3. “Contribution”
+

means Covered Software of a particular Contributor.

+
+
1.4. “Covered Software”
+

means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.

+
+
1.5. “Incompatible With Secondary Licenses”
+

means

+
    +
  1. that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or

  2. +
  3. that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.

  4. +
+
+
1.6. “Executable Form”
+

means any form of the work other than Source Code Form.

+
+
1.7. “Larger Work”
+

means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.

+
+
1.8. “License”
+

means this document.

+
+
1.9. “Licensable”
+

means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.

+
+
1.10. “Modifications”
+

means any of the following:

+
    +
  1. any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or

  2. +
  3. any new file in Source Code Form that contains any Covered Software.

  4. +
+
+
1.11. “Patent Claims” of a Contributor
+

means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.

+
+
1.12. “Secondary License”
+

means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.

+
+
1.13. “Source Code Form”
+

means the form of the work preferred for making modifications.

+
+
1.14. “You” (or “Your”)
+

means an individual or a legal entity exercising rights under this License. For legal entities, “You” includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, “control” means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.

+
+
+

2. License Grants and Conditions

+

2.1. Grants

+

Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:

+
    +
  1. under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and

  2. +
  3. under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.

  4. +
+

2.2. Effective Date

+

The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.

+

2.3. Limitations on Grant Scope

+

The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:

+
    +
  1. for any code that a Contributor has removed from Covered Software; or

  2. +
  3. for infringements caused by: (i) Your and any other third party’s modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or

  4. +
  5. under Patent Claims infringed by Covered Software in the absence of its Contributions.

  6. +
+

This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).

+

2.4. Subsequent Licenses

+

No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).

+

2.5. Representation

+

Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.

+

2.6. Fair Use

+

This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.

+

2.7. Conditions

+

Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.

+

3. Responsibilities

+

3.1. Distribution of Source Form

+

All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients’ rights in the Source Code Form.

+

3.2. Distribution of Executable Form

+

If You distribute Covered Software in Executable Form then:

+
    +
  1. such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and

  2. +
  3. You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients’ rights in the Source Code Form under this License.

  4. +
+

3.3. Distribution of a Larger Work

+

You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).

+

3.4. Notices

+

You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.

+

3.5. Application of Additional Terms

+

You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.

+

4. Inability to Comply Due to Statute or Regulation

+

If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.

+

5. Termination

+

5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.

+

5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.

+

5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.

+

6. Disclaimer of Warranty

+

Covered Software is provided under this License on an “as is” basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.

+

7. Limitation of Liability

+

Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party’s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.

+

8. Litigation

+

Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party’s ability to bring cross-claims or counter-claims.

+

9. Miscellaneous

+

This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.

+

10. Versions of the License

+

10.1. New Versions

+

Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.

+

10.2. Effect of New Versions

+

You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.

+

10.3. Modified Versions

+

If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).

+

10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses

+

If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.

+

Exhibit A - Source Code Form License Notice

+
+

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

+
+

If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.

+

You may add additional accurate notices of copyright ownership.

+

Exhibit B - “Incompatible With Secondary Licenses” Notice

+
+

This Source Code Form is “Incompatible With Secondary Licenses”, as defined by the Mozilla Public License, v. 2.0.

+
+ + \ No newline at end of file diff --git a/licenses/certification.manifest b/licenses/certification.manifest index 634ca0e8ec..66f4e56893 100644 --- a/licenses/certification.manifest +++ b/licenses/certification.manifest @@ -15,6 +15,7 @@ Crystal_Clear_Icons_-_LGPL_2.1.txt||LICENSE||||END| FAMFAMFAM_Icons_-_CC_2.5.txt||LICENSE||||END| FAMFAMFAM_Mini_Icons_-_Public_Domain.txt||LICENSE||||END| GPL_2_With_Classpath_Exception.txt||LICENSE||||END| +H2_Mozilla_License_2.0.html||LICENSE||||END| INRIA_License.txt||LICENSE||||END| JDOM_License.txt||LICENSE||||END| JSch_License.txt||LICENSE||||END|