aboutsummaryrefslogtreecommitdiffstats
path: root/security/tripwire
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2006-02-22 03:01:50 +0800
committercy <cy@FreeBSD.org>2006-02-22 03:01:50 +0800
commitc797209c3e08b6993b0d9d2d830dee8a81a23ff4 (patch)
treea715b9c2e2fb67e39dd4ecaa501ca676d7ce32fe /security/tripwire
parent8ceb22ecd883bf3148d68b6493826cdd481bb1eb (diff)
downloadfreebsd-ports-gnome-c797209c3e08b6993b0d9d2d830dee8a81a23ff4.tar.gz
freebsd-ports-gnome-c797209c3e08b6993b0d9d2d830dee8a81a23ff4.tar.zst
freebsd-ports-gnome-c797209c3e08b6993b0d9d2d830dee8a81a23ff4.zip
Fix a problem with the CLOBBER option. The meaning of this option is
rather ambiguous. The original author of the tripwire software had coded the distribution contrib/install.sh file not to clobber the local and site key files only whereas CLOBBER=false should also include not clobbering the installed copies of the twcfg.txt and twpol.txt files. PR: 85155
Diffstat (limited to 'security/tripwire')
-rw-r--r--security/tripwire/files/patch-contrib::install.sh52
1 files changed, 51 insertions, 1 deletions
diff --git a/security/tripwire/files/patch-contrib::install.sh b/security/tripwire/files/patch-contrib::install.sh
index bdd36f0f8d37..6b5aa70fdc48 100644
--- a/security/tripwire/files/patch-contrib::install.sh
+++ b/security/tripwire/files/patch-contrib::install.sh
@@ -1,5 +1,5 @@
--- contrib/install.sh.orig Thu Sep 15 20:12:39 2005
-+++ contrib/install.sh Mon Feb 13 16:18:22 2006
++++ contrib/install.sh Tue Feb 21 08:22:10 2006
@@ -162,12 +162,6 @@
# Default installation script configuration file.
INSTALL_CONFIG_FILE="./install/install.cfg"
@@ -31,3 +31,53 @@
for i in $loosefiles; do
eval "eval \"\$$i\""
+@@ -719,6 +711,7 @@
+ ## Generate tripwire configuration file.
+ ##=======================================================
+
++[ ! -f "$TXT_CFG" -o "$CLOBBER" = "false" ] && {
+ echo
+ echo "----------------------------------------------"
+ echo "Generating Tripwire configuration file..."
+@@ -757,6 +750,7 @@
+ fi
+
+ chmod 640 "$TXT_CFG"
++}
+
+ ##=======================================================
+ ## Create signed tripwire configuration file.
+@@ -826,20 +820,21 @@
+ echo "----------------------------------------------"
+ echo "Customizing default policy file..."
+
+-sed '/@@section GLOBAL/,/@@section FS/ {
+- s?^\(TWROOT=\).*$?TWDOCS='\""$TWDOCS"\"';?
+- s?^\(TWBIN=\).*$?\1'\""$TWBIN"\"';?
+- s?^\(TWPOL=\).*$?\1'\""$TWPOLICY"\"';?
+- s?^\(TWDB=\).*$?\1'\""$TWDB"\"';?
+- s?^\(TWSKEY=\).*$?\1'\""$TWSITEKEYDIR"\"';?
+- s?^\(TWLKEY=\).*$?\1'\""$TWLOCALKEYDIR"\"';?
+- s?^\(TWREPORT=\).*$?\1'\""$TWREPORT"\"';?
+- s?^\(HOSTNAME=\).*$?\1'"$HOST_NAME"';?
+-}' "${TWPOLICY}/${POLICYSRC}" > "${TXT_POL}.tmp"
+-
+ # copy the tmp file back over the default policy
+ [ -f "${TXT_POL}" ] && cp "${TXT_POL}" "${TXT_POL}.bak"
+-mv "${TXT_POL}.tmp" "${TXT_POL}"
++[ ! -f "${TXT_POL}" -o "$CLOBBER" = "true" ] && {
++ sed '/@@section GLOBAL/,/@@section FS/ {
++ s?^\(TWROOT=\).*$?TWDOCS='\""$TWDOCS"\"';?
++ s?^\(TWBIN=\).*$?\1'\""$TWBIN"\"';?
++ s?^\(TWPOL=\).*$?\1'\""$TWPOLICY"\"';?
++ s?^\(TWDB=\).*$?\1'\""$TWDB"\"';?
++ s?^\(TWSKEY=\).*$?\1'\""$TWSITEKEYDIR"\"';?
++ s?^\(TWLKEY=\).*$?\1'\""$TWLOCALKEYDIR"\"';?
++ s?^\(TWREPORT=\).*$?\1'\""$TWREPORT"\"';?
++ s?^\(HOSTNAME=\).*$?\1'"$HOST_NAME"';?
++ }' "${TWPOLICY}/${POLICYSRC}" > "${TXT_POL}"
++}
++
+ rm -f "${TWPOLICY}/${POLICYSRC}"
+
+ # reset rights on the policy files to 640