GT-2740 script corrections

This commit is contained in:
ghidra1 2019-04-10 17:42:12 -04:00
parent 00acea89c2
commit 038d4462d3
3 changed files with 5 additions and 11 deletions

View File

@ -99,17 +99,13 @@ public class ServerAdmin implements GhidraLaunchable {
File userFile = new File(serverDir, UserManager.USER_PASSWORD_FILE);
if (!serverDir.isDirectory() || !userFile.isFile()) {
System.err.println("Invalid Ghidra server directory specified: " + serverDir);
System.err.println("Invalid Ghidra server directory!");
System.exit(-1);
}
File cmdDir = new File(serverDir, UserAdmin.ADMIN_CMD_DIR);
if (!cmdDir.exists()) {
System.err.println("Insufficient privilege or server not started.");
System.exit(-1);
}
if (!cmdDir.isDirectory()) {
System.err.println("Bad server directory: " + serverDir);
if (!cmdDir.isDirectory() || !cmdDir.canWrite()) {
System.err.println("Insufficient privilege or server not started!");
System.exit(-1);
}

View File

@ -19,7 +19,6 @@
# ** migrate-all - migrate all named repositories to index data storage
# ***********************************************************
UMASK=027
SUDO=sudo
# 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/')"
if [ -z "${OWNER}" -o "${OWNER}" = "$(whoami)" ]; then
umask $UMASK
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
echo "Running svrAdmin with $SUDO as ${OWNER} ..."
$SUDO -u $OWNER "$0" "${ARGS[@]}"

View File

@ -13,7 +13,7 @@ setlocal
REM Get parent of current folder
set SCRIPT_DIR=%~dp0
set GHIDRA_DIR=%SCRIPT_DIR%Ghidra
set GHIDRA_DIR=%SCRIPT_DIR%..\Ghidra
set OS_DIR=os
REM Production Environment