summaryrefslogtreecommitdiff
path: root/security/cfs
diff options
context:
space:
mode:
authorjlam <jlam>2001-06-07 15:35:14 +0000
committerjlam <jlam>2001-06-07 15:35:14 +0000
commit7a2ae389afed8727efb182aa2b34f72355600b70 (patch)
tree4fd56c49c8a25b5353b543d91511a227f5e6a2d0 /security/cfs
parentfcf8eb06aca360413ae3d92dc16f2ccd3eaf0da0 (diff)
downloadpkgsrc-7a2ae389afed8727efb182aa2b34f72355600b70.tar.gz
* Use NetBSD's getpass() function instead of the homegrown one, as the
homegrown one doesn't seem to hide the password when it is being entered. * Add a rc.d style script to start cfsd, and also install the documentation for the filesystem. * Rename c* commands to cfs_* to avoid conflicts with coda programs with a similar name.
Diffstat (limited to 'security/cfs')
-rw-r--r--security/cfs/Makefile97
-rw-r--r--security/cfs/distinfo7
-rw-r--r--security/cfs/files/cfsd.sh111
-rw-r--r--security/cfs/patches/patch-aa76
-rw-r--r--security/cfs/pkg/PLIST3
5 files changed, 216 insertions, 78 deletions
diff --git a/security/cfs/Makefile b/security/cfs/Makefile
index a4945547b28..6bf9d8a6add 100644
--- a/security/cfs/Makefile
+++ b/security/cfs/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2001/06/06 12:29:52 simonb Exp $
+# $NetBSD: Makefile,v 1.4 2001/06/07 15:35:14 jlam Exp $
DISTNAME= cfs-1.4.1
CATEGORIES= security
@@ -8,23 +8,94 @@ MAINTAINER= packages@netbsd.org
HOMEPAGE= http://www.crypto.com/software/
COMMENT= encrypting file system, using NFS as its interface
-CRYPTO= yes
+CRYPTO= # defined
+ALL_TARGET= cfs
INSTALL_TARGET= install_cfs
+# Avoid conflicts with coda-client's cpasswd by consistently renaming
+# all references to c* to cfs_*.
+#
+CFS_SUBST= cattach->cfs_attach CATTACH->CFS_ATTACH
+CFS_SUBST+= ccat->cfs_cat CCAT->CFS_CAT
+CFS_SUBST+= cdetach->cfs_detach CDETACH->CFS_DETACH
+CFS_SUBST+= cmkdir->cfs_mkdir CMKDIR->CFS_MKDIR
+CFS_SUBST+= cmkkey->cfs_mkkey CMKKEY->CFS_MKKEY
+CFS_SUBST+= cname->cfs_name CNAME->CFS_NAME
+CFS_SUBST+= cpasswd->cfs_passwd CPASSWD->CFS_PASSWD
+
+.include "../../mk/bsd.prefs.mk"
+
+# Required settings necessary to build CFS on various platforms. This is
+# copied from ${WRKSRC}/Makefile and from browsing the various README files.
+#
+.if ${OPSYS} == "NetBSD"
+CFLAGS+= -traditional # uses strange preprocessor behaviour
+CFLAGS+= -DPROTOTYPES=1
+CFLAGS+= -DBSD44 -DANYPORT -DCFS_PORT=2049 -DSHORTLINKS
+MAKE_ENV+= MAKE=${MAKE_PROGRAM}
+MAKE_ENV+= COMPAT="-lcompat"
+MAKE_ENV+= RPCOPTS="-b"
+#
+# Use getpass() instead of own getpassword() function, which doesn't seem to
+# hide the password when the user is typing it.
+#
+CFS_SUBST+= getpassword->getpass
+CFLAGS+= -DHAVE_GETPASS
+CFS_BUILD_SCRIPT= ${WRKSRC}/netbsd_make_with_bad_rpcgen
+.elif ${OPSYS} == "SunOS"
+CFLAGS+= -traditional
+CFLAGS+= -DPROTOTYPES=1
+CFLAGS+= -DSOLARIS2X -DPORTMAP -DPTMX
+MAKE_ENV+= MAKE=${MAKE_PROGRAM}
+MAKE_ENV+= LIBS="-lsocket -lnsl"
+MAKE_ENV+= COMPAT=
+MAKE_ENV+= RPCOPTS=
+CFS_BUILD_SCRIPT= ${WRKSRC}/make_with_bad_rpcgen
+.elif ${OPSYS} == "Linux"
+CFLAGS+= -traditional
+CFLAGS+= -DPROTOTYPES=1
+CFLAGS+= -U__OPTIMIZE__ -U__STDC__ -Dd_fileno=d_ino
+MAKE_ENV+= MAKE=${MAKE_PROGRAM}
+MAKE_ENV+= LIBS=
+MAKE_ENV+= COMPAT=
+MAKE_ENV+= RPCOPTS="-k -b"
+CFS_BUILD_SCRIPT= ${WRKSRC}/make_with_bad_rpcgen
+.endif
+
+CFS_SUBST_SED= ${CFS_SUBST:S/->/!/:S/$/!g/:S/^/ -e s!/}
+
+DOCDIR= ${PREFIX}/share/doc/cfs
+
+post-extract:
+ @${RM} -f ${WRKSRC}/esm.1
+ @cd ${WRKSRC}; for file in *; do \
+ ${MV} -f $${file} $${file}.orig; \
+ dest=`${ECHO} $${file} | ${SED} ${CFS_SUBST_SED}`; \
+ ${SED} ${CFS_SUBST_SED} $${file}.orig > $${dest}; \
+ ${RM} -f $${file}.orig; \
+ done
+
+post-patch:
+ @${CHMOD} +x ${CFS_BUILD_SCRIPT}
+
do-build:
- @cd ${WRKSRC} && \
- ${SETENV} ${MAKE_ENV} $$fix ./netbsd_make_with_bad_rpcgen cfs
+ cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} \
+ ${SH} ${CFS_BUILD_SCRIPT} ${ALL_TARGET}
+
+pre-install:
+ ${SED} -e "s|@PREFIX@|${PREFIX}|g" \
+ ${FILESDIR}/cfsd.sh > ${WRKDIR}/cfsd.sh
post-install:
- ${BSD_INSTALL_MAN} ${WRKSRC}/cattach.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cdetach.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cfssh.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cmkdir.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cmkkey.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cpasswd.1 ${PREFIX}/man/man1/
- ${BSD_INSTALL_MAN} ${WRKSRC}/ccat.8 ${PREFIX}/man/man8/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cfsd.8 ${PREFIX}/man/man8/
- ${BSD_INSTALL_MAN} ${WRKSRC}/cname.8 ${PREFIX}/man/man8/
+ ${INSTALL_SCRIPT} ${WRKDIR}/cfsd.sh ${PREFIX}/etc/rc.d/cfsd
+ cd ${WRKSRC}; for file in *.1; do \
+ ${INSTALL_MAN} $${file} ${PREFIX}/man/man1/$${file}; \
+ done
+ cd ${WRKSRC}; for file in *.8; do \
+ ${INSTALL_MAN} $${file} ${PREFIX}/man/man8/$${file}; \
+ done
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/notes.ms ${DOCDIR}
.include "../../mk/bsd.pkg.mk"
diff --git a/security/cfs/distinfo b/security/cfs/distinfo
index 9a23b142695..6a8d0f52f50 100644
--- a/security/cfs/distinfo
+++ b/security/cfs/distinfo
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.2 2001/06/05 11:15:42 agc Exp $
+$NetBSD: distinfo,v 1.3 2001/06/07 15:35:14 jlam Exp $
SHA1 (cfs-1.4.1.tar.gz) = be3f73b233149477b739456498c71b120d5f2fb5
Size (cfs-1.4.1.tar.gz) = 98943 bytes
-SHA1 (patch-aa) = d7def837754ff4648b7a01159b71afcff613f47c
+SHA1 (patch-aa) = ab443ca956c48d186072acb3042d36966dbc105a
+SHA1 (patch-ab) = 1ff2d2e32b87332ec66cc8f01299fa4b1ddac81a
+SHA1 (patch-ac) = 354290ff606fab97b73980e6e512f10ef1397f01
+SHA1 (patch-ad) = 2ed5967d59d8f91948b2dd9ed4b18c5073d63615
diff --git a/security/cfs/files/cfsd.sh b/security/cfs/files/cfsd.sh
new file mode 100644
index 00000000000..1500dc9d737
--- /dev/null
+++ b/security/cfs/files/cfsd.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+#
+# $NetBSD: cfsd.sh,v 1.3 2001/06/07 15:35:14 jlam Exp $
+#
+# PROVIDE: cfsd
+# REQUIRE: mountd
+#
+# To start cfsd at startup, copy this script to /etc/rc.d and set
+# cfs=YES in /etc/rc.conf.
+
+name="cfsd"
+rcvar=$name
+command="@PREFIX@/sbin/${name}"
+command_args="> /dev/null 2>&1"
+required_vars="mountd rpcbind"
+
+# set defaults
+if [ -r /etc/rc.conf ]
+then
+ . /etc/rc.conf
+else
+ eval ${rcvar}=YES
+fi
+
+# $flags from environment overrides ${rcvar}_flags
+if [ -n "${flags}" ]
+then
+ eval ${rcvar}_flags="${flags}"
+fi
+
+checkyesno()
+{
+ eval _value=\$${1}
+ case $_value in
+ [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) return 0 ;;
+ [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;;
+ *)
+ echo "\$${1} is not set properly."
+ return 1
+ ;;
+ esac
+}
+
+cmd=${1:-start}
+case ${cmd} in
+force*)
+ cmd=${cmd#force}
+ forcecmd=YES
+ eval ${rcvar}=YES
+ ;;
+esac
+
+required_vars="${rcvar} ${required_vars}"
+pid_cmd="ps ax | awk '{print \$1,\$5}' | grep ${name} | awk '{print \$1}'"
+
+for _var in ${required_vars}
+do
+ if ! checkyesno ${_var}
+ then
+ echo "\$${_var} is not set."
+ if [ -z "${forcecmd}" ]
+ then
+ exit 1
+ fi
+ fi
+done
+
+if [ -x ${command} ]
+then
+ # Execute any relevant precmd.
+ eval precmd="\$${rcvar}_${cmd}_precmd"
+ if ! eval ${precmd} && [ -z "${forcecmd}" ]
+ then
+ exit 1
+ fi
+
+ case ${cmd} in
+ start)
+ echo "Starting ${name}."
+ eval ${command} ${cfsd_flags} ${command_args}
+ ;;
+ stop)
+ pid=`eval ${pid_cmd}`
+ if [ -z "${pid}" ]
+ then
+ echo "${name} not running?"
+ exit 1
+ fi
+ echo "Stopping ${name}."
+ kill ${pid}
+ ;;
+ restart)
+ ( $0 forcestop )
+ sleep 5
+ $0 forcestart
+ ;;
+ status)
+ pid=`eval ${pid_cmd}`
+ if [ -n "${pid}" ]; then
+ echo "${name} is running as pid ${pid}."
+ else
+ echo "${name} is not running."
+ exit 1
+ fi
+ ;;
+ *)
+ echo 1>&2 "Usage: $0 [restart|start|stop|status]"
+ exit 1
+ ;;
+ esac
+fi
diff --git a/security/cfs/patches/patch-aa b/security/cfs/patches/patch-aa
index 745c4621ccd..a23447df2cf 100644
--- a/security/cfs/patches/patch-aa
+++ b/security/cfs/patches/patch-aa
@@ -1,80 +1,34 @@
-$NetBSD: patch-aa,v 1.2 2001/06/05 11:15:42 agc Exp $
+$NetBSD: patch-aa,v 1.3 2001/06/07 15:35:15 jlam Exp $
---- Makefile 2001/06/05 09:15:05 1.1
-+++ Makefile 2001/06/05 10:08:08
-@@ -79,13 +79,13 @@
+--- Makefile.orig Thu May 3 11:29:21 2001
++++ Makefile Thu Jun 7 07:28:23 2001
+@@ -74,18 +74,19 @@
+ #CC=cc
+ #COPT=-O -DNOT_ANSI_C -DPROTOTYPES=0
+ # for gcc, use
+-CC=gcc
+-COPT=-O2 -DPROTOTYPES=1
++#CC=gcc
++#COPT=-O2 -DPROTOTYPES=1
++CFLAGS+=${CFS_CFLAGS}
#1B: paths:
#some peple like /usr/local/sbin instead of /usr/local/etc
-BINDIR=/usr/local/bin
-ETCDIR=/usr/local/etc
+BINDIR=${PREFIX}/bin
-+ETCDIR=${PREFIX}/libexec
++ETCDIR=${PREFIX}/sbin
PRINTCMD=enscript -Gr2
# you only need RSAREF for ESM
# these paths WILL have to be changed...
-RSALIB=/usr/mab/rsaref/install/rsaref.a
-RINCLUDES=/usr/mab/rsaref/source
+#RSALIB=/usr/mab/rsaref/install/rsaref.a
-+RINCLUDES=${PREFIX}/include
++#RINCLUDES=/usr/mab/rsaref/source
# if you're a paranoid fascist, you might want to configure
# default timeouts on the attach command. If you do,
-@@ -104,6 +104,8 @@
- # Uncomment the options for the your local platform.
- # You'll need to figure out how to install man pages yourself.
-
-+OS!= uname -s
-+
- ## Use these for vanilla SUNOS 4.x .
- #CFLAGS=$(COPT) -I$(RINCLUDES) -DSUN
- #LIBS=
-@@ -116,10 +118,12 @@
- ## Linux dists).
- ## See NOTE TO LINUX USERS above, and also README.linux,
- ## if you can't make things work.
--#CFLAGS=$(COPT) -U__STDC__ -Dd_fileno=d_ino -I$(RINCLUDES)
--#LIBS=
--#COMPAT=
--#RPCOPTS= -k -b
-+.if ${OS} == "Linux"
-+CFLAGS=$(COPT) -U__STDC__ -Dd_fileno=d_ino -I$(RINCLUDES)
-+LIBS=
-+COMPAT=
-+RPCOPTS= -k -b
-+.endif
-
- ## A few Linux users have reported success with these
- ## options:
-@@ -211,15 +215,18 @@
- #* Use these for NetBSD 1.5
- ## For mounting, use
- ## mount -o intr,-2 127.0.0.1:/null /crypt
--#CFLAGS=$(COPT) -DBSD44 -DANYPORT -DCFS_PORT=2049 -DSHORTLINKS -I$(RINCLUDES) -traditional
--#COMPAT=-lcompat
--#RPCOPTS=-b
--
--## Solaris 2.3 / SUNOS 5.x
--#CFLAGS=$(COPT) -DSOLARIS2X -DPORTMAP -I$(RINCLUDES) -DPTMX
--#LIBS=-lsocket -lnsl
--#COMPAT=
--#RPCOPTS=
-+.if ${OS} == "NetBSD"
-+CFLAGS=$(COPT) -DBSD44 -DANYPORT -DCFS_PORT=2049 -DSHORTLINKS -I$(RINCLUDES) -traditional
-+COMPAT=-lcompat
-+RPCOPTS=-b
-+.endif
-+
-+.if ${OS} == "SunOS"
-+CFLAGS=$(COPT) -DSOLARIS2X -DPORTMAP -I$(RINCLUDES) -DPTMX
-+LIBS=-lsocket -lnsl
-+COMPAT=
-+RPCOPTS=
-+.endif
-
- ## not sure what to do for NeXT. I think this works:
- #CFLAGS=$(COPT) -posix -D_BSD -DANYPORT -I$(RINCLUDES)
-@@ -229,7 +236,7 @@
+@@ -229,7 +230,7 @@
# (3/3) CONFIGURE: one last thing
#==========================================================================
# finally, comment out the next line:
diff --git a/security/cfs/pkg/PLIST b/security/cfs/pkg/PLIST
index 01c7c8c4870..7c30b507852 100644
--- a/security/cfs/pkg/PLIST
+++ b/security/cfs/pkg/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.1.1.2 2001/06/05 22:19:11 jlam Exp $
+@comment $NetBSD: PLIST,v 1.2 2001/06/07 15:35:15 jlam Exp $
bin/cfs_attach
bin/cfs_cat
bin/cfs_detach
@@ -18,6 +18,5 @@ man/man8/cfs_cat.8
man/man8/cfs_name.8
man/man8/cfsd.8
sbin/cfsd
-share/doc/cfs/README.netbsd
share/doc/cfs/notes.ms
@dirrm share/doc/cfs