diff options
author | glewis <glewis@FreeBSD.org> | 2005-06-21 02:39:29 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2005-06-21 02:39:29 +0800 |
commit | 3926b885006b961589d879db7d4ec3a0c6015b28 (patch) | |
tree | 9d5cea068845f20e1ed54a093b64159c04ed19cb /java | |
parent | 2bee9c884900b89c46513bf8dc21c5cb5c321828 (diff) | |
download | freebsd-ports-gnome-3926b885006b961589d879db7d4ec3a0c6015b28.tar.gz freebsd-ports-gnome-3926b885006b961589d879db7d4ec3a0c6015b28.tar.zst freebsd-ports-gnome-3926b885006b961589d879db7d4ec3a0c6015b28.zip |
. Add a couple of comments.
. Kick unprivileged users out early in registervm/unregistervm to
prevent double error messages.
Diffstat (limited to 'java')
-rw-r--r-- | java/javavmwrapper/src/javavmwrapper.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/javavmwrapper/src/javavmwrapper.sh b/java/javavmwrapper/src/javavmwrapper.sh index 7113b252600d..81497379248e 100644 --- a/java/javavmwrapper/src/javavmwrapper.sh +++ b/java/javavmwrapper/src/javavmwrapper.sh @@ -72,10 +72,12 @@ createJavaLinks () { # Sort the configuration file # sortConfiguration () { + # Ensure the configuration file exists if [ ! -f "${CONF}" ]; then return fi + # Ensure the configuration file has the correct permissions if [ ! -w "${CONF}" -o ! -r "${CONF}" ]; then echo "${IAM}: error: can't read/write ${CONF} configuration file!" >&2 return @@ -271,6 +273,12 @@ registerVM () { touch "${CONF}" fi + # Ensure the configuration file exists and has the correct permissions + if [ ! -f "${CONF}" -o ! -w "${CONF}" -o ! -r "${CONF}" ]; then + echo "${IAM}: error: can't read/write ${CONF} configuration file!" 1>&2 + exit 1 + fi + # Check that the given VM can be found in the configuration file VM=`echo "${1}" | sed -E 's|[[:space:]]*#.*||' 2>/dev/null` REGISTERED= @@ -333,6 +341,12 @@ unregisterVM () { exit 1 fi + # Ensure the configuration file has the correct permissions + if [ ! -w "${CONF}" -o ! -r "${CONF}" ]; then + echo "${IAM}: error: can't read/write ${CONF} configuration file!" >&2 + exit 1 + fi + # Check that the given VM can be found in the configuration file if [ -z "`grep "${1}" "${CONF}"`" ]; then echo "${IAM}: error: \"${1}\" JavaVM is not currently registered" |