mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 07:48:52 -05:00
GT-2740 revision to facilitate test use of ServerAdmin utility
This commit is contained in:
@@ -50,7 +50,7 @@ public class ServerAdmin implements GhidraLaunchable {
|
||||
private boolean propertyUsed = false;
|
||||
|
||||
/**
|
||||
* Main method for running the UserAdmin Application.
|
||||
* Main method for launching the ServerAdmin Application via GhidraLauncher.
|
||||
* The following properties may be set:
|
||||
* <pre>
|
||||
* UserAdmin.invocation - identifies the name of the application used when displaying usage text.
|
||||
@@ -69,6 +69,20 @@ public class ServerAdmin implements GhidraLaunchable {
|
||||
Application.initializeApplication(layout, configuration);
|
||||
}
|
||||
|
||||
execute(args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main method for processing ServerAdmin command line arguments.
|
||||
* The following properties may be set:
|
||||
* <pre>
|
||||
* UserAdmin.invocation - identifies the name of the application used when displaying usage text.
|
||||
* UserAdmin.serverDir - identifies the server directory instead of passing on command line.
|
||||
* </pre>
|
||||
* @param args command line arguments
|
||||
*/
|
||||
public void execute(String[] args) {
|
||||
|
||||
File serverDir = null;
|
||||
|
||||
int ix = 0;
|
||||
|
||||
+4
-3
@@ -40,7 +40,7 @@ import ghidra.framework.store.local.LocalFileSystem;
|
||||
import ghidra.framework.store.local.LocalFolderItem;
|
||||
import ghidra.net.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.server.UserAdmin;
|
||||
import ghidra.server.ServerAdmin;
|
||||
import ghidra.server.UserManager;
|
||||
import ghidra.test.ToyProgramBuilder;
|
||||
import ghidra.util.*;
|
||||
@@ -940,11 +940,12 @@ public class ServerTestUtil {
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void addPKIUser(File serverRoot, String userName, String dn) throws Exception {
|
||||
ServerAdmin serverAdmin = new ServerAdmin();
|
||||
if (dn != null) {
|
||||
UserAdmin.main(new String[] { serverRoot.getAbsolutePath(), "-dn", userName, dn });
|
||||
serverAdmin.execute(new String[] { serverRoot.getAbsolutePath(), "-dn", userName, dn });
|
||||
}
|
||||
else {
|
||||
UserAdmin.main(new String[] { serverRoot.getAbsolutePath(), "-add", userName });
|
||||
serverAdmin.execute(new String[] { serverRoot.getAbsolutePath(), "-add", userName });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user