Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 43)
+++ trunk/Makefile.in	(revision 44)
@@ -948,45 +948,20 @@
 	group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
 	cat prototype | grep -v 'none / ' | \
-	sed 's,none /etc .*,none /etc ? ? ?,' | \
-	sed 's,none /etc/init.d .*,none /etc/init.d ? ? ?,' | \
-	sed 's,none /usr .*,none /usr ? ? ?,' | \
-	sed 's,none /usr/bin .*,none /usr/bin ? ? ?,' | \
-	sed 's,none /var .*,none /var ? ? ?,' | \
-	sed 's,none /var/lib .*,none /var/lib ? ? ?,' | \
-	sed 's,none /var/log .*,none /var/log ? ? ?,' | \
-	sed 's,none /var/run .*,none /var/run ? ? ?,' | \
-	sed 's,none /usr/sbin .*,none /usr/sbin ? ? ?,' | \
 	sed s,$$user\ $$group,root\ sys,g > prototype.1; \
-	rm -f prototype && mv prototype.1 prototype; \
-	if test -d /usr/local; then \
-		cat prototype | \
-		sed 's,none /usr/local .*,none /usr/local ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
-	if test -d /usr/local/bin; then \
-		cat prototype | \
-		sed 's,none /usr/local/bin .*,none /usr/local/bin ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
-	if test -d /usr/local/sbin; then \
-		cat prototype | \
-		sed 's,none /usr/local/sbin .*,none /usr/local/sbin ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
-	if test -d /usr/local/man; then \
-		cat prototype | \
-		sed 's,none /usr/local/man .*,none /usr/local/man ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
-	if test -d /usr/local/man/man5; then \
-		cat prototype | \
-		sed 's,none /usr/local/man/man5 .*,none /usr/local/man/man5 ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
-	if test -d /usr/local/man/man8; then \
-		cat prototype | \
-		sed 's,none /usr/local/man/man8 .*,none /usr/local/man/man8 ? ? ?,' >prototype.1;\
-		rm -f prototype && mv prototype.1 prototype; \
-	fi; \
+	rm -f prototype.2; \
+	while read line; do \
+		echo "$${line}" | egrep '^d none' >/dev/null 2>&1;  \
+		if [ $$? = 0 ]; then \
+			dir=`echo "$${line}" | awk '{ print $$3 }'`; \
+			if [ -d "$$dir" ]; then \
+				echo "d none $${dir} ? ? ?" >> prototype.2; \
+			else \
+				echo "$${line}" >> prototype.2; \
+			fi; \
+		else \
+			echo "$${line}" >> prototype.2; \
+		fi; \
+	done < prototype.1; \
+	rm -f prototype && rm prototype.1 && mv prototype.2 prototype; \
 	echo "d none /etc/rc0.d ? ? ?" >> prototype; \
 	echo "d none /etc/rc1.d ? ? ?" >> prototype; \
@@ -1012,4 +987,5 @@
 	  cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
 	  echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
+	  echo "to install, use: pkgadd -n -d $(PACKAGE)-$(VERSION).pkg all"; \
 	  echo; \
 	  rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
Index: trunk/test/testrun_2a.sh
===================================================================
--- trunk/test/testrun_2a.sh	(revision 43)
+++ trunk/test/testrun_2a.sh	(revision 44)
@@ -25,5 +25,5 @@
 SERVER_BUILDOPTS="--quiet  $TRUST  --enable-network=server --prefix=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$PW_DIR/testrc_2 --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=${SH_LOCALHOST}  --with-log-file=$PW_DIR/.samhain_log --with-pid-file=$PW_DIR/.samhain_lock"; export SERVER_BUILDOPTS
 
-CLIENT_BUILDOPTS="--quiet  $TRUST --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock"; export CLIENT_BUILDOPTS
+CLIENT_BUILDOPTS="--quiet  $TRUST --enable-debug --enable-network=client --enable-srp --prefix=$PW_DIR --with-tmp-dir=$PW_DIR --localstatedir=$PW_DIR --with-config-file=REQ_FROM_SERVER$RCFILE --with-data-file=REQ_FROM_SERVER$PW_DIR/.samhain_file --with-logserver=localhost  --with-log-file=$LOGFILE --with-pid-file=$PW_DIR/.samhain_lock --enable-suidcheck"; export CLIENT_BUILDOPTS
 
 do_test_1_a () {
@@ -113,4 +113,30 @@
 	${TOP_SRCDIR}/configure ${CLIENT_BUILDOPTS}
 	#
+	# Limit suid check
+	#
+	BASE="${PW_DIR}"; export BASE
+	#
+	if test x$? = x0; then
+		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
+		$MAKE  'DBGDEF=-DSH_SUIDTESTDIR=\"${BASE}\"' > /dev/null 2>>test_log
+		if test x$? = x0; then
+		    [ -z "$verbose" ] || log_msg_ok "make..."; 
+		else
+		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
+		    return 1
+		fi
+
+	else
+		[ -z "$quiet" ] &&       log_msg_fail "configure...";
+		return 1
+	fi
+
+	# save binary and build server
+	#
+	cp samhain samhain.build || return 1
+	$MAKE clean >/dev/null || return 1
+
+	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
+	#
 	if test x$? = x0; then
 		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
@@ -128,26 +154,4 @@
 	fi
 
-	# save binary and build server
-	#
-	cp samhain samhain.build || return 1
-	$MAKE clean >/dev/null || return 1
-
-	${TOP_SRCDIR}/configure ${SERVER_BUILDOPTS}
-	#
-	if test x$? = x0; then
-		[ -z "$verbose" ] ||     log_msg_ok "configure..."; 
-		$MAKE  > /dev/null 2>>test_log
-		if test x$? = x0; then
-		    [ -z "$verbose" ] || log_msg_ok "make..."; 
-		else
-		    [ -z "$quiet" ] &&   log_msg_fail "make..."; 
-		    return 1
-		fi
-
-	else
-		[ -z "$quiet" ] &&       log_msg_fail "configure...";
-		return 1
-	fi
-
 
 	#####################################################################
@@ -221,5 +225,4 @@
 	cp    ./testrc_2       "./rc.${ALTHOST}"
 	cp    ./file.${SH_LOCALHOST} "./file.${ALTHOST}" 2>/dev/null
-
 }
 
