aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2005-06-20 18:39:29 +0000
committerGreg Lewis <glewis@FreeBSD.org>2005-06-20 18:39:29 +0000
commit9a4718a6796d332246332ae931406e4a97973fe6 (patch)
tree05495f849d13d8a41f04469e7f2c1e6d7d213ee0 /java
parentb450fc1e84e800f0e4616b4b001cb78d3566690b (diff)
downloadports-9a4718a6796d332246332ae931406e4a97973fe6.tar.gz
ports-9a4718a6796d332246332ae931406e4a97973fe6.zip
Notes
Diffstat (limited to 'java')
-rw-r--r--java/javavmwrapper/src/javavmwrapper.sh14
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"