aboutsummaryrefslogtreecommitdiff
path: root/sysutils/radmind
diff options
context:
space:
mode:
authorSofian Brabez <sbz@FreeBSD.org>2012-04-20 22:14:34 +0000
committerSofian Brabez <sbz@FreeBSD.org>2012-04-20 22:14:34 +0000
commit8f100ec53fde110ede80b7b58cfe1aecb01d7e06 (patch)
tree4795367d2998306042be26abb7084c37553bf23a /sysutils/radmind
parent17b8dd17e45c577076d91e6697d156a6f38d5f31 (diff)
downloadports-8f100ec53fde110ede80b7b58cfe1aecb01d7e06.tar.gz
ports-8f100ec53fde110ede80b7b58cfe1aecb01d7e06.zip
Notes
Diffstat (limited to 'sysutils/radmind')
-rw-r--r--sysutils/radmind/Makefile15
-rw-r--r--sysutils/radmind/files/config.sample8
-rw-r--r--sysutils/radmind/files/optpatch-ignore_timestamps94
-rw-r--r--sysutils/radmind/files/patch-.gitignore17
-rw-r--r--sysutils/radmind/files/patch-Makefile.in50
-rw-r--r--sysutils/radmind/files/patch-README46
-rw-r--r--sysutils/radmind/files/patch-aclocal.m421
-rw-r--r--sysutils/radmind/files/patch-configure.ac44
-rw-r--r--sysutils/radmind/files/patch-lapply.c52
-rw-r--r--sysutils/radmind/files/patch-man__lcreate.115
-rw-r--r--sysutils/radmind/files/patch-man__rash.138
-rw-r--r--sysutils/radmind/files/patch-mkdirs.c13
-rw-r--r--sysutils/radmind/files/patch-ra.sh139
-rw-r--r--sysutils/radmind/files/patch-t2pkg.c46
-rw-r--r--sysutils/radmind/files/pkg-message.in23
-rw-r--r--sysutils/radmind/files/radmind.sh.in4
-rw-r--r--sysutils/radmind/pkg-descr4
-rw-r--r--sysutils/radmind/pkg-plist6
18 files changed, 614 insertions, 21 deletions
diff --git a/sysutils/radmind/Makefile b/sysutils/radmind/Makefile
index 05ae9b8418b5..eae329fb33eb 100644
--- a/sysutils/radmind/Makefile
+++ b/sysutils/radmind/Makefile
@@ -7,6 +7,7 @@
PORTNAME= radmind
PORTVERSION= 1.14.1
+PORTREVISION= 2012032001
CATEGORIES= sysutils
MASTER_SITES= SF
MASTER_SITE_SUBDIR=${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
@@ -27,7 +28,7 @@ GROUPS= ${RADMINUSER}
RADMIND_BASE_DIR?= /var/radmind
SUB_LIST= RADMIND_BASE_DIR=${RADMIND_BASE_DIR} RADMINUSER=${RADMINUSER}
-PLIST_SUB= RADMIND_BASE_DIR=${RADMIND_BASE_DIR}
+PLIST_SUB= RADMIND_BASE_DIR=${RADMIND_BASE_DIR} RADMINUSER=${RADMINUSER}
SUB_FILES+= pkg-install pkg-message
MAN1= fsdiff.1 ktcheck.1 lapply.1 lcksum.1 lcreate.1 lfdiff.1 \
@@ -36,6 +37,14 @@ MAN5= applefile.5
MAN8= radmind.8
DOCS= COPYRIGHT README SPEC
+OPTIONS= IGNORE_TIMESTAMPS "Add '-t' option to fsdiff" Off
+
+.include <bsd.port.options.mk>
+
+.if defined(WITH_IGNORE_TIMESTAMPS)
+EXTRA_PATCHES+= ${FILESDIR}/optpatch-ignore_timestamps
+.endif
+
post-install:
# Ugly hack to remove generated man pages
${RM} -rf ${WRKSRC}/tmp
@@ -44,6 +53,10 @@ post-install:
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${DOCSDIR}
.endif
+ ${CP} ${FILESDIR}/config.sample ${RADMIND_BASE_DIR}/config.sample
+ @if [ ! -f ${RADMIND_BASE_DIR}/config ]; then \
+ ${CP} -p ${RADMIND_BASE_DIR}/config.sample ${RADMIND_BASE_DIR}/config ; \
+ fi
@${CHOWN} -R ${RADMINUSER}:${RADMINUSER} ${RADMIND_BASE_DIR}
@${CAT} ${PKGMESSAGE}
diff --git a/sysutils/radmind/files/config.sample b/sysutils/radmind/files/config.sample
new file mode 100644
index 000000000000..6edae2bf8dc1
--- /dev/null
+++ b/sysutils/radmind/files/config.sample
@@ -0,0 +1,8 @@
+# Example radmind configuration file.
+#
+#
+# Host Command (.K) file.
+# localhost default.K
+# 127.0.0.1 default.K
+######################################################
+
diff --git a/sysutils/radmind/files/optpatch-ignore_timestamps b/sysutils/radmind/files/optpatch-ignore_timestamps
new file mode 100644
index 000000000000..c48855968d80
--- /dev/null
+++ b/sysutils/radmind/files/optpatch-ignore_timestamps
@@ -0,0 +1,94 @@
+--- fsdiff.c.orig
++++ fsdiff.c
+@@ -33,6 +33,7 @@ int dotfd;
+ int lastpercent = -1;
+ int case_sensitive = 1;
+ int tran_format = -1;
++int ignore_timestamps = 0;
+ extern int exclude_warnings;
+ const EVP_MD *md;
+
+@@ -266,7 +267,7 @@ main( int argc, char **argv )
+ cksum = 0;
+ outtran = stdout;
+
+- while (( c = getopt( argc, argv, "%1ACc:IK:o:VvW" )) != EOF ) {
++ while (( c = getopt( argc, argv, "%1ACc:IK:o:tVvW" )) != EOF ) {
+ switch( c ) {
+ case '%':
+ case 'v':
+@@ -320,6 +321,10 @@ main( int argc, char **argv )
+ exclude_warnings = 1;
+ break;
+
++ case 't': /* ignore files for which only the time has changed */
++ ignore_timestamps = 1;
++ break;
++
+ case '?':
+ printf( "bad %c\n", c );
+ errflag++;
+
+--- man/fsdiff.1.orig
++++ man/fsdiff.1
+@@ -11,7 +11,7 @@
+ |
+ .B -1
+ } [
+-.BI -IVW
++.BI -IVWt
+ ] [
+ .BI \-K\ command
+ ] [
+@@ -312,6 +312,9 @@ order of preference and then exits.
+ prints a warning to the standard error when encountering an object
+ matching an exclude pattern.
+ .sp
++.TP 19
++.B \-t
++ignores files where only the timestamp has changed.
+ .SH FILES
+ .TP 19
+ .B _RADMIND_COMMANDFILE
+
+--- transcript.c.orig
++++ transcript.c
+@@ -38,6 +38,7 @@ static struct transcript *prev_tran = NULL;
+ extern int edit_path;
+ extern int case_sensitive;
+ extern int tran_format;
++extern int ignore_timestamps;
+ static char *kdir;
+ static struct list *kfile_list;
+ struct list *special_list;
+@@ -45,6 +46,7 @@ struct list *exclude_list;
+
+ char *path_prefix = NULL;
+ int edit_path;
++int ignore_timestamps;
+ int skip;
+ int cksum;
+ int fs_minus;
+@@ -544,14 +546,16 @@ t_compare( struct pathinfo *fs, struct transcript *tran )
+ t_print( fs, tran, PR_DOWNLOAD );
+ break;
+ }
+- } else if ( fs->pi_stat.st_mtime != tran->t_pinfo.pi_stat.st_mtime ) {
+- t_print( fs, tran, PR_DOWNLOAD );
+- break;
++ } else if ( ignore_timestamps == 0 &&
++ fs->pi_stat.st_mtime != tran->t_pinfo.pi_stat.st_mtime) {
++ t_print( fs, tran, PR_DOWNLOAD );
++ break;
+ }
+
+- if ( fs->pi_stat.st_mtime != tran->t_pinfo.pi_stat.st_mtime ) {
+- t_print( fs, tran, PR_STATUS );
+- break;
++ if ( ignore_timestamps == 0 &&
++ fs->pi_stat.st_mtime != tran->t_pinfo.pi_stat.st_mtime ) {
++ t_print( fs, tran, PR_STATUS );
++ break;
+ }
+ }
+
diff --git a/sysutils/radmind/files/patch-.gitignore b/sysutils/radmind/files/patch-.gitignore
new file mode 100644
index 000000000000..81241bb8a606
--- /dev/null
+++ b/sysutils/radmind/files/patch-.gitignore
@@ -0,0 +1,17 @@
+--- ./.gitignore.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./.gitignore 2012-03-20 14:37:54.000000000 -0400
+@@ -10,12 +10,8 @@
+ config.log
+ config.status
+
+-# External Libraries #
+-######################
+-libsnet
+-
+-# Comiled Files #
+-#################
++# Compiled Files #
++##################
+ *.o
+ fsdiff
+ ktcheck
diff --git a/sysutils/radmind/files/patch-Makefile.in b/sysutils/radmind/files/patch-Makefile.in
new file mode 100644
index 000000000000..4b2b317a4266
--- /dev/null
+++ b/sysutils/radmind/files/patch-Makefile.in
@@ -0,0 +1,50 @@
+--- ./Makefile.in.orig 2010-12-12 22:43:49.000000000 -0500
++++ ./Makefile.in 2012-03-20 14:37:54.000000000 -0400
+@@ -204,37 +204,37 @@
+ radmind : libsnet/libsnet.la ${RADMIND_OBJ} Makefile
+ ${CC} ${CFLAGS} -o radmind ${RADMIND_OBJ} ${LDFLAGS}
+
+-fsdiff : ${FSDIFF_OBJ}
++fsdiff : libsnet/libsnet.la ${FSDIFF_OBJ}
+ ${CC} ${CFLAGS} -o fsdiff ${FSDIFF_OBJ} ${LDFLAGS}
+
+-ktcheck: ${KTCHECK_OBJ}
++ktcheck: libsnet/libsnet.la ${KTCHECK_OBJ}
+ ${CC} ${CFLAGS} -o ktcheck ${KTCHECK_OBJ} ${LDFLAGS}
+
+-lapply: ${LAPPLY_OBJ}
++lapply: libsnet/libsnet.la ${LAPPLY_OBJ}
+ ${CC} ${CFLAGS} -o lapply ${LAPPLY_OBJ} ${LDFLAGS}
+
+-lcksum: ${LCKSUM_OBJ}
++lcksum: libsnet/libsnet.la ${LCKSUM_OBJ}
+ ${CC} ${CFLAGS} -o lcksum ${LCKSUM_OBJ} ${LDFLAGS}
+
+-lcreate: ${LCREATE_OBJ}
++lcreate: libsnet/libsnet.la ${LCREATE_OBJ}
+ ${CC} ${CFLAGS} -o lcreate ${LCREATE_OBJ} ${LDFLAGS}
+
+-lmerge: ${LMERGE_OBJ}
++lmerge: libsnet/libsnet.la ${LMERGE_OBJ}
+ ${CC} ${CFLAGS} -o lmerge ${LMERGE_OBJ} ${LDFLAGS}
+
+-lfdiff: ${LFDIFF_OBJ}
++lfdiff: libsnet/libsnet.la ${LFDIFF_OBJ}
+ ${CC} ${CFLAGS} -o lfdiff ${LFDIFF_OBJ} ${LDFLAGS}
+
+-repo : ${REPO_OBJ}
++repo: libsnet/libsnet.la ${REPO_OBJ}
+ ${CC} ${CFLAGS} -o repo ${REPO_OBJ} ${LDFLAGS}
+
+ t2pkg: ${T2PKG_OBJ}
+ ${CC} ${CFLAGS} -o t2pkg ${T2PKG_OBJ} ${LDFLAGS}
+
+-twhich: ${TWHICH_OBJ}
++twhich: libsnet/libsnet.la ${TWHICH_OBJ}
+ ${CC} ${CFLAGS} -o twhich ${TWHICH_OBJ} ${LDFLAGS}
+
+-lsort: ${LSORT_OBJ}
++lsort: libsnet/libsnet.la ${LSORT_OBJ}
+ ${CC} ${CFLAGS} -o lsort ${LSORT_OBJ} ${LDFLAGS}
+
+ FRC :
diff --git a/sysutils/radmind/files/patch-README b/sysutils/radmind/files/patch-README
new file mode 100644
index 000000000000..5c47af2589dd
--- /dev/null
+++ b/sysutils/radmind/files/patch-README
@@ -0,0 +1,46 @@
+--- ./README.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./README 2012-03-20 14:37:54.000000000 -0400
+@@ -72,25 +72,25 @@
+ % "env CPPFLAGS=-I/usr/kerberos/include ./configure"
+
+ -----------------
+-Building from CVS
++Building from git
+ -----------------
+ The Radmind Development Team occasionally asks for help testing a new feature
+ or bug fix. The best way to assist is to download the source code from the
+-CVS repository and build it manually. The following steps will result in
+-a build from CVS.
++git repository and build it manually. The following steps will result in
++a build from git.
+
+-1) Download the source from CVS:
++1) Download the source from git:
+
+-cvs -d :pserver:anonymous@radmind.cvs.sourceforge.net:/cvsroot/radmind \
+- checkout radmind
++ git clone git://radmind.git.sourceforge.net/gitroot/gradmind
+
+ 2) Move into the new radmind directory:
+
+-cd radmind
++ cd radmind
+
+-3) Download libsnet[1], the network library Radmind uses:
++3) Checkout all required submodules [1]:
+
+-sh bin/getsnet
++ git submodule init
++ git submodule update
+
+ 4) Follow steps 2 and 3 from "More detailed instructions" for building, above.
+
+@@ -115,4 +115,7 @@
+ ----------
+ References
+ ----------
+-[1]: http://sourceforge.net/projects/libsnet
++[1]: Current submodules:
++
++ * libsnet, a networking library with TLS support
++ http://sourceforge.net/projects/libsnet
diff --git a/sysutils/radmind/files/patch-aclocal.m4 b/sysutils/radmind/files/patch-aclocal.m4
new file mode 100644
index 000000000000..c6d78dc7a296
--- /dev/null
+++ b/sysutils/radmind/files/patch-aclocal.m4
@@ -0,0 +1,21 @@
+--- ./aclocal.m4.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./aclocal.m4 2012-03-20 14:37:54.000000000 -0400
+@@ -105,16 +105,11 @@
+ arches="-arch i386 -arch ppc"
+ ;;
+
+- darwin9*)
++ darwin9*|darwin10*|darwin11*)
+ dep_target="-mmacosx-version-min=10.4"
+ macosx_sdk="MacOSX10.5.sdk"
+ arches="-arch i386 -arch x86_64 -arch ppc -arch ppc64"
+- ;;
+-
+- darwin10*)
+- dep_target="-mmacosx-version-min=10.4"
+- macosx_sdk="MacOSX10.6.sdk"
+- arches="-arch i386 -arch x86_64 -arch ppc"
++ LDFLAGS="$LDFLAGS -L/Developer/SDKs/$macosx_sdk/usr/lib"
+ ;;
+
+ *)
diff --git a/sysutils/radmind/files/patch-configure.ac b/sysutils/radmind/files/patch-configure.ac
new file mode 100644
index 000000000000..a470974df3b4
--- /dev/null
+++ b/sysutils/radmind/files/patch-configure.ac
@@ -0,0 +1,44 @@
+--- ./configure.ac.orig 2010-12-12 22:43:38.000000000 -0500
++++ ./configure.ac 2012-03-20 14:37:54.000000000 -0400
+@@ -45,24 +45,29 @@
+ # Check sizes
+ AC_CHECK_SIZEOF(off_t)
+
++# check early to make any required changes to environment for following tests.
++CHECK_UNIVERSAL_BINARIES
++
+ # Checks for libraries.
+ AC_CHECK_LIB(c, inet_aton, libc_inet_aton=yes)
+ if test x$libc_inet_aton != xyes; then
+ AC_CHECK_LIB(resolv, inet_aton)
+ fi
+-AC_CHECK_LIB(c, lchown)
+-AC_CHECK_LIB(c, lchmod)
++AC_CHECK_LIB(c, lchown, [AC_DEFINE(HAVE_LCHOWN)], [])
++AC_CHECK_LIB(c, lchmod, [AC_DEFINE(HAVE_LCHMOD)], [])
+ AC_CHECK_LIB(nsl, gethostbyaddr)
+ AC_CHECK_LIB([socket], [socket])
+ AC_CHECK_LIB([ssl], [SSL_accept], , [CHECK_SSL])
+ AC_CHECK_HEADER([openssl/ssl.h], [], [AC_MSG_ERROR([header file <openssl/ssl.h>
+ is required for this software. You may be running RedHat 9. If so, see the FAQ or the README for further instructions.])])
+ AC_CHECK_LIB([crypto], [SSLeay_version], , [CHECK_SSL])
+-AC_CHECK_FUNC([X509_VERIFY_PARAM_set_flags], [AC_DEFINE(HAVE_X509_VERIFY_PARAM)], [])
++AC_CHECK_LIB([crypto], [X509_VERIFY_PARAM_set_flags], [AC_DEFINE(HAVE_X509_VERIFY_PARAM)], [])
+
+ # PAM
+-AC_ARG_WITH([pam], AC_HELP_STRING([--with-pam=yes], [Pluggable Authentication Module support (default: yes)]), [], with_pam=yes)
++AC_ARG_WITH([pam], AC_HELP_STRING([--with-pam=PATH], [Pluggable Authentication Module support (default: /usr)]), [], with_pam=/usr)
+ if test x_"$with_pam" != x_no; then
++ CPPFLAGS="${CPPFLAGS} -I$with_pam/include"
++ LDFLAGS="${LDFLAGS} -L$with_pam/lib"
+ AC_CHECK_LIB([pam], [pam_start],
+ [
+ AC_CHECK_HEADERS(pam/pam_appl.h, , [AC_CHECK_HEADERS(security/pam_appl.h)])
+@@ -75,7 +80,6 @@
+ AC_CHECK_LIB(dns_sd, DNSServiceRegister)
+
+ CHECK_ZLIB
+-CHECK_UNIVERSAL_BINARIES
+
+ # HPUX lacks wait4 and strtoll
+ AC_CHECK_FUNCS(wait4 strtoll)
diff --git a/sysutils/radmind/files/patch-lapply.c b/sysutils/radmind/files/patch-lapply.c
new file mode 100644
index 000000000000..63113803d7d9
--- /dev/null
+++ b/sysutils/radmind/files/patch-lapply.c
@@ -0,0 +1,52 @@
+--- ./lapply.c.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./lapply.c 2012-03-20 14:37:54.000000000 -0400
+@@ -651,27 +651,37 @@
+ filechecklist:
+ if ( head == NULL ) {
+ if ( unlink( path ) != 0 ) {
+- perror( path );
+- goto error2;
+- }
+- if ( !quiet && !showprogress ) {
+- printf( "%s: deleted\n", path );
+- }
+- if ( showprogress ) {
+- progressupdate( PROGRESSUNIT, path );
+- }
+- } else {
+- if ( ischildcase( path, head->path, case_sensitive )) {
+- if ( unlink( path ) != 0 ) {
++ if ( !force || errno != ENOENT ) {
+ perror( path );
+ goto error2;
+ }
++ fprintf( stderr, "Warning: failed to remove %s: %s\n",
++ path, strerror( errno ));
++ } else {
+ if ( !quiet && !showprogress ) {
+ printf( "%s: deleted\n", path );
+ }
+ if ( showprogress ) {
+ progressupdate( PROGRESSUNIT, path );
+ }
++ }
++ } else {
++ if ( ischildcase( path, head->path, case_sensitive )) {
++ if ( unlink( path ) != 0 ) {
++ if ( !force || errno != ENOENT ) {
++ perror( path );
++ goto error2;
++ }
++ fprintf( stderr, "Warning: failed to remove %s: "
++ "%s\n", path, strerror( errno ));
++ } else {
++ if ( !quiet && !showprogress ) {
++ printf( "%s: deleted\n", path );
++ }
++ if ( showprogress ) {
++ progressupdate( PROGRESSUNIT, path );
++ }
++ }
+ } else {
+ /* remove head */
+ if ( rmdir( head->path ) != 0 ) {
diff --git a/sysutils/radmind/files/patch-man__lcreate.1 b/sysutils/radmind/files/patch-man__lcreate.1
new file mode 100644
index 000000000000..5902bace1df5
--- /dev/null
+++ b/sysutils/radmind/files/patch-man__lcreate.1
@@ -0,0 +1,15 @@
+--- ./man/lcreate.1.orig 2010-12-12 22:50:53.000000000 -0500
++++ ./man/lcreate.1 2012-03-20 14:38:03.000000000 -0400
+@@ -45,12 +45,6 @@
+ .sp
+ If the -n option is given, no files or transcripts are uploaded. Instead,
+ .B lcreate
+-verifies that all files exist in the filesystem and have
+-the same size as listed in the transcript. If used with the -c option,
+-checksums are also verified.
+-.sp
+-If the -n option is given, no files or transcripts are uploaded. Instead,
+-.B lcreate
+ uses
+ .BR access (2)
+ to verify that all files in the transcript exist in the
diff --git a/sysutils/radmind/files/patch-man__rash.1 b/sysutils/radmind/files/patch-man__rash.1
new file mode 100644
index 000000000000..dd8178a7cacd
--- /dev/null
+++ b/sysutils/radmind/files/patch-man__rash.1
@@ -0,0 +1,38 @@
+--- ./man/rash.1.orig 2010-12-12 22:50:53.000000000 -0500
++++ ./man/rash.1 2012-03-20 14:38:08.000000000 -0400
+@@ -11,6 +11,10 @@
+ |
+ .B -q
+ ] [
++.BR \-C\ "generate"
++|
++.BI \-C\ checksum
++] [
+ .B \-D
+ .I workingdir
+ ] [
+@@ -120,6 +124,24 @@
+ .B \-c
+ use sha1 checksums.
+ .TP 19
++.BR \-C\ "generate"
++Print a sha1 checksum of the difference transcript of applied changes. For use with
++.IR auto ,
++.IR force
++or
++.IR update .
++.TP 19
++.BI \-C\ checksum
++In
++.I auto
++mode, exit with an error if the checksum of the difference transcript to be applied does not match
++.IR checksum .
++In
++.I update
++or
++.I force
++mode, warn if the two do not match.
++.TP 19
+ .BI \-D\ workingdir
+ change to
+ .I workingdir
diff --git a/sysutils/radmind/files/patch-mkdirs.c b/sysutils/radmind/files/patch-mkdirs.c
new file mode 100644
index 000000000000..de5d57bf7af0
--- /dev/null
+++ b/sysutils/radmind/files/patch-mkdirs.c
@@ -0,0 +1,13 @@
+--- ./mkdirs.c.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./mkdirs.c 2012-03-20 14:38:08.000000000 -0400
+@@ -37,7 +37,9 @@
+ if ( mkdir( path, 0777 ) == 0 ) {
+ break;
+ }
+- if ( errno != ENOENT ) {
++ if ( errno == EEXIST ) {
++ break;
++ } else if ( errno != ENOENT ) {
+ return( -1 );
+ }
+ q = p;
diff --git a/sysutils/radmind/files/patch-ra.sh b/sysutils/radmind/files/patch-ra.sh
new file mode 100644
index 000000000000..949abd5083f9
--- /dev/null
+++ b/sysutils/radmind/files/patch-ra.sh
@@ -0,0 +1,139 @@
+--- ./ra.sh.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./ra.sh 2012-03-20 14:38:08.000000000 -0400
+@@ -91,7 +91,7 @@
+ }
+
+ usage() {
+- $ECHO "Usage: $0 [ -ctV ] [ -D working-directory ] [ -h server ] [ -p port ] [ -w authlevel ] { trip | update | create | auto | force | checkout | checkin } [ /path/or/file ]" >&2
++ $ECHO "Usage: $0 [ -cIltV ] [ -% | -q ] [ -C \"generate\" | -C <checksum> ] [ -D working-directory ] [ -h server ] [ -p port ] [ -w authlevel ] { trip | update | create | auto | force | checkout | checkin } [ /path/or/file ]" >&2
+ exit 1
+ }
+
+@@ -128,6 +128,38 @@
+ fi
+ }
+
++cksum_generate() {
++ if [ -n "$FSDIFF_CHECKSUM" ]; then
++ FTMP_CHECKSUM=`openssl sha1 ${FTMP} | awk '{ print $2 }'`
++ fi
++}
++
++cksum_compare() {
++ if [ -n "$FSDIFF_CHECKSUM" -a \
++ "$FSDIFF_CHECKSUM" != "generate" -a \
++ "$FSDIFF_CHECKSUM" != "$FTMP_CHECKSUM" ]; then
++ return 1
++ fi
++
++ return 0
++}
++
++cksum_print() {
++ if [ -n "$FSDIFF_CHECKSUM" ]; then
++ $ECHO "Difference transcript checksum: $FTMP_CHECKSUM"
++ fi
++}
++
++cksum_mismatch() {
++ if [ -n "$FSDIFF_CHECKSUM" ]; then
++ $ECHO
++ $ECHO "**** Difference transcript checksum mismatch!"
++ $ECHO "**** Expected: $FSDIFF_CHECKSUM"
++ $ECHO "**** Actual: $FTMP_CHECKSUM"
++ #ECHO
++ fi
++}
++
+ update() {
+ opt="$1"
+ kopt=
+@@ -211,6 +243,11 @@
+ fi
+ if [ x"${opt}" = x"interactive" ]; then
+ while [ 1 ]; do
++ cksum_generate
++ if ! cksum_compare; then
++ cksum_mismatch
++ fi
++
+ if [ x"${can_edit}" = x"yes" ]; then
+ $ECHO -n "(e)dit difference transcript, "
+ fi
+@@ -248,7 +285,8 @@
+
+ lapply ${CASE} ${PROGRESS} ${NETOPTS} ${CHECKSUM} ${FTMP}
+ case "$?" in
+- 0) ;;
++ 0) cksum_print
++ ;;
+
+ *) if [ x"$opt" = x"hook" ]; then
+ $ECHO -n "Applying changes failed, trying again "
+@@ -284,7 +322,7 @@
+ . "${DEFAULTS}"
+ fi
+
+-while getopts %cD:h:Ilp:qr:tU:Vw: opt; do
++while getopts %C:cD:h:Ilp:qr:tU:Vw: opt; do
+ case $opt in
+ %) PROGRESS="-%"
+ FPROGRESS="-%"
+@@ -293,6 +331,13 @@
+ q) PROGRESS="-q"
+ ;;
+
++ C) FSDIFF_CHECKSUM="$OPTARG"
++ if ! type openssl >/dev/null 2>&1; then
++ $ECHO "-C requires openssl, but no openssl found in PATH $PATH"
++ cleanup_and_exit
++ fi
++ ;;
++
+ c) CHECKSUM="-csha1"
+ ;;
+
+@@ -524,6 +569,14 @@
+ cleanup
+ exit 1
+ fi
++
++ cksum_generate
++ if ! cksum_compare; then
++ $ECHO "Auto failure: `hostname`: difference cksum mismatch"
++ cksum_mismatch
++ cleanup_and_exit
++ fi
++
+ dopreapply ${FTMP}
+ if [ -s ${FTMP} ]; then
+ lapply ${NETOPTS} ${CASE} ${PROGRESS} \
+@@ -532,6 +585,7 @@
+ 0)
+ $ECHO Auto update: `hostname`
+ cat ${FTMP}
++ cksum_print
+ dopostapply ${FTMP}
+ cleanup
+ break
+@@ -588,14 +642,17 @@
+ exit 0
+ fi
+
++ cksum_generate
++ cksum_compare || cksum_mismatch
+ dopreapply ${FTMP}
+ lapply ${CASE} ${PROGRESS} ${NETOPTS} ${CHECKSUM} ${FTMP}
+ case "$?" in
+- 0) ;;
++ 0) cksum_print
++ ;;
+
+ *) cleanup
+- exit $?
+- ;;
++ exit $?
++ ;;
+ esac
+ dopostapply ${FTMP}
+
diff --git a/sysutils/radmind/files/patch-t2pkg.c b/sysutils/radmind/files/patch-t2pkg.c
new file mode 100644
index 000000000000..5fe9840818a3
--- /dev/null
+++ b/sysutils/radmind/files/patch-t2pkg.c
@@ -0,0 +1,46 @@
+--- ./t2pkg.c.orig 2010-12-12 22:42:49.000000000 -0500
++++ ./t2pkg.c 2012-03-20 14:38:08.000000000 -0400
+@@ -38,6 +38,7 @@
+ extern off_t lsize;
+ extern char *version;
+
++int tran_format = -1;
+ int cksum = 0;
+ int force = 0;
+ int case_sensitive = 1;
+@@ -718,31 +719,23 @@
+ }
+
+ /* create the destination path */
+- if ( snprintf( tmp, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
++ if ( snprintf( dst, MAXPATHLEN, "%s/%s", dstdir, t->t_pinfo.pi_name )
+ >= MAXPATHLEN ) {
+ fprintf( stderr, "%s/%s: path too long\n", dstdir,
+ t->t_pinfo.pi_name );
+ exit( 2 );
+ }
+- if ( mkdirs( tmp ) < 0 ) {
+- fprintf( stderr, "mkdirs %s: %s\n", tmp, strerror( errno ));
+- }
+- if ( realpath( tmp, dst ) == NULL ) {
+- fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
+- exit( 2 );
++ if ( mkdirs( dst ) < 0 ) {
++ fprintf( stderr, "mkdirs %s: %s\n", dst, strerror( errno ));
+ }
+
+ /* and the source path */
+- if ( snprintf( tmp, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
++ if ( snprintf( src, MAXPATHLEN, "%s/%s", root, t->t_pinfo.pi_name )
+ >= MAXPATHLEN ) {
+ fprintf( stderr, "%s/%s: path too long\n", dstdir,
+ t->t_pinfo.pi_name );
+ exit( 2 );
+ }
+- if ( realpath( tmp, src ) == NULL ) {
+- fprintf( stderr, "realpath %s: %s\n", tmp, strerror( errno ));
+- exit( 2 );
+- }
+
+ if ( local_update( t, dst, src, where ) != 0 ) {
+ /* XXX is this really a good idea? */
diff --git a/sysutils/radmind/files/pkg-message.in b/sysutils/radmind/files/pkg-message.in
index a048e2160daf..e99cde202f90 100644
--- a/sysutils/radmind/files/pkg-message.in
+++ b/sysutils/radmind/files/pkg-message.in
@@ -1,16 +1,11 @@
####################
-
-Important Note:
-The radmind daemon now runs as user "%%RADMINUSER%%"
-by default.
-If you have installed an older version of
-the radmind port you may need to chown
-%%RADMIND_BASE_DIR%% appropriately.
-
-
-You may restore the previous behavior by
-setting
- radmind_user="root"
-in /etc/rc.conf
-
+The radmind daemon for this port runs as user "%%RADMINUSER%%"
+by default. If you wish to change this behavior you may
+set the radmind_user variable in /etc/rc.conf
+
+A template configuration file has been installed as
+%%RADMIND_BASE_DIR%%/config.sample .
+Please modify this file as necessary and place it in
+%%RADMIND_BASE_DIR%%/config to ensure proper operation of the
+radmind daemon.
####################
diff --git a/sysutils/radmind/files/radmind.sh.in b/sysutils/radmind/files/radmind.sh.in
index c0d8ff20f3fe..d64beb14c971 100644
--- a/sysutils/radmind/files/radmind.sh.in
+++ b/sysutils/radmind/files/radmind.sh.in
@@ -15,7 +15,7 @@
# You may also override the default daemon user & flags:
#
#radmind_user="radmind"
-#radmind_flags="-D /var/radmind -m 5 -u 077 -Llocal7 -w 0"
+#radmind_flags="-D /var/radmind -u 077 -w 0"
#
# See radmind(8) for flags
#
@@ -32,7 +32,7 @@ required_files=%%RADMIND_BASE_DIR%%/config
radmind_enable=${radmind_enable:-"NO"}
radmind_user=${radmind_user:-"radmind"}
-radmind_flags=${radmind_flags:-"-D %%RADMIND_BASE_DIR%% -m 5 -u 077 -Llocal7 -w 0"}
+radmind_flags=${radmind_flags:-"-D %%RADMIND_BASE_DIR%% -m 5 -u 077 -w 0"}
load_rc_config ${name}
run_rc_command "$1"
diff --git a/sysutils/radmind/pkg-descr b/sysutils/radmind/pkg-descr
index 005f819fc8aa..0953fe6080af 100644
--- a/sysutils/radmind/pkg-descr
+++ b/sysutils/radmind/pkg-descr
@@ -1,6 +1,6 @@
-radmind is a set of tools for creating filesystem diffs which can be
+radmind is a set of tools for creating filesystem diffs which can be
loaded over the network. This is useful for administering a large number
of hosts at the filesystem level. It can also act as an intelligent
tripwire.
-WWW: http://rsug.itd.umich.edu/software/radmind/
+WWW: http://rsug.itd.umich.edu/software/radmind/
diff --git a/sysutils/radmind/pkg-plist b/sysutils/radmind/pkg-plist
index c798185b3e04..fcf1cd431f6c 100644
--- a/sysutils/radmind/pkg-plist
+++ b/sysutils/radmind/pkg-plist
@@ -1,3 +1,4 @@
+@comment $FreeBSD$
bin/fsdiff
bin/ktcheck
bin/lapply
@@ -19,8 +20,9 @@ sbin/radmind
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/client
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/preapply
@exec mkdir -p -m 755 %%RADMIND_BASE_DIR%%/postapply
-@exec chown -R radmind:radmind %%RADMIND_BASE_DIR%%
-@cwd /
+@exec chown -R %%RADMINUSER%%:%%RADMINUSER%% %%RADMIND_BASE_DIR%%
+@unexec if cmp -s %%RADMIND_BASE_DIR%%/config.sample %%RADMIND_BASE_DIR%%/config; then rm -f %%RADMIND_BASE_DIR%%/config; fi
+%%RADMIND_BASE_DIR%%/config.sample
@dirrmtry %%RADMIND_BASE_DIR%%/transcript
@dirrmtry %%RADMIND_BASE_DIR%%/tmp/transcript
@dirrmtry %%RADMIND_BASE_DIR%%/tmp/file