diff options
author | jdp <jdp@FreeBSD.org> | 2004-08-05 23:37:47 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 2004-08-05 23:37:47 +0000 |
commit | ed35f37ecbf209f0b6c041552a3947e3422d3e37 (patch) | |
tree | ed236a847559e666a6a6b196c20c39b244f8a5f5 /net/cvsup-mirror | |
parent | e66d2408e2cf81ac0c5a9ff237d0f78363b8d465 (diff) | |
download | FreeBSD-ports-ed35f37ecbf209f0b6c041552a3947e3422d3e37.zip FreeBSD-ports-ed35f37ecbf209f0b6c041552a3947e3422d3e37.tar.gz |
Fix two bugs in scripts.
1. If update.sh failed to determine the PREFIX, it didn't realize it
had failed. This is arguably caused by a shell bug in processing
the statement
export PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$")
This statement always succeeds even if the "expr" command fails.
Moving the "export" to a separate statement makes it work.
2. If the system had no "/home" directory, the pkg-install script
would create it with mode 0700, making ~cvsupin inaccessible to its
owner. A user ran into this bug when installing cvsup-mirror into a
jail.
Diffstat (limited to 'net/cvsup-mirror')
-rw-r--r-- | net/cvsup-mirror/Makefile | 2 | ||||
-rw-r--r-- | net/cvsup-mirror/files/update.sh | 3 | ||||
-rw-r--r-- | net/cvsup-mirror/pkg-install | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/net/cvsup-mirror/Makefile b/net/cvsup-mirror/Makefile index 86c7acd..99095a3 100644 --- a/net/cvsup-mirror/Makefile +++ b/net/cvsup-mirror/Makefile @@ -7,7 +7,7 @@ PORTNAME= cvsup-mirror PORTVERSION= 1.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net DISTFILES= diff --git a/net/cvsup-mirror/files/update.sh b/net/cvsup-mirror/files/update.sh index 025900a..d67e925 100644 --- a/net/cvsup-mirror/files/update.sh +++ b/net/cvsup-mirror/files/update.sh @@ -1,10 +1,11 @@ #! /bin/sh -if ! export PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$"); then +if ! PREFIX=$(expr $0 : "\(/.*\)/etc/cvsup/update\.sh\$"); then echo "$0: Cannot determine the PREFIX" >&2 exit 1 fi +export PREFIX export CVSUP_ARGS="$*" export PATH=/bin:/usr/bin:${PREFIX}/bin diff --git a/net/cvsup-mirror/pkg-install b/net/cvsup-mirror/pkg-install index 98e6940..27b6dfb 100644 --- a/net/cvsup-mirror/pkg-install +++ b/net/cvsup-mirror/pkg-install @@ -117,10 +117,10 @@ make_account() { if yesno \ "Would you like me to create ${u}'s home directory (${home})" y then - (umask 77 && \ - mkdir -p ${home}/.cvsup && \ - touch ${home}/.cvsup/auth) || exit + mkdir -p ${home}/.cvsup || exit + touch ${home}/.cvsup/auth || exit chown -R ${u}:${g} ${home} || exit + chmod -R go= ${home} || exit else echo "Please create it, and try again." exit 1 |