diff options
author | alepulver <alepulver@FreeBSD.org> | 2006-11-02 04:02:31 +0800 |
---|---|---|
committer | alepulver <alepulver@FreeBSD.org> | 2006-11-02 04:02:31 +0800 |
commit | 794e4b3131ed09e0ddd7407dd4922328c4544fe2 (patch) | |
tree | af4ec86a9a66bda4679a2b093c66c6dc3333965d | |
parent | f5d5c5e3cd49b5ac9f03dd50070c65611ed5c884 (diff) | |
download | freebsd-ports-gnome-794e4b3131ed09e0ddd7407dd4922328c4544fe2.tar.gz freebsd-ports-gnome-794e4b3131ed09e0ddd7407dd4922328c4544fe2.tar.zst freebsd-ports-gnome-794e4b3131ed09e0ddd7407dd4922328c4544fe2.zip |
- 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.
- Installation will fail without the user/group, so I simply create them.
PR: ports/104577
Submitted by: Ulrich Spoerlein <uspoerlein@gmail.com>
Approved by: Scott Kleihege <scott-ports@tummy.com> (maintainer)
-rw-r--r-- | sysutils/heartbeat/Makefile | 14 | ||||
-rw-r--r-- | sysutils/heartbeat/distinfo | 6 | ||||
-rw-r--r-- | sysutils/heartbeat/files/pkg-install.in | 104 | ||||
-rw-r--r-- | sysutils/heartbeat/pkg-plist | 6 | ||||
-rw-r--r-- | sysutils/heartbeat2/Makefile | 14 | ||||
-rw-r--r-- | sysutils/heartbeat2/distinfo | 6 | ||||
-rw-r--r-- | sysutils/heartbeat2/files/pkg-install.in | 104 | ||||
-rw-r--r-- | sysutils/heartbeat2/pkg-plist | 6 |
8 files changed, 92 insertions, 168 deletions
diff --git a/sysutils/heartbeat/Makefile b/sysutils/heartbeat/Makefile index e0b778dbdd9e..be93b8c7c087 100644 --- a/sysutils/heartbeat/Makefile +++ b/sysutils/heartbeat/Makefile @@ -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 diff --git a/sysutils/heartbeat/distinfo b/sysutils/heartbeat/distinfo index e3ab74888e6a..3387aa6840d3 100644 --- a/sysutils/heartbeat/distinfo +++ b/sysutils/heartbeat/distinfo @@ -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 diff --git a/sysutils/heartbeat/files/pkg-install.in b/sysutils/heartbeat/files/pkg-install.in index f7a35e3b1cfa..add49ae3f155 100644 --- a/sysutils/heartbeat/files/pkg-install.in +++ b/sysutils/heartbeat/files/pkg-install.in @@ -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 diff --git a/sysutils/heartbeat/pkg-plist b/sysutils/heartbeat/pkg-plist index 7365db1669c6..74f617f4014e 100644 --- a/sysutils/heartbeat/pkg-plist +++ b/sysutils/heartbeat/pkg-plist @@ -271,6 +271,6 @@ sbin/supervise-ldirectord-config @dirrmtry etc/ha.d/conf @dirrmtry etc/ha.d @cwd / -@dirrmtry var/lib/heartbeat/ckpt -@dirrmtry var/lib/heartbeat/ccm -@dirrmtry var/lib/heartbeat +@dirrmtry var/lock/subsys +@dirrmtry var/lock +@dirrmtry var/lib diff --git a/sysutils/heartbeat2/Makefile b/sysutils/heartbeat2/Makefile index e0b778dbdd9e..be93b8c7c087 100644 --- a/sysutils/heartbeat2/Makefile +++ b/sysutils/heartbeat2/Makefile @@ -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 diff --git a/sysutils/heartbeat2/distinfo b/sysutils/heartbeat2/distinfo index e3ab74888e6a..3387aa6840d3 100644 --- a/sysutils/heartbeat2/distinfo +++ b/sysutils/heartbeat2/distinfo @@ -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 diff --git a/sysutils/heartbeat2/files/pkg-install.in b/sysutils/heartbeat2/files/pkg-install.in index f7a35e3b1cfa..add49ae3f155 100644 --- a/sysutils/heartbeat2/files/pkg-install.in +++ b/sysutils/heartbeat2/files/pkg-install.in @@ -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 diff --git a/sysutils/heartbeat2/pkg-plist b/sysutils/heartbeat2/pkg-plist index 7365db1669c6..74f617f4014e 100644 --- a/sysutils/heartbeat2/pkg-plist +++ b/sysutils/heartbeat2/pkg-plist @@ -271,6 +271,6 @@ sbin/supervise-ldirectord-config @dirrmtry etc/ha.d/conf @dirrmtry etc/ha.d @cwd / -@dirrmtry var/lib/heartbeat/ckpt -@dirrmtry var/lib/heartbeat/ccm -@dirrmtry var/lib/heartbeat +@dirrmtry var/lock/subsys +@dirrmtry var/lock +@dirrmtry var/lib |