mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-03 06:04:53 +00:00
- Add patches for OpenBSD bugs 6624 and 6627
- Switch to USERS and GROUPS framework
This commit is contained in:
parent
796bfe95b7
commit
4c7caa5f18
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275145
@ -6,7 +6,7 @@
|
||||
|
||||
PORTNAME= relayd
|
||||
PORTVERSION= 4.9.20110526
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${MASTER_SITE_LOCAL}
|
||||
MASTER_SITE_SUBDIR= mm
|
||||
@ -29,13 +29,8 @@ CFLAGS+= -I${PREFIX}/include -Wall
|
||||
|
||||
MAKE_ARGS+= BINDIR=${PREFIX}/sbin MANDIR=${PREFIX}/man/man
|
||||
|
||||
RUSER= _relayd
|
||||
RGROUP= _relayd
|
||||
PKGINSTALL= ${WRKDIR}/pkginstall
|
||||
SUB_FILES+= pkg-install
|
||||
|
||||
SUB_LIST+= RUSER=${RUSER} \
|
||||
RGROUP=${RGROUP}
|
||||
USERS= _relayd
|
||||
GROUPS= _relayd
|
||||
|
||||
OPTIONS= LIBEVENT_STATIC "Build with static libevent" Off
|
||||
|
||||
@ -66,10 +61,6 @@ post-patch:
|
||||
${WRKSRC}/relayd/relayd.conf.5 \
|
||||
${WRKSRC}/relayd/relayd.8
|
||||
|
||||
pre-su-install:
|
||||
@${SETENV} PKG_PREFIX=${PREFIX} \
|
||||
${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
|
||||
|
||||
post-install:
|
||||
@${INSTALL_DATA} ${WRKSRC}/../etc/relayd.conf \
|
||||
${PREFIX}/etc/relayd.conf.sample
|
||||
|
20
net/relayd/files/patch-bug-6624
Normal file
20
net/relayd/files/patch-bug-6624
Normal file
@ -0,0 +1,20 @@
|
||||
--- relayd/check_tcp.c.orig Sat Jun 4 08:59:06 2011
|
||||
+++ relayd/check_tcp.c Sat Jun 4 09:07:17 2011
|
||||
@@ -77,6 +77,8 @@
|
||||
goto bad;
|
||||
}
|
||||
|
||||
+ cte->s = s;
|
||||
+
|
||||
bzero(&lng, sizeof(lng));
|
||||
if (setsockopt(s, SOL_SOCKET, SO_LINGER, &lng, sizeof(lng)) == -1)
|
||||
goto bad;
|
||||
@@ -100,7 +102,6 @@
|
||||
|
||||
cte->buf = NULL;
|
||||
cte->host->up = HOST_UP;
|
||||
- cte->s = s;
|
||||
event_del(&cte->ev);
|
||||
event_set(&cte->ev, s, EV_TIMEOUT|EV_WRITE, tcp_write, cte);
|
||||
event_add(&cte->ev, &tv);
|
||||
|
41
net/relayd/files/patch-bug-6627
Normal file
41
net/relayd/files/patch-bug-6627
Normal file
@ -0,0 +1,41 @@
|
||||
--- relayd/hce.c.orig Mon Jun 6 18:02:45 2011
|
||||
+++ relayd/hce.c Mon Jun 6 18:09:07 2011
|
||||
@@ -207,10 +207,27 @@
|
||||
struct timeval tv_now, tv_dur;
|
||||
u_long duration;
|
||||
u_int logopt;
|
||||
- struct host *h;
|
||||
+ struct host *h, *hostupd;
|
||||
int hostup;
|
||||
const char *msg;
|
||||
|
||||
+ if ((hostupd = host_find(env, host->conf.id)) == NULL)
|
||||
+ fatalx("hce_notify_done: desynchronized");
|
||||
+
|
||||
+ if ((table = table_find(env, host->conf.tableid)) == NULL)
|
||||
+ fatalx("hce_notify_done: invalid table id");
|
||||
+
|
||||
+ if (hostupd->flags & F_DISABLE) {
|
||||
+ if (env->sc_opts & RELAYD_OPT_LOGUPDATE) {
|
||||
+ log_info("host %s, check %s%s (ignoring result, "
|
||||
+ "host disabled)",
|
||||
+ host->conf.name, table_check(table->conf.check),
|
||||
+ (table->conf.flags & F_SSL) ? " use ssl" : "");
|
||||
+ }
|
||||
+ host->flags |= (F_CHECK_SENT|F_CHECK_DONE);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
hostup = host->up;
|
||||
host->he = he;
|
||||
|
||||
@@ -250,9 +267,6 @@
|
||||
duration = (tv_dur.tv_sec * 1000) + (tv_dur.tv_usec / 1000.0);
|
||||
else
|
||||
duration = 0;
|
||||
-
|
||||
- if ((table = table_find(env, host->conf.tableid)) == NULL)
|
||||
- fatalx("hce_notify_done: invalid table id");
|
||||
|
||||
if (env->sc_opts & logopt) {
|
||||
log_info("host %s, check %s%s (%lums), state %s -> %s, "
|
@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
case $2 in
|
||||
PRE-INSTALL)
|
||||
USER=%%RUSER%%
|
||||
GROUP=%%RGROUP%%
|
||||
UID=913
|
||||
GID=913
|
||||
|
||||
if pw group show "${GROUP}" 2>/dev/null; then
|
||||
echo "You already have a group \"${GROUP}\", so I will use it."
|
||||
else
|
||||
if pw groupadd ${GROUP} -g ${GID}; then
|
||||
echo "Added group \"${GROUP}\"."
|
||||
else
|
||||
echo "Adding group \"${GROUP}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if pw user show "${USER}" 2>/dev/null; then
|
||||
echo "You already have a user \"${USER}\", so I will use it."
|
||||
else
|
||||
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
|
||||
-d /var/empty -c "Relay Daemon" -s /usr/sbin/nologin
|
||||
then
|
||||
echo "Added user \"${USER}\"."
|
||||
else
|
||||
echo "Adding user \"${USER}\" failed..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user