diff options
Diffstat (limited to 'net/csync2/files')
-rw-r--r-- | net/csync2/files/csync2.in | 68 | ||||
-rw-r--r-- | net/csync2/files/patch-csync2.c | 21 | ||||
-rw-r--r-- | net/csync2/files/patch-csync2.h | 11 | ||||
-rw-r--r-- | net/csync2/files/patch-rsync.c | 30 | ||||
-rw-r--r-- | net/csync2/files/pkg-install.in | 60 |
5 files changed, 0 insertions, 190 deletions
diff --git a/net/csync2/files/csync2.in b/net/csync2/files/csync2.in deleted file mode 100644 index 85a100d1e94a..000000000000 --- a/net/csync2/files/csync2.in +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# PROVIDE: csync2 -# REQUIRE: LOGIN -# KEYWORD: shutdown - -# Add the following line to /etc/rc.conf to enable csync2: -# csync2_enable="YES" -# -# Optional configuration of csync2: -# csync2_cfg (str): Path to csync2 main configuration. -# Default is %%PREFIX%%/etc/csync2.cfg. -# csync2_flags (str): Extra flags passed to csync2 program. -# Default to "-ii -v". -# csync2_logfile (str): Path to logfile where daemon' output logged to. -# Default to "/var/log/csync2.log". - -. /etc/rc.subr - -name="csync2" -rcvar=csync2_enable - -pidfile=/var/run/${name}.pid -command=%%PREFIX%%/sbin/csync2 - -start_cmd="csync2_start" - -load_rc_config $name -: ${csync2_enable="NO"} -: ${csync2_flags="-ii -v"} -: ${csync2_cfg="%%PREFIX%%/etc/csync2.cfg"} -: ${csync2_logfile="/var/log/csync2.log"} - -required_files="${csync2_cfg}" - -csync2_check_keys() -{ - [ -f "${csync2_cfg}" ] || return 1 - - _key=`grep '^[[:blank:]]*key[[:space:]]\+.\+;\?$' ${csync2_cfg} |\ - awk '{print($2)}'` - [ -n "${_key}" ] || return 1 - - for _file in ${_key}; do - _file=${_file%;} - [ ! -f "${_file}" ] && \ - warn "PSK specified but not found, use csync2 -k ${_file} to create it." - done - - return 0 -} - -csync2_start() { - - if [ -z "$rc_fast" -a -n "$rc_pid" ]; then - echo 1>&2 "${name} already running? (pid=$rc_pid)." - return 1 - fi - - csync2_check_keys - - check_startmsgs && echo "Starting ${name}." - - /usr/sbin/daemon -p ${pidfile} \ - ${command} ${csync2_flags} >> ${csync2_logfile} 2>&1 -} - -run_rc_command "$1" diff --git a/net/csync2/files/patch-csync2.c b/net/csync2/files/patch-csync2.c deleted file mode 100644 index 82a700578f63..000000000000 --- a/net/csync2/files/patch-csync2.c +++ /dev/null @@ -1,21 +0,0 @@ ---- csync2.c.orig 2013-05-02 12:58:04 UTC -+++ csync2.c -@@ -256,7 +256,7 @@ static int csync_server_bind(void) - struct addrinfo hints; - struct addrinfo *result, *rp; - int save_errno; -- int sfd = -1, s, on = 1; -+ int sfd = -1, s, off = 0, on = 1; - memset(&hints, 0, sizeof(struct addrinfo)); - hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 */ - hints.ai_socktype = SOCK_STREAM; -@@ -284,6 +284,9 @@ static int csync_server_bind(void) - goto error; - if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, (socklen_t) sizeof(on)) < 0) - goto error; -+ if (rp->ai_family == AF_INET6) -+ if (setsockopt(sfd, IPPROTO_IPV6, IPV6_V6ONLY, &off, (socklen_t) sizeof(off)) < 0) -+ goto error; - - if (bind(sfd, rp->ai_addr, rp->ai_addrlen) == 0) - break; /* Success */ diff --git a/net/csync2/files/patch-csync2.h b/net/csync2/files/patch-csync2.h deleted file mode 100644 index c6d392192ac5..000000000000 --- a/net/csync2/files/patch-csync2.h +++ /dev/null @@ -1,11 +0,0 @@ ---- csync2.h.orig 2013-05-02 12:58:14 UTC -+++ csync2.h -@@ -80,7 +80,7 @@ extern int csync_perm(const char *filena - - extern void csync_printtime(); - extern void csync_printtotaltime(); --extern void csync_fatal(const char *fmt, ...); -+extern void csync_fatal(const char *fmt, ...) __dead2; - extern void csync_debug(int lv, const char *fmt, ...); - - #define csync_debug_ping(N) \ diff --git a/net/csync2/files/patch-rsync.c b/net/csync2/files/patch-rsync.c deleted file mode 100644 index c8f47627d5cb..000000000000 --- a/net/csync2/files/patch-rsync.c +++ /dev/null @@ -1,30 +0,0 @@ ---- rsync.c.orig 2015-03-09 14:08:51 UTC -+++ rsync.c -@@ -41,6 +41,7 @@ - - /* This has been taken from rsync:lib/compat.c */ - -+#if 0 - /** - * Like strncpy but does not 0 fill the buffer and always null - * terminates. -@@ -61,6 +62,7 @@ static size_t strlcpy(char *d, const cha - } - return ret; - } -+#endif - - /* splits filepath at the last '/', if any, like so: - * dirname basename filepath -@@ -117,7 +119,10 @@ int mkpath(const char *path, mode_t mode - return -1; - } - -- strlcpy(temp,path,strlen(path)); -+ if(strlcpy(temp,path,sizeof(temp))>=sizeof(temp)) { -+ csync_debug(1,"path too long: %s",path); -+ return -1; -+ } - csync_debug(1,"mkpath full path: %s",temp); - for( remaining=strchr(temp+1, '/'); remaining!=NULL; remaining=strchr(remaining+1, '/') ){ - *remaining='\0'; diff --git a/net/csync2/files/pkg-install.in b/net/csync2/files/pkg-install.in deleted file mode 100644 index 9401f90b79e0..000000000000 --- a/net/csync2/files/pkg-install.in +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -create_cert() { - - _errlog=`mktemp /tmp/.${0##*/}.XXXXX` - code=0 - - exec 3>&2 2>${_errlog} - - openssl genrsa -out ${PKG_PREFIX}/etc/csync2_ssl_key.pem 1024 || code=1 - yes '' | openssl req -new -key ${PKG_PREFIX}/etc/csync2_ssl_key.pem \ - -out /tmp/csync2_ssl_cert.csr || code=1 - openssl x509 -req -days 600 -in /tmp/csync2_ssl_cert.csr \ - -signkey ${PKG_PREFIX}/etc/csync2_ssl_key.pem \ - -out ${PKG_PREFIX}/etc/csync2_ssl_cert.pem || code=1 - - rm -f /tmp/csync2_ssl_cert.csr - - if [ ${code} -ne 0 ]; then - echo "csync2: OpenSSL error occurred:" - echo - cat ${_errlog} - echo - rm -f ${_errlog} - return 1 - fi - - exec 2>&3 - - rm -f ${_errlog} - - chmod 600 ${PKG_PREFIX}/etc/csync2_ssl_key.pem \ - ${PKG_PREFIX}/etc/csync2_ssl_cert.pem - - echo "csync2: RSA certificate-key pair installed." - - return 0 -} - -pre_install() { - return 0 -} - -post_install() { - - [ -n "${PACKAGE_BUILDING}" ] && return 0 - - if [ ! -f ${PKG_PREFIX}/etc/csync2_ssl_cert.pem ]; then - create_cert || return $? - fi - - return 0 -} - -[ $# -eq 2 ] || exit 0 - -case $2 in - "PRE-INSTALL") pre_install ;; - "POST-INSTALL") post_install ;; -esac |