From 68873ca3c7fcc2d45a2d7644c83e86a4a181165d Mon Sep 17 00:00:00 2001 From: Soner Tari Date: Mon, 2 Dec 2019 22:41:32 +0300 Subject: [PATCH] Update OpenBSD patches to 6.6 --- .../amd64/{common => ramdisk_cd}/patch-list | 10 +++--- .../utmfw/distrib/miniroot/patch-dot_profile | 8 ++--- .../utmfw/distrib/miniroot/patch-install_sub | 34 +++++++++---------- openbsd/utmfw/distrib/ramdisk/patch-list | 10 ------ openbsd/utmfw/sbin/disklabel/patch-editor_c | 4 +-- .../utmfw/usr.bin/newsyslog/patch-newsyslog_c | 4 +-- openbsd/utmfw/usr.sbin/relayd/patch-relay_c | 20 ----------- .../utmfw/usr.sbin/relayd/patch-relay_http_c | 27 --------------- openbsd/utmfw/usr.sbin/relayd/patch-relayd_h | 14 -------- .../utmfw/usr.sbin/syslogd/patch-syslogd_c | 12 +++---- 10 files changed, 36 insertions(+), 107 deletions(-) rename openbsd/utmfw/distrib/amd64/{common => ramdisk_cd}/patch-list (51%) delete mode 100644 openbsd/utmfw/distrib/ramdisk/patch-list delete mode 100644 openbsd/utmfw/usr.sbin/relayd/patch-relay_c delete mode 100644 openbsd/utmfw/usr.sbin/relayd/patch-relay_http_c delete mode 100644 openbsd/utmfw/usr.sbin/relayd/patch-relayd_h diff --git a/openbsd/utmfw/distrib/amd64/common/patch-list b/openbsd/utmfw/distrib/amd64/ramdisk_cd/patch-list similarity index 51% rename from openbsd/utmfw/distrib/amd64/common/patch-list rename to openbsd/utmfw/distrib/amd64/ramdisk_cd/patch-list index 867b136d..04a6140e 100644 --- a/openbsd/utmfw/distrib/amd64/common/patch-list +++ b/openbsd/utmfw/distrib/amd64/ramdisk_cd/patch-list @@ -1,10 +1,10 @@ ---- list.orig 2018-10-27 02:53:00.453192386 +0300 -+++ list 2018-05-20 23:18:36.849487904 +0300 -@@ -69,6 +69,7 @@ +--- list.orig Thu Nov 28 15:15:10 2019 ++++ list Thu Nov 28 15:17:45 2019 +@@ -104,6 +104,7 @@ COPY ${CURDIR}/../../miniroot/master.passwd etc/master.passwd SPECIAL pwd_mkdb -p -d etc master.passwd; rm etc/master.passwd - COPY ${DESTDIR}/etc/signify/openbsd-${REV}-base.pub etc/signify/openbsd-${REV}-base.pub -+COPY /etc/signify/utmfw-${REV}.pub etc/signify/utmfw-${REV}.pub + COPY ${DESTDIR}/etc/signify/openbsd-${OSrev}-base.pub etc/signify/openbsd-${OSrev}-base.pub ++COPY /etc/signify/utmfw-${OSrev}.pub etc/signify/utmfw-${OSrev}.pub COPY ${CURDIR}/../../miniroot/protocols etc/protocols COPY ${CURDIR}/../../miniroot/services etc/services TERMCAP vt100,vt220,dumb usr/share/misc/termcap diff --git a/openbsd/utmfw/distrib/miniroot/patch-dot_profile b/openbsd/utmfw/distrib/miniroot/patch-dot_profile index 7d870877..93addb06 100644 --- a/openbsd/utmfw/distrib/miniroot/patch-dot_profile +++ b/openbsd/utmfw/distrib/miniroot/patch-dot_profile @@ -1,6 +1,6 @@ ---- dot.profile.orig Mon Oct 29 20:04:02 2018 -+++ dot.profile Mon Oct 29 20:09:47 2018 -@@ -100,13 +100,13 @@ +--- dot.profile.orig Sun Apr 28 01:08:58 2019 ++++ dot.profile Thu Nov 28 15:26:43 2019 +@@ -103,13 +103,13 @@ fi while :; do @@ -17,7 +17,7 @@ else # User has made a choice; stop the read timeout. [[ -n $timer_pid ]] && kill $timer_pid 2>/dev/null -@@ -114,9 +114,7 @@ +@@ -117,9 +117,7 @@ fi case $REPLY in diff --git a/openbsd/utmfw/distrib/miniroot/patch-install_sub b/openbsd/utmfw/distrib/miniroot/patch-install_sub index 141b6d94..2f7ee177 100644 --- a/openbsd/utmfw/distrib/miniroot/patch-install_sub +++ b/openbsd/utmfw/distrib/miniroot/patch-install_sub @@ -1,6 +1,6 @@ ---- install.sub.orig Sat Sep 22 12:12:36 2018 -+++ install.sub Sun Oct 28 02:00:20 2018 -@@ -1235,7 +1235,7 @@ +--- install.sub.orig Tue Oct 1 05:11:41 2019 ++++ install.sub Thu Nov 28 15:32:42 2019 +@@ -1243,7 +1243,7 @@ # Set up IPv4 and IPv6 interface configuration. configure_ifs() { @@ -9,16 +9,16 @@ # Always need lo0 configured. ifconfig lo0 inet 127.0.0.1/8 -@@ -1243,6 +1243,8 @@ +@@ -1251,6 +1251,8 @@ # In case of restart, delete previous default gateway config. rm -f /tmp/i/mygate + _iflist=$(get_ifs) + while :; do - # Discover last configured vlan interface and increment it's + # Discover last configured vlan interface and increment its # minor for the next offered vlan interface. -@@ -1251,7 +1253,7 @@ +@@ -1259,7 +1261,7 @@ ask_which "network interface" "do you wish to configure" \ "\$(get_ifs) vlan${_vi:-0}" \ @@ -27,7 +27,7 @@ [[ $resp == done ]] && break _if=$resp -@@ -1281,10 +1283,12 @@ +@@ -1289,10 +1291,12 @@ if [[ -f $_hn ]]; then chmod 640 $_hn : ${_first:=$_if} @@ -41,7 +41,7 @@ done } -@@ -1542,8 +1546,9 @@ +@@ -1550,8 +1554,9 @@ # Try to prefetch and control checksum of the set files. # Use dummy for loop as combined assignment and do { ... } while(0). for _issue in ''; do @@ -52,8 +52,8 @@ if ! $_srclocal; then ! _tmpfs_list=$(prefetcharea_fs_list) && -@@ -1586,7 +1591,7 @@ - # The bsd.rd only download/verify/install assumes that the sets +@@ -1594,7 +1599,7 @@ + # The bsd.rd only download/verify/install assumes the sets # location of the next release. So use the right signature file. $UPGRADE_BSDRD && - PUB_KEY=/mnt/etc/signify/openbsd-$((VERSION + 1))-base.pub @@ -61,7 +61,7 @@ # Verify signature file with public keys. ! unpriv -f "$_cfile" \ -@@ -1633,7 +1638,7 @@ +@@ -1643,7 +1648,7 @@ [[ -n $_unver ]] && : ${_issue:="Unverified sets:" ${_unver% }} if [[ -n $_issue ]] && @@ -70,7 +70,7 @@ [[ -d $_tmpsrc ]] && rm -rf "$_tmpsrc" $AI && exit 1 return -@@ -2055,20 +2060,6 @@ +@@ -2092,20 +2097,6 @@ ask_yn "Start sshd(8) by default?" yes START_SSHD=$resp @@ -91,7 +91,7 @@ if [[ -n $CDEV ]]; then _d=${CPROM:-$CDEV} [[ -n $CONSOLE ]] && _cdef=yes -@@ -2099,6 +2090,9 @@ +@@ -2136,6 +2127,9 @@ ;; root|daemon|operator|bin|build|sshd|www|nobody|ftp) ;; @@ -101,7 +101,7 @@ [a-z]*([-a-z0-9_])) ((${#resp} <= 31)) && break ;; -@@ -2897,7 +2891,6 @@ +@@ -2941,7 +2935,6 @@ questions # Gather information for setting up the initial user account. @@ -109,7 +109,7 @@ ask_root_sshd # Set TZ variable based on zonefile and user selection. -@@ -3263,7 +3256,7 @@ +@@ -3360,7 +3353,7 @@ INSTALL_METHOD= NIFS=0 export PS1="$MODE# " @@ -118,7 +118,7 @@ ROOTDEV= ROOTDISK= SETDIR="$VNAME/$ARCH" -@@ -3302,14 +3295,14 @@ +@@ -3399,14 +3392,14 @@ # Selected sets will be installed in the order they are listed in $ALLSETS. # Ensure that siteXX.tgz is the *last* set listed so its contents overwrite # the contents of the other sets, not the other way around. @@ -137,4 +137,4 @@ + SANESETS="${MDSANESETS:-bsd bsd.mp} base${VERSION}.tgz xbase${VERSION}.tgz xfont${VERSION}.tgz site${VERSION}.tgz" fi - # Prepare COLUMNS sanely. \ No newline at end of file + # Prepare COLUMNS sanely. diff --git a/openbsd/utmfw/distrib/ramdisk/patch-list b/openbsd/utmfw/distrib/ramdisk/patch-list deleted file mode 100644 index b0f86204..00000000 --- a/openbsd/utmfw/distrib/ramdisk/patch-list +++ /dev/null @@ -1,10 +0,0 @@ ---- list.orig 2018-10-27 02:54:13.413831813 +0300 -+++ list 2018-05-20 23:19:39.530019077 +0300 -@@ -61,6 +61,7 @@ - COPY ${CURDIR}/../miniroot/master.passwd etc/master.passwd - SPECIAL pwd_mkdb -p -d etc master.passwd; rm etc/master.passwd - COPY ${DESTDIR}/etc/signify/openbsd-${REV}-base.pub etc/signify/openbsd-${REV}-base.pub -+COPY /etc/signify/utmfw-${REV}.pub etc/signify/utmfw-${REV}.pub - COPY ${CURDIR}/../miniroot/protocols etc/protocols - COPY ${CURDIR}/../miniroot/services etc/services - diff --git a/openbsd/utmfw/sbin/disklabel/patch-editor_c b/openbsd/utmfw/sbin/disklabel/patch-editor_c index 8a04fc26..58ebbeca 100644 --- a/openbsd/utmfw/sbin/disklabel/patch-editor_c +++ b/openbsd/utmfw/sbin/disklabel/patch-editor_c @@ -1,5 +1,5 @@ ---- editor.c.orig Fri Nov 29 22:00:03 2019 -+++ editor.c Fri Nov 29 22:04:51 2019 +--- editor.c.orig Fri Nov 29 22:09:57 2019 ++++ editor.c Fri Nov 29 22:10:40 2019 @@ -88,24 +88,20 @@ /* entries for swap and var are changed by editor_allocspace() */ diff --git a/openbsd/utmfw/usr.bin/newsyslog/patch-newsyslog_c b/openbsd/utmfw/usr.bin/newsyslog/patch-newsyslog_c index 13b575c0..d3f917a9 100644 --- a/openbsd/utmfw/usr.bin/newsyslog/patch-newsyslog_c +++ b/openbsd/utmfw/usr.bin/newsyslog/patch-newsyslog_c @@ -1,5 +1,5 @@ ---- newsyslog.c.orig 2018-10-27 02:55:45.190636143 +0300 -+++ newsyslog.c 2018-10-27 02:33:58.807187015 +0300 +--- newsyslog.c.orig Fri Jun 28 16:35:02 2019 ++++ newsyslog.c Thu Nov 28 15:42:06 2019 @@ -144,7 +144,7 @@ char *conf = CONF; /* Configuration file to use */ time_t timenow; diff --git a/openbsd/utmfw/usr.sbin/relayd/patch-relay_c b/openbsd/utmfw/usr.sbin/relayd/patch-relay_c deleted file mode 100644 index c26b8cbb..00000000 --- a/openbsd/utmfw/usr.sbin/relayd/patch-relay_c +++ /dev/null @@ -1,20 +0,0 @@ -UTMFW does not use relayd anymore. ---- relay.c.orig 2018-10-27 02:56:36.323084269 +0300 -+++ relay.c 2018-10-27 02:38:44.977695010 +0300 -@@ -1192,6 +1192,16 @@ - return; - } - -+ // For $TARGET_* expansions -+ struct sockaddr_in target_addr; -+ socklen_t target_addr_len = sizeof(target_addr); -+ if (getsockname(s, (struct sockaddr *)&target_addr, &target_addr_len) == -1) { -+ relay_close(con, "failed to get target address", 1); -+ return; -+ } -+ bcopy(&target_addr, &con->target_ss, target_addr_len); -+ con->target_port = ntohs(target_addr.sin_port); -+ - relay_session(con); - return; - err: diff --git a/openbsd/utmfw/usr.sbin/relayd/patch-relay_http_c b/openbsd/utmfw/usr.sbin/relayd/patch-relay_http_c deleted file mode 100644 index c1a89139..00000000 --- a/openbsd/utmfw/usr.sbin/relayd/patch-relay_http_c +++ /dev/null @@ -1,27 +0,0 @@ -UTMFW does not use relayd anymore. ---- relay_http.c.orig 2018-10-27 02:57:10.819386593 +0300 -+++ relay_http.c 2018-10-27 02:42:40.219756668 +0300 -@@ -1102,6 +1102,23 @@ - return (NULL); - } - } -+ if (strstr(val, "$TARGET_") != NULL) { -+ if (strstr(val, "$TARGET_ADDR") != NULL) { -+ if (print_host(&con->target_ss, ibuf, sizeof(ibuf)) == NULL) -+ return (NULL); -+ if (expand_string(buf, len, -+ "$TARGET_ADDR", ibuf) != 0) -+ return (NULL); -+ log_debug("$TARGET_ADDR = %s", ibuf); -+ } -+ if (strstr(val, "$TARGET_PORT") != NULL) { -+ snprintf(ibuf, sizeof(ibuf), "%u", con->target_port); -+ if (expand_string(buf, len, -+ "$TARGET_PORT", ibuf) != 0) -+ return (NULL); -+ log_debug("$TARGET_PORT = %s", ibuf); -+ } -+ } - if (strstr(val, "$SERVER_") != NULL) { - if (strstr(val, "$SERVER_ADDR") != NULL) { - if (print_host(&rlay->rl_conf.ss, diff --git a/openbsd/utmfw/usr.sbin/relayd/patch-relayd_h b/openbsd/utmfw/usr.sbin/relayd/patch-relayd_h deleted file mode 100644 index 9bbe46e7..00000000 --- a/openbsd/utmfw/usr.sbin/relayd/patch-relayd_h +++ /dev/null @@ -1,14 +0,0 @@ -UTMFW does not use relayd anymore. ---- relayd.h.orig 2018-10-27 02:56:55.043248332 +0300 -+++ relayd.h 2018-10-27 02:40:01.970369772 +0300 -@@ -552,6 +552,10 @@ - objid_t se_relayid; - struct ctl_relay_event se_in; - struct ctl_relay_event se_out; -+ -+ struct sockaddr_storage target_ss; -+ in_port_t target_port; -+ - void *se_priv; - SIPHASH_CTX se_siphashctx; - struct relay_table *se_table; diff --git a/openbsd/utmfw/usr.sbin/syslogd/patch-syslogd_c b/openbsd/utmfw/usr.sbin/syslogd/patch-syslogd_c index 28865fba..998511a1 100644 --- a/openbsd/utmfw/usr.sbin/syslogd/patch-syslogd_c +++ b/openbsd/utmfw/usr.sbin/syslogd/patch-syslogd_c @@ -1,6 +1,6 @@ ---- syslogd.c.orig 2018-10-27 02:58:05.163862868 +0300 -+++ syslogd.c 2018-10-27 02:46:40.433861902 +0300 -@@ -1677,6 +1677,9 @@ +--- syslogd.c.orig Fri Jul 5 16:23:27 2019 ++++ syslogd.c Thu Nov 28 15:43:32 2019 +@@ -1689,6 +1689,9 @@ struct timeval now; @@ -10,7 +10,7 @@ /* * Log a message to the appropriate log files, users, etc. based on * the priority. -@@ -1802,6 +1805,43 @@ +@@ -1815,6 +1818,43 @@ } prog[i] = 0; @@ -54,7 +54,7 @@ /* log the message to the particular outputs */ if (!Initialized) { f = &consfile; -@@ -1815,7 +1855,7 @@ +@@ -1828,7 +1868,7 @@ f->f_type = F_CONSOLE; } init_dropped++; @@ -63,7 +63,7 @@ } SIMPLEQ_FOREACH(f, &Files, f_next) { /* skip messages that are incorrect priority */ -@@ -1887,6 +1927,9 @@ +@@ -1900,6 +1940,9 @@ if (f->f_quick) break; }