diff --git a/sysutils/spiped/Makefile b/sysutils/spiped/Makefile index d9f5cac39925..6c3476b05ebc 100644 --- a/sysutils/spiped/Makefile +++ b/sysutils/spiped/Makefile @@ -1,42 +1,43 @@ PORTNAME= spiped PORTVERSION= 1.6.4 +PORTREVISION= 1 CATEGORIES= sysutils security MASTER_SITES= http://www.tarsnap.com/spiped/ MAINTAINER= cperciva@tarsnap.com COMMENT= Daemon for creating secure symmetric pipes WWW= https://www.tarsnap.com/spiped.html LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/COPYRIGHT # The spiped build only needs C99, but asking for compiler:c11 will help to # get us a compiler which has support for AESNI on x86 systems USES= compiler:c11 tar:tgz ssl # Install into ${STAGEDIR}${PREFIX} MAKE_ARGS+= BINDIR=${STAGEDIR}${PREFIX}/bin MAKE_ARGS+= MAN1DIR=${STAGEDIR}${PREFIX}/share/man/man1 # add -I and -L directories for OpenSSL MAKE_ARGS+= CFLAGS="-O2 -I${OPENSSLINC}" MAKE_ARGS+= LDADD_EXTRA="-L${OPENSSLLIB}" PORTDOCS= BUILDING CHANGELOG COPYRIGHT README.md STYLE PLIST_FILES= bin/spipe \ bin/spiped \ share/man/man1/spipe.1.gz \ share/man/man1/spiped.1.gz USE_RC_SUBR= spiped OPTIONS_DEFINE= DOCS USERS= spiped GROUPS= spiped post-install: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR} .include diff --git a/sysutils/spiped/files/spiped.in b/sysutils/spiped/files/spiped.in index 5f661fd398c8..fedc8b5e7fa2 100644 --- a/sysutils/spiped/files/spiped.in +++ b/sysutils/spiped/files/spiped.in @@ -1,83 +1,88 @@ #!/bin/sh # PROVIDE: spiped # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # # spiped_enable: Set to YES to enable spiped. # spiped_uid: User for spiped process (default "spiped"). # spiped_gid: Group for spiped process (default "spiped"). # spiped_pipes: List of names of pipes to create. # spiped_pipe_X_mode: "encrypt"/"client" or "decrypt"/"server". # spiped_pipe_X_source: Source address of pipe X. # spiped_pipe_X_target: Target address of pipe X. # spiped_pipe_X_key: Key file for pipe X. # spiped_pipe_X_flags: Optional flags for pipe X. See spiped(1) for details. . /etc/rc.subr name="spiped" rcvar=spiped_enable load_rc_config $name : ${spiped_enable="NO"} : ${spiped_uid="spiped"} : ${spiped_gid="spiped"} command=%%PREFIX%%/bin/${name} start_cmd="${name}_start" stop_cmd="${name}_stop" spiped_start() { local P PIDFILE MODE SOURCE TARGET KEY MODEFLAG for P in ${spiped_pipes}; do PIDFILE=/var/run/spiped_${P}.pid eval MODE=\$spiped_pipe_${P}_mode eval SOURCE=\$spiped_pipe_${P}_source eval TARGET=\$spiped_pipe_${P}_target eval KEY=\$spiped_pipe_${P}_key eval FLAGS=\$spiped_pipe_${P}_flags case "$MODE" in encrypt | client) MODEFLAG="-e" ;; decrypt | server) MODEFLAG="-d" ;; *) echo Invalid value for spiped_pipe_${P}_mode: $MODE continue esac + case "$SOURCE" in + /*) + [ -S "$SOURCE" ] && rm -f "$SOURCE" + ;; + esac ${command} -D $MODEFLAG -s $SOURCE -t $TARGET -k $KEY \ -u ${spiped_uid}:${spiped_gid} -p $PIDFILE $FLAGS done } spiped_stop() { local P PIDFILE for P in ${spiped_pipes}; do PIDFILE=/var/run/spiped_${P}.pid if [ -f $PIDFILE ] ; then rc_pid=$(check_pidfile $PIDFILE $command) fi if [ -z "$rc_pid" ]; then [ -n "$rc_fast" ] && return 0 _run_rc_notrunning return 1 fi echo "Stopping ${name}." kill $sig_stop $rc_pid wait_for_pids $rc_pid rm $PIDFILE done } run_rc_command "$1"