From b2ac5a8556b6ea187592b01b918d742b2c592a7c Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 16 May 2011 11:26:59 +0000
Subject: [PATCH] Fix for OPENDJ-148 : pfexec /usr/opendj/configure does not execute (permission denied). pfexec checks file permissions before the profile and exec attributes on OpenIndiana (and OpenSolaris). So now configure and unconfigure are executable by all, but check for root id, allowing use with pfexec.

---
 opends/resource/unconfigure |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/opends/resource/unconfigure b/opends/resource/unconfigure
index c8df403..c50d875 100755
--- a/opends/resource/unconfigure
+++ b/opends/resource/unconfigure
@@ -41,6 +41,14 @@
 SCRIPT_NAME=unconfigure
 export SCRIPT_NAME
 
+# Check if running as root. This is required to be able to copy files and
+# enable SMF
+if [[ `id -u` -ne 0 ]]
+then
+  echo "This script must be run as root" 1>&2
+  exit 1
+fi
+
 cd "${WORKING_DIR}"
 
 # Set environment variables

--
Gitblit v1.10.0