mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-06-01 13:24:41 +08:00
GT-2740 script corrections
This commit is contained in:
@@ -99,17 +99,13 @@ public class ServerAdmin implements GhidraLaunchable {
|
|||||||
|
|
||||||
File userFile = new File(serverDir, UserManager.USER_PASSWORD_FILE);
|
File userFile = new File(serverDir, UserManager.USER_PASSWORD_FILE);
|
||||||
if (!serverDir.isDirectory() || !userFile.isFile()) {
|
if (!serverDir.isDirectory() || !userFile.isFile()) {
|
||||||
System.err.println("Invalid Ghidra server directory specified: " + serverDir);
|
System.err.println("Invalid Ghidra server directory!");
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
File cmdDir = new File(serverDir, UserAdmin.ADMIN_CMD_DIR);
|
File cmdDir = new File(serverDir, UserAdmin.ADMIN_CMD_DIR);
|
||||||
if (!cmdDir.exists()) {
|
if (!cmdDir.isDirectory() || !cmdDir.canWrite()) {
|
||||||
System.err.println("Insufficient privilege or server not started.");
|
System.err.println("Insufficient privilege or server not started!");
|
||||||
System.exit(-1);
|
|
||||||
}
|
|
||||||
if (!cmdDir.isDirectory()) {
|
|
||||||
System.err.println("Bad server directory: " + serverDir);
|
|
||||||
System.exit(-1);
|
System.exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
# ** migrate-all - migrate all named repositories to index data storage
|
# ** migrate-all - migrate all named repositories to index data storage
|
||||||
# ***********************************************************
|
# ***********************************************************
|
||||||
|
|
||||||
UMASK=027
|
|
||||||
SUDO=sudo
|
SUDO=sudo
|
||||||
|
|
||||||
# Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
|
# Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
|
||||||
@@ -45,9 +44,8 @@ fi
|
|||||||
OWNER="$(grep '^wrapper.app.account=' "${CONFIG}" | sed -e 's/^.*=\(.*\)\s*.*$/\1/')"
|
OWNER="$(grep '^wrapper.app.account=' "${CONFIG}" | sed -e 's/^.*=\(.*\)\s*.*$/\1/')"
|
||||||
|
|
||||||
if [ -z "${OWNER}" -o "${OWNER}" = "$(whoami)" ]; then
|
if [ -z "${OWNER}" -o "${OWNER}" = "$(whoami)" ]; then
|
||||||
umask $UMASK
|
|
||||||
VMARGS="-DUserAdmin.invocation=$(basename "${SCRIPT_FILE}") -DUserAdmin.config=\"${CONFIG}\""
|
VMARGS="-DUserAdmin.invocation=$(basename "${SCRIPT_FILE}") -DUserAdmin.config=\"${CONFIG}\""
|
||||||
. "${SCRIPT_DIR}"/../support/launch.sh fg svrAdmin "${MAXMEM}" "$VMARGS" ghidra.server.ServerAdmin "$@"
|
"${SCRIPT_DIR}"/../support/launch.sh fg svrAdmin "${MAXMEM}" "$VMARGS" ghidra.server.ServerAdmin "$@"
|
||||||
else
|
else
|
||||||
echo "Running svrAdmin with $SUDO as ${OWNER} ..."
|
echo "Running svrAdmin with $SUDO as ${OWNER} ..."
|
||||||
$SUDO -u $OWNER "$0" "${ARGS[@]}"
|
$SUDO -u $OWNER "$0" "${ARGS[@]}"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ setlocal
|
|||||||
REM Get parent of current folder
|
REM Get parent of current folder
|
||||||
set SCRIPT_DIR=%~dp0
|
set SCRIPT_DIR=%~dp0
|
||||||
|
|
||||||
set GHIDRA_DIR=%SCRIPT_DIR%Ghidra
|
set GHIDRA_DIR=%SCRIPT_DIR%..\Ghidra
|
||||||
set OS_DIR=os
|
set OS_DIR=os
|
||||||
|
|
||||||
REM Production Environment
|
REM Production Environment
|
||||||
|
|||||||
Reference in New Issue
Block a user