ports/104577: [PATCH] sysutils/heartbeat: update to 1.2.5

Ulrich Spoerlein uspoerlein at gmail.com
Thu Oct 19 17:00:30 UTC 2006


>Number:         104577
>Category:       ports
>Synopsis:       [PATCH] sysutils/heartbeat: update to 1.2.5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 19 17:00:28 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Ulrich Spoerlein
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD coyote 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Sun Oct  1 16:34:48 CEST
>Description:
- Update to 1.2.5, fixing a DoS vulnerability
- usr /var for runtime files making it possible to keep /usr mounted r/o
- Grab 275 as a reserved UID and GID
- Remove old cruft in pkg-install
- Make 'make -DBATCH install' work non-interactively
- Make 'pkg_add heartbeat-1.2.5' work non-interactively
  Note: Installation will fail without the user/group, so I simply create them

Port maintainer (scott-ports at tummy.com) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- heartbeat-1.2.5.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/sysutils/heartbeat/Makefile,v
retrieving revision 1.7
diff -u -p -u -r1.7 Makefile
--- Makefile	15 Aug 2006 01:04:51 -0000	1.7
+++ Makefile	19 Oct 2006 16:26:36 -0000
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	heartbeat
-PORTVERSION=	1.2.4
+PORTVERSION=	1.2.5
 CATEGORIES=	sysutils
 MASTER_SITES=	http://linux-ha.org/download/
 
@@ -24,7 +24,9 @@ USE_GNOME=	glib12
 USE_LDCONFIG=	yes
 
 CONFIGURE_ARGS+=	--disable-fatal-warnings \
-			--with-initdir=${PREFIX}/etc/rc.d
+			--with-initdir=${PREFIX}/etc/rc.d \
+			--localstatedir=/var \
+			--with-group-id=275 --with-ccmuser-id=275
 
 SUB_FILES=	pkg-install
 PKGDEINSTALL=	${PKGINSTALL}
@@ -63,11 +65,15 @@ post-patch:
 		${WRKSRC}/telecom/cms/Makefile.in
 .endif
 
+.if !defined(BATCH)
+BATCH=no
+.endif
+
 post-deinstall:
-	@${SH} ${PKGINSTALL} ${PKGNAME} DEINSTALL
+	@BATCH=${BATCH} ${SH} ${PKGINSTALL} ${PKGNAME} DEINSTALL
 
 post-install:
-	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+	@BATCH=${BATCH} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
 # some subdirs treat man as documentation, therefor we have to install
 # those man pages manually if NOPORTDOCS is defined
Index: distinfo
===================================================================
RCS file: /home/ncvs/ports/sysutils/heartbeat/distinfo,v
retrieving revision 1.3
diff -u -p -u -r1.3 distinfo
--- distinfo	18 Apr 2006 21:53:58 -0000	1.3
+++ distinfo	19 Oct 2006 16:26:36 -0000
@@ -1,3 +1,3 @@
-MD5 (heartbeat-1.2.4.tar.gz) = 7e3f752af06c25f7141c4b67a538e718
-SHA256 (heartbeat-1.2.4.tar.gz) = cb2516a965582651859ab48a44dd8764332897ef9a81986a0aa25dc9306378cf
-SIZE (heartbeat-1.2.4.tar.gz) = 2102978
+MD5 (heartbeat-1.2.5.tar.gz) = d59b021af0e1cbaba56345cc67f6ef12
+SHA256 (heartbeat-1.2.5.tar.gz) = 46f88a69324012317a4426dc93654ab28947b77675826686624d15cd5a4e357f
+SIZE (heartbeat-1.2.5.tar.gz) = 2107371
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/sysutils/heartbeat/pkg-plist,v
retrieving revision 1.3
diff -u -p -u -r1.3 pkg-plist
--- pkg-plist	18 Apr 2006 21:53:58 -0000	1.3
+++ pkg-plist	19 Oct 2006 16:26:36 -0000
@@ -271,6 +271,6 @@ sbin/supervise-ldirectord-config
 @dirrmtry etc/ha.d/conf
 @dirrmtry etc/ha.d
 @cwd /
- at dirrmtry var/lib/heartbeat/ckpt
- at dirrmtry var/lib/heartbeat/ccm
- at dirrmtry var/lib/heartbeat
+ at dirrmtry var/lock/subsys
+ at dirrmtry var/lock
+ at dirrmtry var/lib
Index: files/pkg-install.in
===================================================================
RCS file: /home/ncvs/ports/sysutils/heartbeat/files/pkg-install.in,v
retrieving revision 1.2
diff -u -p -u -r1.2 pkg-install.in
--- files/pkg-install.in	18 Apr 2006 21:53:58 -0000	1.2
+++ files/pkg-install.in	19 Oct 2006 16:26:36 -0000
@@ -1,17 +1,15 @@
 #! /bin/sh
 
-BATCH=${BATCH:=no}
-base=%%PREFIX%%
-
 ask() {
     local question default answer
 
     question=$1
     default=$2
-    if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then
+    # pkg_add fails anyhow, if we do not create the user/group
+    if [ "x${BATCH}" = xno ]; then
 	read -p "${question} [${default}]? " answer
     fi
-    if [ x${answer} = x ]; then
+    if [ "x${answer}" = x ]; then
 	answer=${default}
     fi
     echo ${answer}
@@ -33,26 +31,22 @@ yesno() {
 }
 
 make_account() {
-    local u g gcos homeopt home
+    local u g uid gid
 
     u=$1
     g=$2
-    gcos=$3
-    homeopt=${4:+"-d $4"}
+    uid=$3
+    gid=$4
 
     if pw group show "${g}" >/dev/null 2>&1; then
 	echo "You already have a group \"${g}\", so I will use it."
     else
 	echo "You need a group \"${g}\"."
-	if which -s pw && yesno "Would you like me to create it" y; then
-	    pw groupadd ${g} || exit
+	if yesno "Would you like me to create it" y; then
+	    pw groupadd ${g} -g ${gid} || exit
 	    echo "Done."
 	else
-	    echo "Please create it, and try again."
-	    if ! grep -q "^${u}:" /etc/passwd; then
-		echo "While you're at it, please create a user \"${u}\" too,"
-		echo "with a default group of \"${g}\"."
-	    fi
+	    echo "Please create it manually, and try again."
 	    exit 1
 	fi
     fi
@@ -61,90 +55,52 @@ make_account() {
 	echo "You already have a user \"${u}\", so I will use it."
     else
 	echo "You need a user \"${u}\"."
-	if which -s pw && yesno "Would you like me to create it" y; then
-	    pw useradd ${u} -g ${g} -h - ${homeopt} \
-		-s /nonexistent -c "${gcos}" || exit
+	if yesno "Would you like me to create it" y; then
+	    pw useradd ${u} -u ${uid} -g ${g} -h - -d /nonexistant \
+		-s /sbin/nologin -c "Heartbeat cluster user" || exit
 	    echo "Done."
 	else
 	    echo "Please create it, and try again."
 	    exit 1
 	fi
     fi
-
-    if [ x"$homeopt" = x ]; then
-	eval home=~${u}
-	if [ ! -d "${home}" ]; then
-	    if yesno \
-		"Would you like me to create ${u}'s home directory (${home})" y
-	    then
-		mkdir -p ${home} || exit
-		chown -R ${u}:${g} ${home} || exit
-		chmod -R go= ${home} || exit
-	    else
-		echo "Please create it, and try again."
-		exit 1
-	    fi
-	fi
-    fi
 }
 
 delete_account() {
-    local u g home
+    local u g
 
     u=$1
     g=$2
     if yesno "Do you want me to remove group \"${g}\"" y; then
+	echo "Removing group \"${g}\""
         pw groupdel -n ${g}
         echo "Done."
     fi
     if yesno "Do you want me to remove user \"${u}\"" y; then
-        eval home=~${u}
+	echo "Removing user \"${u}\""
         pw userdel -n ${u}
         echo "Done."
-        if [ -d "${home}" ]; then
-            echo "Please remember to remove the home directory \"${home}\" as"
-            echo "well as the mirrored files."
-        fi
     fi
 }
 
 case $2 in
 
 POST-INSTALL)
-    if which -s pw && which -s lockf; then
-	:
-    else
-	cat <<EOF
-
-This system looks like a pre-2.2 version of FreeBSD.  I see that it
-is missing the "lockf" and/or "pw" utilities.  I need these utilities.
-Please get them and install them, and try again.  You can get the
-sources from:
-
-  ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.bin/lockf.tar.gz
-  ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz
-
-EOF
-	exit 1
-    fi
-
     echo ""
     user=hacluster
     group=haclient
-    make_account ${user} ${group} "${user} ${group}" "/nonexistent"
+    uid=275
+    gid=275
+    make_account ${user} ${group} $uid $gid
 
     echo "Adding empty dirs and pid file."
-    test -d ${base}/var/lib/heartbeat/ckpt || \
-            install -d -m 755 ${base}/var/lib/heartbeat/ckpt
-    test -d ${base}/var/lib/heartbeat/ccm || \
-            install -d -m 755 ${base}/var/lib/heartbeat/ccm
-    test -d ${base}/var/lock/subsys || \
-            install -d -m 755 ${base}/var/lock/subsys
-    test -d ${base}/etc/ha.d/conf || \
-            install -d -m 755 ${base}/etc/ha.d/conf
-    test -f ${base}/var/run/heartbeat.pid || \
+    test -d /var/lib/heartbeat/ckpt || \
+            install -d -m 755 /var/lib/heartbeat/ckpt
+    test -d /var/lock/subsys || \
+            install -d -m 755 /var/lock/subsys
+    test -f /var/run/heartbeat.pid || \
             install -m 644 -o ${user} -g ${group} /dev/null \
-                ${base}/var/run/heartbeat.pid
+                /var/run/heartbeat.pid
     ;;
 
 DEINSTALL)
@@ -161,14 +117,14 @@ DEINSTALL)
     delete_account hacluster haclient
 
     echo "Removing runtime files"
-    if [ -d ${base}/var/lib/heartbeat ]; then
-        rm -r ${base}/var/lib/heartbeat
+    if [ -d /var/lib/heartbeat ]; then
+        rm -r /var/lib/heartbeat
     fi
-    if [ -f ${base}/var/lock/subsys/heartbeat ]; then
-        rm ${base}/var/lock/subsys/heartbeat
+    if [ -f /var/lock/subsys/heartbeat ]; then
+        rm /var/lock/subsys/heartbeat
     fi
-    if [ -f ${base}/var/run/heartbeat.pid ]; then
-        rm ${base}/var/run/heartbeat.pid
+    if [ -f /var/run/heartbeat.pid ]; then
+        rm /var/run/heartbeat.pid
     fi
     ;;
 esac
--- heartbeat-1.2.5.patch ends here ---

--- UIDs.orig	Thu Oct 19 18:50:01 2006
+++ UIDs	Thu Oct 19 18:29:59 2006
@@ -79,6 +79,7 @@
 smxc:*:262:262:Sendmail X SMTPC:/nonexistent:/sbin/nologin
 smxm:*:263:263:Sendmail X misc:/nonexistent:/sbin/nologin
 smx:*:264:264:Sendmail X other:/nonexistent:/sbin/nologin
+hacluster:*:275:275:Heartbeat cluster user:/nonexistent:/sbin/nologin
 mrtg:*:279:279:MRTG daemon:/nonexistent:/sbin/nologin
 dkfilter:*:325:325:DK Filter Owner:/nonexistent:/sbin/nologin
 ldap:*:389:389:OpenLDAP Server:/nonexistent:/sbin/nologin
--- GIDs.orig	Thu Oct 19 18:49:54 2006
+++ GIDs	Thu Oct 19 18:28:54 2006
@@ -67,6 +67,7 @@
 smxc:*:262:
 smxm:*:263:
 smx:*:264:
+haclient:*:275:
 mrtg:*:279:
 dkfilter:*:325:
 ldap:*:389:
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list