rust: Update to 1.78.0 master
authorTianling Shen <cnsztl@immortalwrt.org>
Sat, 4 May 2024 10:39:44 +0000 (18:39 +0800)
committerTianling Shen <cnsztl@gmail.com>
Sun, 5 May 2024 04:49:58 +0000 (12:49 +0800)
- Switch back to .gz tarball
- Replace local bootstrap cache hack with upstreamed option

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
110 files changed:
.circleci/Dockerfile [deleted file]
.circleci/README [deleted file]
.circleci/config.yml [deleted file]
admin/syslog-ng/Makefile
admin/syslog-ng/files/syslog-ng.conf
lang/lua-eco/Makefile
lang/lua5.4/Makefile [new file with mode: 0644]
lang/lua5.4/patches-host/001-include-version-number.patch [new file with mode: 0644]
lang/lua5.4/patches-host/100-no_readline.patch [new file with mode: 0644]
lang/lua5.4/patches/001-include-version-number.patch [new file with mode: 0644]
lang/lua5.4/patches/020-shared_liblua.patch [new file with mode: 0644]
lang/lua5.4/patches/100-no_readline.patch [new file with mode: 0644]
lang/rust/Makefile
lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch [new file with mode: 0644]
lang/rust/patches/0002-rustc-bootstrap-cache.patch [deleted file]
libs/gnutls/Makefile
libs/gnutls/patches/010-m4.patch
libs/gnutls/patches/030-unistring-optional.patch
libs/hyperscan/Makefile
libs/hyperscan/patches/0001-CMakeLists.txt-hack-for-our-build-system.patch [new file with mode: 0644]
libs/libideviceactivation/Makefile [new file with mode: 0644]
libs/libimobiledevice-glue/Makefile [new file with mode: 0644]
libs/libimobiledevice/Makefile
libs/libimobiledevice/patches/020-config.patch
libs/libimobiledevice/patches/100-ios14.patch [deleted file]
libs/libimobiledevice/patches/110-iOS14.patch [deleted file]
libs/libimobiledevice/patches/120-iOS14.patch [deleted file]
libs/libirecovery/Makefile
libs/libplist/Makefile
libs/libusbmuxd/Makefile
mail/msmtp/Makefile
net/adblock-fast/Makefile
net/adblock-fast/files/etc/init.d/adblock-fast
net/alist/Makefile
net/banip/Makefile
net/banip/files/README.md
net/banip/files/banip-functions.sh
net/banip/files/banip.feeds
net/cloudflared/Makefile
net/dnsproxy/Makefile
net/dnsproxy/files/dnsproxy.config
net/dnsproxy/files/dnsproxy.init
net/dnsproxy/files/dnsproxy.json [new file with mode: 0644]
net/frr/Makefile
net/frr/patches/998-lib-fix-error-on-MacOS.patch [new file with mode: 0644]
net/gensio/Makefile
net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch [deleted file]
net/gensio/patches/0002_ax_python_devel-fix-serial.patch [deleted file]
net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch [deleted file]
net/hev-socks5-server/Makefile [new file with mode: 0644]
net/hev-socks5-server/files/hev-socks5-server.config [new file with mode: 0644]
net/hev-socks5-server/files/hev-socks5-server.init [new file with mode: 0644]
net/hev-socks5-server/test.sh [new file with mode: 0755]
net/jool/files/readme.md
net/librespeed-go/Makefile
net/nextdns/Makefile
net/nmap/Makefile
net/nmap/patches/010-Build-based-on-OpenSSL-version.patch [deleted file]
net/nmap/patches/020-Python3-port-of-ndiff.patch [deleted file]
net/nmap/patches/030-ncat-drop-ca-bundle.patch
net/nmap/patches/100-nsock-Fix-compilation-error-with-OPENSSL_NO_DTLS.patch [new file with mode: 0644]
net/p910nd/Makefile
net/p910nd/files/p910nd.hotplug
net/pdns-recursor/Makefile
net/ser2net/Makefile
net/sing-box/Makefile
net/snort3/Makefile
net/snort3/files/snort-mgr
net/snort3/patches/900-core-convert-project-to-PCRE2.patch [new file with mode: 0644]
net/speedtest-go/Makefile [new file with mode: 0644]
net/transmission/Makefile
net/uspot/Makefile
net/v2ray-core/Makefile
net/v2ray-geodata/Makefile
net/xray-core/Makefile
utils/apk/Makefile [deleted file]
utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub [deleted file]
utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub [deleted file]
utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub [deleted file]
utils/apk/files/alpine-repositories [deleted file]
utils/apk/patches/0001-remove-doc-generation.patch [deleted file]
utils/apk/patches/010-openssl-deprecated.patch [deleted file]
utils/apk/test.sh [deleted file]
utils/audit/Makefile [deleted file]
utils/audit/files/audit.init [deleted file]
utils/audit/patches/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch [deleted file]
utils/audit/patches/0002-fix-gcc-10.patch [deleted file]
utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch [deleted file]
utils/containerd/Makefile
utils/docker-compose/Makefile
utils/docker/Makefile
utils/dockerd/Makefile
utils/flashrom/Makefile
utils/flashrom/flashrom.mk
utils/ideviceinstaller/Makefile [new file with mode: 0644]
utils/idevicerestore/Makefile
utils/ifuse/Makefile [new file with mode: 0644]
utils/nano/Makefile
utils/nano/patches/0001-post80-fix-minibar-do-not-falsely-report.patch [new file with mode: 0644]
utils/ncdu/Makefile
utils/qemu/Makefile
utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch
utils/qemu/patches/0007-qga-invoke-separate-applets-for-guest-shutdown-modes.patch
utils/qemu/patches/0010-no-tests.patch
utils/rtty/Makefile
utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch [deleted file]
utils/usbmuxd/Makefile
utils/usbmuxd/patches/001-Revert-usb-Set-default-mode-to-3-to-include-CDC-NCM-.patch [new file with mode: 0644]
utils/usbmuxd/patches/002-version-print.patch [new file with mode: 0644]
utils/usbmuxd/patches/010-config.patch

diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile
deleted file mode 100644 (file)
index b2914c3..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-FROM debian:10
-
-
-# Configuration version history
-# v1.0   - Initial version by Etienne Champetier
-# v1.0.1 - Run as non-root, add unzip, xz-utils
-# v1.0.2 - Add bzr
-# v1.0.3 - Verify usign signatures
-# v1.0.4 - Add support for Python3
-# v1.0.5 - Add 19.07 public keys, verify keys
-# v1.0.6 - Add 21.02 public keys, update Debian image to version 10, add rsync
-# v1.0.7 - Add 22.03 public keys, 18.06 v2 gpg key, 18.06 usign key
-
-RUN apt update && apt install -y \
-build-essential \
-bzr \
-curl \
-jq \
-gawk \
-gettext \
-git \
-libncurses5-dev \
-libssl-dev \
-python \
-python3 \
-signify-openbsd \
-subversion \
-rsync \
-time \
-unzip \
-wget \
-xz-utils \
-zlib1g-dev \
-&& rm -rf /var/lib/apt/lists/*
-
-RUN useradd -c "OpenWrt Builder" -m -d /home/build -s /bin/bash build
-USER build
-ENV HOME /home/build
-
-# OpenWrt Build System (PGP key for unattended snapshot builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/626471F1.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-snapshots@openwrt.org>' | grep '^fpr:::::::::54CC74307A2C6DC9CE618269CD84BCED626471F1:$' \
- && echo '54CC74307A2C6DC9CE618269CD84BCED626471F1:6:' | gpg --import-ownertrust
-
-# OpenWrt Build System (PGP key for 17.01 "Reboot" release builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/D52BBB6B.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-17.01@openwrt.org>' | grep '^fpr:::::::::B09BE781AE8A0CD4702FDCD3833C6010D52BBB6B:$' \
- && echo 'B09BE781AE8A0CD4702FDCD3833C6010D52BBB6B:6:' | gpg --import-ownertrust
-
-# OpenWrt Release Builder (18.06 Signing Key)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/17E1CE16.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<openwrt-devel@lists.openwrt.org>' | grep '^fpr:::::::::6768C55E79B032D77A28DA5F0F20257417E1CE16:$' \
- && echo '6768C55E79B032D77A28DA5F0F20257417E1CE16:6:' | gpg --import-ownertrust
-
-# OpenWrt Build System (PGP key for 18.06 release builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/15807931.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-18.06@openwrt.org>' | grep '^fpr:::::::::AD0507363D2BCE9C9E36CEC4FBCB78F015807931:$' \
- && echo 'AD0507363D2BCE9C9E36CEC4FBCB78F015807931:6:' | gpg --import-ownertrust
-
-# OpenWrt Build System (PGP key for 19.07 release builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/2074BE7A.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-19.07@openwrt.org>' | grep '^fpr:::::::::D9C6901F45C9B86858687DFF28A39BC32074BE7A:$' \
- && echo 'D9C6901F45C9B86858687DFF28A39BC32074BE7A:6:' | gpg --import-ownertrust
-
-# OpenWrt Build System (PGP key for 21.02 release builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/88CA59E8.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-21.02@openwrt.org>' | grep '^fpr:::::::::667205E379BAF348863A5C6688CA59E88F681580:$' \
- && echo '667205E379BAF348863A5C6688CA59E88F681580:6:' | gpg --import-ownertrust
-
-# OpenWrt Build System (GnuPGP key for 22.03 release builds)
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/CD54E82DADB3684D.asc' | gpg --import \
- && gpg --fingerprint --with-colons '<pgpsign-22.03@openwrt.org>' | grep '^fpr:::::::::BF856781A01293C8409ABE72CD54E82DADB3684D:$' \
- && echo 'BF856781A01293C8409ABE72CD54E82DADB3684D:6:' | gpg --import-ownertrust
-
-# untrusted comment: Public usign key for unattended snapshot builds
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=usign/b5043e70f9a75cde' --create-dirs -o /home/build/usign/b5043e70f9a75cde \
- && echo 'd7ac10f9ed1b38033855f3d27c9327d558444fca804c685b17d9dcfb0648228f */home/build/usign/b5043e70f9a75cde' | sha256sum --check
-
-# untrusted comment: Public usign key for 18.06 release builds
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=usign/1035ac73cc4e59e3' --create-dirs -o /home/build/usign/1035ac73cc4e59e3 \
- && echo '8dc2e7f5c4e634437e6641f4df77a18bf59f0c8e9016c8ba4be5d4a0111e68c2 */home/build/usign/1035ac73cc4e59e3' | sha256sum --check
-
-# untrusted comment: Public usign key for 19.07 release builds
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=usign/f94b9dd6febac963' --create-dirs -o /home/build/usign/f94b9dd6febac963 \
- && echo 'b1d09457cfbc36fccfe18382d65c54a2ade3e7fd3902da490a53aa517b512755 */home/build/usign/f94b9dd6febac963' | sha256sum --check
-
-# untrusted comment: Public usign key for 21.02 release builds
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=usign/2f8b0b98e08306bf' --create-dirs -o /home/build/usign/2f8b0b98e08306bf \
- && echo 'd102bdd75421c62490b97f520f9db06aadb44ad408b244755d26e96ea5cd3b7f */home/build/usign/2f8b0b98e08306bf' | sha256sum --check
-
-# untrusted comment: Public usign key for 22.03 release builds
-RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=usign/4d017e6f1ed5d616' --create-dirs -o /home/build/usign/4d017e6f1ed5d616 \
- && echo 'f3c5fdf447d7c2743442e68077d60acc7c3e91754849e1f4b6be837b4204b7e2 */home/build/usign/4d017e6f1ed5d616' | sha256sum --check
diff --git a/.circleci/README b/.circleci/README
deleted file mode 100644 (file)
index 8626412..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# Build/update the docker image
-
-docker pull debian:10
-docker build --rm -t docker.io/openwrtorg/packages-cci:latest .
-docker tag <IMAGE ID> docker.io/openwrtorg/packages-cci:<VERSION-TAG>
-docker push docker.io/openwrtorg/packages-cci
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644 (file)
index 3058137..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-version: 2.0
-jobs:
-  build:
-    docker:
-      - image: docker.io/openwrtorg/packages-cci:v1.0.7
-    environment:
-      - SDK_HOST: "downloads.openwrt.org"
-      - SDK_PATH: "snapshots/targets/ath79/generic"
-      - SDK_FILE: "openwrt-sdk-ath79-generic_*.Linux-x86_64.tar.xz"
-      - BRANCH: "master"
-    steps:
-      - checkout:
-          path: ~/openwrt_packages
-
-      - run:
-          name: Check changes / verify commits
-          working_directory: ~/openwrt_packages
-          command: |
-             cat >> $BASH_ENV <<EOF
-             echo_red()   { printf "\033[1;31m\$*\033[m\n"; }
-             echo_green() { printf "\033[1;32m\$*\033[m\n"; }
-             echo_blue()  { printf "\033[1;34m\$*\033[m\n"; }
-             EOF
-             source $BASH_ENV
-
-             RET=0
-             for commit in $(git rev-list HEAD ^origin/$BRANCH); do
-               echo_blue "=== Checking commit '$commit'"
-               if git show --format='%P' -s $commit | grep -qF ' '; then
-                 echo_red "Pull request should not include merge commits"
-                 RET=1
-               fi
-
-               author="$(git show -s --format=%aN $commit)"
-               if echo $author | grep -q '\S\+\s\+\S\+'; then
-                 echo_green "Author name ($author) seems ok"
-               else
-                 echo_red "Author name ($author) need to be your real name 'firstname lastname'"
-                 RET=1
-               fi
-
-               subject="$(git show -s --format=%s $commit)"
-               if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
-                 echo_green "Commit subject line seems ok ($subject)"
-               else
-                 echo_red "Commit subject line MUST start with '<package name>: ' ($subject)"
-                 RET=1
-               fi
-
-               body="$(git show -s --format=%b $commit)"
-               sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
-               if echo "$body" | grep -qF "$sob"; then
-                 echo_green "Signed-off-by match author"
-               else
-                 echo_red "Signed-off-by is missing or doesn't match author (should be '$sob')"
-                 RET=1
-               fi
-             done
-
-             exit $RET
-
-      - run:
-          name: Download the SDK
-          working_directory: ~/sdk
-          command: |
-             curl "https://$SDK_HOST/$SDK_PATH/sha256sums" -sS -o sha256sums
-             curl "https://$SDK_HOST/$SDK_PATH/sha256sums.asc" -fs -o sha256sums.asc || true
-             curl "https://$SDK_HOST/$SDK_PATH/sha256sums.sig" -fs -o sha256sums.sig || true
-             if [ ! -f sha256sums.asc ] && [ ! -f sha256sums.sig ]; then
-                 echo_red "Missing sha256sums signature files"
-                 exit 1
-             fi
-             [ ! -f sha256sums.asc ] || gpg --with-fingerprint --verify sha256sums.asc sha256sums
-             if [ -f sha256sums.sig ]; then
-                 VERIFIED=
-                 for KEY in ~/usign/*; do
-                     echo "Trying $KEY..."
-                     if signify-openbsd -V -q -p "$KEY" -x sha256sums.sig -m sha256sums; then
-                         echo "...verified"
-                         VERIFIED=1
-                         break
-                     fi
-                 done
-                 if [ -z "$VERIFIED" ]; then
-                     echo_red "Could not verify usign signature"
-                     exit 1
-                 fi
-             fi
-             rsync -av "$SDK_HOST::downloads/$SDK_PATH/$SDK_FILE" .
-             sha256sum -c --ignore-missing sha256sums
-
-      - run:
-          name: Prepare build_dir
-          working_directory: ~/build_dir
-          command: |
-             tar Jxf ~/sdk/$SDK_FILE --strip=1
-             touch .config
-             make prepare-tmpinfo scripts/config/conf
-             ./scripts/config/conf --defconfig=.config Config.in
-             make prereq
-             rm .config
-             cat > feeds.conf <<EOF
-             src-git base https://github.com/openwrt/openwrt.git;$BRANCH
-             src-link packages $HOME/openwrt_packages
-             src-git luci https://github.com/openwrt/luci.git;$BRANCH
-             EOF
-             cat feeds.conf
-             ./scripts/feeds update -a > /dev/null
-             make defconfig > /dev/null
-             # enable BUILD_LOG
-             sed -i 's/# CONFIG_BUILD_LOG is not set/CONFIG_BUILD_LOG=y/' .config
-
-      - run:
-          name: Install & download source, check package, compile
-          working_directory: ~/build_dir
-          command: |
-             set +o pipefail
-             PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/$BRANCH..." | grep 'Makefile$' | grep -Ev '/files/|/src/' | awk -F/ '{ print $(NF-1) }')
-             if [ -z "$PKGS" ] ; then
-                 echo_blue "WARNING: No new or modified packages found!"
-                 exit 0
-             fi
-
-             echo_blue "=== Found new/modified packages: $PKGS"
-             for PKG in $PKGS ; do
-                 echo_blue "===+ Install: $PKG"
-                 ./scripts/feeds install "$PKG"
-
-                 echo_blue "===+ Download: $PKG"
-                 make "package/$PKG/download" V=s
-
-                 echo_blue "===+ Check package: $PKG"
-                 make "package/$PKG/check" V=s 2>&1 | tee logtmp
-                 RET=${PIPESTATUS[0]}
-
-                 if [ $RET -ne 0 ]; then
-                     echo_red   "=> Package check failed: $RET)"
-                     exit $RET
-                 fi
-
-                 badhash_msg="HASH does not match "
-                 badhash_msg+="|HASH uses deprecated hash,"
-                 badhash_msg+="|HASH is missing,"
-                 if grep -qE "$badhash_msg" logtmp; then
-                     echo_red   "=> Package HASH check failed"
-                     exit 1
-                 fi
-                 echo_green "=> Package check OK"
-             done
-
-             make \
-                 -f .config \
-                 -f tmp/.packagedeps \
-                 -f <(echo '$(info $(sort $(package-y) $(package-m)))'; echo -en 'a:\n\t@:') \
-              | tr ' ' '\n' >enabled-package-subdirs.txt
-             for PKG in $PKGS ; do
-                 if ! grep -m1 -qE "(^|/)$PKG$" enabled-package-subdirs.txt; then
-                        echo_red "===+ Building: $PKG skipped. It cannot be enabled with $SDK_FILE"
-                        continue
-                 fi
-                 echo_blue "===+ Building: $PKG"
-                 make "package/$PKG/compile" -j3 V=s || {
-                        RET=$?
-                        echo_red "===+ Building: $PKG failed, rebuilding with -j1 for human readable error log"
-                        make "package/$PKG/compile" -j1 V=s; exit $RET
-                 }
-             done
-
-      - store_artifacts:
-          path: ~/build_dir/logs
-
-      - store_artifacts:
-          path: ~/build_dir/bin
-
-workflows:
-  version: 2
-  buildpr:
-    jobs:
-      - build:
-          filters:
-            branches:
-              ignore: master
index 13b7fa0174664ab62b17e3b65d0003da0906d148..f366dcfcc1d5aeaa0f5e2f6bbf938c6f6097565e 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=syslog-ng
-PKG_VERSION:=4.6.0
-PKG_RELEASE:=2
+PKG_VERSION:=4.7.1
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>
 PKG_LICENSE:=LGPL-2.1-or-later GPL-2.0-or-later
@@ -11,7 +11,7 @@ PKG_CPE_ID:=cpe:/a:balabit:syslog-ng
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/syslog-ng/syslog-ng/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
-PKG_HASH:=b69e3360dfb96a754a4e1cbead4daef37128b1152a23572356db4ab64a475d4f
+PKG_HASH:=5477189a2d12325aa4faebfcf59f5bdd9084234732f0c3ec16dd253847dacf1c
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
index ca7b0972a82c566839d33ac762be914efd3d6b47..dafef7b7e465a2a17650206512bba41214bc938f 100644 (file)
@@ -1,7 +1,7 @@
 # Collect all local logs into a single file /var/log/messages.
 # See https://www.syslog-ng.com/technical-documents/list/syslog-ng-open-source-edition
 
-@version: 4.6
+@version: 4.7
 @include "scl.conf"
 
 options {
index 078d48839bfab3a7591f057ad360c1bbf64f9f0a..1a7efedc616b9edbf006cbbef3b86c3b9d71877d 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua-eco
-PKG_VERSION:=3.4.1
+PKG_VERSION:=3.5.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL=https://github.com/zhaojh329/lua-eco/releases/download/v$(PKG_VERSION)
-PKG_HASH:=6b28cf832d7427dd5106750814de65b2d9796669e6efacdfa14277c85fcb3b01
+PKG_HASH:=d2b9abee0373055268b91ec70739dad7d032f69e875f75ae39515e3b4ab3f824
 
 PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
 PKG_LICENSE:=MIT
@@ -55,7 +55,7 @@ Package/lua-eco-ssl=$(call Package/lua-eco/Module,ssl,\
   +LUA_ECO_MBEDTLS:libmbedtls +LUA_ECO_MBEDTLS:zlib +lua-eco-socket)
 Package/lua-eco-ubus=$(call Package/lua-eco/Module,ubus,+libubus)
 Package/lua-eco-http=$(call Package/lua-eco/Module,http/https,+lua-eco-dns +lua-eco-ssl +lua-eco-base64 +lua-eco-log)
-Package/lua-eco-mqtt=$(call Package/lua-eco/Module,mqtt,+lua-eco-socket +lua-eco-dns +libmosquitto-ssl)
+Package/lua-eco-mqtt=$(call Package/lua-eco/Module,mqtt,+lua-eco-socket +lua-eco-ssl)
 Package/lua-eco-websocket=$(call Package/lua-eco/Module,websocket,+lua-eco-http +lua-eco-base64 +lua-eco-sha1)
 Package/lua-eco-termios=$(call Package/lua-eco/Module,termios)
 Package/lua-eco-netlink=$(call Package/lua-eco/Module,netlink,+lua-eco-socket)
@@ -153,9 +153,8 @@ define Package/lua-eco-http/install
 endef
 
 define Package/lua-eco-mqtt/install
-       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco/core
+       $(INSTALL_DIR) $(1)/usr/local/lib/lua/5.3/eco
        $(INSTALL_DATA) $(PKG_BUILD_DIR)/mqtt.lua $(1)/usr/local/lib/lua/5.3/eco
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/mqtt.so $(1)/usr/local/lib/lua/5.3/eco/core
 endef
 
 define Package/lua-eco-websocket/install
diff --git a/lang/lua5.4/Makefile b/lang/lua5.4/Makefile
new file mode 100644 (file)
index 0000000..b525c9a
--- /dev/null
@@ -0,0 +1,165 @@
+#
+# Copyright (C) 2006-2023 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua
+PKG_VERSION:=5.4.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://www.lua.org/ftp/ \
+       https://www.tecgraf.puc-rio.br/lua/ftp/
+PKG_HASH:=7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88
+PKG_BUILD_PARALLEL:=1
+
+PKG_MAINTAINER:=Christian Marangi <ansuelsmth@gmail.com>
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYRIGHT
+PKG_CPE_ID:=cpe:/a:lua:lua
+
+HOST_PATCH_DIR := ./patches-host
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/lua5.4/Default
+  SUBMENU:=Lua
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Lua programming language (version 5.4)
+  URL:=https://www.lua.org/
+endef
+
+define Package/lua5.4/Default/description
+  Lua is a powerful, efficient, lightweight, embeddable scripting language. It
+  supports procedural programming, object-oriented programming, functional
+  programming, data-driven programming, and data description.
+endef
+
+define Package/liblua5.4
+$(call Package/lua5.4/Default)
+  SUBMENU:=
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (libraries)
+  ABI_VERSION:=5.4
+endef
+
+define Package/liblua5.4/description
+$(call Package/lua5.4/Default/description)
+ This package contains the Lua shared libraries, needed by other programs.
+endef
+
+define Package/lua5.4
+$(call Package/lua5.4/Default)
+  DEPENDS:=+liblua5.4
+  TITLE+= (interpreter)
+endef
+
+define Package/lua5.4/description
+$(call Package/lua5.4/Default/description)
+  This package contains the Lua language interpreter.
+endef
+
+define Package/luac5.4
+$(call Package/lua5.4/Default)
+  DEPENDS:=+liblua5.4
+  TITLE+= (compiler)
+endef
+
+define Package/luac5.4/description
+$(call Package/lua5.4/Default/description)
+  This package contains the Lua language compiler.
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       mv $(PKG_BUILD_DIR)/doc/lua.1 $(PKG_BUILD_DIR)/doc/lua5.4.1
+       mv $(PKG_BUILD_DIR)/doc/luac.1 $(PKG_BUILD_DIR)/doc/luac5.4.1
+endef
+
+TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC) -std=gnu99
+
+define Build/Compile
+       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+               CC="$(TARGET_CROSS)gcc" \
+               AR="$(TARGET_CROSS)ar rcu" \
+               RANLIB="$(TARGET_CROSS)ranlib" \
+               INSTALL_ROOT=/usr \
+               CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+               PKG_VERSION=$(PKG_VERSION) \
+               linux
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               INSTALL_TOP="$(PKG_INSTALL_DIR)/usr" \
+               install
+endef
+
+define Host/Prepare
+       $(call Host/Prepare/Default)
+       mv $(HOST_BUILD_DIR)/doc/lua.1 $(HOST_BUILD_DIR)/doc/lua5.4.1
+       mv $(HOST_BUILD_DIR)/doc/luac.1 $(HOST_BUILD_DIR)/doc/luac5.4.1
+endef
+
+define Host/Configure
+       $(SED) 's,"/usr/local/","$(STAGING_DIR_HOSTPKG)/",' $(HOST_BUILD_DIR)/src/luaconf.h
+endef
+
+ifeq ($(HOST_OS),Darwin)
+       LUA_OS:=macosx
+else
+       ifeq ($(HOST_OS),FreeBSD)
+               LUA_OS:=freebsd
+       else
+               LUA_OS:=linux
+       endif
+endif
+
+define Host/Compile
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               CC="$(HOSTCC) $(HOST_FPIC) -std=gnu99" \
+               $(LUA_OS)
+endef
+
+define Host/Install
+       $(MAKE) -C $(HOST_BUILD_DIR) \
+               INSTALL_TOP="$(STAGING_DIR_HOSTPKG)" \
+               install
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/lua5.4 $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua{,lib,conf}.h $(1)/usr/include/lua5.4/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lua.hpp $(1)/usr/include/lua5.4/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/lua5.4/lauxlib.h $(1)/usr/include/lua5.4/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.{a,so*} $(1)/usr/lib/
+       $(LN) liblua5.4.so.0.0.0 $(1)/usr/lib/liblualib5.4.so
+endef
+
+define Package/liblua5.4/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblua5.4.so* $(1)/usr/lib/
+endef
+
+define Package/lua5.4/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lua5.4 $(1)/usr/bin/
+endef
+
+define Package/luac5.4/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/luac5.4 $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,liblua5.4))
+$(eval $(call BuildPackage,lua5.4))
+$(eval $(call BuildPackage,luac5.4))
+$(eval $(call HostBuild))
diff --git a/lang/lua5.4/patches-host/001-include-version-number.patch b/lang/lua5.4/patches-host/001-include-version-number.patch
new file mode 100644 (file)
index 0000000..99c225e
--- /dev/null
@@ -0,0 +1,65 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+---
+
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ PLAT= guess
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+@@ -39,10 +39,10 @@ RM= rm -f
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+ # What to install.
+-TO_BIN= lua luac
++TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
+-TO_MAN= lua.1 luac.1
++TO_LIB= liblua$V.a
++TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+ V= 5.4
+@@ -52,7 +52,7 @@ R= $V.6
+ all:  $(PLAT)
+ $(PLATS) help test clean:
+-      @cd src && $(MAKE) $@
++      @cd src && $(MAKE) $@ V=$V
+ install: dummy
+       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -32,15 +32,15 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+-LUA_A=        liblua.a
++LUA_A=        liblua$V.a
+ CORE_O=       lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O=        lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+-LUA_T=        lua
++LUA_T=        lua$V
+ LUA_O=        lua.o
+-LUAC_T=       luac
++LUAC_T=       luac$V
+ LUAC_O=       luac.o
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
diff --git a/lang/lua5.4/patches-host/100-no_readline.patch b/lang/lua5.4/patches-host/100-no_readline.patch
new file mode 100644 (file)
index 0000000..64567dd
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -126,7 +126,7 @@ c89:
+       @echo ''
+ FreeBSD NetBSD OpenBSD freebsd:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
+ generic: $(ALL)
+@@ -136,13 +136,13 @@ ios:
+ Linux linux:  linux-noreadline
+ linux-noreadline:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
+ linux-readline:
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
+ Darwin macos macosx:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
+ mingw:
+       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
diff --git a/lang/lua5.4/patches/001-include-version-number.patch b/lang/lua5.4/patches/001-include-version-number.patch
new file mode 100644 (file)
index 0000000..99c225e
--- /dev/null
@@ -0,0 +1,65 @@
+From 96576b44a1b368bd6590eb0778ae45cc9ccede3f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Fri, 21 Jun 2019 14:08:38 +0200
+Subject: [PATCH] include version number
+
+Including it allows multiple lua versions to coexist.
+
+Signed-off-by: RafaÅ‚ MiÅ‚ecki <rafal@milecki.pl>
+---
+
+--- a/Makefile
++++ b/Makefile
+@@ -12,7 +12,7 @@ PLAT= guess
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
+ INSTALL_TOP= /usr/local
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+-INSTALL_INC= $(INSTALL_TOP)/include
++INSTALL_INC= $(INSTALL_TOP)/include/lua$V
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+ INSTALL_MAN= $(INSTALL_TOP)/man/man1
+ INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+@@ -39,10 +39,10 @@ RM= rm -f
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+ # What to install.
+-TO_BIN= lua luac
++TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua.a
+-TO_MAN= lua.1 luac.1
++TO_LIB= liblua$V.a
++TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+ V= 5.4
+@@ -52,7 +52,7 @@ R= $V.6
+ all:  $(PLAT)
+ $(PLATS) help test clean:
+-      @cd src && $(MAKE) $@
++      @cd src && $(MAKE) $@ V=$V
+ install: dummy
+       cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -32,15 +32,15 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+-LUA_A=        liblua.a
++LUA_A=        liblua$V.a
+ CORE_O=       lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O=        lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+-LUA_T=        lua
++LUA_T=        lua$V
+ LUA_O=        lua.o
+-LUAC_T=       luac
++LUAC_T=       luac$V
+ LUAC_O=       luac.o
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
diff --git a/lang/lua5.4/patches/020-shared_liblua.patch b/lang/lua5.4/patches/020-shared_liblua.patch
new file mode 100644 (file)
index 0000000..f2bed51
--- /dev/null
@@ -0,0 +1,115 @@
+--- a/Makefile
++++ b/Makefile
+@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic
+ # What to install.
+ TO_BIN= lua$V luac$V
+ TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
+-TO_LIB= liblua$V.a
++TO_LIB= liblua$V.a liblua$V.so.0.0.0
+ TO_MAN= lua$V.1 luac$V.1
+ # Lua version and release.
+@@ -59,6 +59,9 @@ install: dummy
+       cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+       cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+       cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0.0
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0
++      ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so
+       cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ uninstall:
+--- a/src/ldebug.h
++++ b/src/ldebug.h
+@@ -36,7 +36,7 @@
+ #endif
+-LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc);
++LUA_API int luaG_getfuncline (const Proto *f, int pc);
+ LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n,
+                                                     StkId *pos);
+ LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o,
+--- a/src/lstring.h
++++ b/src/lstring.h
+@@ -50,7 +50,7 @@ LUAI_FUNC void luaS_init (lua_State *L);
+ LUAI_FUNC void luaS_remove (lua_State *L, TString *ts);
+ LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, int nuvalue);
+ LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l);
+-LUAI_FUNC TString *luaS_new (lua_State *L, const char *str);
++LUA_API TString *luaS_new (lua_State *L, const char *str);
+ LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l);
+--- a/src/lundump.h
++++ b/src/lundump.h
+@@ -30,7 +30,7 @@
+ LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name);
+ /* dump one chunk; from ldump.c */
+-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
++LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w,
+                          void* data, int strip);
+ #endif
+--- a/src/lzio.h
++++ b/src/lzio.h
+@@ -44,7 +44,7 @@ typedef struct Mbuffer {
+ #define luaZ_freebuffer(L, buff)      luaZ_resizebuffer(L, buff, 0)
+-LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
++LUA_API void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader,
+                                         void *data);
+ LUAI_FUNC size_t luaZ_read (ZIO* z, void *b, size_t n);       /* read next n bytes */
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -33,6 +33,7 @@ CMCFLAGS=
+ PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris
+ LUA_A=        liblua$V.a
++LUA_SO=       liblua$V.so.0.0.0
+ CORE_O=       lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o
+ LIB_O=        lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
+ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+@@ -44,8 +45,9 @@ LUAC_T=      luac$V
+ LUAC_O=       luac.o
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T)
+ ALL_A= $(LUA_A)
++ALL_SO= $(LUA_SO)
+ # Targets start here.
+ default: $(PLAT)
+@@ -56,14 +58,25 @@ o: $(ALL_O)
+ a:    $(ALL_A)
++so:   $(ALL_SO)
++
+ $(LUA_A): $(BASE_O)
+       $(AR) $@ $(BASE_O)
+       $(RANLIB) $@
+-$(LUA_T): $(LUA_O) $(LUA_A)
+-      $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++$(LUA_SO): $(CORE_O) $(LIB_O)
++      $(CC) -o $@ -Wl,-Bsymbolic-functions -shared -Wl,-soname="$@" $?
++      ln -fs $@ liblua$V.so.0.0
++      ln -fs $@ liblua$V.so.0
++      ln -fs $@ liblua$V.so
++
++$(LUA_T): $(LUA_O) $(LUA_SO)
++      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUA_O) $(LIBS)
++
++$(LUAC_T): $(LUAC_O) $(LUA_SO)
++      $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUAC_O) $(LIBS)
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
++$(LUAC_T)-host: $(LUAC_O) $(LUA_A)
+       $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ test:
diff --git a/lang/lua5.4/patches/100-no_readline.patch b/lang/lua5.4/patches/100-no_readline.patch
new file mode 100644 (file)
index 0000000..64567dd
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -126,7 +126,7 @@ c89:
+       @echo ''
+ FreeBSD NetBSD OpenBSD freebsd:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE) -I/usr/include/edit" SYSLIBS="-Wl,-E -ledit" CC="cc"
+ generic: $(ALL)
+@@ -136,13 +136,13 @@ ios:
+ Linux linux:  linux-noreadline
+ linux-noreadline:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="-Wl,-E -ldl $(if $(USE_READLINE), -lreadline)"
+ linux-readline:
+       $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX -DLUA_USE_READLINE" SYSLIBS="-Wl,-E -ldl -lreadline"
+ Darwin macos macosx:
+-      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX -DLUA_USE_READLINE" SYSLIBS="-lreadline"
++      $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX $(if $(USE_READLINE), -DLUA_USE_READLINE)" SYSLIBS="$(if $(USE_READLINE), -lreadline)"
+ mingw:
+       $(MAKE) "LUA_A=lua54.dll" "LUA_T=lua.exe" \
index 53f9aa389114af69fdeae71e03491c0b10cc89fd..794ab2dd4f16a55cd9ca3c4779337b5b4cb15bfe 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rust
-PKG_VERSION:=1.77.0
+PKG_VERSION:=1.78.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.xz
+PKG_SOURCE:=rustc-$(PKG_VERSION)-src.tar.gz
 PKG_SOURCE_URL:=https://static.rust-lang.org/dist/
-PKG_HASH:=66126989782cbf77fa3aff121bbb108429f2d46fe19328c3de231553de711b90
+PKG_HASH:=ff544823a5cb27f2738128577f1e7e00ee8f4c83f2a348781ae4fc355e91d5a9
 HOST_BUILD_DIR:=$(BUILD_DIR)/host/rustc-$(PKG_VERSION)-src
 
 PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org>
@@ -74,6 +74,7 @@ HOST_CONFIGURE_ARGS = \
        --disable-sanitizers \
        --release-channel=stable \
        --enable-cargo-native-static \
+       --bootstrap-cache-path=$(DL_DIR)/rustc \
        --set=llvm.download-ci-llvm=true \
        $(TARGET_CONFIGURE_ARGS)
 
@@ -87,7 +88,6 @@ define Host/Compile
        $(RUST_SCCACHE_VARS) \
        CARGO_HOME=$(CARGO_HOME) \
        TARGET_CFLAGS="$(TARGET_CFLAGS)" \
-       OPENWRT_RUSTC_BOOTSTRAP_CACHE=$(DL_DIR)/rustc \
        $(PYTHON) $(HOST_BUILD_DIR)/x.py \
                --build-dir $(HOST_BUILD_DIR)/build \
                --config $(HOST_BUILD_DIR)/config.toml \
diff --git a/lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch b/lang/rust/patches/0002-correct-the-handling-of-bootstrap-cache-path-option.patch
new file mode 100644 (file)
index 0000000..99c8038
--- /dev/null
@@ -0,0 +1,47 @@
+From bd479113d38aa453cbad9d9f5ca9c5fc8903b0cf Mon Sep 17 00:00:00 2001
+From: onur-ozkan <work@onurozkan.dev>
+Date: Thu, 11 Apr 2024 14:57:10 +0300
+Subject: [PATCH] correct the handling of `bootstrap-cache-path` option
+
+This change makes `build.bootstrap-cache-path` option to be configurable with
+`./configure` script, so it can be used like `./configure --bootstrap-cache-path=demo`.
+
+Signed-off-by: onur-ozkan <work@onurozkan.dev>
+---
+ config.example.toml        | 2 +-
+ src/bootstrap/configure.py | 4 +++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+--- a/config.example.toml
++++ b/config.example.toml
+@@ -302,7 +302,7 @@
+ # Set the bootstrap/download cache path. It is useful when building rust
+ # repeatedly in a CI invironment.
+-# bootstrap-cache-path = /shared/cache
++#bootstrap-cache-path = /path/to/shared/cache
+ # Enable a build of the extended Rust tool set which is not only the compiler
+ # but also tools such as Cargo. This will also produce "combined installers"
+--- a/src/bootstrap/configure.py
++++ b/src/bootstrap/configure.py
+@@ -152,9 +152,9 @@ v("default-linker", "rust.default-linker
+ # (others are conditionally saved).
+ o("manage-submodules", "build.submodules", "let the build manage the git submodules")
+ o("full-bootstrap", "build.full-bootstrap", "build three compilers instead of two (not recommended except for testing reproducible builds)")
+-o("bootstrap-cache-path", "build.bootstrap-cache-path", "use provided path for the bootstrap cache")
+ o("extended", "build.extended", "build an extended rust tool set")
++v("bootstrap-cache-path", None, "use provided path for the bootstrap cache")
+ v("tools", None, "List of extended tools will be installed")
+ v("codegen-backends", None, "List of codegen backends to build")
+ v("build", "build.build", "GNUs ./configure syntax LLVM build triple")
+@@ -359,6 +359,8 @@ def apply_args(known_args, option_checki
+             set('target.{}.llvm-filecheck'.format(build_triple), value, config)
+         elif option.name == 'tools':
+             set('build.tools', value.split(','), config)
++        elif option.name == 'bootstrap-cache-path':
++            set('build.bootstrap-cache-path', value, config)
+         elif option.name == 'codegen-backends':
+             set('rust.codegen-backends', value.split(','), config)
+         elif option.name == 'host':
diff --git a/lang/rust/patches/0002-rustc-bootstrap-cache.patch b/lang/rust/patches/0002-rustc-bootstrap-cache.patch
deleted file mode 100644 (file)
index 61cd009..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
---- a/src/bootstrap/bootstrap.py
-+++ b/src/bootstrap/bootstrap.py
-@@ -557,7 +557,7 @@ class RustBuild(object):
-                 shutil.rmtree(bin_root)
-             key = self.stage0_compiler.date
--            cache_dst = os.path.join(self.build_dir, "cache")
-+            cache_dst = os.getenv('OPENWRT_RUSTC_BOOTSTRAP_CACHE', os.path.join(self.build_dir, "cache"))
-             rustc_cache = os.path.join(cache_dst, key)
-             if not os.path.exists(rustc_cache):
-                 os.makedirs(rustc_cache)
---- a/src/bootstrap/src/core/download.rs
-+++ b/src/bootstrap/src/core/download.rs
-@@ -208,10 +208,13 @@ impl Config {
-             Some(other) => panic!("unsupported protocol {other} in {url}"),
-             None => panic!("no protocol in {url}"),
-         }
--        t!(
--            std::fs::rename(&tempfile, dest_path),
--            format!("failed to rename {tempfile:?} to {dest_path:?}")
--        );
-+        match std::fs::rename(&tempfile, dest_path) {
-+            Ok(v) => v,
-+            Err(_) => {
-+                t!(std::fs::copy(&tempfile, dest_path));
-+                t!(std::fs::remove_file(&tempfile));
-+            }
-+        };
-     }
-     fn download_http_with_retries(&self, tempfile: &Path, url: &str, help_on_error: &str) {
-@@ -577,7 +580,10 @@ impl Config {
-             return;
-         }
--        let cache_dst = self.out.join("cache");
-+        let cache_dst = match env::var_os("OPENWRT_RUSTC_BOOTSTRAP_CACHE") {
-+            Some(v) => PathBuf::from(v),
-+            None => self.out.join("cache"),
-+        };
-         let cache_dir = cache_dst.join(key);
-         if !cache_dir.exists() {
-             t!(fs::create_dir_all(&cache_dir));
-@@ -704,7 +710,10 @@ download-rustc = false
-         let llvm_assertions = self.llvm_assertions;
-         let cache_prefix = format!("llvm-{llvm_sha}-{llvm_assertions}");
--        let cache_dst = self.out.join("cache");
-+        let cache_dst = match env::var_os("OPENWRT_RUSTC_BOOTSTRAP_CACHE") {
-+            Some(v) => PathBuf::from(v),
-+            None => self.out.join("cache"),
-+        };
-         let rustc_cache = cache_dst.join(cache_prefix);
-         if !rustc_cache.exists() {
-             t!(fs::create_dir_all(&rustc_cache));
index ea5e74f3172ec19986b7db1951fd5e4a68213597..b24cc14a6b96f549099cc0406221cba00241ea78 100644 (file)
@@ -6,13 +6,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnutls
-PKG_VERSION:=3.8.3
+PKG_VERSION:=3.8.5
 PKG_RELEASE:=1
 PKG_BUILD_FLAGS:=no-mips16
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8
-PKG_HASH:=f74fc5954b27d4ec6dfbb11dea987888b5b124289a3703afcada0ee520f4173e
+PKG_HASH:=66269a2cfe0e1c2dabec87bdbbd8ab656f396edd9a40dd006978e003cfa52bfc
 
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
 PKG_LICENSE:=LGPL-2.1-or-later
index ac66a71bb53d4999b2878bf56771f070d403c916..447580f782834e67963a06972f717d8e37dc30b0 100644 (file)
@@ -62,7 +62,7 @@
      [AC_COMPILE_IFELSE(
 --- a/src/gl/m4/gnulib-comp.m4
 +++ b/src/gl/m4/gnulib-comp.m4
-@@ -1252,7 +1252,7 @@ changequote([, ])dnl
+@@ -1268,7 +1268,7 @@ changequote([, ])dnl
    gl_UNISTD_MODULE_INDICATOR([sleep])
    AC_CHECK_DECLS_ONCE([alarm])
    AC_REQUIRE([gt_TYPE_WCHAR_T])
index 6b42caee80ae4eb0df8809134de8928a633d9d68..4e9de330be7ddb1582917644b1c2229e5f4e52eb 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -471,6 +471,8 @@ DEFAULT_VALGRINDFLAGS='-q --error-exitco
+@@ -508,6 +508,8 @@ DEFAULT_VALGRINDFLAGS='-q --error-exitco
  
  gl_VALGRIND_TESTS_DEFAULT_NO
  
index 92f97f3b9f776285440c707e4863430d1c1eeba0..ed33cae4f918bbac5b44897afad668806a1b26c0 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hyperscan
 PKG_VERSION:=5.4.2
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/intel/hyperscan/tar.gz/v$(PKG_VERSION)?
diff --git a/libs/hyperscan/patches/0001-CMakeLists.txt-hack-for-our-build-system.patch b/libs/hyperscan/patches/0001-CMakeLists.txt-hack-for-our-build-system.patch
new file mode 100644 (file)
index 0000000..450af73
--- /dev/null
@@ -0,0 +1,56 @@
+From c5a983652a2bbbc029961affd2996459e45b5336 Mon Sep 17 00:00:00 2001
+From: John Audia <therealgraysky@proton.me>
+Date: Sat, 20 Apr 2024 13:29:49 -0400
+Subject: [PATCH] CMakeLists.txt: hack for our build system
+
+If building with the project external toolchain, the gcc check
+fails to set the correct value for TUNE_FLAG to allow the min
+supported SSSE3 compiler support test to pass.  This patch hacks
+the file to set to the correct value.
+
+Links to upstream bug reports:
+https://github.com/openwrt/openwrt/issues/15216
+https://github.com/intel/hyperscan/issues/431
+
+---
+ CMakeLists.txt | 29 +----------------------------
+ 1 file changed, 1 insertion(+), 28 deletions(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -183,34 +183,7 @@ else()
+     endforeach ()
+     if (CMAKE_COMPILER_IS_GNUCC)
+-        message(STATUS "gcc version ${CMAKE_C_COMPILER_VERSION}")
+-        # If gcc doesn't recognise the host cpu, then mtune=native becomes
+-        # generic, which isn't very good in some cases. march=native looks at
+-        # cpuid info and then chooses the best microarch it can (and replaces
+-        # the flag), so use that for tune.
+-
+-        # arg1 might exist if using ccache
+-        string (STRIP "${CMAKE_C_COMPILER_ARG1}" CC_ARG1)
+-        set (EXEC_ARGS ${CC_ARG1} -c -Q --help=target -march=native -mtune=native)
+-        execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
+-            OUTPUT_VARIABLE _GCC_OUTPUT)
+-        string(FIND "${_GCC_OUTPUT}" "march" POS)
+-        string(SUBSTRING "${_GCC_OUTPUT}" ${POS} -1 _GCC_OUTPUT)
+-        string(REGEX REPLACE "march=[ \t]*([^ \n]*)[ \n].*" "\\1"
+-            GNUCC_ARCH "${_GCC_OUTPUT}")
+-
+-        # test the parsed flag
+-        set (EXEC_ARGS ${CC_ARG1} -E - -mtune=${GNUCC_ARCH})
+-        execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS}
+-            OUTPUT_QUIET ERROR_QUIET
+-            INPUT_FILE /dev/null
+-            RESULT_VARIABLE GNUCC_TUNE_TEST)
+-        if (NOT GNUCC_TUNE_TEST EQUAL 0)
+-            message(SEND_ERROR "Something went wrong determining gcc tune: -mtune=${GNUCC_ARCH} not valid")
+-        endif()
+-        set(TUNE_FLAG ${GNUCC_ARCH})
+-    else ()
+-        set(TUNE_FLAG native)
++        set(TUNE_FLAG x86-64-v2)
+     endif()
+     # compiler version checks TODO: test more compilers
diff --git a/libs/libideviceactivation/Makefile b/libs/libideviceactivation/Makefile
new file mode 100644 (file)
index 0000000..b73daf5
--- /dev/null
@@ -0,0 +1,96 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libideviceactivation
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libideviceactivation.git
+PKG_SOURCE_DATE:=2024-04-16
+PKG_SOURCE_VERSION:=6925d58ef7994168fb9585aa6f48421149982329
+PKG_MIRROR_HASH:=671a4feef00d6cc1b81df1e8f305a2e7a26752848b23c8ab60432940f307fe57
+
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING.LESSER
+PKG_CPE_ID:=cpe:/a:libimobiledevice:libideviceactivation
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libideviceactivation/Default
+  TITLE:=Manage the activation of Apple iOS devices
+  URL:=https://www.libimobiledevice.org/
+  SUBMENU:=libimobiledevice
+endef
+
+define Package/libideviceactivation/Default/description
+  A library to manage the activation process of Apple iOS devices.
+  This project provides an interface to activate and deactivate iOS devices
+  by talking to Apple's webservice alongside a command-line utility named
+  ideviceactivation.
+  - Status: Implements complete activation and deactivation process
+  - Compatibility: Supports legacy and latest activation webservice APIs
+  - Utility: Provides ideviceactivation utility for command-line usage
+  - Interactive: Requests user input if the activation process uses forms
+  - Cross-Platform: Tested on Linux, macOS, Windows and Android platforms
+endef
+
+define Package/libideviceactivation
+  $(call Package/libideviceactivation/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libcurl +libimobiledevice +usbmuxd
+  LICENSE:=LGPL-2.1-or-later
+  LICENSE_FILES:=COPYING.LESSER
+endef
+
+define Package/libideviceactivation/description
+  $(call Package/libideviceactivation/Default/description)
+endef
+
+define Package/libideviceactivation-utils
+  $(call Package/libideviceactivation/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libideviceactivation
+  LICENSE:=GPL-3.0-or-later
+  ICENSE_FILES:=COPYING
+endef
+
+define Package/libideviceactivation-utils/description
+  $(call Package/libideviceactivation/Default/description)
+  This package contains the libideviceactivation utilities.
+endef
+
+CONFIGURE_ARGS += \
+       PACKAGE_VERSION=$(PKG_VERSION)
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libideviceactivation.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libideviceactivation-1.0.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libideviceactivation-1.0.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libideviceactivation/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libideviceactivation-1.0.so.* $(1)/usr/lib/
+endef
+
+define Package/libideviceactivation-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ideviceactivation $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,libideviceactivation))
+$(eval $(call BuildPackage,libideviceactivation-utils))
diff --git a/libs/libimobiledevice-glue/Makefile b/libs/libimobiledevice-glue/Makefile
new file mode 100644 (file)
index 0000000..39066f1
--- /dev/null
@@ -0,0 +1,67 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libimobiledevice-glue
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libimobiledevice-glue/releases/download/$(PKG_VERSION)
+PKG_HASH:=ff9cbc240c9780edfa43914a057b86362054053721b65fb04f54a25023b92b62
+
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libimobiledevice-glue/Default
+  TITLE:=Common code used by libimobiledevice.
+  URL:=https://www.libimobiledevice.org/
+  SUBMENU:=libimobiledevice
+endef
+
+define Package/libimobiledevice-glue/Default/description
+  libimobiledevice-glue is a library with common code used by the
+  libraries and tools around the libimobiledevice project.
+endef
+
+define Package/libimobiledevice-glue
+  $(call Package/libimobiledevice-glue/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libplist
+  LICENSE:=LGPL-2.1-or-later
+  LICENSE_FILES:=COPYING
+endef
+
+define Package/libimobiledevice-glue/description
+  $(call Package/libimobiledevice-glue/Default/description)
+endef
+
+CONFIGURE_ARGS += \
+       --disable-static \
+       --without-cython
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/libimobiledevice-glue $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice-glue-1.0.so* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libimobiledevice-glue-1.0.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libimobiledevice-glue/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libimobiledevice-glue-1.0.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libimobiledevice-glue))
index b1528c9ec954b8dc735075a0d430e9124d81a694..cc124cc57623da5df81d376fe82bfca932a6333e 100644 (file)
@@ -8,17 +8,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libimobiledevice
-PKG_VERSION:=1.3.0
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=53f2640c6365cd9f302a6248f531822dc94a6cced3f17128d4479a77bd75b0f6
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libimobiledevice.git
+PKG_SOURCE_DATE:=2024-04-16
+PKG_SOURCE_VERSION:=5f083426b4ede24b2576f3a56eaf8ac3632c02f7
+PKG_MIRROR_HASH:=96d63f5a5cdfbc045aa58939fa0ab1ab81739b67b042b86bbbeee75d332e09d5
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_LICENSE:=LGPL-2.1-or-later
 PKG_LICENSE_FILES:=COPYING.LESSER
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
@@ -39,7 +41,7 @@ define Package/libimobiledevice
   $(call Package/libimobiledevice/Default)
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libplist +libusbmuxd +libopenssl
+  DEPENDS:=+libplist +libimobiledevice-glue +libusbmuxd +libopenssl
   LICENSE:=LGPL-2.1-or-later
   LICENSE_FILES:=COPYING.LESSER
 endef
@@ -64,7 +66,8 @@ endef
 
 CONFIGURE_ARGS += \
        --disable-static \
-       --without-cython
+       --without-cython \
+       PACKAGE_VERSION=$(PKG_VERSION)
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index da65a725d4b0447f08da946e07d348506f3aef73..2df33f6d939a6538d3af773829ac7023eed858d6 100644 (file)
@@ -1,6 +1,6 @@
 --- a/common/userpref.c
 +++ b/common/userpref.c
-@@ -159,7 +159,7 @@ const char *userpref_get_config_dir()
+@@ -173,7 +173,7 @@ const char *userpref_get_config_dir()
  #ifdef __APPLE__
        base_config_dir = strdup("/var/db");
  #else
diff --git a/libs/libimobiledevice/patches/100-ios14.patch b/libs/libimobiledevice/patches/100-ios14.patch
deleted file mode 100644 (file)
index cd95028..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-From b5d575c118ecfc2afcb12739433e916527182327 Mon Sep 17 00:00:00 2001
-From: Nikias Bassen <nikias@gmx.li>
-Date: Fri, 7 Aug 2020 00:50:46 +0200
-Subject: [PATCH] mobilebackup2: Set DeviceLink version to 400 to support iOS
- 14b4+
-
----
- src/mobilebackup2.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/mobilebackup2.c
-+++ b/src/mobilebackup2.c
-@@ -30,7 +30,7 @@
- #include "device_link_service.h"
- #include "common/debug.h"
--#define MBACKUP2_VERSION_INT1 300
-+#define MBACKUP2_VERSION_INT1 400
- #define MBACKUP2_VERSION_INT2 0
- #define IS_FLAG_SET(x, y) ((x & y) == y)
diff --git a/libs/libimobiledevice/patches/110-iOS14.patch b/libs/libimobiledevice/patches/110-iOS14.patch
deleted file mode 100644 (file)
index d4d1b4c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-From d857a83272d921929ae6ccf1fa70d85768840e84 Mon Sep 17 00:00:00 2001
-From: Nikias Bassen <nikias@gmx.li>
-Date: Mon, 10 Aug 2020 15:39:56 +0200
-Subject: [PATCH] screenshotr: Set DeviceLink version to 400 to support iOS
- 14b4+
-
----
- src/screenshotr.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/screenshotr.c
-+++ b/src/screenshotr.c
-@@ -30,7 +30,7 @@
- #include "device_link_service.h"
- #include "common/debug.h"
--#define SCREENSHOTR_VERSION_INT1 300
-+#define SCREENSHOTR_VERSION_INT1 400
- #define SCREENSHOTR_VERSION_INT2 0
- /**
diff --git a/libs/libimobiledevice/patches/120-iOS14.patch b/libs/libimobiledevice/patches/120-iOS14.patch
deleted file mode 100644 (file)
index db9dd36..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-From 98056a89648f431759c5fa4ed87c6ea6ba0cdd3f Mon Sep 17 00:00:00 2001
-From: Nikias Bassen <nikias@gmx.li>
-Date: Thu, 10 Sep 2020 15:12:21 +0200
-Subject: [PATCH] debugserver: Fix service startup for iOS 14b4+
-
----
- include/libimobiledevice/debugserver.h |  1 +
- include/libimobiledevice/lockdown.h    |  1 +
- src/debugserver.c                      | 11 +++++++++--
- src/lockdown.c                         |  5 ++++-
- 4 files changed, 15 insertions(+), 3 deletions(-)
-
---- a/include/libimobiledevice/debugserver.h
-+++ b/include/libimobiledevice/debugserver.h
-@@ -31,6 +31,7 @@ extern "C" {
- #include <libimobiledevice/lockdown.h>
- #define DEBUGSERVER_SERVICE_NAME "com.apple.debugserver"
-+#define DEBUGSERVER_SECURE_SERVICE_NAME DEBUGSERVER_SERVICE_NAME ".DVTSecureSocketProxy"
- /** Error Codes */
- typedef enum {
---- a/include/libimobiledevice/lockdown.h
-+++ b/include/libimobiledevice/lockdown.h
-@@ -96,6 +96,7 @@ typedef struct lockdownd_pair_record *lo
- struct lockdownd_service_descriptor {
-       uint16_t port;
-       uint8_t ssl_enabled;
-+      char* identifier;
- };
- typedef struct lockdownd_service_descriptor *lockdownd_service_descriptor_t;
---- a/src/debugserver.c
-+++ b/src/debugserver.c
-@@ -80,7 +80,10 @@ LIBIMOBILEDEVICE_API debugserver_error_t
-               debug_info("Creating base service client failed. Error: %i", ret);
-               return ret;
-       }
--      service_disable_bypass_ssl(parent, 1);
-+
-+      if (service->identifier && (strcmp(service->identifier, DEBUGSERVER_SECURE_SERVICE_NAME) != 0)) {
-+              service_disable_bypass_ssl(parent, 1);
-+      }
-       debugserver_client_t client_loc = (debugserver_client_t) malloc(sizeof(struct debugserver_client_private));
-       client_loc->parent = parent;
-@@ -95,7 +98,11 @@ LIBIMOBILEDEVICE_API debugserver_error_t
- LIBIMOBILEDEVICE_API debugserver_error_t debugserver_client_start_service(idevice_t device, debugserver_client_t * client, const char* label)
- {
-       debugserver_error_t err = DEBUGSERVER_E_UNKNOWN_ERROR;
--      service_client_factory_start_service(device, DEBUGSERVER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err);
-+      service_client_factory_start_service(device, DEBUGSERVER_SECURE_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err);
-+      if (err != DEBUGSERVER_E_SUCCESS) {
-+              err = DEBUGSERVER_E_UNKNOWN_ERROR;
-+              service_client_factory_start_service(device, DEBUGSERVER_SERVICE_NAME, (void**)client, label, SERVICE_CONSTRUCTOR(debugserver_client_new), &err);
-+      }
-       return err;
- }
---- a/src/lockdown.c
-+++ b/src/lockdown.c
-@@ -1307,6 +1307,7 @@ static lockdownd_error_t lockdownd_do_st
-                       *service = (lockdownd_service_descriptor_t)malloc(sizeof(struct lockdownd_service_descriptor));
-               (*service)->port = 0;
-               (*service)->ssl_enabled = 0;
-+              (*service)->identifier = strdup(identifier);
-               /* read service port number */
-               plist_t node = plist_dict_get_item(dict, "Port");
-@@ -1511,8 +1512,10 @@ LIBIMOBILEDEVICE_API lockdownd_error_t l
- LIBIMOBILEDEVICE_API lockdownd_error_t lockdownd_service_descriptor_free(lockdownd_service_descriptor_t service)
- {
--      if (service)
-+      if (service) {
-+              free(service->identifier);
-               free(service);
-+      }
-       return LOCKDOWN_E_SUCCESS;
- }
index 8d82ef0028fec3b801aa1f555cd263842fc0ca96..cd12b794546040bb2b48a4e293854034ca9e0b59 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libirecovery
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=cda0aba10a5b6fc2e1d83946b009e3e64d0be36912a986e35ad6d34b504ad9b4
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libirecovery/releases/download/$(PKG_VERSION)
+PKG_HASH:=74448348f8a68b654015fe1952fdc4e0781db20dcf4e1d85ec97d6f91e95eb14
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_LICENSE:=LGPL-2.1-or-later
@@ -37,7 +37,7 @@ define Package/libirecovery
   TITLE:=A library that talks to Apple iBoot/iBSS
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+libreadline +libusb-1.0
+  DEPENDS:=+libimobiledevice-glue +libreadline +libusb-1.0
 endef
 
 define Package/libirecovery/description
index eb8265b1b8b3d56621076053aa1ea0bb817653b1..7c8b959a1b11f48f7ed99de18c8e9690b9ce601b 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libplist
-PKG_VERSION:=2.2.0
-PKG_RELEASE:=3
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=4a5517e5377ec421df84c586ba85bb4e1d26f11ad203d7d450a907c0156fbd9a
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libplist/releases/download/$(PKG_VERSION)
+PKG_HASH:=3f5868ae15b117320c1ff5e71be53d29469d4696c4085f89db1975705781a7cd
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_CPE_ID:=cpe:/a:libimobiledevice:libplist
index 59b8d908a9f68bf86e538fc5c452cb17acfe3f4f..3ad1dabd43c5c1360875f1dea74a932013e2e209 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libusbmuxd
-PKG_VERSION:=2.0.2
+PKG_VERSION:=2.1.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=cc6a808553da4efa9fa5638be256d5ae020498795d9d260d280b87074e799b20
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/libusbmuxd/releases/download/$(PKG_VERSION)
+PKG_HASH:=c35bf68f8e248434957bd5b234c389b02206a06ecd9303a7fb931ed7a5636b16
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_CPE_ID:=cpe:/a:libimobiledevice:libusbmuxd
@@ -42,7 +42,7 @@ define Package/libusbmuxd
   SECTION:=libs
   CATEGORY:=Libraries
   TITLE+= library
-  DEPENDS:=+libplist +libpthread +libxml2 +zlib
+  DEPENDS:=+libplist +libimobiledevice-glue +libpthread +libxml2 +zlib
   PKG_LICENSE:=LGPL-2.1-or-later
   PKG_LICENSE_FILES:=COPYING
 endef
index 0bb48b1271b7b9e4e948d704ea535d43f2082ec9..9b4c369ae723eb6fb6588f765270d8b5f0b35564 100644 (file)
@@ -9,12 +9,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=msmtp
-PKG_VERSION:=1.8.24
+PKG_VERSION:=1.8.25
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://marlam.de/msmtp/releases
-PKG_HASH:=bd6644b1aaab17d61b86647993e3efad860b23c54283b00ddc579c1f5110aa59
+PKG_HASH:=2dfe1dbbb397d26fe0b0b6b2e9cd2efdf9d72dd42d18e70d7f363ada2652d738
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-3.0-or-later
index 29aed1873542f1e8734b2f76a9dcfb6b850b27f9..9a9e5d6339a7669f2e29c422a7803c821db0a767 100644 (file)
@@ -1,14 +1,14 @@
-# Copyright 2023 MOSSDeF, Stan Grishin (stangri@melmac.ca)
-# TLD optimization written by Dirk Brenken (dev@brenken.org)
-# This is free software, licensed under the GNU General Public License v3.
+# Copyright 2023-2024 MOSSDeF, Stan Grishin (stangri@melmac.ca).
+# TLD optimization written by Dirk Brenken (dev@brenken.org).
+# This is free software, licensed under AGPL-3.0-or-later.
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=adblock-fast
 PKG_VERSION:=1.1.1
-PKG_RELEASE:=r8
+PKG_RELEASE:=11
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
-PKG_LICENSE:=GPL-3.0-or-later
+PKG_LICENSE:=AGPL-3.0-or-later
 
 include $(INCLUDE_DIR)/package.mk
 
index 61fc43a8d5f692d9d895f5569e8f7a8583ae1c30..ccef67683bd124a8a797c33b19cecf99ff63ea82 100755 (executable)
@@ -52,7 +52,7 @@ readonly smartdnsNftsetFilter=';'
 readonly unboundFile="/var/lib/unbound/adb_list.${packageName}"
 readonly unboundCache="/var/run/${packageName}/unbound.cache"
 readonly unboundGzip="${packageName}.unbound.gz"
-readonly unboundFilter='s|^|local-zone: "|;s|$|" static|'
+readonly unboundFilter='s|^|local-zone: "|;s|$|." always_nxdomain|'
 readonly A_TMP="/var/${packageName}.a.tmp"
 readonly B_TMP="/var/${packageName}.b.tmp"
 readonly SED_TMP="/var/${packageName}.sed.tmp"
@@ -267,7 +267,7 @@ dns_set_output_values() {
                        outputFilter="$unboundFilter"
                        outputFile="$unboundFile"
                        outputCache="$unboundCache"
-                       outputGzip="$unboundGzip"
+                       outputGzip="${compressed_cache_dir}/${unboundGzip}"
                ;;
        esac
 }
@@ -757,7 +757,7 @@ load_environment() {
        [ "$dns" = 'smartdns.domainset' ] || rm -f "$smartdnsDomainSetFile" "$smartdnsDomainSetCache" "${compressed_cache_dir}/${smartdnsDomainSetGzip}" "$smartdnsDomainSetConfig"
        [ "$dns" = 'smartdns.ipset' ]     || rm -f "$smartdnsIpsetFile" "$smartdnsIpsetCache" "${compressed_cache_dir}/${smartdnsIpsetGzip}" "$smartdnsIpsetConfig"
        [ "$dns" = 'smartdns.nftset' ]    || rm -f "$smartdnsNftsetFile" "$smartdnsNftsetCache" "${compressed_cache_dir}/${smartdnsNftsetGzip}" "$smartdnsNftsetConfig"
-       [ "$dns" = 'unbound.adb_list' ]   || rm -f "$unboundFile" "$unboundCache" "$unboundGzip"
+       [ "$dns" = 'unbound.adb_list' ]   || rm -f "$unboundFile" "$unboundCache" "${compressed_cache_dir}/${unboundGzip}"
 
        for i in "$runningConfigFile" "$runningErrorFile" "$runningStatusFile" "$outputFile" "$outputCache" "$outputGzip" "$outputConfig"; do
                [ -n "$i" ] || continue
@@ -892,7 +892,7 @@ resolver() {
                        rm -f "$smartdnsDomainSetFile" "$smartdnsDomainSetCache" "${compressed_cache_dir}/${smartdnsDomainSetGzip}" "$smartdnsDomainSetConfig"
                        rm -f "$smartdnsIpsetFile" "$smartdnsIpsetCache" "${compressed_cache_dir}/${smartdnsIpsetGzip}" "$smartdnsIpsetConfig"
                        rm -f "$smartdnsNftsetFile" "$smartdnsNftsetCache" "${compressed_cache_dir}/${smartdnsNftsetGzip}" "$smartdnsNftsetConfig"
-                       rm -f "$unboundFile" "$unboundCache" "$unboundGzip"
+                       rm -f "$unboundFile" "$unboundCache" "${compressed_cache_dir}/${unboundGzip}"
                        if [ -s "/etc/config/dhcp" ]; then
                                config_load 'dhcp'
                                config_foreach _dnsmasq_instance_config 'dnsmasq' 'cleanup'
@@ -932,19 +932,19 @@ resolver() {
                        case "$dns" in
                                dnsmasq.*)
                                        chmod 660 "$outputFile"
-                                       chown root:dnsmasq "$outputFile"
+                                       chown root:dnsmasq "$outputFile" >/dev/null 2>/dev/null
                                        param='dnsmasq_restart'
                                        output_text='Restarting dnsmasq'
                                ;;
                                smartdns.*)
                                        chmod 660 "$outputFile" "$outputConfig"
-                                       chown root:root "$outputFile" "$outputConfig"
+                                       chown root:root "$outputFile" "$outputConfig" >/dev/null 2>/dev/null
                                        param='smartdns_restart'
                                        output_text='Restarting SmartDNS'
                                ;;
                                unbound.*)
                                        chmod 660 "$outputFile"
-                                       chown root:unbound "$outputFile"
+                                       chown root:unbound "$outputFile" >/dev/null 2>/dev/null
                                        param='unbound_restart'
                                        output_text='Restarting Unbound'
                                ;;
@@ -1036,7 +1036,7 @@ cache() {
                        return $?
                ;;
                test_gzip)
-                       [ -s "$outputGzip" ] && gzip -t -c "$outputGzip"
+                       [ -s "$outputGzip" ] && gzip -t -c "$outputGzip" >/dev/null 2>/dev/null
                        return $?
                ;;
                create_gzip)
@@ -1412,6 +1412,11 @@ $(sed '/^[[:space:]]*$/d' "$A_TMP")"
                output_failn
                json add error 'errorMovingDataFile'
        fi
+       case "$dns" in
+               unbound.adb_list)
+                       sed -i '1 i\server:' "$outputFile"
+               ;;
+       esac
        if [ "$compressed_cache" -gt 0 ]; then
                output 2 'Creating compressed cache '
                json set message "$(get_text 'statusProcessing'): creating compressed cache"
@@ -1596,7 +1601,7 @@ adb_check() {
                                        smartdns.*)
                                                grep "$string" "$outputFile";;
                                        unbound.adb_list)
-                                               grep "$string" "$outputFile" | sed 's|^local-zone: "||;s|" static$||;';;
+                                               grep "$string" "$outputFile" | sed 's|^local-zone: "||;s|." always_nxdomain$||;';;
                                esac
                        fi
                else
index 9b0cf2f108319e52580bf999c0458c1c95a170c6..c05feace1a5cd9526c886740f042e5ea5c9de5b2 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=alist
-PKG_VERSION:=3.33.0
+PKG_VERSION:=3.34.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=28aea1ddae1f394b9d66ca95cf25ab86cf30cce94544783ce7ea440f15d95f77
+PKG_HASH:=843d6ccc74210d6541d0c976c4b396381ca98a855a9c75b2e753e94c7f78cbad
 
 PKG_LICENSE:=AGPL-3.0-only
 PKG_LICENSE_FILES:=LICENSE
@@ -46,13 +46,13 @@ define Package/alist/conffiles
 /etc/config/alist
 endef
 
-WEB_VERSION:=3.33.0
+WEB_VERSION:=3.34.0
 WEB_FILE:=$(PKG_NAME)-web-$(WEB_VERSION).tar.gz
 define Download/alist-web
        URL:=https://github.com/alist-org/alist-web/releases/download/$(WEB_VERSION)/
        URL_FILE:=dist.tar.gz
        FILE:=$(WEB_FILE)
-       HASH:=50ae0539720bce7c470ac6bc47216b0e103e73636ee3a9b4b9364e2b52ca93f6
+       HASH:=82a634c20df88b0ce385d029d0a23a8047b825273621d08c276232fb3309442c
 endef
 
 define Build/Prepare
index 14636f1b813d64c7e4643b1ec2d94d4eac948bc3..43bf050f1ee4ae2d51fe70d7b667da193ae4fe51 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=banip
 PKG_VERSION:=0.9.5
-PKG_RELEASE:=2
+PKG_RELEASE:=4
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index a28067e84eb8c30ebd98fac8bbcc2a5ec1ff5c0a..4f4300a01ea9f0f48fe46ca216b55350a5484cb7 100644 (file)
@@ -15,7 +15,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
 | adguard             | adguard IPs                    |         |         |    x    | tcp: 80, 443 | [Link](https://github.com/dibdot/banIP-IP-blocklists)        |
 | adguardtrackers     | adguardtracker IPs             |         |         |    x    | tcp: 80, 443 | [Link](https://github.com/dibdot/banIP-IP-blocklists)        |
 | antipopads          | antipopads IPs                 |         |         |    x    | tcp: 80, 443 | [Link](https://github.com/dibdot/banIP-IP-blocklists)        |
-| asn                 | ASN segments                   |         |         |    x    | tcp: 80, 443 | [Link](https://asn.ipinfo.app)                               |
+| asn                 | ASN segments                   |    x    |    x    |    x    |              | [Link](https://asn.ipinfo.app)                               |
 | backscatterer       | backscatterer IPs              |    x    |    x    |         |              | [Link](https://www.uceprotect.net/en/index.php)              |
 | becyber             | malicious attacker IPs         |    x    |    x    |         |              | [Link](https://github.com/duggytuxy/malicious_ip_addresses)  |
 | binarydefense       | binary defense banlist         |    x    |    x    |         |              | [Link](https://iplists.firehol.org/?ipset=bds_atif)          |
@@ -37,6 +37,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
 | greensnow           | suspicious server IPs          |    x    |    x    |         |              | [Link](https://greensnow.co)                                 |
 | iblockads           | Advertising IPs                |         |         |    x    | tcp: 80, 443 | [Link](https://www.iblocklist.com)                           |
 | iblockspy           | Malicious spyware IPs          |         |         |    x    | tcp: 80, 443 | [Link](https://www.iblocklist.com)                           |
+| ipblackhole         | blackhole IPs                  |    x    |    x    |         |              | [Link](https://github.com/BlackHoleMonster/IP-BlackHole)     |
 | ipsum               | malicious IPs                  |    x    |    x    |         |              | [Link](https://github.com/stamparm/ipsum)                    |
 | ipthreat            | hacker and botnet TPs          |    x    |    x    |         |              | [Link](https://ipthreat.net)                                 |
 | myip                | real-time IP blocklist         |    x    |    x    |         |              | [Link](https://myip.ms)                                      |
@@ -114,7 +115,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
 * It's strongly recommended to use the LuCI frontend to easily configure all aspects of banIP, the application is located in LuCI under the 'Services' menu
 * If you're using a complex network setup, e.g. special tunnel interfaces, than untick the 'Auto Detection' option under the 'General Settings' tab and set the required options manually
 * Start the service with '/etc/init.d/banip start' and check everything is working by running '/etc/init.d/banip status' and also check the 'Firewall Log' and 'Processing Log' tabs
-* If you're going to configure banIP via CLI, edit the config file '/etc/config/banip' and enable the service (set ban\_enabled to '1'), then add pre-configured feeds via 'ban\_feed' (see the feed list above) and add/change other options to your needs (see the options reference below)
+* If you're going to configure banIP via CLI, edit the config file '/etc/config/banip' and enable the service (set ban\_enabled to '1'), then add pre-configured feeds via 'ban\_feed' (see the feed list above) and add/change other options to your needs, see the options reference table below
 
 ## banIP CLI interface
 * All important banIP functions are accessible via CLI.
@@ -428,12 +429,12 @@ A valid JSON source object contains the following information, e.g.:
                "rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)$/{printf \"%s,\\n\",$1}",
                "rule_6": "/^(([0-9A-f]{0,4}:){1,7}[0-9A-f]{0,4}:?(\\/(1?[0-2][0-8]|[0-9][0-9]))?)$/{printf \"%s,\\n\",$1}",
                "descr": "tor exit nodes",
-               "flag": "tcp 80-89 443"
+               "flag": "gz tcp 80-88 udp 50000"
        },
        [...]
 ```
 Add an unique feed name (no spaces, no special chars) and make the required changes: adapt at least the URL, the regex and the description for a new feed.  
-Please note: the flag field is optional, it's a space separated list of options: supported are 'gz' as an archive format, protocols 'tcp' or 'udp' with port numbers/port ranges for destination port limitations.  
+Please note: the flag field is optional, it's a space separated list of options: supported are 'gz' as an archive format, protocols 'tcp' or 'udp' with port numbers/port ranges for destination port limitations - multiple definitions are possible.  
 
 ## Support
 Please join the banIP discussion in this [forum thread](https://forum.openwrt.org/t/banip-support-thread/16985) or contact me by mail <dev@brenken.org>
index 50e805b5a41c0a46d07e7160323648f56ef8eaea..e9cf873674dd40c55fba77965aeb9d404874c860 100644 (file)
@@ -595,24 +595,30 @@ f_etag() {
 # build initial nft file with base table, chains and rules
 #
 f_nftinit() {
-       local wan_dev vlan_allow vlan_block log_ct log_icmp log_syn log_udp log_tcp feed_log feed_rc allow_proto allow_dport flag file="${1}"
+       local wan_dev vlan_allow vlan_block log_ct log_icmp log_syn log_udp log_tcp feed_log feed_rc flag tmp_proto tmp_port allow_dport file="${1}"
 
        wan_dev="$(printf "%s" "${ban_dev}" | "${ban_sedcmd}" 's/^/\"/;s/$/\"/;s/ /\", \"/g')"
        [ -n "${ban_vlanallow}" ] && vlan_allow="$(printf "%s" "${ban_vlanallow%%?}" | "${ban_sedcmd}" 's/^/\"/;s/$/\"/;s/ /\", \"/g')"
        [ -n "${ban_vlanblock}" ] && vlan_block="$(printf "%s" "${ban_vlanblock%%?}" | "${ban_sedcmd}" 's/^/\"/;s/$/\"/;s/ /\", \"/g')"
 
        for flag in ${ban_allowflag}; do
-               if [ -z "${allow_proto}" ] && { [ "${flag}" = "tcp" ] || [ "${flag}" = "udp" ]; }; then
-                       allow_proto="${flag}"
-               elif [ -n "${allow_proto}" ] && [ -n "${flag//[![:digit]-]/}" ] && ! printf "%s" "${allow_dport}" | "${ban_grepcmd}" -qw "${flag}"; then
-                       if [ -z "${allow_dport}" ]; then
-                               allow_dport="${flag}"
-                       else
-                               allow_dport="${allow_dport}, ${flag}"
+               if [ "${flag}" = "tcp" ] || [ "${flag}" = "udp" ]; then
+                       if [ -z "${tmp_proto}" ]; then
+                               tmp_proto="${flag}"
+                       elif ! printf "%s" "${tmp_proto}" | "${ban_grepcmd}" -qw "${flag}"; then
+                               tmp_proto="${tmp_proto}, ${flag}"
+                       fi
+               elif [ -n "${flag//[![:digit]-]/}" ]; then
+                       if [ -z "${tmp_port}" ]; then
+                               tmp_port="${flag}"
+                       elif ! printf "%s" "${tmp_port}" | "${ban_grepcmd}" -qw "${flag}"; then
+                               tmp_port="${tmp_port}, ${flag}"
                        fi
                fi
        done
-       [ -n "${allow_dport}" ] && allow_dport="${allow_proto} dport { ${allow_dport} }"
+       if [ -n "${tmp_proto}" ] && [ -n "${tmp_port}" ]; then
+               allow_dport="meta l4proto { ${tmp_proto} } th dport { ${tmp_port} }"
+       fi
 
        if [ "${ban_logprerouting}" = "1" ]; then
                log_icmp="log level ${ban_nftloglevel} prefix \"banIP/pre-icmp/drop: \""
@@ -697,7 +703,7 @@ f_nftinit() {
 #
 f_down() {
        local log_input log_forwardwan log_forwardlan start_ts end_ts tmp_raw tmp_load tmp_file split_file ruleset_raw handle rc etag_rc
-       local expr cnt_set cnt_dl restore_rc feed_direction feed_rc feed_log feed_comp feed_proto feed_dport feed_target
+       local expr cnt_set cnt_dl restore_rc feed_direction feed_rc feed_log feed_comp feed_target feed_dport tmp_proto tmp_port flag
        local feed="${1}" proto="${2}" feed_url="${3}" feed_rule="${4}" feed_flag="${5}"
 
        start_ts="$(date +%s)"
@@ -756,19 +762,25 @@ f_down() {
        # prepare feed flags
        #
        for flag in ${feed_flag}; do
-               if [ "${flag}" = "gz" ] && ! printf "%s" "${feed_comp}" | "${ban_grepcmd}" -qw "${flag}"; then
+               if [ "${flag}" = "gz" ]; then
                        feed_comp="${flag}"
-               elif [ -z "${feed_proto}" ] && { [ "${flag}" = "tcp" ] || [ "${flag}" = "udp" ]; }; then
-                       feed_proto="${flag}"
-               elif [ -n "${feed_proto}" ] && [ -n "${flag//[![:digit]-]/}" ] && ! printf "%s" "${feed_dport}" | "${ban_grepcmd}" -qw "${flag}"; then
-                       if [ -z "${feed_dport}" ]; then
-                               feed_dport="${flag}"
-                       else
-                               feed_dport="${feed_dport}, ${flag}"
+               elif [ "${flag}" = "tcp" ] || [ "${flag}" = "udp" ]; then
+                       if [ -z "${tmp_proto}" ]; then
+                               tmp_proto="${flag}"
+                       elif ! printf "%s" "${tmp_proto}" | "${ban_grepcmd}" -qw "${flag}"; then
+                               tmp_proto="${tmp_proto}, ${flag}"
+                       fi
+               elif [ -n "${flag//[![:digit]-]/}" ]; then
+                       if [ -z "${tmp_port}" ]; then
+                               tmp_port="${flag}"
+                       elif ! printf "%s" "${tmp_port}" | "${ban_grepcmd}" -qw "${flag}"; then
+                               tmp_port="${tmp_port}, ${flag}"
                        fi
                fi
        done
-       [ -n "${feed_dport}" ] && feed_dport="${feed_proto} dport { ${feed_dport} }"
+       if [ -n "${tmp_proto}" ] && [ -n "${tmp_port}" ]; then
+               feed_dport="meta l4proto { ${tmp_proto} } th dport { ${tmp_port} }"
+       fi
 
        # chain/rule maintenance
        #
@@ -1342,6 +1354,7 @@ f_report() {
        local report_jsn report_txt tmp_val ruleset_raw item table_sets set_cnt set_input set_forwardwan set_forwardlan set_cntinput set_cntforwardwan set_cntforwardlan set_proto set_dport set_details
        local expr detail jsnval timestamp autoadd_allow autoadd_block sum_sets sum_setinput sum_setforwardwan sum_setforwardlan sum_setelements sum_cntinput sum_cntforwardwan sum_cntforwardlan
        local sum_synflood sum_udpflood sum_icmpflood sum_ctinvalid sum_tcpinvalid output="${1}"
+
        [ -z "${ban_dev}" ] && f_conf
        f_mkdir "${ban_reportdir}"
        report_jsn="${ban_reportdir}/ban_report.jsn"
@@ -1537,7 +1550,7 @@ f_report() {
                        [ -n "${ban_mailreceiver}" ] && [ -x "${ban_mailcmd}" ] && f_mail
                        ;;
        esac
-       rm -f "${report_txt}"
+       : >"${report_txt}"
 }
 
 # Set search
@@ -1670,6 +1683,9 @@ f_monitor() {
                                        log_raw="$(eval ${loglimit_cmd})"
                                        log_count="$(printf "%s\n" "${log_raw}" | "${ban_grepcmd}" -c "suspicious IP '${ip}'")"
                                        if [ "${log_count}" -ge "${ban_logcount}" ]; then
+                                               if "${ban_nftcmd}" add element inet banIP "blocklist${proto}" { ${ip} ${nft_expiry} } >/dev/null 2>&1; then
+                                                       f_log "info" "add IP '${ip}' (expiry: ${ban_nftexpiry:-"-"}) to blocklist${proto} set"
+                                               fi
                                                if [ "${ban_autoblocksubnet}" = "1" ]; then
                                                        rdap_log="$("${ban_fetchcmd}" ${ban_rdapparm} "${ban_rdapfile}" "${ban_rdapurl}${ip}" 2>&1)"
                                                        rdap_rc="${?}"
@@ -1688,11 +1704,6 @@ f_monitor() {
                                                                f_log "info" "rdap request failed (rc: ${rdap_rc:-"-"}/log: ${rdap_log})"
                                                        fi
                                                fi
-                                               if [ "${ban_autoblocksubnet}" = "0" ] || [ "${rdap_rc}" != "0" ] || [ ! -s "${ban_rdapfile}" ] || [ -z "${rdap_prefix}" ] || [ -z "${rdap_length}" ]; then
-                                                       if "${ban_nftcmd}" add element inet banIP "blocklist${proto}" { ${ip} ${nft_expiry} } >/dev/null 2>&1; then
-                                                               f_log "info" "add IP '${ip}' (expiry: ${ban_nftexpiry:-"-"}) to blocklist${proto} set"
-                                                       fi
-                                               fi
                                                if [ -z "${ban_nftexpiry}" ] && [ "${ban_autoblocklist}" = "1" ] && ! "${ban_grepcmd}" -q "^${ip}" "${ban_blocklist}"; then
                                                        printf "%-42s%s\n" "${ip}" "# added on $(date "+%Y-%m-%d %H:%M:%S")" >>"${ban_blocklist}"
                                                        f_log "info" "add IP '${ip}' to local blocklist"
index 36982654ba29b25ad09d497ce555cd01352f719f..a614b33947b3c52a60b2d7c0432c827ecb49499c 100644 (file)
@@ -36,8 +36,7 @@
                "url_6": "https://asn.ipinfo.app/api/text/list/",
                "rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)$/{printf \"%s,\\n\",$1}",
                "rule_6": "/^(([0-9A-f]{0,4}:){1,7}[0-9A-f]{0,4}:?(\\/(1?[0-2][0-8]|[0-9][0-9]))?)$/{printf \"%s,\\n\",$1}",
-               "descr": "ASN IP segments",
-               "flag": "tcp 80 443"
+               "descr": "ASN IP segments"
        },
        "backscatterer":{
                "url_4": "http://wget-mirrors.uceprotect.net/rbldnsd-all/ips.backscatterer.org.gz",
                "descr": "malicious spyware IPs",
                "flag": "gz tcp 80 443"
        },
+       "ipblackhole":{
+               "url_4": "https://blackhole.s-e-r-v-e-r.pw/blackhole-today",
+               "rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)$/{printf \"%s,\\n\",$1}",
+               "descr": "blackhole IP blocklist"
+       },
        "ipsum":{
                "url_4": "https://raw.githubusercontent.com/stamparm/ipsum/master/levels/3.txt",
                "rule_4": "/^(([0-9]{1,3}\\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)[-[:space:]]?/{printf \"%s,\\n\",$1}",
index f65f9eaa6ba2d9265d7ff9e23afa18abefd66cf0..b49ba6282fa7488e1f63067264eb24afafa9e6c8 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cloudflared
-PKG_VERSION:=2024.4.0
+PKG_VERSION:=2024.4.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/cloudflare/cloudflared/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=a68882beb5ec2855a17253a751295c4cc4f8f9ca3b49920ffa7e398995f85055
+PKG_HASH:=11bed2bd793cc03775aa6270797ed328434bc982e09fd3597e267590f28d2436
 
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
index cf5b46fcde23868c2fd55953058a1f5289420010..8a97ac28710b7f7a7ab096bf61d9779a8d82bd43 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsproxy
-PKG_VERSION:=0.70.0
+PKG_VERSION:=0.71.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/AdguardTeam/dnsproxy/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a78ce398f2019e7a3a57e7ffcb06ecfb6d08e36e0a07c58ada4ac4871cecd677
+PKG_HASH:=9c55c83ce3521c5197293a7618ed3ff103d236344aabf73ba37055e3964d2087
 
 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 PKG_LICENSE:=Apache-2.0
@@ -45,6 +45,8 @@ endef
 define Package/dnsproxy/install
        $(call GoPackage/Package/Install/Bin,$(1))
 
+       $(INSTALL_DIR) $(1)/etc/capabilities/
+       $(INSTALL_DATA) $(CURDIR)/files/dnsproxy.json $(1)/etc/capabilities/dnsproxy.json
        $(INSTALL_DIR) $(1)/etc/config/
        $(INSTALL_CONF) $(CURDIR)/files/dnsproxy.config $(1)/etc/config/dnsproxy
        $(INSTALL_DIR) $(1)/etc/init.d/
index 90feb94d468b5904bd8949523828cf666d1c9ed3..ac704a7bb43d581f8b01accabfc12c997b609dfc 100644 (file)
@@ -37,8 +37,19 @@ config dnsproxy 'edns'
        option enabled '0'
        option edns_addr ''
 
+config dnsproxy 'private_rdns'
+       option enabled '0'
+       list upstream '127.0.0.1:53'
+
 config dnsproxy 'servers'
        list bootstrap 'tls://8.8.8.8'
        list fallback 'tls://9.9.9.9'
        list upstream 'tls://1.1.1.1'
 
+config dnsproxy 'tls'
+       option enabled '0'
+       option tls_crt ''
+       option tls_key ''
+       option https_port '8443'
+       option tls_port '853'
+       option quic_port '853'
index fc04ac9a6828ca29e50944d6a14a6bfcdeb59b64..ab1382d3f1f07e7e702fa6f4e9aaf86d9159c8c1 100644 (file)
@@ -66,6 +66,11 @@ load_config_list() {
 
        is_empty "bogus_nxdomain" "ip_addr" || config_list_foreach "bogus_nxdomain" "ip_addr" "append_param '--bogus-nxdomain'"
 
+       is_enabled "private_rdns" "enabled" && {
+               append_param "--use-private-rdns"
+               config_list_foreach "private_rdns" "upstream" "append_param '--private-rdns-upstream'"
+       }
+
        for i in "bootstrap" "fallback" "upstream"; do
                is_empty "servers" "$i" || config_list_foreach "servers" "$i" "append_param '--$i'"
        done
@@ -95,6 +100,14 @@ load_config_param() {
                append_param "--edns"
                append_param_arg "edns" "edns_addr" "--edns-addr"
        }
+
+       is_enabled "tls" "enabled" && {
+               append_param_arg "tls" "tls_crt" "--tls-crt"
+               append_param_arg "tls" "tls_key" "--tls-key"
+               append_param_arg "tls" "https_port" "--https-port"
+               append_param_arg "tls" "tls_port" "--tls-port"
+               append_param_arg "tls" "quic_port" "--quic-port"
+       }
 }
 
 start_service() {
@@ -102,6 +115,11 @@ start_service() {
 
        is_enabled "global" "enabled" || return 1
 
+       local log_file tls_crt tls_key
+       config_get log_file global log_file
+       config_get tls_crt tls tls_crt
+       config_get tls_key tls tls_key
+
        procd_open_instance "$CONF"
        procd_set_param command "$PROG"
 
@@ -114,6 +132,13 @@ start_service() {
        procd_set_param stderr 1
        procd_set_param user dnsproxy
 
+       procd_add_jail dnsproxy ronly log
+       procd_set_param capabilities "/etc/capabilities/dnsproxy.json"
+       procd_add_jail_mount "/etc/ssl/certs/ca-certificates.crt"
+       [ -z "$log_file" ] || procd_add_jail_mount_rw "$log_file"
+       [ -z "$tls_crt" ] || procd_add_jail_mount "$tls_crt"
+       [ -z "$tls_key" ] || procd_add_jail_mount "$tls_key"
+
        procd_close_instance
 }
 
diff --git a/net/dnsproxy/files/dnsproxy.json b/net/dnsproxy/files/dnsproxy.json
new file mode 100644 (file)
index 0000000..82eb37a
--- /dev/null
@@ -0,0 +1,17 @@
+{
+       "bounding": [
+               "CAP_NET_BIND_SERVICE"
+       ],
+       "effective": [
+               "CAP_NET_BIND_SERVICE"
+       ],
+       "ambient": [
+               "CAP_NET_BIND_SERVICE"
+       ],
+       "permitted": [
+               "CAP_NET_BIND_SERVICE"
+       ],
+       "inheritable": [
+               "CAP_NET_BIND_SERVICE"
+       ]
+}
index b889c8a4c710aca5ba63ed4a325c17274558cebe..6c68364bb69b6ea776d751d3374613531b74bd2d 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 PKG_NAME:=frr
 PKG_VERSION:=9.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_SOURCE_DATE:=2023-08-12
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
diff --git a/net/frr/patches/998-lib-fix-error-on-MacOS.patch b/net/frr/patches/998-lib-fix-error-on-MacOS.patch
new file mode 100644 (file)
index 0000000..6ee727b
--- /dev/null
@@ -0,0 +1,85 @@
+From ad26e0926d1fa20bfdd9b5f63cec4db9837f880a Mon Sep 17 00:00:00 2001
+From: Ruben Kerkhof <ruben@rubenkerkhof.com>
+Date: Wed, 18 Mar 2020 15:40:39 +0100
+Subject: [PATCH] lib: fix error on MacOS
+
+Sections use a different syntax for Mach-O executables.
+
+Fixes:
+
+lib/bfd.c:35:1: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a
+      comma
+DEFINE_MTYPE_STATIC(LIB, BFD_INFO, "BFD info")
+^
+./lib/memory.h:140:2: note: expanded from macro 'DEFINE_MTYPE_STATIC'
+        DEFINE_MTYPE_ATTR(group, name, static, desc)                           \
+        ^
+./lib/memory.h:110:26: note: expanded from macro 'DEFINE_MTYPE_ATTR'
+                __attribute__((section(".data.mtypes"))) = { {                 \
+                                       ^
+1 error generated.
+
+Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
+Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
+---
+ lib/memory.h | 43 +++++++++++++++++++++++++++----------------
+ 1 file changed, 27 insertions(+), 16 deletions(-)
+
+--- a/lib/compiler.h
++++ b/lib/compiler.h
+@@ -447,6 +447,12 @@ _Static_assert(sizeof(_uint64_t) == 8 &&
+ #define unlikely(_x) !!(_x)
+ #endif
++#ifdef __MACH__
++#define _DATA_SECTION(name) __attribute__((section("__DATA," name)))
++#else
++#define _DATA_SECTION(name) __attribute__((section(".data." name)))
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif
+--- a/lib/memory.h
++++ b/lib/memory.h
+@@ -69,14 +69,12 @@ struct memgroup {
+ #define DECLARE_MGROUP(name) extern struct memgroup _mg_##name
+ #define _DEFINE_MGROUP(mname, desc, ...)                                       \
+-      struct memgroup _mg_##mname                                            \
+-              __attribute__((section(".data.mgroups"))) = {                  \
+-                      .name = desc,                                          \
+-                      .types = NULL,                                         \
+-                      .next = NULL,                                          \
+-                      .insert = NULL,                                        \
+-                      .ref = NULL,                                           \
+-                      __VA_ARGS__                                            \
++      struct memgroup _mg_##mname _DATA_SECTION("mgroups") = {               \
++              .name = desc,                                                  \
++              .types = NULL,                                                 \
++              .next = NULL,                                                  \
++              .insert = NULL,                                                \
++              .ref = NULL,                                                   \
+       };                                                                     \
+       static void _mginit_##mname(void) __attribute__((_CONSTRUCTOR(1000))); \
+       static void _mginit_##mname(void)                                      \
+@@ -105,13 +103,12 @@ struct memgroup {
+       /* end */
+ #define DEFINE_MTYPE_ATTR(group, mname, attr, desc)                            \
+-      attr struct memtype MTYPE_##mname[1]                                   \
+-              __attribute__((section(".data.mtypes"))) = { {                 \
+-                      .name = desc,                                          \
+-                      .next = NULL,                                          \
+-                      .n_alloc = 0,                                          \
+-                      .size = 0,                                             \
+-                      .ref = NULL,                                           \
++      attr struct memtype MTYPE_##mname[1] _DATA_SECTION("mtypes") = { {     \
++              .name = desc,                                                  \
++              .next = NULL,                                                  \
++              .n_alloc = 0,                                                  \
++              .size = 0,                                                     \
++              .ref = NULL,                                                   \
+       } };                                                                   \
+       static void _mtinit_##mname(void) __attribute__((_CONSTRUCTOR(1001))); \
+       static void _mtinit_##mname(void)                                      \
index 98b429d0df97d7396f409d3f7a12133beb86599b..efc45da2b02840e4083c65eb488f222fc1e1d87e 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gensio
-PKG_VERSION:=2.7.6
+PKG_VERSION:=2.8.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ser2net
-PKG_HASH:=7574fb710ddd6580d53ea44af4ddfc57f28dbcdc646d842f7ed8ccc1235fdf89
+PKG_HASH:=28807dce0373f04271d44e1cdd38aa9486f3dd3060867b9acd370ece10404f62
 
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
diff --git a/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch b/net/gensio/patches/0001-Ensure-that-ax_python_devel_found-is-defined.patch
deleted file mode 100644 (file)
index a21d516..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-From 6bbc3056c4b9192010d888672d97810609ee23f9 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Sat, 18 Nov 2023 21:46:15 +0100
-Subject: [PATCH] Ensure that $ax_python_devel_found is defined
-
-Otherwise in case of --without-python, it triggers an error like:
--snip-
-...
-checking consistency of all components of python development environment... yes
-./configure: line 23729: test: =: unary operator expected
-...
--snap-
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- configure.ac | 3 +++
- 1 file changed, 3 insertions(+)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1997,6 +1997,9 @@ if test "x$trypython" = "xyes"; then
-       PYTHON_CPPFLAGS="$pythoncflags"
-    fi
-    AX_PYTHON_DEVEL([], [true])
-+   ax_python_devel_found=yes
-+else
-+   ax_python_devel_found=no
- fi
- if test $ax_python_devel_found = yes; then
-    AX_PROG_PYTHON_VERSION([3.0.0],
diff --git a/net/gensio/patches/0002_ax_python_devel-fix-serial.patch b/net/gensio/patches/0002_ax_python_devel-fix-serial.patch
deleted file mode 100644 (file)
index 211f692..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/m4/ax_python_devel.m4
-+++ b/m4/ax_python_devel.m4
-@@ -72,7 +72,7 @@
- #   modified version of the Autoconf Macro, you may extend this special
- #   exception to the GPL to apply to your modified version as well.
--#serial 34
-+#serial 35
- AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL])
- AC_DEFUN([AX_PYTHON_DEVEL],[
diff --git a/net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch b/net/gensio/patches/0003-Revert-ax_pkg_swig.m4-to-latest-vanilla-version.patch
deleted file mode 100644 (file)
index fb13df9..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-From f53fc85ee9734dd21447ea3438b7ba1edcd1bcf8 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Tue, 21 Nov 2023 23:27:45 +0100
-Subject: [PATCH] Revert ax_pkg_swig.m4 to latest vanilla version
-
-And instead of extending the macro, we can use the already
-create variable 'available_swig_vernum' to compare the
-required version number.
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- configure.ac      | 26 ++++++++++++--------------
- m4/ax_pkg_swig.m4 | 20 +++++++++-----------
- 2 files changed, 21 insertions(+), 25 deletions(-)
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -1956,21 +1956,19 @@ AC_CHECK_LIB(nsl, main, [HAVE_LIBNSL=1;
- SWIG_DIR=
- SWIG_CPP_DIR=
- SWIG=
--SWIG_NUMVERSION=0
-+available_swig_vernum=0
- if test "x$tryswig" = "xyes"; then
-    if test "x$swigprog" != "x"; then
-       SWIG="$swigprog"
-    fi
--   AX_PKG_SWIG([1.3.21])
--   if test "x$SWIG" != "x"; then
--      AC_DEFINE([HAVE_SWIG], [], [Have swig installed])
--      SWIG_DIR=swig
--      if test $SWIG_NUMVERSION -ge 40100; then
--          SWIG_CPP_DIR=swig
--      else
--          AC_MSG_WARN([SWIG version >= 4.1.0 is required for C++ swig.])
--      fi
--   fi
-+   AX_PKG_SWIG(4.1.0,
-+        [
-+            AC_DEFINE([HAVE_SWIG], [], [Have swig installed])
-+            SWIG_DIR=swig
-+            SWIG_CPP_DIR=swig
-+        ], [
-+            AC_MSG_WARN([SWIG version >= 4.1.0 is required for C++ swig.])
-+        ])
- fi
- AC_SUBST(SWIG_DIR)
- AC_SUBST(SWIG_CPP_DIR)
-@@ -2055,7 +2053,7 @@ AC_SUBST(PYTHON_UNDEF_LIBS)
- PYTHON_EXECUTABLE="${PYTHON}"
- AC_SUBST(PYTHON_EXECUTABLE)
--if test $SWIG_NUMVERSION -ge 40100 -a "${enable_shared}" = yes; then
-+if test $available_swig_vernum -ge 40100 -a "${enable_shared}" = yes; then
-    trygo=yes
- else
-    trygo=no
-@@ -2076,7 +2074,7 @@ AC_ARG_WITH(go,
-    fi,
- )
--if test $trygo = yes -a $SWIG_NUMVERSION -lt 40100; then
-+if test $trygo = yes -a $available_swig_vernum -lt 40100; then
-    AC_MSG_ERROR([Go enabled, but swig version must be >= 4.1.0 for that])
- fi
- GODIR=
-@@ -2363,7 +2361,7 @@ pr_op  "  shared libraries:      " $enable_sh
- pr_op  "  sctp sendv:         " $ac_cv_lib_sctp_sctp_sendv
- pr_vop "  python:             " "$ax_python_version"
- if test "$SWIG_CPP_DIR" = "swig"; then
--  prrw "  swig:                       " "$SWIG_NUMVERSION"
-+  prrw "  swig:                       " "$available_swig_vernum"
- else
-   prrw "  swig:                       " "no"
- fi
---- a/m4/ax_pkg_swig.m4
-+++ b/m4/ax_pkg_swig.m4
-@@ -19,11 +19,6 @@
- #   1.3.17), AX_PKG_SWIG checks that the swig package is this version number
- #   or higher.
- #
--#   If successful, SWIG_NUMVERSION is set to a numeric value for the
--#   version found in the format NNnnpp where NN is the major version,
--#   nn is the minor version, and pp is the patch version.  This is
--#   easy to directly compare with a number.
--#
- #   As usual, action-if-found is executed if SWIG is found, otherwise
- #   action-if-not-found is executed.
- #
-@@ -41,6 +36,8 @@
- #   Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
- #   Copyright (c) 2008 Andrew Collier
- #   Copyright (c) 2011 Murray Cumming <murrayc@openismus.com>
-+#   Copyright (c) 2018 Reini Urban <rurban@cpan.org>
-+#   Copyright (c) 2021 Vincent Danjean <Vincent.Danjean@ens-lyon.org>
- #
- #   This program is free software; you can redistribute it and/or modify it
- #   under the terms of the GNU General Public License as published by the
-@@ -68,14 +65,16 @@
- #   modified version of the Autoconf Macro, you may extend this special
- #   exception to the GPL to apply to your modified version as well.
--#serial 13
-+#serial 15
- AC_DEFUN([AX_PKG_SWIG],[
-         # Find path to the "swig" executable.
-         AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0])
-         if test -z "$SWIG" ; then
-                 m4_ifval([$3],[$3],[:])
--        elif test -n "$1" ; then
-+        elif test -z "$1" ; then
-+                m4_ifval([$2],[$2],[:])
-+      else
-                 AC_MSG_CHECKING([SWIG version])
-                 [swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
-                 AC_MSG_RESULT([$swig_version])
-@@ -86,12 +85,12 @@ AC_DEFUN([AX_PKG_SWIG],[
-                         if test -z "$required_major" ; then
-                                 [required_major=0]
-                         fi
--                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-+                        [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`]
-                         [required_minor=`echo $required | sed 's/[^0-9].*//'`]
-                         if test -z "$required_minor" ; then
-                                 [required_minor=0]
-                         fi
--                        [required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
-+                        [required=`echo $required. | sed 's/[0-9]*[^0-9]//'`]
-                         [required_patch=`echo $required | sed 's/[^0-9].*//'`]
-                         if test -z "$required_patch" ; then
-                                 [required_patch=0]
-@@ -126,10 +125,9 @@ AC_DEFUN([AX_PKG_SWIG],[
-                                 m4_ifval([$3],[$3],[])
-                         else
-                                 AC_MSG_CHECKING([for SWIG library])
--                                SWIG_LIB=`$SWIG -swiglib | tail -1`
-+                                SWIG_LIB=`$SWIG -swiglib | tr '\r\n' '  '`
-                                 AC_MSG_RESULT([$SWIG_LIB])
-                                 m4_ifval([$2],[$2],[])
--                                SWIG_NUMVERSION=$available_swig_vernum
-                         fi
-                 else
-                         AC_MSG_WARN([cannot determine SWIG version])
diff --git a/net/hev-socks5-server/Makefile b/net/hev-socks5-server/Makefile
new file mode 100644 (file)
index 0000000..c307b0e
--- /dev/null
@@ -0,0 +1,49 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=hev-socks5-server
+PKG_VERSION:=2.6.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/heiher/hev-socks5-server/releases/download/$(PKG_VERSION)
+PKG_HASH:=07d3297483cc624464eec424f7dd27f2028f4f56c70c2c9d0b6902e181a32ccb
+
+PKG_MAINTAINER:=Ray Wang <r@hev.cc>
+PKG_LICENSE:=GPL-3.0-only
+PKG_LICENSE_FILES:=License
+
+PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/hev-socks5-server
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=A high-performance socks5 server for Unix
+  URL:=https://github.com/heiher/hev-socks5-server
+endef
+
+MAKE_FLAGS += REV_ID="$(PKG_VERSION)"
+
+define Package/hev-socks5-server/conffiles
+/etc/config/hev-socks5-server
+/etc/hev-socks5-server/
+endef
+
+define Package/hev-socks5-server/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/hev-socks5-server $(1)/usr/bin/
+
+       $(INSTALL_DIR) $(1)/etc/hev-socks5-server/
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/main.yml $(1)/etc/hev-socks5-server/main.yml
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/auth.txt $(1)/etc/hev-socks5-server/auth.txt
+
+       $(INSTALL_DIR) $(1)/etc/config/
+       $(INSTALL_CONF) ./files/hev-socks5-server.config $(1)/etc/config/hev-socks5-server
+
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) ./files/hev-socks5-server.init $(1)/etc/init.d/hev-socks5-server
+endef
+
+$(eval $(call BuildPackage,hev-socks5-server))
diff --git a/net/hev-socks5-server/files/hev-socks5-server.config b/net/hev-socks5-server/files/hev-socks5-server.config
new file mode 100644 (file)
index 0000000..0df231a
--- /dev/null
@@ -0,0 +1,3 @@
+config hev-socks5-server 'config'
+       option enabled '0'
+       option conffile '/etc/hev-socks5-server/main.yml'
diff --git a/net/hev-socks5-server/files/hev-socks5-server.init b/net/hev-socks5-server/files/hev-socks5-server.init
new file mode 100644 (file)
index 0000000..671870c
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=99
+
+CONF="hev-socks5-server"
+PROG="/usr/bin/hev-socks5-server"
+
+start_service() {
+       config_load "$CONF"
+
+       local enabled
+       config_get_bool enabled "config" "enabled" "0"
+       [ "$enabled" -eq "1" ] || return 1
+
+       local conffile
+       config_get conffile "config" "conffile"
+
+       procd_open_instance "$CONF"
+       procd_set_param command "$PROG" "$conffile"
+       procd_set_param file "$conffile"
+
+       procd_set_param limits core="unlimited"
+       procd_set_param limits nofile="1000000 1000000"
+       procd_set_param stdout 1
+       procd_set_param stderr 1
+       procd_set_param respawn
+
+       procd_close_instance
+}
+
+service_triggers() {
+       procd_add_reload_trigger "$CONF"
+}
diff --git a/net/hev-socks5-server/test.sh b/net/hev-socks5-server/test.sh
new file mode 100755 (executable)
index 0000000..9ae615c
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+"$1" 2>&1 | grep "$2"
index 88f978d9dc3a5a2e1971513d7f110ecc260da385..0638d786e7dd5ef319ff09c2a23258ebc15c9977 100644 (file)
@@ -1,28 +1,35 @@
-# [Jool](https://www.jool.mx)
+# [Jool](https://nicmx.github.io/Jool/en/index.html)
 
 ## Documentation
 
-[See here](https://www.jool.mx/en/documentation.html).
+[See here](https://nicmx.github.io/Jool/en/documentation.html).
 
-You might also want to see [contact info](https://www.jool.mx/en/contact.html).
+You might also want to see [contact info](https://nicmx.github.io/Jool/en/contact.html).
 
 ## Usage
 
 ### Start script
 
 This package includes a start script that will:
-    1. Read the configuration file `/etc/config/jool`
-    2. Determine what services are active
-    3. Run jool with procd
-
-For now this means that:
-    * The services will be disabled by default in the uci config `(/etc/config/jool)`
-    * The only uci configuration support available for the package is to enable or disable each instance or the entire deamon
-    * There is no uci support and configuration will be saved at `/etc/jool/*
-    * Only one instance of jool(nat64) can run with the boot script
-    * Only one instance of jool(siit) can run with the boot script
-    * For now there is no way of overriding of the configuration file's paths
-
-The configuration files the startup script useses for each jool instance are:
-    * jool(nat64): `/etc/jool/jool-nat64.conf.json`
-    * jool(siit): `/etc/jool/jool-siit.conf.json`
+
+  1. Read the configuration file `/etc/config/jool`
+  2. Determine what services are active
+  3. Run `jool` with procd
+
+### For now this means that
+  
+- The services will be disabled by default in the uci config `(/etc/config/jool)`
+- The only uci configuration support available for the package is to enable or disable each instance or the entire deamon
+- There is no uci support and configuration will be saved at `/etc/jool/`
+- Only one instance of jool(nat64) can run with the boot script
+- Only one instance of jool(siit) can run with the boot script
+- For now there is no way of overriding of the configuration file's paths
+
+The configuration files the startup script uses for each jool instance are:
+
+- jool(nat64): `/etc/jool/jool-nat64.conf.json`
+- jool(siit): `/etc/jool/jool-siit.conf.json`
+
+### OpenWrt tutorial
+
+For a more detailed tutorial refer to this [wiki page](https://openwrt.org/docs/guide-user/network/ipv6/nat64).
index 984370e64b8e223318716a5f8ae8493fbd4f4ad6..0b5f4e2793d62e36ccfb596d617dbe7844d7f1de 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=librespeed-go
 PKG_VERSION:=1.1.5
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/librespeed/speedtest-go/tar.gz/v$(PKG_VERSION)?
@@ -39,10 +39,10 @@ define Package/librespeed-go
 endef
 
 define Package/librespeed-go/description
-  No Flash, No Java, No WebSocket, No Bullshit.
-
   This is a very lightweight speed test implemented in JavaScript,
   using XMLHttpRequest and Web Workers.
+
+  No Flash, No Java, No WebSocket, No Bullshit.
 endef
 
 define Package/librespeed-go/conffiles
index 5efe9799bfb91a919dbeb584e28bf4144ee594b2..38f1d5137f766bda627794a25ae366cf516643dc 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nextdns
-PKG_VERSION:=1.42.0
+PKG_VERSION:=1.43.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=nextdns-$(PKG_VERSION).tar.gz
 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.github.com/nextdns/nextdns/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=893692bea9015116d6ce610c94dccf744f3aa29aeb716a15cca17dd6e6b837c1
+PKG_HASH:=574b377d6f4af140e3dcfba78fcf68d52ddb32390c020d1fe9bc5ade0af85f97
 
 PKG_MAINTAINER:=Olivier Poitrey <rs@nextdns.io>
 PKG_LICENSE:=MIT
index 501ea06728ac49a1f514b5ab357725ac50235228..c93214cf2ae9fcdc03c29989d5182589e66f3283 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nmap
-PKG_VERSION:=7.93
-PKG_RELEASE:=4
+PKG_VERSION:=7.95
+PKG_RELEASE:=1
 PKG_MAINTAINER:=Nuno Gonçalves <nunojpg@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://nmap.org/dist/
-PKG_HASH:=55bcfe4793e25acc96ba4274d8c4228db550b8e8efd72004b38ec55a2dd16651
+PKG_HASH:=e14ab530e47b5afd88f1c8a2bac7f89cd8fe6b478e22d255c5b9bddb7a1c5778
+
 PKG_LICENSE:=NPSL-0.94-or-NPSL-0.95
 PKG_LICENSE_FILES:=LICENSE
 PKG_CPE_ID:=cpe:/a:nmap:nmap
@@ -32,7 +33,7 @@ PYTHON3_PKG_FORCE_DISTUTILS_SETUP:=1
 include $(INCLUDE_DIR)/package.mk
 include ../../lang/python/python3-package.mk
 
-NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre
+NMAP_DEPENDS:=+libpcap +libstdcpp +zlib +libpcre2
 NCAT_DEPENDS:=+libpcap
 NPING_DEPENDS:=+libpcap +libpthread +libstdcpp
 SSL_DEPENDS:=+libopenssl +ca-certs
@@ -60,7 +61,7 @@ endef
 
 define Package/nmap-full
 $(call Package/nmap/default)
-  DEPENDS:=$(NMAP_DEPENDS) $(SSL_DEPENDS) +liblua5.3 +libssh2
+  DEPENDS:=$(NMAP_DEPENDS) $(SSL_DEPENDS) +liblua5.4 +libssh2
   VARIANT:=full
   TITLE:=Nmap (with OpenSSL and scripting support)
 endef
@@ -81,7 +82,7 @@ endef
 
 define Package/ncat-full
 $(call Package/nmap/default)
-  DEPENDS:=$(NCAT_DEPENDS) $(SSL_DEPENDS) +liblua5.3
+  DEPENDS:=$(NCAT_DEPENDS) $(SSL_DEPENDS) +liblua5.4
   VARIANT:=full
   TITLE:=Ncat (with OpenSSL and scripting support)
 endef
diff --git a/net/nmap/patches/010-Build-based-on-OpenSSL-version.patch b/net/nmap/patches/010-Build-based-on-OpenSSL-version.patch
deleted file mode 100644 (file)
index 3a615df..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-From d6bea8dcdee36a3902cece14097993350306f1b6 Mon Sep 17 00:00:00 2001
-From: dmiller <dmiller@e0a8ed71-7df4-0310-8962-fdc924857419>
-Date: Tue, 6 Sep 2022 22:39:34 +0000
-Subject: [PATCH] Build based on OpenSSL version, not API level. Fixes #2516
-
----
- ncat/http_digest.c        |  2 +-
- ncat/ncat_connect.c       |  4 ++--
- ncat/ncat_ssl.c           |  6 +++---
- ncat/ncat_ssl.h           | 12 ------------
- ncat/test/test-wildcard.c |  4 ++--
- nse_openssl.cc            | 28 +++++++---------------------
- nse_ssl_cert.cc           | 24 ++++++------------------
- nsock/src/nsock_ssl.c     |  4 ++--
- nsock/src/nsock_ssl.h     | 15 +--------------
- 9 files changed, 24 insertions(+), 75 deletions(-)
-
---- a/ncat/http_digest.c
-+++ b/ncat/http_digest.c
-@@ -133,7 +133,7 @@ int http_digest_init_secret(void)
-     return 0;
- }
--#if OPENSSL_API_LEVEL < 10100
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
- #define EVP_MD_CTX_new EVP_MD_CTX_create
- #define EVP_MD_CTX_free EVP_MD_CTX_destroy
- #endif
---- a/ncat/ncat_connect.c
-+++ b/ncat/ncat_connect.c
-@@ -82,8 +82,8 @@
- #include <openssl/err.h>
- /* Deprecated in OpenSSL 3.0 */
--#if OPENSSL_API_LEVEL >= 30000
--#define SSL_get_peer_certificate SSL_get1_peer_certificate
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
-+# define SSL_get_peer_certificate SSL_get1_peer_certificate
- #endif
- #endif
---- a/ncat/ncat_ssl.c
-+++ b/ncat/ncat_ssl.c
-@@ -80,7 +80,7 @@
- #define FUNC_ASN1_STRING_data ASN1_STRING_data
- #endif
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- #include <openssl/provider.h>
- /* Deprecated in OpenSSL 3.0 */
- #define SSL_get_peer_certificate SSL_get1_peer_certificate
-@@ -117,7 +117,7 @@ SSL_CTX *setup_ssl_listen(void)
-     OpenSSL_add_all_algorithms();
-     ERR_load_crypto_strings();
-     SSL_load_error_strings();
--#elif OPENSSL_API_LEVEL >= 30000
-+#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
-   if (NULL == OSSL_PROVIDER_load(NULL, "legacy"))
-   {
-     loguser("OpenSSL legacy provider failed to load.\n");
-@@ -477,7 +477,7 @@ static int ssl_gen_cert(X509 **cert, EVP
-     const char *commonName = "localhost";
-     char dNSName[128];
-     int rc;
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-     int ret = 0;
-     RSA *rsa = NULL;
-     BIGNUM *bne = NULL;
---- a/ncat/ncat_ssl.h
-+++ b/ncat/ncat_ssl.h
-@@ -67,18 +67,6 @@
- #include <openssl/ssl.h>
- #include <openssl/err.h>
--/* OPENSSL_API_LEVEL per OpenSSL 3.0: decimal MMmmpp */
--#ifndef OPENSSL_API_LEVEL
--# if OPENSSL_API_COMPAT < 0x900000L
--#  define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
--# else
--#  define OPENSSL_API_LEVEL \
--     (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000  \
--      + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
--      + ((OPENSSL_API_COMPAT >> 12) & 0xFF))
--# endif
--#endif
--
- #define NCAT_CA_CERTS_FILE "ca-bundle.crt"
- enum {
---- a/ncat/test/test-wildcard.c
-+++ b/ncat/test/test-wildcard.c
-@@ -20,7 +20,7 @@ are rejected. The SSL transactions happe
- #include "ncat_core.h"
- #include "ncat_ssl.h"
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
- #include <openssl/bn.h>
- #endif
-@@ -294,7 +294,7 @@ stack_err:
- static int gen_cert(X509 **cert, EVP_PKEY **key,
-     const struct lstr commonNames[], const struct lstr dNSNames[])
- {
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-     int rc, ret=0;
-     RSA *rsa = NULL;
-     BIGNUM *bne = NULL;
---- a/nse_openssl.cc
-+++ b/nse_openssl.cc
-@@ -20,6 +20,9 @@
- #define FUNC_EVP_CIPHER_CTX_init EVP_CIPHER_CTX_reset
- #define FUNC_EVP_CIPHER_CTX_cleanup EVP_CIPHER_CTX_reset
- #define PASS_EVP_CTX(ctx) (ctx)
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
-+# include <openssl/provider.h>
-+#endif
- #else
- #define FUNC_EVP_MD_CTX_init EVP_MD_CTX_init
- #define FUNC_EVP_MD_CTX_cleanup EVP_MD_CTX_cleanup
-@@ -37,23 +40,6 @@ extern NmapOps o;
- #include "nse_openssl.h"
--/* OPENSSL_API_LEVEL per OpenSSL 3.0: decimal MMmmpp */
--#ifndef OPENSSL_API_LEVEL
--# if OPENSSL_API_COMPAT < 0x900000L
--#  define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
--# else
--#  define OPENSSL_API_LEVEL \
--     (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000  \
--      + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
--      + ((OPENSSL_API_COMPAT >> 12) & 0xFF))
--# endif
--#endif
--
--
--#if OPENSSL_API_LEVEL >= 30000
--#include <openssl/provider.h>
--#endif
--
- #define NSE_SSL_LUA_ERR(_L) \
-     luaL_error(_L, "OpenSSL error: %s", ERR_error_string(ERR_get_error(), NULL))
-@@ -184,7 +170,7 @@ static int l_bignum_is_prime( lua_State
-   bignum_data_t * p = (bignum_data_t *) luaL_checkudata( L, 1, "BIGNUM" );
-   BN_CTX * ctx = BN_CTX_new();
-   int is_prime =
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-     BN_is_prime_ex( p->bn, BN_prime_checks, ctx, NULL );
- #else
-     BN_check_prime( p->bn, ctx, NULL );
-@@ -199,7 +185,7 @@ static int l_bignum_is_safe_prime( lua_S
-   bignum_data_t * p = (bignum_data_t *) luaL_checkudata( L, 1, "BIGNUM" );
-   BN_CTX * ctx = BN_CTX_new();
-   int is_prime =
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-     BN_is_prime_ex( p->bn, BN_prime_checks, ctx, NULL );
- #else
-     BN_check_prime( p->bn, ctx, NULL );
-@@ -210,7 +196,7 @@ static int l_bignum_is_safe_prime( lua_S
-     BN_sub_word( n, (BN_ULONG)1 );
-     BN_div_word( n, (BN_ULONG)2 );
-     is_safe =
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-       BN_is_prime_ex( n, BN_prime_checks, ctx, NULL );
- #else
-       BN_check_prime( n, ctx, NULL );
-@@ -582,7 +568,7 @@ LUALIB_API int luaopen_openssl(lua_State
- #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined LIBRESSL_VERSION_NUMBER
-   OpenSSL_add_all_algorithms();
-   ERR_load_crypto_strings();
--#elif OPENSSL_API_LEVEL >= 30000
-+#elif OPENSSL_VERSION_NUMBER >= 0x30000000L
-   if (NULL == OSSL_PROVIDER_load(NULL, "legacy") && o.debugging > 1)
-   {
-     // Legacy provider may not be available.
---- a/nse_ssl_cert.cc
-+++ b/nse_ssl_cert.cc
-@@ -89,19 +89,7 @@
- #define X509_get0_notAfter X509_get_notAfter
- #endif
--/* OPENSSL_API_LEVEL per OpenSSL 3.0: decimal MMmmpp */
--#ifndef OPENSSL_API_LEVEL
--# if OPENSSL_API_COMPAT < 0x900000L
--#  define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
--# else
--#  define OPENSSL_API_LEVEL \
--     (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000  \
--      + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
--      + ((OPENSSL_API_COMPAT >> 12) & 0xFF))
--# endif
--#endif
--
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- #include <openssl/core_names.h>
- /* Deprecated in OpenSSL 3.0 */
- #define SSL_get_peer_certificate SSL_get1_peer_certificate
-@@ -459,7 +447,7 @@ static const char *pkey_type_to_string(i
- }
- int lua_push_ecdhparams(lua_State *L, EVP_PKEY *pubkey) {
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
-   char tmp[64] = {0};
-   size_t len = 0;
-   /* This structure (ecdhparams.curve_params) comes from tls.lua */
-@@ -634,7 +622,7 @@ static int parse_ssl_cert(lua_State *L,
-   else
- #endif
-   if (pkey_type == EVP_PKEY_RSA) {
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-     RSA *rsa = EVP_PKEY_get1_RSA(pubkey);
-     if (rsa) {
- #endif
-@@ -643,7 +631,7 @@ static int parse_ssl_cert(lua_State *L,
-       luaL_getmetatable( L, "BIGNUM" );
-       lua_setmetatable( L, -2 );
- #if HAVE_OPAQUE_STRUCTS
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-       const BIGNUM *n = NULL, *e = NULL;
-       data->should_free = false;
-       RSA_get0_key(rsa, &n, &e, NULL);
-@@ -663,7 +651,7 @@ static int parse_ssl_cert(lua_State *L,
-       luaL_getmetatable( L, "BIGNUM" );
-       lua_setmetatable( L, -2 );
- #if HAVE_OPAQUE_STRUCTS
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-       data->should_free = false;
- #else
-       data->should_free = true;
-@@ -673,7 +661,7 @@ static int parse_ssl_cert(lua_State *L,
-       data->bn = rsa->n;
- #endif
-       lua_setfield(L, -2, "modulus");
--#if OPENSSL_API_LEVEL < 30000
-+#if OPENSSL_VERSION_NUMBER < 0x30000000L
-       RSA_free(rsa);
-     }
- #endif
---- a/nsock/src/nsock_ssl.c
-+++ b/nsock/src/nsock_ssl.c
-@@ -64,7 +64,7 @@
- #include "netutils.h"
- #if HAVE_OPENSSL
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- #include <openssl/provider.h>
- #endif
-@@ -120,7 +120,7 @@ static SSL_CTX *ssl_init_helper(const SS
-     SSL_library_init();
- #else
-     OPENSSL_atexit(nsock_ssl_atexit);
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
-     if (NULL == OSSL_PROVIDER_load(NULL, "legacy"))
-     {
-       nsock_log_error("OpenSSL legacy provider failed to load.\n");
---- a/nsock/src/nsock_ssl.h
-+++ b/nsock/src/nsock_ssl.h
-@@ -69,20 +69,7 @@
- #include <openssl/err.h>
- #include <openssl/rand.h>
--/* OPENSSL_API_LEVEL per OpenSSL 3.0: decimal MMmmpp */
--#ifndef OPENSSL_API_LEVEL
--# if OPENSSL_API_COMPAT < 0x900000L
--#  define OPENSSL_API_LEVEL (OPENSSL_API_COMPAT)
--# else
--#  define OPENSSL_API_LEVEL \
--     (((OPENSSL_API_COMPAT >> 28) & 0xF) * 10000  \
--      + ((OPENSSL_API_COMPAT >> 20) & 0xFF) * 100 \
--      + ((OPENSSL_API_COMPAT >> 12) & 0xFF))
--# endif
--#endif
--
--
--#if OPENSSL_API_LEVEL >= 30000
-+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
- /* Deprecated in OpenSSL 3.0 */
- #define SSL_get_peer_certificate SSL_get1_peer_certificate
- #endif
diff --git a/net/nmap/patches/020-Python3-port-of-ndiff.patch b/net/nmap/patches/020-Python3-port-of-ndiff.patch
deleted file mode 100644 (file)
index 019be8a..0000000
+++ /dev/null
@@ -1,1734 +0,0 @@
-From: Bryan Quigley <bryan.quigley@canonical.com>
-Date: Sat, 2 Nov 2019 21:06:44 -0700
-Subject: Python3 port of ndiff
-
-Ported all python scrips in ndiff/ except setup.py
-
-Some hints on cmp taken from #1484
-
-Minor tweaks to Makefile to support python3, but unsure if
-there is a better way to do that.
-
-Seperated .travis.yml commands for easier debugging where it breaks.
-
-This closes the easy half of #1176
-
-Resolves: #1484
----
- .travis.yml                   |   8 +-
- Makefile.in                   |   6 +-
- ndiff/ndiff.py                | 503 +++++++++++++++++++++---------------------
- ndiff/ndifftest.py            |  94 ++++----
- ndiff/scripts/ndiff           |  14 +-
- ndiff/setup.py                |  44 ++--
- ndiff/test-scans/anonymize.py |  18 +-
- 7 files changed, 346 insertions(+), 341 deletions(-)
- mode change 100644 => 100755 ndiff/setup.py
-
---- a/.travis.yml
-+++ b/.travis.yml
-@@ -4,7 +4,13 @@ compiler:
-   - clang
- # Change this to your needs
- sudo: false
--script: mkdir /tmp/n && ./configure $SSL_FLAG $LUA_FLAG --prefix=/tmp/n && make && make check && make install && /tmp/n/bin/nmap -A localhost
-+script:
-+  - "mkdir /tmp/n"
-+  - "./configure $SSL_FLAG $LUA_FLAG --prefix=/tmp/n"
-+  - "make"
-+  - "make check"
-+  - "make install"
-+  - "/tmp/n/bin/nmap -A localhost"
- env:
-   - SSL_FLAG="--without-openssl" LUA_FLAG="--without-liblua"
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -34,6 +34,7 @@ ZENMAPDIR = @ZENMAPDIR@
- NDIFFDIR = @NDIFFDIR@
- NPINGDIR = @NPINGDIR@
- PYTHON = @PYTHON@
-+PYTHON3 = /usr/bin/env python3
- DEFS = @DEFS@ -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
- # With GCC, add extra security checks to source code.
- # http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
-@@ -361,6 +362,7 @@ tests/check_dns: $(OBJS)
- # this as the location of the interpreter whenever we're not doing a
- # local installation.
- DEFAULT_PYTHON_PATH = /usr/bin/env python
-+DEFAULT_PYTHON3_PATH = /usr/bin/env python3
- build-zenmap: $(ZENMAPDIR)/setup.py $(ZENMAPDIR)/zenmapCore/Version.py
- # When DESTDIR is defined, assume we're building an executable
-@@ -381,7 +383,7 @@ install-zenmap: $(ZENMAPDIR)/setup.py
-       ln -sf zenmap $(DESTDIR)$(bindir)/xnmap
- build-ndiff:
--      cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)")
-+      cd $(NDIFFDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON3_PATH)")
- build-nping: $(NPINGDIR)/Makefile build-nbase build-nsock build-netutil $(NPINGDIR)/nping.h @DNET_BUILD@ @PCAP_BUILD@
-       @cd $(NPINGDIR) && $(MAKE)
-@@ -451,7 +453,7 @@ check-ncat:
-       @cd $(NCATDIR) && $(MAKE) check
- check-ndiff:
--      @cd $(NDIFFDIR) && $(PYTHON) ndifftest.py
-+      @cd $(NDIFFDIR) && $(PYTHON3) ndifftest.py
- check-nsock:
-       @cd $(NSOCKDIR)/src && $(MAKE) check
---- a/ndiff/ndiff.py
-+++ b/ndiff/ndiff.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- # Ndiff
- #
-@@ -25,11 +25,11 @@ xml.__path__ = [x for x in xml.__path__
- import xml.sax
- import xml.sax.saxutils
- import xml.dom.minidom
--from StringIO import StringIO
-+from io import StringIO
- verbose = False
--NDIFF_XML_VERSION = u"1"
-+NDIFF_XML_VERSION = "1"
- class OverrideEntityResolver(xml.sax.handler.EntityResolver):
-@@ -74,35 +74,35 @@ class Scan(object):
-     def write_nmaprun_open(self, writer):
-         attrs = {}
-         if self.scanner is not None:
--            attrs[u"scanner"] = self.scanner
-+            attrs["scanner"] = self.scanner
-         if self.args is not None:
--            attrs[u"args"] = self.args
-+            attrs["args"] = self.args
-         if self.start_date is not None:
--            attrs[u"start"] = "%d" % time.mktime(self.start_date.timetuple())
--            attrs[u"startstr"] = self.start_date.strftime(
-+            attrs["start"] = "%d" % time.mktime(self.start_date.timetuple())
-+            attrs["startstr"] = self.start_date.strftime(
-                     "%a %b %d %H:%M:%S %Y")
-         if self.version is not None:
--            attrs[u"version"] = self.version
--        writer.startElement(u"nmaprun", attrs)
-+            attrs["version"] = self.version
-+        writer.startElement("nmaprun", attrs)
-     def write_nmaprun_close(self, writer):
--        writer.endElement(u"nmaprun")
-+        writer.endElement("nmaprun")
-     def nmaprun_to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"nmaprun")
-+        elem = document.createElement("nmaprun")
-         if self.scanner is not None:
--            elem.setAttribute(u"scanner", self.scanner)
-+            elem.setAttribute("scanner", self.scanner)
-         if self.args is not None:
--            elem.setAttribute(u"args", self.args)
-+            elem.setAttribute("args", self.args)
-         if self.start_date is not None:
-             elem.setAttribute(
--                    u"start", "%d" % time.mktime(self.start_date.timetuple()))
-+                    "start", "%d" % time.mktime(self.start_date.timetuple()))
-             elem.setAttribute(
--                    u"startstr",
-+                    "startstr",
-                     self.start_date.strftime("%a %b %d %H:%M:%S %Y"))
-         if self.version is not None:
--            elem.setAttribute(u"version", self.version)
-+            elem.setAttribute("version", self.version)
-         frag.appendChild(elem)
-         return frag
-@@ -132,17 +132,17 @@ class Host(object):
-     def format_name(self):
-         """Return a human-readable identifier for this host."""
--        address_s = u", ".join(a.s for a in sorted(self.addresses))
--        hostname_s = u", ".join(sorted(self.hostnames))
-+        address_s = ", ".join(a.s for a in sorted(self.addresses))
-+        hostname_s = ", ".join(sorted(self.hostnames))
-         if len(hostname_s) > 0:
-             if len(address_s) > 0:
--                return u"%s (%s)" % (hostname_s, address_s)
-+                return "%s (%s)" % (hostname_s, address_s)
-             else:
-                 return hostname_s
-         elif len(address_s) > 0:
-             return address_s
-         else:
--            return u"<no name>"
-+            return "<no name>"
-     def add_port(self, port):
-         self.ports[port.spec] = port
-@@ -159,46 +159,46 @@ class Host(object):
-         return state is None or state in self.extraports
-     def extraports_string(self):
--        list = [(count, state) for (state, count) in self.extraports.items()]
-+        locallist = [(count, state) for (state, count) in list(self.extraports.items())]
-         # Reverse-sort by count.
--        list.sort(reverse=True)
--        return u", ".join(
--                [u"%d %s ports" % (count, state) for (count, state) in list])
-+        locallist.sort(reverse=True)
-+        return ", ".join(
-+                ["%d %s ports" % (count, state) for (count, state) in locallist])
-     def state_to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
-         if self.state is not None:
--            elem = document.createElement(u"status")
--            elem.setAttribute(u"state", self.state)
-+            elem = document.createElement("status")
-+            elem.setAttribute("state", self.state)
-             frag.appendChild(elem)
-         return frag
-     def hostname_to_dom_fragment(self, document, hostname):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"hostname")
--        elem.setAttribute(u"name", hostname)
-+        elem = document.createElement("hostname")
-+        elem.setAttribute("name", hostname)
-         frag.appendChild(elem)
-         return frag
-     def extraports_to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        for state, count in self.extraports.items():
--            elem = document.createElement(u"extraports")
--            elem.setAttribute(u"state", state)
--            elem.setAttribute(u"count", unicode(count))
-+        for state, count in list(self.extraports.items()):
-+            elem = document.createElement("extraports")
-+            elem.setAttribute("state", state)
-+            elem.setAttribute("count", str(count))
-             frag.appendChild(elem)
-         return frag
-     def os_to_dom_fragment(self, document, os):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"osmatch")
--        elem.setAttribute(u"name", os)
-+        elem = document.createElement("osmatch")
-+        elem.setAttribute("name", os)
-         frag.appendChild(elem)
-         return frag
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"host")
-+        elem = document.createElement("host")
-         if self.state is not None:
-             elem.appendChild(self.state_to_dom_fragment(document))
-@@ -207,13 +207,13 @@ class Host(object):
-             elem.appendChild(addr.to_dom_fragment(document))
-         if len(self.hostnames) > 0:
--            hostnames_elem = document.createElement(u"hostnames")
-+            hostnames_elem = document.createElement("hostnames")
-             for hostname in self.hostnames:
-                 hostnames_elem.appendChild(
-                         self.hostname_to_dom_fragment(document, hostname))
-             elem.appendChild(hostnames_elem)
--        ports_elem = document.createElement(u"ports")
-+        ports_elem = document.createElement("ports")
-         ports_elem.appendChild(self.extraports_to_dom_fragment(document))
-         for port in sorted(self.ports.values()):
-             if not self.is_extraports(port.state):
-@@ -222,13 +222,13 @@ class Host(object):
-             elem.appendChild(ports_elem)
-         if len(self.os) > 0:
--            os_elem = document.createElement(u"os")
-+            os_elem = document.createElement("os")
-             for os in self.os:
-                 os_elem.appendChild(self.os_to_dom_fragment(document, os))
-             elem.appendChild(os_elem)
-         if len(self.script_results) > 0:
--            hostscript_elem = document.createElement(u"hostscript")
-+            hostscript_elem = document.createElement("hostscript")
-             for sr in self.script_results:
-                 hostscript_elem.appendChild(sr.to_dom_fragment(document))
-             elem.appendChild(hostscript_elem)
-@@ -242,7 +242,7 @@ class Address(object):
-         self.s = s
-     def __eq__(self, other):
--        return self.__cmp__(other) == 0
-+        return self.sort_key() == other.sort_key()
-     def __ne__(self, other):
-         return not self.__eq__(other)
-@@ -250,8 +250,8 @@ class Address(object):
-     def __hash__(self):
-         return hash(self.sort_key())
--    def __cmp__(self, other):
--        return cmp(self.sort_key(), other.sort_key())
-+    def __lt__(self, other):
-+        return self.sort_key() < other.sort_key()
-     def __str__(self):
-         return str(self.s)
-@@ -260,21 +260,21 @@ class Address(object):
-         return self.s
-     def new(type, s):
--        if type == u"ipv4":
-+        if type == "ipv4":
-             return IPv4Address(s)
--        elif type == u"ipv6":
-+        elif type == "ipv6":
-             return IPv6Address(s)
--        elif type == u"mac":
-+        elif type == "mac":
-             return MACAddress(s)
-         else:
--            raise ValueError(u"Unknown address type %s." % type)
-+            raise ValueError("Unknown address type %s." % type)
-     new = staticmethod(new)
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"address")
--        elem.setAttribute(u"addr", self.s)
--        elem.setAttribute(u"addrtype", self.type)
-+        elem = document.createElement("address")
-+        elem.setAttribute("addr", self.s)
-+        elem.setAttribute("addrtype", self.type)
-         frag.appendChild(elem)
-         return frag
-@@ -283,21 +283,21 @@ class Address(object):
- class IPv4Address(Address):
--    type = property(lambda self: u"ipv4")
-+    type = property(lambda self: "ipv4")
-     def sort_key(self):
-         return (0, self.s)
- class IPv6Address(Address):
--    type = property(lambda self: u"ipv6")
-+    type = property(lambda self: "ipv6")
-     def sort_key(self):
-         return (1, self.s)
- class MACAddress(Address):
--    type = property(lambda self: u"mac")
-+    type = property(lambda self: "mac")
-     def sort_key(self):
-         return (2, self.s)
-@@ -316,31 +316,28 @@ class Port(object):
-     def state_string(self):
-         if self.state is None:
--            return u"unknown"
-+            return "unknown"
-         else:
--            return unicode(self.state)
-+            return str(self.state)
-     def spec_string(self):
--        return u"%d/%s" % self.spec
-+        return "%d/%s" % self.spec
-     def __hash__(self):
-         return hash(self.spec)
--    def __cmp__(self, other):
--        d = cmp(self.spec, other.spec)
--        if d != 0:
--            return d
--        return cmp((self.spec, self.service, self.script_results),
--            (other.spec, other.service, other.script_results))
-+    def __lt__(self, other):
-+        return (self.spec, self.service, self.script_results) < (
-+            other.spec, other.service, other.script_results)
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"port")
--        elem.setAttribute(u"portid", unicode(self.spec[0]))
--        elem.setAttribute(u"protocol", self.spec[1])
-+        elem = document.createElement("port")
-+        elem.setAttribute("portid", str(self.spec[0]))
-+        elem.setAttribute("protocol", self.spec[1])
-         if self.state is not None:
--            state_elem = document.createElement(u"state")
--            state_elem.setAttribute(u"state", self.state)
-+            state_elem = document.createElement("state")
-+            state_elem.setAttribute("state", self.state)
-             elem.appendChild(state_elem)
-         elem.appendChild(self.service.to_dom_fragment(document))
-         for sr in self.script_results:
-@@ -384,7 +381,7 @@ class Service(object):
-         if len(parts) == 0:
-             return None
-         else:
--            return u"/".join(parts)
-+            return "/".join(parts)
-     def version_string(self):
-         """Get a string like in the VERSION column of Nmap output."""
-@@ -394,17 +391,17 @@ class Service(object):
-         if self.version is not None:
-             parts.append(self.version)
-         if self.extrainfo is not None:
--            parts.append(u"(%s)" % self.extrainfo)
-+            parts.append("(%s)" % self.extrainfo)
-         if len(parts) == 0:
-             return None
-         else:
--            return u" ".join(parts)
-+            return " ".join(parts)
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"service")
--        for attr in (u"name", u"product", u"version", u"extrainfo", u"tunnel"):
-+        elem = document.createElement("service")
-+        for attr in ("name", "product", "version", "extrainfo", "tunnel"):
-             v = getattr(self, attr)
-             if v is None:
-                 continue
-@@ -434,53 +431,53 @@ class ScriptResult(object):
-         result = []
-         lines = self.output.splitlines()
-         if len(lines) > 0:
--            lines[0] = self.id + u": " + lines[0]
-+            lines[0] = self.id + ": " + lines[0]
-         for line in lines[:-1]:
--            result.append(u"|  " + line)
-+            result.append("|  " + line)
-         if len(lines) > 0:
--            result.append(u"|_ " + lines[-1])
-+            result.append("|_ " + lines[-1])
-         return result
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        elem = document.createElement(u"script")
--        elem.setAttribute(u"id", self.id)
--        elem.setAttribute(u"output", self.output)
-+        elem = document.createElement("script")
-+        elem.setAttribute("id", self.id)
-+        elem.setAttribute("output", self.output)
-         frag.appendChild(elem)
-         return frag
- def format_banner(scan):
-     """Format a startup banner more or less like Nmap does."""
--    scanner = u"Nmap"
--    if scan.scanner is not None and scan.scanner != u"nmap":
-+    scanner = "Nmap"
-+    if scan.scanner is not None and scan.scanner != "nmap":
-         scanner = scan.scanner
-     parts = [scanner]
-     if scan.version is not None:
-         parts.append(scan.version)
--    parts.append(u"scan")
-+    parts.append("scan")
-     if scan.start_date is not None:
--        parts.append(u"initiated %s" % scan.start_date.strftime(
-+        parts.append("initiated %s" % scan.start_date.strftime(
-             "%a %b %d %H:%M:%S %Y"))
-     if scan.args is not None:
--        parts.append(u"as: %s" % scan.args)
--    return u" ".join(parts)
-+        parts.append("as: %s" % scan.args)
-+    return " ".join(parts)
- def print_script_result_diffs_text(title, script_results_a, script_results_b,
-         script_result_diffs, f=sys.stdout):
--    table = Table(u"*")
-+    table = Table("*")
-     for sr_diff in script_result_diffs:
-         sr_diff.append_to_port_table(table)
-     if len(table) > 0:
--        print >> f
-+        print(file=f)
-         if len(script_results_b) == 0:
--            print >> f, u"-%s:" % title
-+            print("-%s:" % title, file=f)
-         elif len(script_results_a) == 0:
--            print >> f, u"+%s:" % title
-+            print("+%s:" % title, file=f)
-         else:
--            print >> f, u" %s:" % title
--        print >> f, table
-+            print(" %s:" % title, file=f)
-+        print(table, file=f)
- def script_result_diffs_to_dom_fragment(elem, script_results_a,
-@@ -488,13 +485,13 @@ def script_result_diffs_to_dom_fragment(
-     if len(script_results_a) == 0 and len(script_results_b) == 0:
-         return document.createDocumentFragment()
-     elif len(script_results_b) == 0:
--        a_elem = document.createElement(u"a")
-+        a_elem = document.createElement("a")
-         for sr in script_results_a:
-             elem.appendChild(sr.to_dom_fragment(document))
-         a_elem.appendChild(elem)
-         return a_elem
-     elif len(script_results_a) == 0:
--        b_elem = document.createElement(u"b")
-+        b_elem = document.createElement("b")
-         for sr in script_results_b:
-             elem.appendChild(sr.to_dom_fragment(document))
-         b_elem.appendChild(elem)
-@@ -579,10 +576,10 @@ class ScanDiffText(ScanDiff):
-         banner_a = format_banner(self.scan_a)
-         banner_b = format_banner(self.scan_b)
-         if banner_a != banner_b:
--            print >> self.f, u"-%s" % banner_a
--            print >> self.f, u"+%s" % banner_b
-+            print("-%s" % banner_a, file=self.f)
-+            print("+%s" % banner_b, file=self.f)
-         elif verbose:
--            print >> self.f, u" %s" % banner_a
-+            print(" %s" % banner_a, file=self.f)
-     def output_pre_scripts(self, pre_script_result_diffs):
-         print_script_result_diffs_text("Pre-scan script results",
-@@ -595,7 +592,7 @@ class ScanDiffText(ScanDiff):
-             post_script_result_diffs, self.f)
-     def output_host_diff(self, h_diff):
--        print >> self.f
-+        print(file=self.f)
-         h_diff.print_text(self.f)
-     def output_ending(self):
-@@ -620,8 +617,8 @@ class ScanDiffXML(ScanDiff):
-     def output_beginning(self):
-         self.writer.startDocument()
--        self.writer.startElement(u"nmapdiff", {u"version": NDIFF_XML_VERSION})
--        self.writer.startElement(u"scandiff", {})
-+        self.writer.startElement("nmapdiff", {"version": NDIFF_XML_VERSION})
-+        self.writer.startElement("scandiff", {})
-         if self.nmaprun_differs():
-             self.writer.frag_a(
-@@ -634,7 +631,7 @@ class ScanDiffXML(ScanDiff):
-     def output_pre_scripts(self, pre_script_result_diffs):
-         if len(pre_script_result_diffs) > 0 or verbose:
--            prescript_elem = self.document.createElement(u"prescript")
-+            prescript_elem = self.document.createElement("prescript")
-             frag = script_result_diffs_to_dom_fragment(
-                 prescript_elem, self.scan_a.pre_script_results,
-                 self.scan_b.pre_script_results, pre_script_result_diffs,
-@@ -644,7 +641,7 @@ class ScanDiffXML(ScanDiff):
-     def output_post_scripts(self, post_script_result_diffs):
-         if len(post_script_result_diffs) > 0 or verbose:
--            postscript_elem = self.document.createElement(u"postscript")
-+            postscript_elem = self.document.createElement("postscript")
-             frag = script_result_diffs_to_dom_fragment(
-                 postscript_elem, self.scan_a.post_script_results,
-                 self.scan_b.post_script_results, post_script_result_diffs,
-@@ -658,8 +655,8 @@ class ScanDiffXML(ScanDiff):
-         frag.unlink()
-     def output_ending(self):
--        self.writer.endElement(u"scandiff")
--        self.writer.endElement(u"nmapdiff")
-+        self.writer.endElement("scandiff")
-+        self.writer.endElement("nmapdiff")
-         self.writer.endDocument()
-@@ -717,9 +714,9 @@ class HostDiff(object):
-         self.cost += os_cost
-         extraports_a = tuple((count, state)
--                for (state, count) in self.host_a.extraports.items())
-+                for (state, count) in list(self.host_a.extraports.items()))
-         extraports_b = tuple((count, state)
--                for (state, count) in self.host_b.extraports.items())
-+                for (state, count) in list(self.host_b.extraports.items()))
-         if extraports_a != extraports_b:
-             self.extraports_changed = True
-             self.cost += 1
-@@ -745,69 +742,69 @@ class HostDiff(object):
-         # Names and addresses.
-         if self.id_changed:
-             if host_a.state is not None:
--                print >> f, u"-%s:" % host_a.format_name()
-+                print("-%s:" % host_a.format_name(), file=f)
-             if self.host_b.state is not None:
--                print >> f, u"+%s:" % host_b.format_name()
-+                print("+%s:" % host_b.format_name(), file=f)
-         else:
--            print >> f, u" %s:" % host_a.format_name()
-+            print(" %s:" % host_a.format_name(), file=f)
-         # State.
-         if self.state_changed:
-             if host_a.state is not None:
--                print >> f, u"-Host is %s." % host_a.state
-+                print("-Host is %s." % host_a.state, file=f)
-             if host_b.state is not None:
--                print >> f, u"+Host is %s." % host_b.state
-+                print("+Host is %s." % host_b.state, file=f)
-         elif verbose:
--            print >> f, u" Host is %s." % host_b.state
-+            print(" Host is %s." % host_b.state, file=f)
-         # Extraports.
-         if self.extraports_changed:
-             if len(host_a.extraports) > 0:
--                print >> f, u"-Not shown: %s" % host_a.extraports_string()
-+                print("-Not shown: %s" % host_a.extraports_string(), file=f)
-             if len(host_b.extraports) > 0:
--                print >> f, u"+Not shown: %s" % host_b.extraports_string()
-+                print("+Not shown: %s" % host_b.extraports_string(), file=f)
-         elif verbose:
-             if len(host_a.extraports) > 0:
--                print >> f, u" Not shown: %s" % host_a.extraports_string()
-+                print(" Not shown: %s" % host_a.extraports_string(), file=f)
-         # Port table.
--        port_table = Table(u"** * * *")
-+        port_table = Table("** * * *")
-         if host_a.state is None:
--            mark = u"+"
-+            mark = "+"
-         elif host_b.state is None:
--            mark = u"-"
-+            mark = "-"
-         else:
--            mark = u" "
--        port_table.append((mark, u"PORT", u"STATE", u"SERVICE", u"VERSION"))
-+            mark = " "
-+        port_table.append((mark, "PORT", "STATE", "SERVICE", "VERSION"))
-         for port in self.ports:
-             port_diff = self.port_diffs[port]
-             port_diff.append_to_port_table(port_table, host_a, host_b)
-         if len(port_table) > 1:
--            print >> f, port_table
-+            print(port_table, file=f)
-         # OS changes.
-         if self.os_changed or verbose:
-             if len(host_a.os) > 0:
-                 if len(host_b.os) > 0:
--                    print >> f, u" OS details:"
-+                    print(" OS details:", file=f)
-                 else:
--                    print >> f, u"-OS details:"
-+                    print("-OS details:", file=f)
-             elif len(host_b.os) > 0:
--                print >> f, u"+OS details:"
-+                print("+OS details:", file=f)
-             # os_diffs is a list of 5-tuples returned by
-             # difflib.SequenceMatcher.
-             for op, i1, i2, j1, j2 in self.os_diffs:
-                 if op == "replace" or op == "delete":
-                     for i in range(i1, i2):
--                        print >> f, "-  %s" % host_a.os[i]
-+                        print("-  %s" % host_a.os[i], file=f)
-                 if op == "replace" or op == "insert":
-                     for i in range(j1, j2):
--                        print >> f, "+  %s" % host_b.os[i]
-+                        print("+  %s" % host_b.os[i], file=f)
-                 if op == "equal":
-                     for i in range(i1, i2):
--                        print >> f, "   %s" % host_a.os[i]
-+                        print("   %s" % host_a.os[i], file=f)
-         print_script_result_diffs_text("Host script results",
-             host_a.script_results, host_b.script_results,
-@@ -818,32 +815,32 @@ class HostDiff(object):
-         host_b = self.host_b
-         frag = document.createDocumentFragment()
--        hostdiff_elem = document.createElement(u"hostdiff")
-+        hostdiff_elem = document.createElement("hostdiff")
-         frag.appendChild(hostdiff_elem)
-         if host_a.state is None or host_b.state is None:
-             # The host is missing in one scan. Output the whole thing.
-             if host_a.state is not None:
--                a_elem = document.createElement(u"a")
-+                a_elem = document.createElement("a")
-                 a_elem.appendChild(host_a.to_dom_fragment(document))
-                 hostdiff_elem.appendChild(a_elem)
-             elif host_b.state is not None:
--                b_elem = document.createElement(u"b")
-+                b_elem = document.createElement("b")
-                 b_elem.appendChild(host_b.to_dom_fragment(document))
-                 hostdiff_elem.appendChild(b_elem)
-             return frag
--        host_elem = document.createElement(u"host")
-+        host_elem = document.createElement("host")
-         # State.
-         if host_a.state == host_b.state:
-             if verbose:
-                 host_elem.appendChild(host_a.state_to_dom_fragment(document))
-         else:
--            a_elem = document.createElement(u"a")
-+            a_elem = document.createElement("a")
-             a_elem.appendChild(host_a.state_to_dom_fragment(document))
-             host_elem.appendChild(a_elem)
--            b_elem = document.createElement(u"b")
-+            b_elem = document.createElement("b")
-             b_elem.appendChild(host_b.state_to_dom_fragment(document))
-             host_elem.appendChild(b_elem)
-@@ -852,31 +849,31 @@ class HostDiff(object):
-         addrset_b = set(host_b.addresses)
-         for addr in sorted(addrset_a.intersection(addrset_b)):
-             host_elem.appendChild(addr.to_dom_fragment(document))
--        a_elem = document.createElement(u"a")
-+        a_elem = document.createElement("a")
-         for addr in sorted(addrset_a - addrset_b):
-             a_elem.appendChild(addr.to_dom_fragment(document))
-         if a_elem.hasChildNodes():
-             host_elem.appendChild(a_elem)
--        b_elem = document.createElement(u"b")
-+        b_elem = document.createElement("b")
-         for addr in sorted(addrset_b - addrset_a):
-             b_elem.appendChild(addr.to_dom_fragment(document))
-         if b_elem.hasChildNodes():
-             host_elem.appendChild(b_elem)
-         # Host names.
--        hostnames_elem = document.createElement(u"hostnames")
-+        hostnames_elem = document.createElement("hostnames")
-         hostnameset_a = set(host_a.hostnames)
-         hostnameset_b = set(host_b.hostnames)
-         for hostname in sorted(hostnameset_a.intersection(hostnameset_b)):
-             hostnames_elem.appendChild(
-                     host_a.hostname_to_dom_fragment(document, hostname))
--        a_elem = document.createElement(u"a")
-+        a_elem = document.createElement("a")
-         for hostname in sorted(hostnameset_a - hostnameset_b):
-             a_elem.appendChild(
-                     host_a.hostname_to_dom_fragment(document, hostname))
-         if a_elem.hasChildNodes():
-             hostnames_elem.appendChild(a_elem)
--        b_elem = document.createElement(u"b")
-+        b_elem = document.createElement("b")
-         for hostname in sorted(hostnameset_b - hostnameset_a):
-             b_elem.appendChild(
-                     host_b.hostname_to_dom_fragment(document, hostname))
-@@ -885,15 +882,15 @@ class HostDiff(object):
-         if hostnames_elem.hasChildNodes():
-             host_elem.appendChild(hostnames_elem)
--        ports_elem = document.createElement(u"ports")
-+        ports_elem = document.createElement("ports")
-         # Extraports.
-         if host_a.extraports == host_b.extraports:
-             ports_elem.appendChild(host_a.extraports_to_dom_fragment(document))
-         else:
--            a_elem = document.createElement(u"a")
-+            a_elem = document.createElement("a")
-             a_elem.appendChild(host_a.extraports_to_dom_fragment(document))
-             ports_elem.appendChild(a_elem)
--            b_elem = document.createElement(u"b")
-+            b_elem = document.createElement("b")
-             b_elem.appendChild(host_b.extraports_to_dom_fragment(document))
-             ports_elem.appendChild(b_elem)
-         # Port list.
-@@ -909,18 +906,18 @@ class HostDiff(object):
-         # OS changes.
-         if self.os_changed or verbose:
--            os_elem = document.createElement(u"os")
-+            os_elem = document.createElement("os")
-             # os_diffs is a list of 5-tuples returned by
-             # difflib.SequenceMatcher.
-             for op, i1, i2, j1, j2 in self.os_diffs:
-                 if op == "replace" or op == "delete":
--                    a_elem = document.createElement(u"a")
-+                    a_elem = document.createElement("a")
-                     for i in range(i1, i2):
-                         a_elem.appendChild(host_a.os_to_dom_fragment(
-                             document, host_a.os[i]))
-                     os_elem.appendChild(a_elem)
-                 if op == "replace" or op == "insert":
--                    b_elem = document.createElement(u"b")
-+                    b_elem = document.createElement("b")
-                     for i in range(j1, j2):
-                         b_elem.appendChild(host_b.os_to_dom_fragment(
-                             document, host_b.os[i]))
-@@ -934,7 +931,7 @@ class HostDiff(object):
-         # Host script changes.
-         if len(self.script_result_diffs) > 0 or verbose:
--            hostscript_elem = document.createElement(u"hostscript")
-+            hostscript_elem = document.createElement("hostscript")
-             host_elem.appendChild(script_result_diffs_to_dom_fragment(
-                 hostscript_elem, host_a.script_results,
-                 host_b.script_results, self.script_result_diffs,
-@@ -987,38 +984,38 @@ class PortDiff(object):
-             self.port_b.service.version_string()]
-         if a_columns == b_columns:
-             if verbose or self.script_result_diffs > 0:
--                table.append([u" "] + a_columns)
-+                table.append([" "] + a_columns)
-         else:
-             if not host_a.is_extraports(self.port_a.state):
--                table.append([u"-"] + a_columns)
-+                table.append(["-"] + a_columns)
-             if not host_b.is_extraports(self.port_b.state):
--                table.append([u"+"] + b_columns)
-+                table.append(["+"] + b_columns)
-         for sr_diff in self.script_result_diffs:
-             sr_diff.append_to_port_table(table)
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
--        portdiff_elem = document.createElement(u"portdiff")
-+        portdiff_elem = document.createElement("portdiff")
-         frag.appendChild(portdiff_elem)
-         if (self.port_a.spec == self.port_b.spec and
-                 self.port_a.state == self.port_b.state):
--            port_elem = document.createElement(u"port")
--            port_elem.setAttribute(u"portid", unicode(self.port_a.spec[0]))
--            port_elem.setAttribute(u"protocol", self.port_a.spec[1])
-+            port_elem = document.createElement("port")
-+            port_elem.setAttribute("portid", str(self.port_a.spec[0]))
-+            port_elem.setAttribute("protocol", self.port_a.spec[1])
-             if self.port_a.state is not None:
--                state_elem = document.createElement(u"state")
--                state_elem.setAttribute(u"state", self.port_a.state)
-+                state_elem = document.createElement("state")
-+                state_elem.setAttribute("state", self.port_a.state)
-                 port_elem.appendChild(state_elem)
-             if self.port_a.service == self.port_b.service:
-                 port_elem.appendChild(
-                         self.port_a.service.to_dom_fragment(document))
-             else:
--                a_elem = document.createElement(u"a")
-+                a_elem = document.createElement("a")
-                 a_elem.appendChild(
-                         self.port_a.service.to_dom_fragment(document))
-                 port_elem.appendChild(a_elem)
--                b_elem = document.createElement(u"b")
-+                b_elem = document.createElement("b")
-                 b_elem.appendChild(
-                         self.port_b.service.to_dom_fragment(document))
-                 port_elem.appendChild(b_elem)
-@@ -1026,10 +1023,10 @@ class PortDiff(object):
-                 port_elem.appendChild(sr_diff.to_dom_fragment(document))
-             portdiff_elem.appendChild(port_elem)
-         else:
--            a_elem = document.createElement(u"a")
-+            a_elem = document.createElement("a")
-             a_elem.appendChild(self.port_a.to_dom_fragment(document))
-             portdiff_elem.appendChild(a_elem)
--            b_elem = document.createElement(u"b")
-+            b_elem = document.createElement("b")
-             b_elem.appendChild(self.port_b.to_dom_fragment(document))
-             portdiff_elem.appendChild(b_elem)
-@@ -1084,13 +1081,13 @@ class ScriptResultDiff(object):
-             for op, i1, i2, j1, j2 in diffs.get_opcodes():
-                 if op == "replace" or op == "delete":
-                     for k in range(i1, i2):
--                        table.append_raw(u"-" + a_lines[k])
-+                        table.append_raw("-" + a_lines[k])
-                 if op == "replace" or op == "insert":
-                     for k in range(j1, j2):
--                        table.append_raw(u"+" + b_lines[k])
-+                        table.append_raw("+" + b_lines[k])
-                 if op == "equal":
-                     for k in range(i1, i2):
--                        table.append_raw(u" " + a_lines[k])
-+                        table.append_raw(" " + a_lines[k])
-     def to_dom_fragment(self, document):
-         frag = document.createDocumentFragment()
-@@ -1100,11 +1097,11 @@ class ScriptResultDiff(object):
-             frag.appendChild(self.sr_a.to_dom_fragment(document))
-         else:
-             if self.sr_a is not None:
--                a_elem = document.createElement(u"a")
-+                a_elem = document.createElement("a")
-                 a_elem.appendChild(self.sr_a.to_dom_fragment(document))
-                 frag.appendChild(a_elem)
-             if self.sr_b is not None:
--                b_elem = document.createElement(u"b")
-+                b_elem = document.createElement("b")
-                 b_elem.appendChild(self.sr_b.to_dom_fragment(document))
-                 frag.appendChild(b_elem)
-         return frag
-@@ -1118,7 +1115,7 @@ class Table(object):
-         copied to the output."""
-         self.widths = []
-         self.rows = []
--        self.prefix = u""
-+        self.prefix = ""
-         self.padding = []
-         j = 0
-         while j < len(template) and template[j] != "*":
-@@ -1143,7 +1140,7 @@ class Table(object):
-         for i in range(len(row)):
-             if row[i] is None:
--                s = u""
-+                s = ""
-             else:
-                 s = str(row[i])
-             if i == len(self.widths):
-@@ -1165,7 +1162,7 @@ class Table(object):
-         for row in self.rows:
-             parts = [self.prefix]
-             i = 0
--            if isinstance(row, basestring):
-+            if isinstance(row, str):
-                 # A raw string.
-                 lines.append(row)
-             else:
-@@ -1174,13 +1171,13 @@ class Table(object):
-                     if i < len(self.padding):
-                         parts.append(self.padding[i])
-                     i += 1
--                lines.append(u"".join(parts).rstrip())
--        return u"\n".join(lines)
-+                lines.append("".join(parts).rstrip())
-+        return "\n".join(lines)
- def warn(str):
-     """Print a warning to stderr."""
--    print >> sys.stderr, str
-+    print(str, file=sys.stderr)
- class NmapContentHandler(xml.sax.handler.ContentHandler):
-@@ -1200,24 +1197,24 @@ class NmapContentHandler(xml.sax.handler
-         self.skip_over = False
-         self._start_elem_handlers = {
--            u"nmaprun": self._start_nmaprun,
--            u"host": self._start_host,
--            u"hosthint": self._start_hosthint,
--            u"status": self._start_status,
--            u"address": self._start_address,
--            u"hostname": self._start_hostname,
--            u"extraports": self._start_extraports,
--            u"port": self._start_port,
--            u"state": self._start_state,
--            u"service": self._start_service,
--            u"script": self._start_script,
--            u"osmatch": self._start_osmatch,
--            u"finished": self._start_finished,
-+            "nmaprun": self._start_nmaprun,
-+            "host": self._start_host,
-+            "hosthint": self._start_hosthint,
-+            "status": self._start_status,
-+            "address": self._start_address,
-+            "hostname": self._start_hostname,
-+            "extraports": self._start_extraports,
-+            "port": self._start_port,
-+            "state": self._start_state,
-+            "service": self._start_service,
-+            "script": self._start_script,
-+            "osmatch": self._start_osmatch,
-+            "finished": self._start_finished,
-         }
-         self._end_elem_handlers = {
--            u'host': self._end_host,
--            u"hosthint": self._end_hosthint,
--            u'port': self._end_port,
-+            'host': self._end_host,
-+            "hosthint": self._end_hosthint,
-+            'port': self._end_port,
-         }
-     def parent_element(self):
-@@ -1247,72 +1244,72 @@ class NmapContentHandler(xml.sax.handler
-     def _start_nmaprun(self, name, attrs):
-         assert self.parent_element() is None
-         if "start" in attrs:
--            start_timestamp = int(attrs.get(u"start"))
-+            start_timestamp = int(attrs.get("start"))
-             self.scan.start_date = datetime.datetime.fromtimestamp(
-                     start_timestamp)
--        self.scan.scanner = attrs.get(u"scanner")
--        self.scan.args = attrs.get(u"args")
--        self.scan.version = attrs.get(u"version")
-+        self.scan.scanner = attrs.get("scanner")
-+        self.scan.args = attrs.get("args")
-+        self.scan.version = attrs.get("version")
-     def _start_host(self, name, attrs):
--        assert self.parent_element() == u"nmaprun"
-+        assert self.parent_element() == "nmaprun"
-         self.current_host = Host()
-         self.scan.hosts.append(self.current_host)
-     def _start_hosthint(self, name, attrs):
--        assert self.parent_element() == u"nmaprun"
-+        assert self.parent_element() == "nmaprun"
-         self.skip_over = True
-     def _start_status(self, name, attrs):
--        assert self.parent_element() == u"host"
-+        assert self.parent_element() == "host"
-         assert self.current_host is not None
--        state = attrs.get(u"state")
-+        state = attrs.get("state")
-         if state is None:
--            warn(u'%s element of host %s is missing the "state" attribute; '
--                    'assuming \unknown\.' % (
-+            warn('%s element of host %s is missing the "state" attribute; '
-+                    r'assuming \unknown\.' % (
-                         name, self.current_host.format_name()))
-             return
-         self.current_host.state = state
-     def _start_address(self, name, attrs):
--        assert self.parent_element() == u"host"
-+        assert self.parent_element() == "host"
-         assert self.current_host is not None
--        addr = attrs.get(u"addr")
-+        addr = attrs.get("addr")
-         if addr is None:
--            warn(u'%s element of host %s is missing the "addr" '
-+            warn('%s element of host %s is missing the "addr" '
-                     'attribute; skipping.' % (
-                         name, self.current_host.format_name()))
-             return
--        addrtype = attrs.get(u"addrtype", u"ipv4")
-+        addrtype = attrs.get("addrtype", "ipv4")
-         self.current_host.add_address(Address.new(addrtype, addr))
-     def _start_hostname(self, name, attrs):
--        assert self.parent_element() == u"hostnames"
-+        assert self.parent_element() == "hostnames"
-         assert self.current_host is not None
--        hostname = attrs.get(u"name")
-+        hostname = attrs.get("name")
-         if hostname is None:
--            warn(u'%s element of host %s is missing the "name" '
-+            warn('%s element of host %s is missing the "name" '
-                     'attribute; skipping.' % (
-                         name, self.current_host.format_name()))
-             return
-         self.current_host.add_hostname(hostname)
-     def _start_extraports(self, name, attrs):
--        assert self.parent_element() == u"ports"
-+        assert self.parent_element() == "ports"
-         assert self.current_host is not None
--        state = attrs.get(u"state")
-+        state = attrs.get("state")
-         if state is None:
--            warn(u'%s element of host %s is missing the "state" '
-+            warn('%s element of host %s is missing the "state" '
-                     'attribute; assuming "unknown".' % (
-                         name, self.current_host.format_name()))
-             state = None
-         if state in self.current_host.extraports:
--            warn(u'Duplicate extraports state "%s" in host %s.' % (
-+            warn('Duplicate extraports state "%s" in host %s.' % (
-                 state, self.current_host.format_name()))
--        count = attrs.get(u"count")
-+        count = attrs.get("count")
-         if count is None:
--            warn(u'%s element of host %s is missing the "count" '
-+            warn('%s element of host %s is missing the "count" '
-                     'attribute; assuming 0.' % (
-                         name, self.current_host.format_name()))
-             count = 0
-@@ -1320,99 +1317,99 @@ class NmapContentHandler(xml.sax.handler
-             try:
-                 count = int(count)
-             except ValueError:
--                warn(u"Can't convert extraports count \"%s\" "
-+                warn("Can't convert extraports count \"%s\" "
-                         "to an integer in host %s; assuming 0." % (
--                            attrs[u"count"], self.current_host.format_name()))
-+                            attrs["count"], self.current_host.format_name()))
-                 count = 0
-         self.current_host.extraports[state] = count
-     def _start_port(self, name, attrs):
--        assert self.parent_element() == u"ports"
-+        assert self.parent_element() == "ports"
-         assert self.current_host is not None
--        portid_str = attrs.get(u"portid")
-+        portid_str = attrs.get("portid")
-         if portid_str is None:
--            warn(u'%s element of host %s missing the "portid" '
-+            warn('%s element of host %s missing the "portid" '
-                     'attribute; skipping.' % (
-                         name, self.current_host.format_name()))
-             return
-         try:
-             portid = int(portid_str)
-         except ValueError:
--            warn(u"Can't convert portid \"%s\" to an integer "
-+            warn("Can't convert portid \"%s\" to an integer "
-                     "in host %s; skipping port." % (
-                         portid_str, self.current_host.format_name()))
-             return
--        protocol = attrs.get(u"protocol")
-+        protocol = attrs.get("protocol")
-         if protocol is None:
--            warn(u'%s element of host %s missing the "protocol" '
-+            warn('%s element of host %s missing the "protocol" '
-                     'attribute; skipping.' % (
-                         name, self.current_host.format_name()))
-             return
-         self.current_port = Port((portid, protocol))
-     def _start_state(self, name, attrs):
--        assert self.parent_element() == u"port"
-+        assert self.parent_element() == "port"
-         assert self.current_host is not None
-         if self.current_port is None:
-             return
-         if "state" not in attrs:
--            warn(u'%s element of port %s is missing the "state" '
-+            warn('%s element of port %s is missing the "state" '
-                     'attribute; assuming "unknown".' % (
-                         name, self.current_port.spec_string()))
-             return
--        self.current_port.state = attrs[u"state"]
-+        self.current_port.state = attrs["state"]
-         self.current_host.add_port(self.current_port)
-     def _start_service(self, name, attrs):
--        assert self.parent_element() == u"port"
-+        assert self.parent_element() == "port"
-         assert self.current_host is not None
-         if self.current_port is None:
-             return
--        self.current_port.service.name = attrs.get(u"name")
--        self.current_port.service.product = attrs.get(u"product")
--        self.current_port.service.version = attrs.get(u"version")
--        self.current_port.service.extrainfo = attrs.get(u"extrainfo")
--        self.current_port.service.tunnel = attrs.get(u"tunnel")
-+        self.current_port.service.name = attrs.get("name")
-+        self.current_port.service.product = attrs.get("product")
-+        self.current_port.service.version = attrs.get("version")
-+        self.current_port.service.extrainfo = attrs.get("extrainfo")
-+        self.current_port.service.tunnel = attrs.get("tunnel")
-     def _start_script(self, name, attrs):
-         result = ScriptResult()
--        result.id = attrs.get(u"id")
-+        result.id = attrs.get("id")
-         if result.id is None:
--            warn(u'%s element missing the "id" attribute; skipping.' % name)
-+            warn('%s element missing the "id" attribute; skipping.' % name)
-             return
--        result.output = attrs.get(u"output")
-+        result.output = attrs.get("output")
-         if result.output is None:
--            warn(u'%s element missing the "output" attribute; skipping.'
-+            warn('%s element missing the "output" attribute; skipping.'
-                     % name)
-             return
--        if self.parent_element() == u"prescript":
-+        if self.parent_element() == "prescript":
-             self.scan.pre_script_results.append(result)
--        elif self.parent_element() == u"postscript":
-+        elif self.parent_element() == "postscript":
-             self.scan.post_script_results.append(result)
--        elif self.parent_element() == u"hostscript":
-+        elif self.parent_element() == "hostscript":
-             self.current_host.script_results.append(result)
--        elif self.parent_element() == u"port":
-+        elif self.parent_element() == "port":
-             self.current_port.script_results.append(result)
-         else:
--            warn(u"%s element not inside prescript, postscript, hostscript, "
-+            warn("%s element not inside prescript, postscript, hostscript, "
-                     "or port element; ignoring." % name)
-             return
-     def _start_osmatch(self, name, attrs):
--        assert self.parent_element() == u"os"
-+        assert self.parent_element() == "os"
-         assert self.current_host is not None
-         if "name" not in attrs:
--            warn(u'%s element of host %s is missing the "name" '
-+            warn('%s element of host %s is missing the "name" '
-                     'attribute; skipping.' % (
-                         name, self.current_host.format_name()))
-             return
--        self.current_host.os.append(attrs[u"name"])
-+        self.current_host.os.append(attrs["name"])
-     def _start_finished(self, name, attrs):
--        assert self.parent_element() == u"runstats"
-+        assert self.parent_element() == "runstats"
-         if "time" in attrs:
--            end_timestamp = int(attrs.get(u"time"))
-+            end_timestamp = int(attrs.get("time"))
-             self.scan.end_date = datetime.datetime.fromtimestamp(end_timestamp)
-     def _end_host(self, name):
-@@ -1434,23 +1431,23 @@ class XMLWriter (xml.sax.saxutils.XMLGen
-     def frag(self, frag):
-         for node in frag.childNodes:
--            node.writexml(self.f, newl=u"\n")
-+            node.writexml(self.f, newl="\n")
-     def frag_a(self, frag):
--        self.startElement(u"a", {})
-+        self.startElement("a", {})
-         for node in frag.childNodes:
--            node.writexml(self.f, newl=u"\n")
--        self.endElement(u"a")
-+            node.writexml(self.f, newl="\n")
-+        self.endElement("a")
-     def frag_b(self, frag):
--        self.startElement(u"b", {})
-+        self.startElement("b", {})
-         for node in frag.childNodes:
--            node.writexml(self.f, newl=u"\n")
--        self.endElement(u"b")
-+            node.writexml(self.f, newl="\n")
-+        self.endElement("b")
- def usage():
--    print u"""\
-+    print("""\
- Usage: %s [option] FILE1 FILE2
- Compare two Nmap XML files and display a list of their differences.
- Differences include host state changes, port state changes, and changes to
-@@ -1460,7 +1457,7 @@ service and OS detection.
-   -v, --verbose  also show hosts and ports that haven't changed.
-   --text         display output in text format (default)
-   --xml          display output in XML format\
--""" % sys.argv[0]
-+""" % sys.argv[0])
- EXIT_EQUAL = 0
- EXIT_DIFFERENT = 1
-@@ -1468,8 +1465,8 @@ EXIT_ERROR = 2
- def usage_error(msg):
--    print >> sys.stderr, u"%s: %s" % (sys.argv[0], msg)
--    print >> sys.stderr, u"Try '%s -h' for help." % sys.argv[0]
-+    print("%s: %s" % (sys.argv[0], msg), file=sys.stderr)
-+    print("Try '%s -h' for help." % sys.argv[0], file=sys.stderr)
-     sys.exit(EXIT_ERROR)
-@@ -1480,7 +1477,7 @@ def main():
-     try:
-         opts, input_filenames = getopt.gnu_getopt(
-                 sys.argv[1:], "hv", ["help", "text", "verbose", "xml"])
--    except getopt.GetoptError, e:
-+    except getopt.GetoptError as e:
-         usage_error(e.msg)
-     for o, a in opts:
-         if o == "-h" or o == "--help":
-@@ -1490,15 +1487,15 @@ def main():
-             verbose = True
-         elif o == "--text":
-             if output_format is not None and output_format != "text":
--                usage_error(u"contradictory output format options.")
-+                usage_error("contradictory output format options.")
-             output_format = "text"
-         elif o == "--xml":
-             if output_format is not None and output_format != "xml":
--                usage_error(u"contradictory output format options.")
-+                usage_error("contradictory output format options.")
-             output_format = "xml"
-     if len(input_filenames) != 2:
--        usage_error(u"need exactly two input filenames.")
-+        usage_error("need exactly two input filenames.")
-     if output_format is None:
-         output_format = "text"
-@@ -1511,8 +1508,8 @@ def main():
-         scan_a.load_from_file(filename_a)
-         scan_b = Scan()
-         scan_b.load_from_file(filename_b)
--    except IOError, e:
--        print >> sys.stderr, u"Can't open file: %s" % str(e)
-+    except IOError as e:
-+        print("Can't open file: %s" % str(e), file=sys.stderr)
-         sys.exit(EXIT_ERROR)
-     if output_format == "text":
---- a/ndiff/ndifftest.py
-+++ b/ndiff/ndifftest.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- # Unit tests for Ndiff.
-@@ -22,7 +22,7 @@ for x in dir(ndiff):
- sys.dont_write_bytecode = dont_write_bytecode
- del dont_write_bytecode
--import StringIO
-+import io
- class scan_test(unittest.TestCase):
-@@ -52,7 +52,7 @@ class scan_test(unittest.TestCase):
-         scan.load_from_file("test-scans/single.xml")
-         host = scan.hosts[0]
-         self.assertEqual(len(host.ports), 5)
--        self.assertEqual(host.extraports.items(), [("filtered", 95)])
-+        self.assertEqual(list(host.extraports.items()), [("filtered", 95)])
-     def test_extraports_multi(self):
-         """Test that the correct number of known ports is returned when there
-@@ -68,9 +68,9 @@ class scan_test(unittest.TestCase):
-         """Test that nmaprun information is recorded."""
-         scan = Scan()
-         scan.load_from_file("test-scans/empty.xml")
--        self.assertEqual(scan.scanner, u"nmap")
--        self.assertEqual(scan.version, u"4.90RC2")
--        self.assertEqual(scan.args, u"nmap -oX empty.xml -p 1-100")
-+        self.assertEqual(scan.scanner, "nmap")
-+        self.assertEqual(scan.version, "4.90RC2")
-+        self.assertEqual(scan.args, "nmap -oX empty.xml -p 1-100")
-     def test_addresses(self):
-         """Test that addresses are recorded."""
-@@ -84,7 +84,7 @@ class scan_test(unittest.TestCase):
-         scan = Scan()
-         scan.load_from_file("test-scans/simple.xml")
-         host = scan.hosts[0]
--        self.assertEqual(host.hostnames, [u"scanme.nmap.org"])
-+        self.assertEqual(host.hostnames, ["scanme.nmap.org"])
-     def test_os(self):
-         """Test that OS information is recorded."""
-@@ -99,7 +99,7 @@ class scan_test(unittest.TestCase):
-         scan.load_from_file("test-scans/complex.xml")
-         host = scan.hosts[0]
-         self.assertTrue(len(host.script_results) > 0)
--        self.assertTrue(len(host.ports[(22, u"tcp")].script_results) > 0)
-+        self.assertTrue(len(host.ports[(22, "tcp")].script_results) > 0)
- # This test is commented out because Nmap XML doesn't store any information
- # about down hosts, not even the fact that they are down. Recovering the list
-@@ -128,16 +128,16 @@ class host_test(unittest.TestCase):
-     def test_format_name(self):
-         h = Host()
--        self.assertTrue(isinstance(h.format_name(), basestring))
--        h.add_address(IPv4Address(u"127.0.0.1"))
--        self.assertTrue(u"127.0.0.1" in h.format_name())
-+        self.assertTrue(isinstance(h.format_name(), str))
-+        h.add_address(IPv4Address("127.0.0.1"))
-+        self.assertTrue("127.0.0.1" in h.format_name())
-         h.add_address(IPv6Address("::1"))
--        self.assertTrue(u"127.0.0.1" in h.format_name())
--        self.assertTrue(u"::1" in h.format_name())
--        h.add_hostname(u"localhost")
--        self.assertTrue(u"127.0.0.1" in h.format_name())
--        self.assertTrue(u"::1" in h.format_name())
--        self.assertTrue(u"localhost" in h.format_name())
-+        self.assertTrue("127.0.0.1" in h.format_name())
-+        self.assertTrue("::1" in h.format_name())
-+        h.add_hostname("localhost")
-+        self.assertTrue("127.0.0.1" in h.format_name())
-+        self.assertTrue("::1" in h.format_name())
-+        self.assertTrue("localhost" in h.format_name())
-     def test_empty_get_port(self):
-         h = Host()
-@@ -197,8 +197,8 @@ class host_test(unittest.TestCase):
-         h = s.hosts[0]
-         self.assertEqual(len(h.ports), 5)
-         self.assertEqual(len(h.extraports), 1)
--        self.assertEqual(h.extraports.keys()[0], u"filtered")
--        self.assertEqual(h.extraports.values()[0], 95)
-+        self.assertEqual(list(h.extraports.keys())[0], "filtered")
-+        self.assertEqual(list(h.extraports.values())[0], 95)
-         self.assertEqual(h.state, "up")
-@@ -241,13 +241,13 @@ class port_test(unittest.TestCase):
-     """Test the Port class."""
-     def test_spec_string(self):
-         p = Port((10, "tcp"))
--        self.assertEqual(p.spec_string(), u"10/tcp")
-+        self.assertEqual(p.spec_string(), "10/tcp")
-         p = Port((100, "ip"))
--        self.assertEqual(p.spec_string(), u"100/ip")
-+        self.assertEqual(p.spec_string(), "100/ip")
-     def test_state_string(self):
-         p = Port((10, "tcp"))
--        self.assertEqual(p.state_string(), u"unknown")
-+        self.assertEqual(p.state_string(), "unknown")
- class service_test(unittest.TestCase):
-@@ -255,47 +255,47 @@ class service_test(unittest.TestCase):
-     def test_compare(self):
-         """Test that services with the same contents compare equal."""
-         a = Service()
--        a.name = u"ftp"
--        a.product = u"FooBar FTP"
--        a.version = u"1.1.1"
--        a.tunnel = u"ssl"
-+        a.name = "ftp"
-+        a.product = "FooBar FTP"
-+        a.version = "1.1.1"
-+        a.tunnel = "ssl"
-         self.assertEqual(a, a)
-         b = Service()
--        b.name = u"ftp"
--        b.product = u"FooBar FTP"
--        b.version = u"1.1.1"
--        b.tunnel = u"ssl"
-+        b.name = "ftp"
-+        b.product = "FooBar FTP"
-+        b.version = "1.1.1"
-+        b.tunnel = "ssl"
-         self.assertEqual(a, b)
--        b.name = u"http"
-+        b.name = "http"
-         self.assertNotEqual(a, b)
-         c = Service()
-         self.assertNotEqual(a, c)
-     def test_tunnel(self):
-         serv = Service()
--        serv.name = u"http"
--        serv.tunnel = u"ssl"
--        self.assertEqual(serv.name_string(), u"ssl/http")
-+        serv.name = "http"
-+        serv.tunnel = "ssl"
-+        self.assertEqual(serv.name_string(), "ssl/http")
-     def test_version_string(self):
-         serv = Service()
--        serv.product = u"FooBar"
-+        serv.product = "FooBar"
-         self.assertTrue(len(serv.version_string()) > 0)
-         serv = Service()
--        serv.version = u"1.2.3"
-+        serv.version = "1.2.3"
-         self.assertTrue(len(serv.version_string()) > 0)
-         serv = Service()
--        serv.extrainfo = u"misconfigured"
-+        serv.extrainfo = "misconfigured"
-         self.assertTrue(len(serv.version_string()) > 0)
-         serv = Service()
--        serv.product = u"FooBar"
--        serv.version = u"1.2.3"
-+        serv.product = "FooBar"
-+        serv.version = "1.2.3"
-         # Must match Nmap output.
-         self.assertEqual(serv.version_string(),
--                u"%s %s" % (serv.product, serv.version))
--        serv.extrainfo = u"misconfigured"
-+                "%s %s" % (serv.product, serv.version))
-+        serv.extrainfo = "misconfigured"
-         self.assertEqual(serv.version_string(),
--                u"%s %s (%s)" % (serv.product, serv.version, serv.extrainfo))
-+                "%s %s (%s)" % (serv.product, serv.version, serv.extrainfo))
- class ScanDiffSub(ScanDiff):
-@@ -703,7 +703,7 @@ class scan_diff_xml_test(unittest.TestCa
-         a.load_from_file("test-scans/empty.xml")
-         b = Scan()
-         b.load_from_file("test-scans/simple.xml")
--        f = StringIO.StringIO()
-+        f = io.StringIO()
-         self.scan_diff = ScanDiffXML(a, b, f)
-         self.scan_diff.output()
-         self.xml = f.getvalue()
-@@ -712,8 +712,8 @@ class scan_diff_xml_test(unittest.TestCa
-     def test_well_formed(self):
-         try:
-             document = xml.dom.minidom.parseString(self.xml)
--        except Exception, e:
--            self.fail(u"Parsing XML diff output caused the exception: %s"
-+        except Exception as e:
-+            self.fail("Parsing XML diff output caused the exception: %s"
-                     % str(e))
-@@ -739,8 +739,8 @@ def host_apply_diff(host, diff):
-         host.os = diff.host_b.os[:]
-     if diff.extraports_changed:
--        for state in host.extraports.keys():
--            for port in host.ports.values():
-+        for state in list(host.extraports.keys()):
-+            for port in list(host.ports.values()):
-                 if port.state == state:
-                     del host.ports[port.spec]
-         host.extraports = diff.host_b.extraports.copy()
---- a/ndiff/scripts/ndiff
-+++ b/ndiff/scripts/ndiff
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- # Ndiff
- #
-@@ -66,15 +66,15 @@ if INSTALL_LIB is not None and is_secure
- try:
-     import ndiff
--except ImportError, e:
--    print >> sys.stderr, """\
-+except ImportError as e:
-+    print("""\
- Could not import the ndiff module: %s.
--I checked in these directories:""" % repr(e.message)
-+I checked in these directories:""" % repr(e), file=sys.stderr)
-     for dir in sys.path:
--        print >> sys.stderr, "    %s" % dir
--    print >> sys.stderr, """\
-+        print("    %s" % dir, file=sys.stderr)
-+    print("""\
- If you installed Ndiff in another directory, you may have to add the
--modules directory to the PYTHONPATH environment variable."""
-+modules directory to the PYTHONPATH environment variable.""", file=sys.stderr)
-     sys.exit(1)
- import ndiff
---- a/ndiff/setup.py
-+++ b/ndiff/setup.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- import errno
- import sys
-@@ -94,7 +94,7 @@ class checked_install(distutils.command.
-         self.saved_prefix = sys.prefix
-         try:
-             distutils.command.install.install.finalize_options(self)
--        except distutils.errors.DistutilsPlatformError, e:
-+        except distutils.errors.DistutilsPlatformError as e:
-             raise distutils.errors.DistutilsPlatformError(str(e) + """
- Installing your distribution's python-dev package may solve this problem.""")
-@@ -152,16 +152,16 @@ Installing your distribution's python-de
-                 self.install_scripts, "uninstall_" + APP_NAME)
-         uninstaller = """\
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- import errno, os, os.path, sys
--print 'Uninstall %(name)s'
-+print('Uninstall %(name)s')
- answer = raw_input('Are you sure that you want to uninstall '
-     '%(name)s (yes/no) ')
- if answer != 'yes' and answer != 'y':
--    print 'Not uninstalling.'
-+    print('Not uninstalling.')
-     sys.exit(0)
- """ % {'name': APP_NAME}
-@@ -177,8 +177,8 @@ if answer != 'yes' and answer != 'y':
-                     # This should never happen (everything gets installed
-                     # inside the root), but if it does, be safe and don't
-                     # delete anything.
--                    uninstaller += ("print '%s was not installed inside "
--                        "the root %s; skipping.'\n" % (output, self.root))
-+                    uninstaller += ("print('%s was not installed inside "
-+                        "the root %s; skipping.')\n" % (output, self.root))
-                     continue
-                 output = path_strip_prefix(output, self.root)
-                 assert os.path.isabs(output)
-@@ -202,24 +202,24 @@ for path in INSTALLED_FILES:
-         dirs.append(path)
- # Delete the files.
- for file in files:
--    print "Removing '%s'." % file
-+    print("Removing '%s'." % file)
-     try:
-         os.remove(file)
--    except OSError, e:
--        print >> sys.stderr, '  Error: %s.' % str(e)
-+    except OSError as e:
-+        print('  Error: %s.' % str(e), file=sys.stderr)
- # Delete the directories. First reverse-sort the normalized paths by
- # length so that child directories are deleted before their parents.
- dirs = [os.path.normpath(dir) for dir in dirs]
- dirs.sort(key = len, reverse = True)
- for dir in dirs:
-     try:
--        print "Removing the directory '%s'." % dir
-+        print("Removing the directory '%s'." % dir)
-         os.rmdir(dir)
--    except OSError, e:
-+    except OSError as e:
-         if e.errno == errno.ENOTEMPTY:
--            print "Directory '%s' not empty; not removing." % dir
-+            print("Directory '%s' not empty; not removing." % dir)
-         else:
--            print >> sys.stderr, str(e)
-+            print(str(e), file=sys.stderr)
- """
-         uninstaller_file = open(uninstaller_filename, 'w')
-@@ -227,7 +227,7 @@ for dir in dirs:
-         uninstaller_file.close()
-         # Set exec bit for uninstaller
--        mode = ((os.stat(uninstaller_filename)[ST_MODE]) | 0555) & 07777
-+        mode = ((os.stat(uninstaller_filename)[ST_MODE]) | 0o555) & 0o7777
-         os.chmod(uninstaller_filename, mode)
-     def write_installed_files(self):
-@@ -241,7 +241,7 @@ for dir in dirs:
-         with open(INSTALLED_FILES_NAME, "w") as f:
-             for output in self.get_installed_files():
-                 assert "\n" not in output
--                print >> f, output
-+                print(output, file=f)
- class my_uninstall(distutils.cmd.Command):
-@@ -263,7 +263,7 @@ class my_uninstall(distutils.cmd.Command
-         # Read the list of installed files.
-         try:
-             f = open(INSTALLED_FILES_NAME, "r")
--        except IOError, e:
-+        except IOError as e:
-             if e.errno == errno.ENOENT:
-                 log.error("Couldn't open the installation record '%s'. "
-                         "Have you installed yet?" % INSTALLED_FILES_NAME)
-@@ -286,7 +286,7 @@ class my_uninstall(distutils.cmd.Command
-             try:
-                 if not self.dry_run:
-                     os.remove(file)
--            except OSError, e:
-+            except OSError as e:
-                 log.error(str(e))
-         # Delete the directories. First reverse-sort the normalized paths by
-         # length so that child directories are deleted before their parents.
-@@ -297,16 +297,16 @@ class my_uninstall(distutils.cmd.Command
-                 log.info("Removing the directory '%s'." % dir)
-                 if not self.dry_run:
-                     os.rmdir(dir)
--            except OSError, e:
-+            except OSError as e:
-                 if e.errno == errno.ENOTEMPTY:
-                     log.info("Directory '%s' not empty; not removing." % dir)
-                 else:
-                     log.error(str(e))
--distutils.core.setup(name=u"ndiff", scripts=[u"scripts/ndiff"],
--    py_modules=[u"ndiff"],
--    data_files=[(u"share/man/man1", [u"docs/ndiff.1"])],
-+distutils.core.setup(name="ndiff", scripts=["scripts/ndiff"],
-+    py_modules=["ndiff"],
-+    data_files=[("share/man/man1", ["docs/ndiff.1"])],
-     cmdclass={
-         "install_egg_info": null_command,
-         "install": checked_install,
---- a/ndiff/test-scans/anonymize.py
-+++ b/ndiff/test-scans/anonymize.py
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/env python3
- # Anonymize an Nmap XML file, replacing host name and IP addresses with random
- # anonymous ones. Anonymized names will be consistent between runs of the
-@@ -20,20 +20,20 @@ r = random.Random()
- def hash(s):
--    digest = hashlib.sha512(s).hexdigest()
-+    digest = hashlib.sha512(s.encode()).hexdigest()
-     return int(digest, 16)
- def anonymize_mac_address(addr):
-     r.seed(hash(addr))
-     nums = (0, 0, 0) + tuple(r.randrange(256) for i in range(3))
--    return u":".join(u"%02X" % x for x in nums)
-+    return ":".join("%02X" % x for x in nums)
- def anonymize_ipv4_address(addr):
-     r.seed(hash(addr))
-     nums = (10,) + tuple(r.randrange(256) for i in range(3))
--    return u".".join(unicode(x) for x in nums)
-+    return ".".join(str(x) for x in nums)
- def anonymize_ipv6_address(addr):
-@@ -41,7 +41,7 @@ def anonymize_ipv6_address(addr):
-     # RFC 4193.
-     nums = (0xFD00 + r.randrange(256),)
-     nums = nums + tuple(r.randrange(65536) for i in range(7))
--    return u":".join("%04X" % x for x in nums)
-+    return ":".join("%04X" % x for x in nums)
- # Maps to memoize address and host name conversions.
- hostname_map = {}
-@@ -54,11 +54,11 @@ def anonymize_hostname(name):
-     LETTERS = "acbdefghijklmnopqrstuvwxyz"
-     r.seed(hash(name))
-     length = r.randrange(5, 10)
--    prefix = u"".join(r.sample(LETTERS, length))
-+    prefix = "".join(r.sample(LETTERS, length))
-     num = r.randrange(1000)
--    hostname_map[name] = u"%s-%d.example.com" % (prefix, num)
-+    hostname_map[name] = "%s-%d.example.com" % (prefix, num)
-     if VERBOSE:
--        print >> sys.stderr, "Replace %s with %s" % (name, hostname_map[name])
-+        print("Replace %s with %s" % (name, hostname_map[name]), file=sys.stderr)
-     return hostname_map[name]
- mac_re = re.compile(r'\b([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}\b')
-@@ -78,7 +78,7 @@ def anonymize_address(addr):
-     else:
-         assert False
-     if VERBOSE:
--        print >> sys.stderr, "Replace %s with %s" % (addr, address_map[addr])
-+        print("Replace %s with %s" % (addr, address_map[addr]), file=sys.stderr)
-     return address_map[addr]
index 0112c03f0936d5b3ad2aad100b3a786446a7a5aa..d7c75f2ec01944bb51a3880952d9849ef79a2111 100644 (file)
@@ -23,7 +23,7 @@ Also remove references to NCAT_CA_CERTS_FILE and NCAT_CA_CERTS_PATH in order to
  ifneq ($(NOLUA),yes)
 --- a/ncat/ncat_posix.c
 +++ b/ncat/ncat_posix.c
-@@ -347,28 +347,17 @@ void set_lf_mode(void)
+@@ -357,28 +357,17 @@ void set_lf_mode(void)
  
  #ifdef HAVE_OPENSSL
  
@@ -55,7 +55,7 @@ Also remove references to NCAT_CA_CERTS_FILE and NCAT_CA_CERTS_PATH in order to
  #endif
 --- a/ncat/ncat_ssl.h
 +++ b/ncat/ncat_ssl.h
-@@ -67,8 +67,6 @@
+@@ -66,8 +66,6 @@
  #include <openssl/ssl.h>
  #include <openssl/err.h>
  
diff --git a/net/nmap/patches/100-nsock-Fix-compilation-error-with-OPENSSL_NO_DTLS.patch b/net/nmap/patches/100-nsock-Fix-compilation-error-with-OPENSSL_NO_DTLS.patch
new file mode 100644 (file)
index 0000000..6f4e6f1
--- /dev/null
@@ -0,0 +1,67 @@
+From 707812db69cc5fdb8b6b4417d3a6b18405116d9f Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Sun, 28 Apr 2024 12:00:02 +0200
+Subject: [PATCH] nsock: Fix compilation error with OPENSSL_NO_DTLS
+
+Commit ba26cc78f207 ("Replace check for DTLS_client_method with
+OPENSSL_NO_DTLS") made DTLS support depend on the openssl define
+directly but leave some use of dtlsctx not guarded by ifdef.
+
+Fix this by adding to the remaining use of dtlsctx ifdef guard and
+return fatal print for running function with unsupported OpenSSL
+feature.
+
+Fixes: ba26cc78f207 ("Replace check for DTLS_client_method with OPENSSL_NO_DTLS")
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+---
+ nsock/src/nsock_connect.c | 4 ++++
+ nsock/src/nsock_core.c    | 9 ++++++++-
+ nsock/src/nsock_pool.c    | 2 ++
+ 3 files changed, 14 insertions(+), 1 deletion(-)
+
+--- a/nsock/src/nsock_connect.c
++++ b/nsock/src/nsock_connect.c
+@@ -472,8 +472,12 @@ nsock_event_id nsock_connect_ssl(nsock_p
+   if (proto == IPPROTO_UDP)
+   {
++#ifndef OPENSSL_NO_DTLS
+     if (!ms->dtlsctx)
+       nsock_pool_dtls_init(ms, 0);
++#else
++    fatal("%s called with no OpenSSL DTLS support", __func__);
++#endif
+   }
+   else
+   {
+--- a/nsock/src/nsock_core.c
++++ b/nsock/src/nsock_core.c
+@@ -364,7 +364,14 @@ void handle_connect_result(struct npool
+     if (nse->type == NSE_TYPE_CONNECT_SSL &&
+         nse->status == NSE_STATUS_SUCCESS) {
+ #if HAVE_OPENSSL
+-      sslctx = iod->lastproto == IPPROTO_UDP ? ms->dtlsctx : ms->sslctx;
++      if (iod->lastproto == IPPROTO_UDP)
++#ifndef OPENSSL_NO_DTLS
++        sslctx = ms->dtlsctx;
++#else
++        fatal("%s called with no OpenSSL DTLS support", __func__);
++#endif
++      else
++        sslctx = ms->sslctx;
+       assert(sslctx != NULL);
+       /* Reuse iod->ssl if present. If set, this is the second try at connection
+          without the SSL_OP_NO_SSLv2 option set. */
+--- a/nsock/src/nsock_pool.c
++++ b/nsock/src/nsock_pool.c
+@@ -178,8 +178,10 @@ nsock_pool nsock_pool_new(void *userdata
+ #if HAVE_OPENSSL
+   nsp->sslctx = NULL;
++#ifndef OPENSSL_NO_DTLS
+   nsp->dtlsctx = NULL;
+ #endif
++#endif
+   nsp->px_chain = NULL;
index c8934779a05f95e88489214221b24f6d2a851afc..3e866590cee71e7b9c1a7b5f39b07c10dab68564 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=p910nd
 PKG_VERSION:=0.97
-PKG_RELEASE:=13
+PKG_RELEASE:=14
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/p910nd
index 3440a86ed8f1e551df2c6827d055f94f20158442..2bebaee8450e18c706495dcb044a12070e1a35d5 100644 (file)
@@ -281,8 +281,7 @@ get_and_store_printer_info() {
                [ "$DEBUG" ] && echo ${MFG:+MFG=$MFG} ${MDL:+MDL=$MDL} ${CMD:+CMD=$CMD} ${CLS:+CLS=$CLS} ${DES:+DES=$DES} ${SN:+SN=$SN}
 
                [ "$DEBUG" ] && echo 'uci set' for UCI_DEV_CFG_NUMBER: $UCI_DEV_CFG_NUMBER
-               # Take the USB info as fact: set bidir regardless. It seems to be a source of confusion.
-               eval "$uqsddu_cmd.bidirectional='$BIDIR'"
+               [ -z "$(eval "$uqgddu_cmd".bidirectional)" ] && eval "$uqsddu_cmd.bidirectional='$BIDIR'"
                [ -z "$(eval "$uqgddu_cmd".port)" ] && eval "$uqsddu_cmd.port='0'"
                [ -z "$(eval "$uqgddu_cmd".enabled)" ] && eval "$uqsddu_cmd.enabled='1'"
                [ -z "$(eval "$uqgddu_cmd".usbvidpid)" ] && [ -n "$THIS_USB_VIDPID" ] && eval "$uqsddu_cmd.usbvidpid='$THIS_USB_VIDPID'"
index 6edbe2bb5c781606f147dad0044115d39e93e2c6..554cc6ee0f37580728b58a8c26b314d41671dc06 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pdns-recursor
-PKG_VERSION:=5.0.3
+PKG_VERSION:=5.0.4
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://downloads.powerdns.com/releases/
-PKG_HASH:=01d170a2850eb2aca501d6838a3444136589980d5cb2c2b53392b76459e38c07
+PKG_HASH:=d52aab108a0ad9e8be1de2179a693bb85e995c6a4d958a50702dcf79eec8ef28
 
 PKG_MAINTAINER:=Peter van Dijk <peter.van.dijk@powerdns.com>, Remi Gacogne <remi.gacogne@powerdns.com>
 PKG_LICENSE:=GPL-2.0-only
index 6c6058ed31e966e68f8673ccc68f6a74849b5b43..ff86e367b9598389323153e299e09ba24112765c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ser2net
-PKG_VERSION:=4.5.0
+PKG_VERSION:=4.6.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/ser2net
-PKG_HASH:=6ee1b217aad026948fd17ea00c5ecf6e982de822384c4349118461ad83caa0da
+PKG_HASH:=63bafcd65bb9270a93b7d5cdde58ccf4d279603ff6d044ac4b484a257cda82ce
 
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
index 27bea3116eea26c8dc545ac20dd4186c73c71baa..62b9d67a890d3bb5d53aa6b0c8ed04c6187d7490 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=sing-box
-PKG_VERSION:=1.8.10
+PKG_VERSION:=1.8.12
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=a959f9a40148ed4166b8161072672f3ce1532957adef7717132c7277bb96dcf6
+PKG_HASH:=802eb5e202ac1dd846b1f529b3df9e5d69452182fd5d70f7c8f2a819c9e86162
 
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=LICENSE
index b9c85922b09ba8165127552e817e0ea1ee81846d..a8552428b7caf372041e06f72b5c7c666123bd10 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=snort3
 PKG_VERSION:=3.1.84.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
@@ -29,7 +29,7 @@ define Package/snort3
   DEPENDS:= \
            +(TARGET_x86||TARGET_x86_64):hyperscan-runtime \
            +(TARGET_x86||TARGET_x86_64):gperftools-runtime \
-           +libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre +libpthread \
+           +libstdcpp +libdaq3 +libdnet +libopenssl +libpcap +libpcre2 +libpthread \
            +libuuid +zlib +libhwloc +libtirpc @HAS_LUAJIT_ARCH +luajit +libatomic \
            +kmod-nft-queue +liblzma +ucode +ucode-mod-fs +ucode-mod-uci
   TITLE:=Lightweight Network Intrusion Detection System
index 1fc54ca127d27703a2c8bb8e7dd972819a7bc5a8..3ea1b3e4d34131e92a30e277f2649a67a1d3d411 100644 (file)
@@ -54,7 +54,7 @@ nft_rm_table() {
 
 nft_add_table() {
        if [ "$(uci -q get snort.snort.method)" = "nfq" ]; then
-               local options
+               local options=''
                $VERBOSE && options='-e'
                print nftables | nft $options -f $STDIN
                $VERBOSE && nft list table inet snort
@@ -118,7 +118,7 @@ check() {
        fi
 
        if [ "$(uci -q get snort.snort.method)" = "nfq" ]; then
-               local options
+               local options=''
                local test_nft="${CONF_DIR}/test_conf.nft"
                print nftables > "${test_nft}" || die "Errors during generation of nftables config"
                $VERBOSE && options='-e'
diff --git a/net/snort3/patches/900-core-convert-project-to-PCRE2.patch b/net/snort3/patches/900-core-convert-project-to-PCRE2.patch
new file mode 100644 (file)
index 0000000..01199f8
--- /dev/null
@@ -0,0 +1,2052 @@
+From a71cca137eb33f659354ce0ebda4951cb26485df Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Mon, 6 Nov 2023 22:43:59 +0100
+Subject: [PATCH] core: convert project to PCRE2
+
+Convert project to PCRE2 as PCRE is EOL and won't receive any security
+updates anymore.
+
+PCRE2 changed some API and concept. Mainly there isn't the concept of
+study anymore, replaced by match_context concept and match_data is used
+instead of ovector to handle results. Because of this the scratcher is
+not needed anymore and is replaced by a simple function to setup the max
+ovector size on end module init.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+---
+ README.md                                     |  17 +-
+ cmake/FindPCRE.cmake                          |  32 --
+ cmake/FindPCRE2.cmake                         |  32 ++
+ cmake/create_pkg_config.cmake                 |   4 +-
+ cmake/include_libraries.cmake                 |   2 +-
+ configure_cmake.sh                            |  16 +-
+ lua/balanced.lua                              |   2 +-
+ lua/max_detect.lua                            |   6 +-
+ lua/security.lua                              |   4 +-
+ snort.pc.in                                   |   4 +-
+ src/CMakeLists.txt                            |   4 +-
+ src/detection/detection_module.cc             |  48 +--
+ src/detection/detection_options.cc            |   6 +-
+ src/ips_options/ips_options.cc                |   4 +-
+ src/ips_options/ips_pcre.cc                   | 391 ++++++++----------
+ src/main/shell.cc                             |   9 +-
+ src/main/snort_config.h                       |  26 +-
+ .../appid/lua_detector_api.cc                 |  62 +--
+ src/parser/parse_rule.cc                      |   4 +-
+ src/parser/parse_stream.cc                    |   2 +-
+ src/search_engines/test/hyperscan_test.cc     |   2 +-
+ src/utils/stats.cc                            |   6 +-
+ src/utils/stats.h                             |   6 +-
+ src/utils/util.cc                             |   8 +-
+ tools/snort2lua/config_states/config_api.cc   |  12 +-
+ .../config_states/config_no_option.cc         |  14 +-
+ .../config_states/config_one_int_option.cc    |  24 +-
+ tools/snort2lua/rule_states/CMakeLists.txt    |   2 +-
+ tools/snort2lua/rule_states/rule_api.cc       |   4 +-
+ .../{rule_pcre.cc => rule_pcre2.cc}           |  40 +-
+ .../snort2lua/rule_states/rule_sd_pattern.cc  |   4 +-
+ 31 files changed, 393 insertions(+), 404 deletions(-)
+ delete mode 100644 cmake/FindPCRE.cmake
+ create mode 100644 cmake/FindPCRE2.cmake
+ rename tools/snort2lua/rule_states/{rule_pcre.cc => rule_pcre2.cc} (80%)
+
+--- a/README.md
++++ b/README.md
+@@ -8,13 +8,14 @@ topics:
+ ---
+-* [Overview](#overview)
+-* [Dependencies](#dependencies)
+-* [Download](#download)
+-* [Build Snort](#build-snort)
+-* [Run Snort](#run-snort)
+-* [Documentation](#documentation)
+-* [Squeal](#squeal)
++- [Snort++](#snort)
++- [OVERVIEW](#overview)
++- [DEPENDENCIES](#dependencies)
++- [DOWNLOAD](#download)
++- [BUILD SNORT](#build-snort)
++- [RUN SNORT](#run-snort)
++- [DOCUMENTATION](#documentation)
++- [SQUEAL](#squeal)
+ # OVERVIEW
+@@ -61,7 +62,7 @@ the latest:
+ * OpenSSL from https://www.openssl.org/source/ for SHA and MD5 file signatures,
+   the protected_content rule option, and SSL service detection
+ * pcap from http://www.tcpdump.org for tcpdump style logging
+-* pcre from http://www.pcre.org for regular expression pattern matching
++* pcre2 from http://www.pcre.org for regular expression pattern matching
+ * pkgconfig from https://www.freedesktop.org/wiki/Software/pkg-config/ to locate build dependencies
+ * zlib from http://www.zlib.net for decompression
+--- a/cmake/FindPCRE.cmake
++++ /dev/null
+@@ -1,32 +0,0 @@
+-# - Find pcre
+-# Find the native PCRE includes and library
+-#
+-#  PCRE_INCLUDE_DIR - where to find pcre.h, etc.
+-#  PCRE_LIBRARIES    - List of libraries when using pcre.
+-#  PCRE_FOUND        - True if pcre found.
+-
+-set(ERROR_MESSAGE
+-    "\n\tERROR!  Libpcre library not found.
+-    \tGet it from http://www.pcre.org\n"
+-)
+-
+-find_package(PkgConfig)
+-pkg_check_modules(PC_PCRE libpcre)
+-
+-# Use PCRE_INCLUDE_DIR_HINT and PCRE_LIBRARIES_DIR_HINT from configure_cmake.sh as primary hints
+-# and then package config information after that.
+-find_path(PCRE_INCLUDE_DIR pcre.h
+-    HINTS ${PCRE_INCLUDE_DIR_HINT} ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS})
+-find_library(PCRE_LIBRARIES NAMES pcre
+-    HINTS ${PCRE_LIBRARIES_DIR_HINT} ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
+-
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(PCRE
+-    REQUIRED_VARS PCRE_INCLUDE_DIR PCRE_LIBRARIES
+-    FAIL_MESSAGE "${ERROR_MESSAGE}"
+-)
+-
+-mark_as_advanced(
+-    PCRE_LIBRARIES
+-    PCRE_INCLUDE_DIR
+-)
+--- /dev/null
++++ b/cmake/FindPCRE2.cmake
+@@ -0,0 +1,32 @@
++# - Find pcre2
++# Find the native PCRE2 includes and library
++#
++#  PCRE2_INCLUDE_DIR - where to find pcre2.h, etc.
++#  PCRE2_LIBRARIES    - List of libraries when using pcre2.
++#  PCRE2_FOUND        - True if pcre2 found.
++
++set(ERROR_MESSAGE
++    "\n\tERROR!  Libpcre2 library not found.
++    \tGet it from http://www.pcre.org\n"
++)
++
++find_package(PkgConfig)
++pkg_check_modules(PC_PCRE2 libpcre2-8)
++
++# Use PCRE2_INCLUDE_DIR_HINT and PCRE_LIBRARIES_DIR_HINT from configure_cmake.sh as primary hints
++# and then package config information after that.
++find_path(PCRE2_INCLUDE_DIR pcre2.h
++    HINTS ${PCRE2_INCLUDE_DIR_HINT} ${PC_PCRE2_INCLUDEDIR} ${PC_PCRE2_INCLUDE_DIRS})
++find_library(PCRE2_LIBRARIES NAMES pcre2-8
++    HINTS ${PCRE2_LIBRARIES_DIR_HINT} ${PC_PCRE2_LIBDIR} ${PC_PCRE2_LIBRARY_DIRS})
++
++include(FindPackageHandleStandardArgs)
++find_package_handle_standard_args(PCRE2-8
++    REQUIRED_VARS PCRE2_INCLUDE_DIR PCRE2_LIBRARIES
++    FAIL_MESSAGE "${ERROR_MESSAGE}"
++)
++
++mark_as_advanced(
++    PCRE2_LIBRARIES
++    PCRE2_INCLUDE_DIR
++)
+--- a/cmake/create_pkg_config.cmake
++++ b/cmake/create_pkg_config.cmake
+@@ -72,8 +72,8 @@ if(PCAP_INCLUDE_DIR)
+     set(PCAP_CPPFLAGS "-I${PCAP_INCLUDE_DIR}")
+ endif()
+-if(PCRE_INCLUDE_DIR)
+-    set(PCRE_CPPFLAGS "-I${PCRE_INCLUDE_DIR}")
++if(PCRE2_INCLUDE_DIR)
++    set(PCRE2_CPPFLAGS "-I${PCRE2_INCLUDE_DIR}")
+ endif()
+ if(UUID_INCLUDE_DIR)
+--- a/cmake/include_libraries.cmake
++++ b/cmake/include_libraries.cmake
+@@ -8,7 +8,7 @@ find_package(HWLOC REQUIRED)
+ find_package(LuaJIT REQUIRED)
+ find_package(OpenSSL 1.1.1 REQUIRED)
+ find_package(PCAP REQUIRED)
+-find_package(PCRE REQUIRED)
++find_package(PCRE2 REQUIRED)
+ find_package(ZLIB REQUIRED)
+ if (ENABLE_UNIT_TESTS)
+     find_package(CppUTest REQUIRED)
+--- a/configure_cmake.sh
++++ b/configure_cmake.sh
+@@ -90,10 +90,10 @@ Optional Packages:
+                             luajit include directory
+     --with-luajit-libraries=DIR
+                             luajit library directory
+-    --with-pcre-includes=DIR
+-                            libpcre include directory
+-    --with-pcre-libraries=DIR
+-                            libpcre library directory
++    --with-pcre2-includes=DIR
++                            libpcre2 include directory
++    --with-pcre2-libraries=DIR
++                            libpcre2 library directory
+     --with-dnet-includes=DIR
+                             libdnet include directory
+     --with-dnet-libraries=DIR
+@@ -417,11 +417,11 @@ while [ $# -ne 0 ]; do
+         --with-luajit-libraries=*)
+             append_cache_entry LUAJIT_LIBRARIES_DIR_HINT PATH $optarg
+             ;;
+-        --with-pcre-includes=*)
+-            append_cache_entry PCRE_INCLUDE_DIR_HINT PATH $optarg
++        --with-pcre2-includes=*)
++            append_cache_entry PCRE2_INCLUDE_DIR_HINT PATH $optarg
+             ;;
+-        --with-pcre-libraries=*)
+-            append_cache_entry PCRE_LIBRARIES_DIR_HINT PATH $optarg
++        --with-pcre2-libraries=*)
++            append_cache_entry PCRE2_LIBRARIES_DIR_HINT PATH $optarg
+             ;;
+         --with-dnet-includes=*)
+             append_cache_entry DNET_INCLUDE_DIR_HINT PATH $optarg
+--- a/lua/balanced.lua
++++ b/lua/balanced.lua
+@@ -5,7 +5,7 @@
+ arp_spoof = nil
+-detection = { pcre_override = false }
++detection = { pcre2_override = false }
+ http_inspect.request_depth = 300
+ http_inspect.response_depth = 500
+--- a/lua/max_detect.lua
++++ b/lua/max_detect.lua
+@@ -10,13 +10,13 @@ ftp_server.check_encrypted = true
+ detection =
+ {
+-    pcre_match_limit = 3500,
+-    pcre_match_limit_recursion = 3500,
++    pcre2_match_limit = 3500,
++    pcre2_match_limit_recursion = 3500,
+     -- enable for hyperscan for best throughput
+     -- use multiple packet threads for fast startup
+     --hyperscan_literals = true,
+-    --pcre_to_regex = true
++    --pcre2_to_regex = true
+ }
+ http_inspect.decompress_pdf = true
+--- a/lua/security.lua
++++ b/lua/security.lua
+@@ -9,8 +9,8 @@ ftp_server.check_encrypted = true
+ detection =
+ {
+-    pcre_match_limit = 3500,
+-    pcre_match_limit_recursion = 3500
++    pcre2_match_limit = 3500,
++    pcre2_match_limit_recursion = 3500
+ }
+ http_inspect.decompress_pdf = true
+--- a/snort.pc.in
++++ b/snort.pc.in
+@@ -9,7 +9,7 @@ mandir=@mandir@
+ infodir=@infodir@
+ cpp_opts=DAQ LUAJIT
+-cpp_opts_other=DNET HWLOC HYPERSCAN LZMA OPENSSL PCAP PCRE UUID
++cpp_opts_other=DNET HWLOC HYPERSCAN LZMA OPENSSL PCAP PCRE2 UUID
+ PCAP_CPPFLAGS=@PCAP_CPPFLAGS@
+ LUAJIT_CPPFLAGS=@LUAJIT_CPPFLAGS@
+@@ -18,7 +18,7 @@ DAQ_CPPFLAGS=@DAQ_CPPFLAGS@
+ FLEX_CPPFLAGS=@FLEX_CPPFLAGS@
+ OPENSSL_CPPFLAGS=@OPENSSL_CPPFLAGS@
+ HWLOC_CPPFLAGS=@HWLOC_CPPFLAGS@
+-PCRE_CPPFLAGS=@PCRE_CPPFLAGS@
++PCRE2_CPPFLAGS=@PCRE2_CPPFLAGS@
+ LZMA_CPPFLAGS=@LZMA_CPPFLAGS@
+ HYPERSCAN_CPPFLAGS=@HYPERSCAN_CPPFLAGS@
+ UUID_CPPFLAGS=@UUID_CPPFLAGS@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -10,7 +10,7 @@ set(EXTERNAL_LIBRARIES
+     ${LUAJIT_LIBRARIES}
+     ${OPENSSL_CRYPTO_LIBRARY}
+     ${PCAP_LIBRARIES}
+-    ${PCRE_LIBRARIES}
++    ${PCRE2_LIBRARIES}
+     ${ZLIB_LIBRARIES}
+ )
+@@ -21,7 +21,7 @@ set(EXTERNAL_INCLUDES
+     ${HWLOC_INCLUDE_DIRS}
+     ${OPENSSL_INCLUDE_DIR}
+     ${PCAP_INCLUDE_DIR}
+-    ${PCRE_INCLUDE_DIR}
++    ${PCRE2_INCLUDE_DIR}
+     ${ZLIB_INCLUDE_DIRS}
+ )
+--- a/src/detection/detection_module.cc
++++ b/src/detection/detection_module.cc
+@@ -96,21 +96,21 @@ static const Parameter detection_params[
+     { "offload_threads", Parameter::PT_INT, "0:max32", "0",
+       "maximum number of simultaneous offloads (defaults to disabled)" },
+-    { "pcre_enable", Parameter::PT_BOOL, nullptr, "true",
+-      "enable pcre pattern matching" },
++    { "pcre2_enable", Parameter::PT_BOOL, nullptr, "true",
++      "enable pcre2 pattern matching" },
+-    { "pcre_match_limit", Parameter::PT_INT, "0:max32", "1500",
+-      "limit pcre backtracking, 0 = off" },
++    { "pcre2_match_limit", Parameter::PT_INT, "0:max32", "1500",
++      "limit pcre2 backtracking, 0 = off" },
+-    { "pcre_match_limit_recursion", Parameter::PT_INT, "0:max32", "1500",
+-      "limit pcre stack consumption, 0 = off" },
++    { "pcre2_match_limit_recursion", Parameter::PT_INT, "0:max32", "1500",
++      "limit pcre2 stack consumption, 0 = off" },
+-    { "pcre_override", Parameter::PT_BOOL, nullptr, "true",
+-      "enable pcre match limit overrides when pattern matching (ie ignore /O)" },
++    { "pcre2_override", Parameter::PT_BOOL, nullptr, "true",
++      "enable pcre2 match limit overrides when pattern matching (ie ignore /O)" },
+ #ifdef HAVE_HYPERSCAN
+-    { "pcre_to_regex", Parameter::PT_BOOL, nullptr, "false",
+-      "enable the use of regex instead of pcre for compatible expressions" },
++    { "pcre2_to_regex", Parameter::PT_BOOL, nullptr, "false",
++      "enable the use of regex instead of pcre2 for compatible expressions" },
+ #endif
+     { "enable_address_anomaly_checks", Parameter::PT_BOOL, nullptr, "false",
+@@ -221,13 +221,13 @@ bool DetectionModule::set(const char*, V
+     else if ( v.is("offload_threads") )
+         sc->offload_threads = v.get_uint32();
+-    else if ( v.is("pcre_enable") )
+-        v.update_mask(sc->run_flags, RUN_FLAG__NO_PCRE, true);
++    else if ( v.is("pcre2_enable") )
++        v.update_mask(sc->run_flags, RUN_FLAG__NO_PCRE2, true);
+-    else if ( v.is("pcre_match_limit") )
+-        sc->pcre_match_limit = v.get_uint32();
++    else if ( v.is("pcre2_match_limit") )
++        sc->pcre2_match_limit = v.get_uint32();
+-    else if ( v.is("pcre_match_limit_recursion") )
++    else if ( v.is("pcre2_match_limit_recursion") )
+     {
+         // Cap the pcre recursion limit to not exceed the stack size.
+         //
+@@ -252,21 +252,21 @@ bool DetectionModule::set(const char*, V
+         if (max_rec < 0)
+             max_rec = 0;
+-        sc->pcre_match_limit_recursion = v.get_uint32();
+-        if (sc->pcre_match_limit_recursion > max_rec)
++        sc->pcre2_match_limit_recursion = v.get_uint32();
++        if (sc->pcre2_match_limit_recursion > max_rec)
+         {
+-            sc->pcre_match_limit_recursion = max_rec;
+-            LogMessage("Capping pcre_match_limit_recursion to %ld, thread stack_size %ld.\n",
+-                sc->pcre_match_limit_recursion, thread_stack_size);
++            sc->pcre2_match_limit_recursion = max_rec;
++            LogMessage("Capping pcre2_match_limit_recursion to %ld, thread stack_size %llu.\n",
++                sc->pcre2_match_limit_recursion, thread_stack_size);
+         }
+     }
+-    else if ( v.is("pcre_override") )
+-        sc->pcre_override = v.get_bool();
++    else if ( v.is("pcre2_override") )
++        sc->pcre2_override = v.get_bool();
+ #ifdef HAVE_HYPERSCAN
+-    else if ( v.is("pcre_to_regex") )
+-        sc->pcre_to_regex = v.get_bool();
++    else if ( v.is("pcre2_to_regex") )
++        sc->pcre2_to_regex = v.get_bool();
+ #endif
+     else if ( v.is("enable_address_anomaly_checks") )
+--- a/src/detection/detection_options.cc
++++ b/src/detection/detection_options.cc
+@@ -595,7 +595,7 @@ int detection_option_node_evaluate(
+                             {
+                                 if ( !child_node->is_relative )
+                                 {
+-                                    // If it's a non-relative content or pcre, no reason
++                                    // If it's a non-relative content or pcre2, no reason
+                                     // to check again.  Only increment result once.
+                                     // Should hit this condition on first loop iteration.
+                                     if ( loop_count == 1 )
+@@ -661,10 +661,10 @@ int detection_option_node_evaluate(
+                 }
+                 // If all children branches matched, we don't need to reeval any of
+-                // the children so don't need to reeval this content/pcre rule
++                // the children so don't need to reeval this content/pcre2 rule
+                 // option at a new offset.
+                 // Else, reset the DOE ptr to last eval for offset/depth,
+-                // distance/within adjustments for this same content/pcre rule option.
++                // distance/within adjustments for this same content/pcre2 rule option.
+                 // If the node and its sub-tree propagate MATCH back,
+                 // then all its continuations are recalled.
+                 if ( result == node->num_children )
+--- a/src/ips_options/ips_options.cc
++++ b/src/ips_options/ips_options.cc
+@@ -72,7 +72,7 @@ extern const BaseApi* ips_ip_proto[];
+ extern const BaseApi* ips_isdataat[];
+ extern const BaseApi* ips_itype[];
+ extern const BaseApi* ips_msg[];
+-extern const BaseApi* ips_pcre[];
++extern const BaseApi* ips_pcre2[];
+ extern const BaseApi* ips_priority[];
+ extern const BaseApi* ips_raw_data[];
+ extern const BaseApi* ips_rem[];
+@@ -146,7 +146,7 @@ void load_ips_options()
+     PluginManager::load_plugins(ips_isdataat);
+     PluginManager::load_plugins(ips_itype);
+     PluginManager::load_plugins(ips_msg);
+-    PluginManager::load_plugins(ips_pcre);
++    PluginManager::load_plugins(ips_pcre2);
+     PluginManager::load_plugins(ips_priority);
+     PluginManager::load_plugins(ips_raw_data);
+     PluginManager::load_plugins(ips_rem);
+--- a/src/ips_options/ips_pcre.cc
++++ b/src/ips_options/ips_pcre.cc
+@@ -23,7 +23,8 @@
+ #include "config.h"
+ #endif
+-#include <pcre.h>
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include <cassert>
+@@ -43,33 +44,31 @@
+ using namespace snort;
+-#ifndef PCRE_STUDY_JIT_COMPILE
+-#define PCRE_STUDY_JIT_COMPILE 0
++#ifndef PCRE2_STUDY_JIT_COMPILE
++#define PCRE2_STUDY_JIT_COMPILE 0
+ #endif
+ //#define NO_JIT // uncomment to disable JIT for Xcode
+ #ifdef NO_JIT
+-#define PCRE_STUDY_FLAGS 0
+-#define pcre_release(x) pcre_free(x)
++#define PCRE2_JIT 0
+ #else
+-#define PCRE_STUDY_FLAGS PCRE_STUDY_JIT_COMPILE
+-#define pcre_release(x) pcre_free_study(x)
++#define PCRE2_JIT PCRE2_STUDY_JIT_COMPILE
+ #endif
++#define pcre2_release(x) pcre2_code_free(x)
+ #define SNORT_PCRE_RELATIVE         0x00010 // relative to the end of the last match
+ #define SNORT_PCRE_INVERT           0x00020 // invert detect
+ #define SNORT_PCRE_ANCHORED         0x00040
+ #define SNORT_OVERRIDE_MATCH_LIMIT  0x00080 // Override default limits on match & match recursion
+-#define s_name "pcre"
++#define s_name "pcre2"
+ #define mod_regex_name "regex"
+-struct PcreData
++struct Pcre2Data
+ {
+-    pcre* re;           /* compiled regex */
+-    pcre_extra* pe;     /* studied regex foo */
+-    bool free_pe;
++    pcre2_code* re;     /* compiled regex */
++    pcre2_match_context* match_context; /* match_context for limits */
+     int options;        /* sp_pcre specific options (relative & inverse) */
+     char* expression;
+ };
+@@ -83,36 +82,32 @@ struct PcreData
+ // by verify; search uses the value in snort conf
+ static int s_ovector_max = -1;
+-static unsigned scratch_index;
+-static ScratchAllocator* scratcher = nullptr;
+-
+-static THREAD_LOCAL ProfileStats pcrePerfStats;
++static THREAD_LOCAL ProfileStats pcre2PerfStats;
+ //-------------------------------------------------------------------------
+ // implementation foo
+ //-------------------------------------------------------------------------
+-static void pcre_capture(
+-    const void* code, const void* extra)
++static void pcre2_capture(const void* code)
+ {
+     int tmp_ovector_size = 0;
+-    pcre_fullinfo((const pcre*)code, (const pcre_extra*)extra,
+-        PCRE_INFO_CAPTURECOUNT, &tmp_ovector_size);
++    pcre2_pattern_info((const pcre2_code *)code,
++        PCRE2_INFO_CAPTURECOUNT, &tmp_ovector_size);
+     if (tmp_ovector_size > s_ovector_max)
+         s_ovector_max = tmp_ovector_size;
+ }
+-static void pcre_check_anchored(PcreData* pcre_data)
++static void pcre2_check_anchored(Pcre2Data* pcre2_data)
+ {
+     int rc;
+     unsigned long int options = 0;
+-    if ((pcre_data == nullptr) || (pcre_data->re == nullptr) || (pcre_data->pe == nullptr))
++    if ((pcre2_data == nullptr) || (pcre2_data->re == nullptr))
+         return;
+-    rc = pcre_fullinfo(pcre_data->re, pcre_data->pe, PCRE_INFO_OPTIONS, (void*)&options);
++    rc = pcre2_pattern_info(pcre2_data->re, PCRE2_INFO_ARGOPTIONS, (void*)&options);
+     switch (rc)
+     {
+     /* pcre_fullinfo fails for the following:
+@@ -127,40 +122,41 @@ static void pcre_check_anchored(PcreData
+         /* This is the success code */
+         break;
+-    case PCRE_ERROR_NULL:
+-        ParseError("pcre_fullinfo: code and/or where were null.");
++    case PCRE2_ERROR_NULL:
++        ParseError("pcre2_fullinfo: code and/or where were null.");
+         return;
+-    case PCRE_ERROR_BADMAGIC:
+-        ParseError("pcre_fullinfo: compiled code didn't have correct magic.");
++    case PCRE2_ERROR_BADMAGIC:
++        ParseError("pcre2_fullinfo: compiled code didn't have correct magic.");
+         return;
+-    case PCRE_ERROR_BADOPTION:
+-        ParseError("pcre_fullinfo: option type is invalid.");
++    case PCRE2_ERROR_BADOPTION:
++        ParseError("pcre2_fullinfo: option type is invalid.");
+         return;
+     default:
+-        ParseError("pcre_fullinfo: Unknown error code.");
++        ParseError("pcre2_fullinfo: Unknown error code.");
+         return;
+     }
+-    if ((options & PCRE_ANCHORED) && !(options & PCRE_MULTILINE))
++    if ((options & PCRE2_ANCHORED) && !(options & PCRE2_MULTILINE))
+     {
+         /* This means that this pcre rule option shouldn't be EvalStatus
+          * even if any of it's relative children should fail to match.
+          * It is anchored to the cursor set by the previous cursor setting
+          * rule option */
+-        pcre_data->options |= SNORT_PCRE_ANCHORED;
++        pcre2_data->options |= SNORT_PCRE_ANCHORED;
+     }
+ }
+-static void pcre_parse(const SnortConfig* sc, const char* data, PcreData* pcre_data)
++static void pcre2_parse(const SnortConfig* sc, const char* data, Pcre2Data* pcre2_data)
+ {
+-    const char* error;
++    PCRE2_UCHAR error[128];
+     char* re, * free_me;
+     char* opts;
+     char delimit = '/';
+-    int erroffset;
++    int errorcode;
++    PCRE2_SIZE erroffset;
+     int compile_flags = 0;
+     if (data == nullptr)
+@@ -180,7 +176,7 @@ static void pcre_parse(const SnortConfig
+     if (*re == '!')
+     {
+-        pcre_data->options |= SNORT_PCRE_INVERT;
++        pcre2_data->options |= SNORT_PCRE_INVERT;
+         re++;
+         while (isspace((int)*re))
+             re++;
+@@ -212,7 +208,7 @@ static void pcre_parse(const SnortConfig
+     else if (*re != delimit)
+         goto syntax;
+-    pcre_data->expression = snort_strdup(re);
++    pcre2_data->expression = snort_strdup(re);
+     /* find ending delimiter, trim delimit chars */
+     opts = strrchr(re, delimit);
+@@ -230,25 +226,25 @@ static void pcre_parse(const SnortConfig
+     {
+         switch (*opts)
+         {
+-        case 'i':  compile_flags |= PCRE_CASELESS;            break;
+-        case 's':  compile_flags |= PCRE_DOTALL;              break;
+-        case 'm':  compile_flags |= PCRE_MULTILINE;           break;
+-        case 'x':  compile_flags |= PCRE_EXTENDED;            break;
++        case 'i':  compile_flags |= PCRE2_CASELESS;            break;
++        case 's':  compile_flags |= PCRE2_DOTALL;              break;
++        case 'm':  compile_flags |= PCRE2_MULTILINE;           break;
++        case 'x':  compile_flags |= PCRE2_EXTENDED;            break;
+         /*
+          * these are pcre specific... don't work with perl
+          */
+-        case 'A':  compile_flags |= PCRE_ANCHORED;            break;
+-        case 'E':  compile_flags |= PCRE_DOLLAR_ENDONLY;      break;
+-        case 'G':  compile_flags |= PCRE_UNGREEDY;            break;
++        case 'A':  compile_flags |= PCRE2_ANCHORED;            break;
++        case 'E':  compile_flags |= PCRE2_DOLLAR_ENDONLY;      break;
++        case 'G':  compile_flags |= PCRE2_UNGREEDY;            break;
+         /*
+-         * these are snort specific don't work with pcre or perl
++         * these are snort specific don't work with pcre2 or perl
+          */
+-        case 'R':  pcre_data->options |= SNORT_PCRE_RELATIVE; break;
++        case 'R':  pcre2_data->options |= SNORT_PCRE_RELATIVE; break;
+         case 'O':
+-            if ( sc->pcre_override )
+-                pcre_data->options |= SNORT_OVERRIDE_MATCH_LIMIT;
++            if ( sc->pcre2_override )
++                pcre2_data->options |= SNORT_OVERRIDE_MATCH_LIMIT;
+             break;
+         default:
+@@ -259,71 +255,68 @@ static void pcre_parse(const SnortConfig
+     }
+     /* now compile the re */
+-    pcre_data->re = pcre_compile(re, compile_flags, &error, &erroffset, nullptr);
++    pcre2_data->re = pcre2_compile((PCRE2_SPTR)re, PCRE2_ZERO_TERMINATED, compile_flags, &errorcode, &erroffset, nullptr);
++
++    if (pcre2_data->re == nullptr)
++    {
++        pcre2_get_error_message(errorcode, error, 128);
++        ParseError(": pcre2 compile of '%s' failed at offset "
++            "%zu : %s", re, erroffset, error);
++        return;
++    }
+-    if (pcre_data->re == nullptr)
++    /* now create match context */
++    pcre2_data->match_context = pcre2_match_context_create(NULL);
++    if(pcre2_data->match_context == NULL)
+     {
+-        ParseError(": pcre compile of '%s' failed at offset "
+-            "%d : %s", re, erroffset, error);
++        ParseError(": failed to allocate memory for match context");
+         return;
+     }
+     /* now study it... */
+-    pcre_data->pe = pcre_study(pcre_data->re, PCRE_STUDY_FLAGS, &error);
++    if (PCRE2_JIT)
++        errorcode = pcre2_jit_compile(pcre2_data->re, PCRE2_JIT_COMPLETE);
+-    if (pcre_data->pe)
++    if (PCRE2_JIT || errorcode)
+     {
+-        if ((sc->get_pcre_match_limit() != 0) &&
+-            !(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT))
++        if ((sc->get_pcre2_match_limit() != 0) &&
++            !(pcre2_data->options & SNORT_OVERRIDE_MATCH_LIMIT))
+         {
+-            if ( !(pcre_data->pe->flags & PCRE_EXTRA_MATCH_LIMIT) )
+-                pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT;
+-
+-            pcre_data->pe->match_limit = sc->get_pcre_match_limit();
++            pcre2_set_match_limit(pcre2_data->match_context, sc->get_pcre2_match_limit());
+         }
+-        if ((sc->get_pcre_match_limit_recursion() != 0) &&
+-            !(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT))
++        if ((sc->get_pcre2_match_limit_recursion() != 0) &&
++            !(pcre2_data->options & SNORT_OVERRIDE_MATCH_LIMIT))
+         {
+-            if ( !(pcre_data->pe->flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) )
+-                pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+-
+-            pcre_data->pe->match_limit_recursion =
+-                sc->get_pcre_match_limit_recursion();
++            pcre2_set_match_limit(pcre2_data->match_context, sc->get_pcre2_match_limit_recursion());
+         }
+     }
+     else
+     {
+-        if (!(pcre_data->options & SNORT_OVERRIDE_MATCH_LIMIT) &&
+-            ((sc->get_pcre_match_limit() != 0) ||
+-             (sc->get_pcre_match_limit_recursion() != 0)))
++        if (!(pcre2_data->options & SNORT_OVERRIDE_MATCH_LIMIT) &&
++            ((sc->get_pcre2_match_limit() != 0) ||
++             (sc->get_pcre2_match_limit_recursion() != 0)))
+         {
+-            pcre_data->pe = (pcre_extra*)snort_calloc(sizeof(pcre_extra));
+-            pcre_data->free_pe = true;
+-
+-            if (sc->get_pcre_match_limit() != 0)
++            if (sc->get_pcre2_match_limit() != 0)
+             {
+-                pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT;
+-                pcre_data->pe->match_limit = sc->get_pcre_match_limit();
++                pcre2_set_match_limit(pcre2_data->match_context, sc->get_pcre2_match_limit());
+             }
+-            if (sc->get_pcre_match_limit_recursion() != 0)
++            if (sc->get_pcre2_match_limit_recursion() != 0)
+             {
+-                pcre_data->pe->flags |= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
+-                pcre_data->pe->match_limit_recursion =
+-                    sc->get_pcre_match_limit_recursion();
++                pcre2_set_match_limit(pcre2_data->match_context, sc->get_pcre2_match_limit_recursion());
+             }
+         }
+     }
+-    if (error != nullptr)
++    if (PCRE2_JIT && errorcode)
+     {
+-        ParseError("pcre study failed : %s", error);
++        ParseError("pcre2 JIT failed : %s", error);
+         return;
+     }
+-    pcre_capture(pcre_data->re, pcre_data->pe);
+-    pcre_check_anchored(pcre_data);
++    pcre2_capture(pcre2_data->re);
++    pcre2_check_anchored(pcre2_data);
+     snort_free(free_me);
+     return;
+@@ -332,40 +325,44 @@ syntax:
+     snort_free(free_me);
+     // ensure integrity from parse error to fatal error
+-    if ( !pcre_data->expression )
+-        pcre_data->expression = snort_strdup("");
++    if ( !pcre2_data->expression )
++        pcre2_data->expression = snort_strdup("");
+-    ParseError("unable to parse pcre %s", data);
++    ParseError("unable to parse pcre2 %s", data);
+ }
+ /*
+- * Perform a search of the PCRE data.
++ * Perform a search of the PCRE2 data.
+  * found_offset will be set to -1 when the find is unsuccessful OR the routine is inverted
+  */
+-static bool pcre_search(
++static bool pcre2_search(
+     Packet* p,
+-    const PcreData* pcre_data,
++    const Pcre2Data* pcre2_data,
+     const uint8_t* buf,
+     unsigned len,
+     unsigned start_offset,
+     int& found_offset)
+ {
++    pcre2_match_data *match_data;
++    PCRE2_SIZE *ovector;
+     bool matched;
+     found_offset = -1;
+-    std::vector<void *> ss = p->context->conf->state[get_instance_id()];
+-    assert(ss[scratch_index]);
++    match_data = pcre2_match_data_create(p->context->conf->pcre2_ovector_size, NULL);
++    if (match_data == nullptr) {
++        pc.pcre2_error++;
++        return false;
++    }
+-    int result = pcre_exec(
+-        pcre_data->re,  /* result of pcre_compile() */
+-        pcre_data->pe,  /* result of pcre_study()   */
+-        (const char*)buf, /* the subject string */
+-        len,            /* the length of the subject string */
+-        start_offset,   /* start at offset 0 in the subject */
+-        0,              /* options(handled at compile time */
+-        (int*)ss[scratch_index], /* vector for substring information */
+-        p->context->conf->pcre_ovector_size); /* number of elements in the vector */
++    int result = pcre2_match(
++        pcre2_data->re,  /* result of pcre_compile() */
++        (PCRE2_SPTR)buf, /* the subject string */
++        (PCRE2_SIZE)len, /* the length of the subject string */
++        (PCRE2_SIZE)start_offset, /* start at offset 0 in the subject */
++        0,               /* options(handled at compile time */
++        match_data,      /* match data to store the match results */
++        pcre2_data->match_context); /* match context for limits */
+     if (result >= 0)
+     {
+@@ -390,34 +387,37 @@ static bool pcre_search(
+          * and a single int for scratch space.
+          */
+-        found_offset = ((int*)ss[scratch_index])[1];
++        ovector = pcre2_get_ovector_pointer(match_data);
++        found_offset = ovector[1];
+     }
+-    else if (result == PCRE_ERROR_NOMATCH)
++    else if (result == PCRE2_ERROR_NOMATCH)
+     {
+         matched = false;
+     }
+-    else if (result == PCRE_ERROR_MATCHLIMIT)
++    else if (result == PCRE2_ERROR_MATCHLIMIT)
+     {
+-        pc.pcre_match_limit++;
++        pc.pcre2_match_limit++;
+         matched = false;
+     }
+-    else if (result == PCRE_ERROR_RECURSIONLIMIT)
++    else if (result == PCRE2_ERROR_RECURSIONLIMIT)
+     {
+-        pc.pcre_recursion_limit++;
++        pc.pcre2_recursion_limit++;
+         matched = false;
+     }
+     else
+     {
+-        pc.pcre_error++;
++        pc.pcre2_error++;
+         return false;
+     }
+     /* invert sense of match */
+-    if (pcre_data->options & SNORT_PCRE_INVERT)
++    if (pcre2_data->options & SNORT_PCRE_INVERT)
+     {
+         matched = !matched;
+     }
++    pcre2_match_data_free(match_data);
++
+     return matched;
+ }
+@@ -425,14 +425,14 @@ static bool pcre_search(
+ // class methods
+ //-------------------------------------------------------------------------
+-class PcreOption : public IpsOption
++class Pcre2Option : public IpsOption
+ {
+ public:
+-    PcreOption(PcreData* c) :
++    Pcre2Option(Pcre2Data* c) :
+         IpsOption(s_name, RULE_OPTION_TYPE_CONTENT)
+     { config = c; }
+-    ~PcreOption() override;
++    ~Pcre2Option() override;
+     uint32_t hash() const override;
+     bool operator==(const IpsOption&) const override;
+@@ -446,17 +446,17 @@ public:
+     EvalStatus eval(Cursor&, Packet*) override;
+     bool retry(Cursor&, const Cursor&) override;
+-    PcreData* get_data()
++    Pcre2Data* get_data()
+     { return config; }
+-    void set_data(PcreData* pcre)
++    void set_data(Pcre2Data* pcre)
+     { config = pcre; }
+ private:
+-    PcreData* config;
++    Pcre2Data* config;
+ };
+-PcreOption::~PcreOption()
++Pcre2Option::~Pcre2Option()
+ {
+     if ( !config )
+         return;
+@@ -464,21 +464,16 @@ PcreOption::~PcreOption()
+     if ( config->expression )
+         snort_free(config->expression);
+-    if ( config->pe )
+-    {
+-        if ( config->free_pe )
+-            snort_free(config->pe);
+-        else
+-            pcre_release(config->pe);
+-    }
++    if ( config->match_context )
++        pcre2_match_context_free(config->match_context);
+     if ( config->re )
+-        free(config->re);  // external allocation
++        pcre2_code_free(config->re);  // external allocation
+     snort_free(config);
+ }
+-uint32_t PcreOption::hash() const
++uint32_t Pcre2Option::hash() const
+ {
+     uint32_t a = 0, b = 0, c = 0;
+     int expression_len = strlen(config->expression);
+@@ -532,14 +527,14 @@ uint32_t PcreOption::hash() const
+     return c;
+ }
+-bool PcreOption::operator==(const IpsOption& ips) const
++bool Pcre2Option::operator==(const IpsOption& ips) const
+ {
+     if ( !IpsOption::operator==(ips) )
+         return false;
+-    const PcreOption& rhs = (const PcreOption&)ips;
+-    PcreData* left = config;
+-    PcreData* right = rhs.config;
++    const Pcre2Option& rhs = (const Pcre2Option&)ips;
++    Pcre2Data* left = config;
++    Pcre2Data* right = rhs.config;
+     if (( strcmp(left->expression, right->expression) == 0) &&
+         ( left->options == right->options))
+@@ -550,13 +545,13 @@ bool PcreOption::operator==(const IpsOpt
+     return false;
+ }
+-IpsOption::EvalStatus PcreOption::eval(Cursor& c, Packet* p)
++IpsOption::EvalStatus Pcre2Option::eval(Cursor& c, Packet* p)
+ {
+     // cppcheck-suppress unreadVariable
+-    RuleProfile profile(pcrePerfStats);
++    RuleProfile profile(pcre2PerfStats);
+-    // short circuit this for testing pcre performance impact
+-    if ( p->context->conf->no_pcre() )
++    // short circuit this for testing pcre2 performance impact
++    if ( p->context->conf->no_pcre2() )
+         return NO_MATCH;
+     unsigned pos = c.get_delta();
+@@ -570,7 +565,7 @@ IpsOption::EvalStatus PcreOption::eval(C
+     int found_offset = -1; // where is the ending location of the pattern
+-    if ( pcre_search(p, config, c.buffer()+adj, c.size()-adj, pos, found_offset) )
++    if ( pcre2_search(p, config, c.buffer()+adj, c.size()-adj, pos, found_offset) )
+     {
+         if ( found_offset > 0 )
+         {
+@@ -585,17 +580,17 @@ IpsOption::EvalStatus PcreOption::eval(C
+ }
+ // we always advance by found_offset so no adjustments to cursor are done
+-// here; note also that this means relative pcre matches on overlapping
++// here; note also that this means relative pcre2 matches on overlapping
+ // patterns won't work.  given the test pattern "ABABACD":
+ //
+ // ( sid:1; content:"ABA"; content:"C"; within:1; )
+-// ( sid:2; pcre:"/ABA/"; content:"C"; within:1; )
++// ( sid:2; pcre2:"/ABA/"; content:"C"; within:1; )
+ //
+ // sid 1 will fire but sid 2 will NOT.  this example is easily fixed by
+-// using content, but more advanced pcre won't work for the relative /
++// using content, but more advanced pcre2 won't work for the relative /
+ // overlap case.
+-bool PcreOption::retry(Cursor&, const Cursor&)
++bool Pcre2Option::retry(Cursor&, const Cursor&)
+ {
+     if ((config->options & (SNORT_PCRE_INVERT | SNORT_PCRE_ANCHORED)))
+     {
+@@ -616,46 +611,43 @@ static const Parameter s_params[] =
+     { nullptr, Parameter::PT_MAX, nullptr, nullptr, nullptr }
+ };
+-struct PcreStats
++struct Pcre2Stats
+ {
+-    PegCount pcre_rules;
++    PegCount pcre2_rules;
+ #ifdef HAVE_HYPERSCAN
+-    PegCount pcre_to_hyper;
++    PegCount pcre2_to_hyper;
+ #endif
+-    PegCount pcre_native;
+-    PegCount pcre_negated;
++    PegCount pcre2_native;
++    PegCount pcre2_negated;
+ };
+ const PegInfo pcre_pegs[] =
+ {
+-    { CountType::SUM, "pcre_rules", "total rules processed with pcre option" },
++    { CountType::SUM, "pcre2_rules", "total rules processed with pcre2 option" },
+ #ifdef HAVE_HYPERSCAN
+-    { CountType::SUM, "pcre_to_hyper", "total pcre rules by hyperscan engine" },
++    { CountType::SUM, "pcre2_to_hyper", "total pcre2 rules by hyperscan engine" },
+ #endif
+-    { CountType::SUM, "pcre_native", "total pcre rules compiled by pcre engine" },
+-    { CountType::SUM, "pcre_negated", "total pcre rules using negation syntax" },
++    { CountType::SUM, "pcre2_native", "total pcre2 rules compiled by pcre engine" },
++    { CountType::SUM, "pcre2_negated", "total pcre2 rules using negation syntax" },
+     { CountType::END, nullptr, nullptr }
+ };
+-PcreStats pcre_stats;
++Pcre2Stats pcre2_stats;
+ #define s_help \
+-    "rule option for matching payload data with pcre"
++    "rule option for matching payload data with pcre2"
+-class PcreModule : public Module
++class Pcre2Module : public Module
+ {
+ public:
+-    PcreModule() : Module(s_name, s_help, s_params)
++    Pcre2Module() : Module(s_name, s_help, s_params)
+     {
+         data = nullptr;
+-        scratcher = new SimpleScratchAllocator(scratch_setup, scratch_cleanup);
+-        scratch_index = scratcher->get_id();
+     }
+-    ~PcreModule() override
++    ~Pcre2Module() override
+     {
+         delete data;
+-        delete scratcher;
+     }
+ #ifdef HAVE_HYPERSCAN
+@@ -665,12 +657,12 @@ public:
+     bool end(const char*, int, SnortConfig*) override;
+     ProfileStats* get_profile() const override
+-    { return &pcrePerfStats; }
++    { return &pcre2PerfStats; }
+     const PegInfo* get_pegs() const override;
+     PegCount* get_counts() const override;
+-    PcreData* get_data();
++    Pcre2Data* get_data();
+     bool global_stats() const override
+     { return true; }
+@@ -682,31 +674,28 @@ public:
+     { return mod_regex; }
+ private:
+-    PcreData* data;
++    Pcre2Data* data;
+     Module* mod_regex = nullptr;
+     std::string re;
+-
+-    static bool scratch_setup(SnortConfig*);
+-    static void scratch_cleanup(SnortConfig*);
+ };
+-PcreData* PcreModule::get_data()
++Pcre2Data* Pcre2Module::get_data()
+ {
+-    PcreData* tmp = data;
++    Pcre2Data* tmp = data;
+     data = nullptr;
+     return tmp;
+ }
+-const PegInfo* PcreModule::get_pegs() const
++const PegInfo* Pcre2Module::get_pegs() const
+ { return pcre_pegs; }
+-PegCount* PcreModule::get_counts() const
+-{ return (PegCount*)&pcre_stats; }
++PegCount* Pcre2Module::get_counts() const
++{ return (PegCount*)&pcre2_stats; }
+ #ifdef HAVE_HYPERSCAN
+-bool PcreModule::begin(const char* name, int v, SnortConfig* sc)
++bool Pcre2Module::begin(const char* name, int v, SnortConfig* sc)
+ {
+-    if ( sc->pcre_to_regex )
++    if ( sc->pcre2_to_regex )
+     {
+         if ( !mod_regex )
+             mod_regex = ModuleManager::get_module(mod_regex_name);
+@@ -718,7 +707,7 @@ bool PcreModule::begin(const char* name,
+ }
+ #endif
+-bool PcreModule::set(const char* name, Value& v, SnortConfig* sc)
++bool Pcre2Module::set(const char* name, Value& v, SnortConfig* sc)
+ {
+     assert(v.is("~re"));
+     re = v.get_string();
+@@ -729,50 +718,28 @@ bool PcreModule::set(const char* name, V
+     return true;
+ }
+-bool PcreModule::end(const char* name, int v, SnortConfig* sc)
++bool Pcre2Module::end(const char* name, int v, SnortConfig* sc)
+ {
+     if( mod_regex )
+         mod_regex = mod_regex->end(name, v, sc) ? mod_regex : nullptr;
+     if ( !mod_regex )
+     {
+-        data = (PcreData*)snort_calloc(sizeof(*data));
+-        pcre_parse(sc, re.c_str(), data);
++        data = (Pcre2Data*)snort_calloc(sizeof(*data));
++        pcre2_parse(sc, re.c_str(), data);
+     }
+-    return true;
+-}
+-
+-bool PcreModule::scratch_setup(SnortConfig* sc)
+-{
+-    if ( s_ovector_max < 0 )
+-        return false;
+-
+     // The pcre_fullinfo() function can be used to find out how many
+     // capturing subpatterns there are in a compiled pattern. The
+     // smallest size for ovector that will allow for n captured
+     // substrings, in addition to the offsets of the substring matched
+     // by the whole pattern is 3(n+1).
+-
+-    sc->pcre_ovector_size = 3 * (s_ovector_max + 1);
+-    s_ovector_max = -1;
+-
+-    for ( unsigned i = 0; i < sc->num_slots; ++i )
+-    {
+-        std::vector<void *>& ss = sc->state[i];
+-        ss[scratch_index] = snort_calloc(sc->pcre_ovector_size, sizeof(int));
++    if ( s_ovector_max >= 0 ) {
++        sc->pcre2_ovector_size = 3 * (s_ovector_max + 1);
++        s_ovector_max = -1;
+     }
+-    return true;
+-}
+-void PcreModule::scratch_cleanup(SnortConfig* sc)
+-{
+-    for ( unsigned i = 0; i < sc->num_slots; ++i )
+-    {
+-        std::vector<void *>& ss = sc->state[i];
+-        snort_free(ss[scratch_index]);
+-        ss[scratch_index] = nullptr;
+-    }
++    return true;
+ }
+ //-------------------------------------------------------------------------
+@@ -780,21 +747,21 @@ void PcreModule::scratch_cleanup(SnortCo
+ //-------------------------------------------------------------------------
+ static Module* mod_ctor()
+-{ return new PcreModule; }
++{ return new Pcre2Module; }
+ static void mod_dtor(Module* m)
+ { delete m; }
+-static IpsOption* pcre_ctor(Module* p, OptTreeNode* otn)
++static IpsOption* pcre2_ctor(Module* p, OptTreeNode* otn)
+ {
+-    pcre_stats.pcre_rules++;
+-    PcreModule* m = (PcreModule*)p;
++    pcre2_stats.pcre2_rules++;
++    Pcre2Module* m = (Pcre2Module*)p;
+ #ifdef HAVE_HYPERSCAN
+     Module* mod_regex = m->get_mod_regex();
+     if ( mod_regex )
+     {
+-        pcre_stats.pcre_to_hyper++;
++        pcre2_stats.pcre2_to_hyper++;
+         const IpsApi* opt_api = IpsManager::get_option_api(mod_regex_name);
+         return opt_api->ctor(mod_regex, otn);
+     }
+@@ -803,16 +770,16 @@ static IpsOption* pcre_ctor(Module* p, O
+     UNUSED(otn);
+ #endif
+     {
+-        pcre_stats.pcre_native++;
+-        PcreData* d = m->get_data();
+-        return new PcreOption(d);
++        pcre2_stats.pcre2_native++;
++        Pcre2Data* d = m->get_data();
++        return new Pcre2Option(d);
+     }
+ }
+-static void pcre_dtor(IpsOption* p)
++static void pcre2_dtor(IpsOption* p)
+ { delete p; }
+-static const IpsApi pcre_api =
++static const IpsApi pcre2_api =
+ {
+     {
+         PT_IPS_OPTION,
+@@ -832,17 +799,17 @@ static const IpsApi pcre_api =
+     nullptr,
+     nullptr,
+     nullptr,
+-    pcre_ctor,
+-    pcre_dtor,
++    pcre2_ctor,
++    pcre2_dtor,
+     nullptr
+ };
+ #ifdef BUILDING_SO
+ SO_PUBLIC const BaseApi* snort_plugins[] =
+ #else
+-const BaseApi* ips_pcre[] =
++const BaseApi* ips_pcre2[] =
+ #endif
+ {
+-    &pcre_api.base,
++    &pcre2_api.base,
+     nullptr
+ };
+--- a/src/main/shell.cc
++++ b/src/main/shell.cc
+@@ -29,7 +29,8 @@
+ #include <fstream>
+ #include <openssl/crypto.h>
+ #include <pcap.h>
+-#include <pcre.h>
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include <stdexcept>
+ #include <vector>
+ #include <zlib.h>
+@@ -138,13 +139,17 @@ static void install_version_strings(lua_
+ static void install_dependencies_strings(Shell* sh, lua_State* L)
+ {
++
+     assert(dep_versions[0]);
++    const char pcre2_version[32] = { 0 };
+     std::vector<const char*> vs;
+     const char* ljv = LUAJIT_VERSION;
+     const char* osv = OpenSSL_version(SSLEAY_VERSION);
+     const char* lpv = pcap_lib_version();
++    pcre2_config(PCRE2_CONFIG_VERSION, (PCRE2_UCHAR8 *)pcre2_version);
++
+     while (*ljv and !isdigit(*ljv))
+         ++ljv;
+     while (*osv and !isdigit(*osv))
+@@ -156,7 +161,7 @@ static void install_dependencies_strings
+     vs.push_back(ljv);
+     vs.push_back(osv);
+     vs.push_back(lpv);
+-    vs.push_back(pcre_version());
++    vs.push_back(pcre2_version);
+     vs.push_back(zlib_version);
+ #ifdef HAVE_HYPERSCAN
+     vs.push_back(hs_version());
+--- a/src/main/snort_config.h
++++ b/src/main/snort_config.h
+@@ -60,7 +60,7 @@ enum RunFlag
+     RUN_FLAG__PCAP_SHOW           = 0x00001000,
+     RUN_FLAG__SHOW_FILE_CODES     = 0x00002000,
+     RUN_FLAG__PAUSE               = 0x00004000,
+-    RUN_FLAG__NO_PCRE             = 0x00008000,
++    RUN_FLAG__NO_PCRE2            = 0x00008000,
+     RUN_FLAG__DUMP_RULE_STATE     = 0x00010000,
+     RUN_FLAG__DUMP_RULE_DEPS      = 0x00020000,
+@@ -214,13 +214,13 @@ public:
+     //------------------------------------------------------
+     // detection module stuff
+-    // FIXIT-L pcre_match_limit* are interdependent
++    // FIXIT-L pcre2_match_limit* are interdependent
+     // somehow a packet thread needs a much lower setting
+-    long int pcre_match_limit = 1500;
+-    long int pcre_match_limit_recursion = 1500;
++    long int pcre2_match_limit = 1500;
++    long int pcre2_match_limit_recursion = 1500;
+-    int pcre_ovector_size = 0;
+-    bool pcre_override = true;
++    int pcre2_ovector_size = 0;
++    bool pcre2_override = true;
+     uint32_t run_flags = 0;
+@@ -228,7 +228,7 @@ public:
+     unsigned offload_threads = 0;    // disabled
+     bool hyperscan_literals = false;
+-    bool pcre_to_regex = false;
++    bool pcre2_to_regex = false;
+     bool global_rule_state = false;
+     bool global_default_rule_state = true;
+@@ -600,8 +600,8 @@ public:
+     bool alert_before_pass() const
+     { return run_flags & RUN_FLAG__ALERT_BEFORE_PASS; }
+-    bool no_pcre() const
+-    { return run_flags & RUN_FLAG__NO_PCRE; }
++    bool no_pcre2() const
++    { return run_flags & RUN_FLAG__NO_PCRE2; }
+     bool conf_error_out() const
+     { return run_flags & RUN_FLAG__CONF_ERROR_OUT; }
+@@ -616,11 +616,11 @@ public:
+     uint8_t new_ttl() const
+     { return get_network_policy()->new_ttl; }
+-    long int get_pcre_match_limit() const
+-    { return pcre_match_limit; }
++    long int get_pcre2_match_limit() const
++    { return pcre2_match_limit; }
+-    long int get_pcre_match_limit_recursion() const
+-    { return pcre_match_limit_recursion; }
++    long int get_pcre2_match_limit_recursion() const
++    { return pcre2_match_limit_recursion; }
+     const ProfilerConfig* get_profiler() const
+     { return profiler; }
+--- a/src/network_inspectors/appid/lua_detector_api.cc
++++ b/src/network_inspectors/appid/lua_detector_api.cc
+@@ -25,7 +25,8 @@
+ #include "lua_detector_api.h"
+ #include <lua.hpp>
+-#include <pcre.h>
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include <unordered_map>
+ #include "detection/fp_config.h"
+@@ -714,7 +715,7 @@ static int detector_get_packet_direction
+     return 1;
+ }
+-/**Perform a pcre match with grouping. A simple regular expression match with no grouping
++/**Perform a pcre2 match with grouping. A simple regular expression match with no grouping
+  * can also be performed.
+  *
+  * @param Lua_State* - Lua state variable.
+@@ -723,41 +724,50 @@ static int detector_get_packet_direction
+  * @return matchedStrings/stack - matched strings are pushed on stack starting with group 0.
+  *     There may be 0 or more strings.
+  */
+-static int detector_get_pcre_groups(lua_State* L)
++static int detector_get_pcre2_groups(lua_State* L)
+ {
+     auto& ud = *UserData<LuaObject>::check(L, DETECTOR, 1);
+     // Verify detector user data and that we are in packet context
+     LuaStateDescriptor* lsd = ud->validate_lua_state(true);
+-    int ovector[OVECCOUNT];
+-    const char* error;
+-    int erroffset;
++    PCRE2_SIZE* ovector;
++    pcre2_match_data* match_data;
++    PCRE2_UCHAR error[128];
++    PCRE2_SIZE erroffset;
++    int errorcode;
+     const char* pattern = lua_tostring(L, 2);
+     unsigned int offset = lua_tonumber(L, 3);     /*offset can be zero, no check necessary. */
+     /*compile the regular expression pattern, and handle errors */
+-    pcre* re = pcre_compile(pattern,  // the pattern
+-        PCRE_DOTALL,                  // default options - dot matches all inc \n
+-        &error,                       // for error message
+-        &erroffset,                   // for error offset
+-        nullptr);                     // use default character tables
++    pcre2_code* re = pcre2_compile((PCRE2_SPTR)pattern,  // the pattern
++        PCRE2_ZERO_TERMINATED,         // assume zero terminated strings
++        PCRE2_DOTALL,                  // default options - dot matches all inc \n
++        &errorcode,                    // for error message
++        &erroffset,                    // for error offset
++        nullptr);                      // use default character tables
+     if (re == nullptr)
+     {
+-        appid_log(lsd->ldp.pkt, TRACE_ERROR_LEVEL, "PCRE compilation failed at offset %d: %s\n", erroffset, error);
++        pcre2_get_error_message(errorcode, error, 128);
++        appid_log(lsd->ldp.pkt, TRACE_ERROR_LEVEL, "PCRE2 compilation failed at offset %d: %s\n", erroffset, error);
++        return 0;
++    }
++
++    match_data = pcre2_match_data_create(OVECCOUNT, NULL);
++    if (match_data == nullptr) {
++        appid_log(lsd->ldp.pkt, TRACE_ERROR_LEVEL, "PCRE2 failed to allocate mem for match_data\n");
+         return 0;
+     }
+     /*pattern match against the subject string. */
+-    int rc = pcre_exec(re,            // compiled pattern
+-        nullptr,                      // no extra data
+-        (const char*)lsd->ldp.data,   // subject string
+-        lsd->ldp.size,                // length of the subject
+-        offset,                       // offset 0
+-        0,                            // default options
+-        ovector,                      // output vector for substring information
+-        OVECCOUNT);                   // number of elements in the output vector
++    int rc = pcre2_match(re,         // compiled pattern
++        (PCRE2_SPTR)lsd->ldp.data,   // subject string
++        (PCRE2_SIZE)lsd->ldp.size,   // length of the subject
++        (PCRE2_SIZE)offset,          // offset 0
++        0,                           // default options
++        match_data,                  // match data for match results
++        NULL);                       // no match context
+     if (rc >= 0)
+     {
+@@ -771,10 +781,11 @@ static int detector_get_pcre_groups(lua_
+         if (!lua_checkstack(L, rc))
+         {
+             appid_log(lsd->ldp.pkt, TRACE_WARNING_LEVEL, "Cannot grow Lua stack by %d slots to hold "
+-                "PCRE matches\n", rc);
++                "PCRE2 matches\n", rc);
+             return 0;
+         }
++        ovector = pcre2_get_ovector_pointer(match_data);
+         for (int i = 0; i < rc; i++)
+         {
+             lua_pushlstring(L, (const char*)lsd->ldp.data + ovector[2*i], ovector[2*i+1] -
+@@ -784,12 +795,13 @@ static int detector_get_pcre_groups(lua_
+     else
+     {
+         // log errors except no matches
+-        if (rc != PCRE_ERROR_NOMATCH)
+-            appid_log(lsd->ldp.pkt, TRACE_WARNING_LEVEL, "PCRE regular expression group match failed. rc: %d\n", rc);
++        if (rc != PCRE2_ERROR_NOMATCH)
++            appid_log(lsd->ldp.pkt, TRACE_WARNING_LEVEL, "PCRE2 regular expression group match failed. rc: %d\n", rc);
+         rc = 0;
+     }
+-    pcre_free(re);
++    pcre2_match_data_free(match_data);
++    pcre2_code_free(re);
+     return rc;
+ }
+@@ -3229,7 +3241,7 @@ static const luaL_Reg detector_methods[]
+     { "getPacketSize",            detector_get_packet_size },
+     { "getPacketDir",             detector_get_packet_direction },
+     { "matchSimplePattern",       detector_memcmp },
+-    { "getPcreGroups",            detector_get_pcre_groups },
++    { "getPcreGroups",            detector_get_pcre2_groups },
+     { "getL4Protocol",            detector_get_protocol_type },
+     { "getPktSrcAddr",            detector_get_packet_src_addr },
+     { "getPktDstAddr",            detector_get_packet_dst_addr },
+--- a/src/parser/parse_rule.cc
++++ b/src/parser/parse_rule.cc
+@@ -911,10 +911,10 @@ void parse_rule_dir(SnortConfig*, const
+         ParseError("illegal direction specifier: %s", s);
+ }
+-// Values of the rule options "pcre", "regex" and "sd_pattern" are already escaped
++// Values of the rule options "pcre2", "regex" and "sd_pattern" are already escaped
+ // They are not unescaped during the rule parsing
+ static bool is_already_escaped(const std::string& opt_key)
+-{ return opt_key == "pcre" or opt_key == "regex" or opt_key == "sd_pattern"; }
++{ return opt_key == "pcre2" or opt_key == "regex" or opt_key == "sd_pattern"; }
+ static std::string escape(const std::string& s)
+ {
+--- a/src/parser/parse_stream.cc
++++ b/src/parser/parse_stream.cc
+@@ -603,7 +603,7 @@ static bool exec(
+ // that individual rule options can do whatever
+ static int get_escape(const string& s)
+ {
+-    if ( s == "pcre" )
++    if ( s == "pcre2" )
+         return 0;  // no escape, option goes to ;
+     else if ( s == "regex" || s == "sd_pattern" )
+--- a/src/search_engines/test/hyperscan_test.cc
++++ b/src/search_engines/test/hyperscan_test.cc
+@@ -223,7 +223,7 @@ TEST(mpse_hs_match, regex)
+     CHECK(hits == 3);
+ }
+-TEST(mpse_hs_match, pcre)
++TEST(mpse_hs_match, pcre2)
+ {
+     Mpse::PatternDescriptor desc;
+--- a/src/utils/stats.cc
++++ b/src/utils/stats.cc
+@@ -227,9 +227,9 @@ const PegInfo pc_names[] =
+     { CountType::SUM, "offload_fallback", "fast pattern offload search fallback attempts" },
+     { CountType::SUM, "offload_failures", "fast pattern offload search failures" },
+     { CountType::SUM, "offload_suspends", "fast pattern search suspends due to offload context chains" },
+-    { CountType::SUM, "pcre_match_limit", "total number of times pcre hit the match limit" },
+-    { CountType::SUM, "pcre_recursion_limit", "total number of times pcre hit the recursion limit" },
+-    { CountType::SUM, "pcre_error", "total number of times pcre returns error" },
++    { CountType::SUM, "pcre2_match_limit", "total number of times pcre2 hit the match limit" },
++    { CountType::SUM, "pcre2_recursion_limit", "total number of times pcre2 hit the recursion limit" },
++    { CountType::SUM, "pcre2_error", "total number of times pcre2 returns error" },
+     { CountType::SUM, "cont_creations", "total number of continuations created" },
+     { CountType::SUM, "cont_recalls", "total number of continuations recalled" },
+     { CountType::SUM, "cont_flows", "total number of flows using continuation" },
+--- a/src/utils/stats.h
++++ b/src/utils/stats.h
+@@ -60,9 +60,9 @@ struct PacketCount
+     PegCount offload_fallback;
+     PegCount offload_failures;
+     PegCount offload_suspends;
+-    PegCount pcre_match_limit;
+-    PegCount pcre_recursion_limit;
+-    PegCount pcre_error;
++    PegCount pcre2_match_limit;
++    PegCount pcre2_recursion_limit;
++    PegCount pcre2_error;
+     PegCount cont_creations;
+     PegCount cont_recalls;
+     PegCount cont_flows;
+--- a/src/utils/util.cc
++++ b/src/utils/util.cc
+@@ -30,7 +30,8 @@
+ #include <netdb.h>
+ #include <openssl/crypto.h>
+ #include <pcap.h>
+-#include <pcre.h>
++#define PCRE2_CODE_UNIT_WIDTH 8
++#include <pcre2.h>
+ #include <pwd.h>
+ #include <sys/file.h>
+ #include <sys/resource.h>
+@@ -105,10 +106,13 @@ void StoreSnortInfoStrings()
+ int DisplayBanner()
+ {
++    PCRE2_UCHAR pcre2_version[32];
+     const char* ljv = LUAJIT_VERSION;
+     while ( *ljv && !isdigit(*ljv) )
+         ++ljv;
++    pcre2_config(PCRE2_CONFIG_VERSION, pcre2_version);
++
+     LogMessage("\n");
+     LogMessage("   ,,_     -*> Snort++ <*-\n");
+ #ifdef BUILD
+@@ -125,7 +129,7 @@ int DisplayBanner()
+     LogMessage("           Using LuaJIT version %s\n", ljv);
+     LogMessage("           Using %s\n", OpenSSL_version(SSLEAY_VERSION));
+     LogMessage("           Using %s\n", pcap_lib_version());
+-    LogMessage("           Using PCRE version %s\n", pcre_version());
++    LogMessage("           Using PCRE version %s\n", pcre2_version);
+     LogMessage("           Using ZLIB version %s\n", zlib_version);
+ #ifdef HAVE_HYPERSCAN
+     LogMessage("           Using Hyperscan version %s\n", hs_version());
+--- a/tools/snort2lua/config_states/config_api.cc
++++ b/tools/snort2lua/config_states/config_api.cc
+@@ -105,13 +105,13 @@ extern const ConvertMap* min_ttl_map;
+ extern const ConvertMap* na_policy_mode_map;
+ extern const ConvertMap* new_ttl_map;
+ extern const ConvertMap* nolog_map;
+-extern const ConvertMap* nopcre_map;
++extern const ConvertMap* nopcre2_map;
+ extern const ConvertMap* no_promisc_map;
+ extern const ConvertMap* obfuscate_map;
+ extern const ConvertMap* order_map;
+ extern const ConvertMap* paf_max_map;
+-extern const ConvertMap* pcre_match_limit_map;
+-extern const ConvertMap* pcre_match_limit_recursion_map;
++extern const ConvertMap* pcre2_match_limit_map;
++extern const ConvertMap* pcre2_match_limit_recursion_map;
+ extern const ConvertMap* pkt_count_map;
+ extern const ConvertMap* ppm_map;
+ extern const ConvertMap* policy_id_map;
+@@ -224,13 +224,13 @@ const std::vector<const ConvertMap*> con
+     na_policy_mode_map,
+     new_ttl_map,
+     nolog_map,
+-    nopcre_map,
++    nopcre2_map,
+     no_promisc_map,
+     obfuscate_map,
+     order_map,
+     paf_max_map,
+-    pcre_match_limit_map,
+-    pcre_match_limit_recursion_map,
++    pcre2_match_limit_map,
++    pcre2_match_limit_recursion_map,
+     pkt_count_map,
+     ppm_map,
+     policy_id_map,
+--- a/tools/snort2lua/config_states/config_no_option.cc
++++ b/tools/snort2lua/config_states/config_no_option.cc
+@@ -250,18 +250,18 @@ static const ConvertMap enable_mpls_over
+ const ConvertMap* enable_mpls_overlapping_ip_map = &enable_mpls_overlapping_ip_api;
+ /*************************************************
+- ********************  nopcre  *******************
++ ********************  nopcre2  *******************
+  *************************************************/
+-static const std::string nopcre = "nopcre";
+-static const std::string pcre_enable = "pcre_enable";
+-static const ConvertMap nopcre_api =
++static const std::string nopcre2 = "nopcre2";
++static const std::string pcre2_enable = "pcre2_enable";
++static const ConvertMap nopcre2_api =
+ {
+-    nopcre,
+-    config_false_no_opt_ctor<& nopcre, & detection, & pcre_enable>
++    nopcre2,
++    config_false_no_opt_ctor<& nopcre2, & detection, & pcre2_enable>
+ };
+-const ConvertMap* nopcre_map = &nopcre_api;
++const ConvertMap* nopcre2_map = &nopcre2_api;
+ /*************************************************
+  ******************  obfuscate  ******************
+--- a/tools/snort2lua/config_states/config_one_int_option.cc
++++ b/tools/snort2lua/config_states/config_one_int_option.cc
+@@ -217,30 +217,30 @@ static const ConvertMap new_ttl_api =
+ const ConvertMap* new_ttl_map = &new_ttl_api;
+ /*************************************************
+- **************  pcre_match_limit   **************
++ **************  pcre2_match_limit   **************
+  *************************************************/
+-static const std::string pcre_match_limit = "pcre_match_limit";
+-static const ConvertMap pcre_match_limit_api =
++static const std::string pcre2_match_limit = "pcre2_match_limit";
++static const ConvertMap pcre2_match_limit_api =
+ {
+-    pcre_match_limit,
+-    config_int_ctor<& pcre_match_limit, & detection>,
++    pcre2_match_limit,
++    config_int_ctor<& pcre2_match_limit, & detection>,
+ };
+-const ConvertMap* pcre_match_limit_map = &pcre_match_limit_api;
++const ConvertMap* pcre2_match_limit_map = &pcre2_match_limit_api;
+ /**************************************************
+- **********  pcre_match_limit_recursion  **********
++ **********  pcre2_match_limit_recursion  **********
+  **************************************************/
+-static const std::string pcre_match_limit_recursion = "pcre_match_limit_recursion";
+-static const ConvertMap pcre_match_limit_recursion_api =
++static const std::string pcre2_match_limit_recursion = "pcre_match_limit_recursion";
++static const ConvertMap pcre2_match_limit_recursion_api =
+ {
+-    pcre_match_limit_recursion,
+-    config_int_ctor<& pcre_match_limit_recursion, & detection>,
++    pcre2_match_limit_recursion,
++    config_int_ctor<& pcre2_match_limit_recursion, & detection>,
+ };
+-const ConvertMap* pcre_match_limit_recursion_map = &pcre_match_limit_recursion_api;
++const ConvertMap* pcre2_match_limit_recursion_map = &pcre2_match_limit_recursion_api;
+ /*************************************************
+  ******************  pkt_count   *****************
+--- a/tools/snort2lua/rule_states/CMakeLists.txt
++++ b/tools/snort2lua/rule_states/CMakeLists.txt
+@@ -12,7 +12,7 @@ add_library( rule_states OBJECT
+     rule_http_encode.cc
+     rule_isdataat.cc
+     rule_metadata.cc
+-    rule_pcre.cc
++    rule_pcre2.cc
+     rule_react.cc
+     rule_reference.cc
+     rule_replace.cc
+--- a/tools/snort2lua/rule_states/rule_api.cc
++++ b/tools/snort2lua/rule_states/rule_api.cc
+@@ -75,7 +75,7 @@ extern const ConvertMap* modbus_data_map
+ extern const ConvertMap* modbus_func_map;
+ extern const ConvertMap* modbus_unit_map;
+ extern const ConvertMap* msg_map;
+-extern const ConvertMap* pcre_map;
++extern const ConvertMap* pcre2_map;
+ extern const ConvertMap* pkt_data_map;
+ extern const ConvertMap* priority_map;
+ extern const ConvertMap* protected_content_map;
+@@ -159,7 +159,7 @@ const std::vector<const ConvertMap*> rul
+     modbus_func_map,
+     modbus_unit_map,
+     msg_map,
+-    pcre_map,
++    pcre2_map,
+     pkt_data_map,
+     priority_map,
+     protected_content_map,
+--- a/tools/snort2lua/rule_states/rule_pcre.cc
++++ /dev/null
+@@ -1,159 +0,0 @@
+-//--------------------------------------------------------------------------
+-// Copyright (C) 2014-2024 Cisco and/or its affiliates. All rights reserved.
+-//
+-// This program is free software; you can redistribute it and/or modify it
+-// under the terms of the GNU General Public License Version 2 as published
+-// by the Free Software Foundation.  You may not use, modify or distribute
+-// this program under any other version of the GNU General Public License.
+-//
+-// This program is distributed in the hope that it will be useful, but
+-// WITHOUT ANY WARRANTY; without even the implied warranty of
+-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-// General Public License for more details.
+-//
+-// You should have received a copy of the GNU General Public License along
+-// with this program; if not, write to the Free Software Foundation, Inc.,
+-// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+-//--------------------------------------------------------------------------
+-// rule_pcre.cc author Josh Rosenbaum <jrosenba@cisco.com>
+-
+-#include <sstream>
+-#include <vector>
+-
+-#include "conversion_state.h"
+-#include "helpers/converter.h"
+-#include "helpers/s2l_util.h"
+-#include "rule_api.h"
+-
+-namespace rules
+-{
+-namespace
+-{
+-class Pcre : public ConversionState
+-{
+-public:
+-    Pcre(Converter& c) : ConversionState(c) { }
+-    bool convert(std::istringstream& data) override;
+-};
+-} // namespace
+-
+-bool Pcre::convert(std::istringstream& data_stream)
+-{
+-    bool sticky_buffer_set = false;
+-    std::string buffer = "pkt_data";
+-
+-    char delim = '/';
+-    std::string pcre_str = util::get_rule_option_args(data_stream);
+-    std::string pattern;
+-    std::string new_opts;
+-    std::string options;
+-
+-    if (pcre_str.front() == '!')
+-    {
+-        pattern += "!";
+-        pcre_str.erase(pcre_str.begin());
+-    }
+-
+-    if (pcre_str.front() != '"' || pcre_str.back() != '"')
+-    {
+-        rule_api.bad_rule(data_stream, "pattern must be enclosed in \"");
+-        return set_next_rule_state(data_stream);
+-    }
+-
+-    pcre_str.erase(pcre_str.begin());
+-    pattern += '"';
+-
+-    if (pcre_str.front() == 'm')
+-    {
+-        pcre_str.erase(pcre_str.begin());
+-        pattern += 'm';
+-        delim = pcre_str.front();
+-    }
+-
+-    const std::size_t pattern_end = pcre_str.rfind(delim);
+-    if ((pcre_str.front() != delim) || (pattern_end == 0))
+-    {
+-        std::string tmp = "Regex must be enclosed in delim '";
+-        tmp.append(delim, 1);
+-        rule_api.bad_rule(data_stream, tmp + "'");
+-        return set_next_rule_state(data_stream);
+-    }
+-
+-    pattern += pcre_str.substr(0, pattern_end + 1);
+-    options = pcre_str.substr(pattern_end + 1, std::string::npos);
+-    new_opts = "";
+-
+-    for (char c : options )
+-    {
+-        std::string sticky_buffer = std::string(); // empty string
+-
+-        switch (c)
+-        {
+-        case 'B': sticky_buffer = "raw_data"; break;
+-        case 'U': sticky_buffer = "http_uri"; break;
+-        case 'P': sticky_buffer = "pcre_P_option_body"; break;
+-        case 'H': sticky_buffer = "pcre_H_option_header"; break;
+-        case 'M': sticky_buffer = "http_method"; break;
+-        case 'C': sticky_buffer = "http_cookie"; break;
+-        case 'I': sticky_buffer = "http_raw_uri"; break;
+-        case 'D': sticky_buffer = "http_raw_header"; break;
+-        case 'K': sticky_buffer = "http_raw_cookie"; break;
+-        case 'S': sticky_buffer = "http_stat_code"; break;
+-        case 'Y': sticky_buffer = "http_stat_msg"; break;
+-        case 'i':
+-        case 's':
+-        case 'm':
+-        case 'x':
+-        case 'A':
+-        case 'E':
+-        case 'G':
+-        case 'O':
+-        case 'R':
+-        case '"':     // end of reg_ex
+-            new_opts += c;
+-            break;
+-        default:
+-        {
+-            std::string dlt_opt = "unknown option - '";
+-            dlt_opt.append(1, c);
+-            dlt_opt += "'";
+-            rule_api.bad_rule(data_stream, dlt_opt);
+-            break;
+-        }
+-        }
+-
+-        if (!sticky_buffer.empty())
+-        {
+-            buffer = sticky_buffer;
+-
+-            if (sticky_buffer_set)
+-                rule_api.bad_rule(data_stream,
+-                    "Two sticky buffers set for this regular expression!");
+-            else
+-                sticky_buffer_set = true;
+-        }
+-    }
+-
+-    rule_api.add_option("pcre", pattern + new_opts);
+-
+-    rule_api.set_curr_options_buffer(buffer);
+-
+-    return set_next_rule_state(data_stream);
+-}
+-
+-/**************************
+- *******  A P I ***********
+- **************************/
+-
+-static ConversionState* ctor(Converter& c)
+-{ return new Pcre(c); }
+-
+-static const ConvertMap pcre_api =
+-{
+-    "pcre",
+-    ctor,
+-};
+-
+-const ConvertMap* pcre_map = &pcre_api;
+-} // namespace rules
+-
+--- /dev/null
++++ b/tools/snort2lua/rule_states/rule_pcre2.cc
+@@ -0,0 +1,159 @@
++//--------------------------------------------------------------------------
++// Copyright (C) 2014-2024 Cisco and/or its affiliates. All rights reserved.
++//
++// This program is free software; you can redistribute it and/or modify it
++// under the terms of the GNU General Public License Version 2 as published
++// by the Free Software Foundation.  You may not use, modify or distribute
++// this program under any other version of the GNU General Public License.
++//
++// This program is distributed in the hope that it will be useful, but
++// WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++// General Public License for more details.
++//
++// You should have received a copy of the GNU General Public License along
++// with this program; if not, write to the Free Software Foundation, Inc.,
++// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
++//--------------------------------------------------------------------------
++// rule_pcre2.cc author Josh Rosenbaum <jrosenba@cisco.com>
++
++#include <sstream>
++#include <vector>
++
++#include "conversion_state.h"
++#include "helpers/converter.h"
++#include "helpers/s2l_util.h"
++#include "rule_api.h"
++
++namespace rules
++{
++namespace
++{
++class Pcre2 : public ConversionState
++{
++public:
++    Pcre2(Converter& c) : ConversionState(c) { }
++    bool convert(std::istringstream& data) override;
++};
++} // namespace
++
++bool Pcre2::convert(std::istringstream& data_stream)
++{
++    bool sticky_buffer_set = false;
++    std::string buffer = "pkt_data";
++
++    char delim = '/';
++    std::string pcre2_str = util::get_rule_option_args(data_stream);
++    std::string pattern;
++    std::string new_opts;
++    std::string options;
++
++    if (pcre2_str.front() == '!')
++    {
++        pattern += "!";
++        pcre2_str.erase(pcre2_str.begin());
++    }
++
++    if (pcre2_str.front() != '"' || pcre2_str.back() != '"')
++    {
++        rule_api.bad_rule(data_stream, "pattern must be enclosed in \"");
++        return set_next_rule_state(data_stream);
++    }
++
++    pcre2_str.erase(pcre2_str.begin());
++    pattern += '"';
++
++    if (pcre2_str.front() == 'm')
++    {
++        pcre2_str.erase(pcre2_str.begin());
++        pattern += 'm';
++        delim = pcre2_str.front();
++    }
++
++    const std::size_t pattern_end = pcre2_str.rfind(delim);
++    if ((pcre2_str.front() != delim) || (pattern_end == 0))
++    {
++        std::string tmp = "Regex must be enclosed in delim '";
++        tmp.append(delim, 1);
++        rule_api.bad_rule(data_stream, tmp + "'");
++        return set_next_rule_state(data_stream);
++    }
++
++    pattern += pcre2_str.substr(0, pattern_end + 1);
++    options = pcre2_str.substr(pattern_end + 1, std::string::npos);
++    new_opts = "";
++
++    for (char c : options )
++    {
++        std::string sticky_buffer = std::string(); // empty string
++
++        switch (c)
++        {
++        case 'B': sticky_buffer = "raw_data"; break;
++        case 'U': sticky_buffer = "http_uri"; break;
++        case 'P': sticky_buffer = "pcre_P_option_body"; break;
++        case 'H': sticky_buffer = "pcre_H_option_header"; break;
++        case 'M': sticky_buffer = "http_method"; break;
++        case 'C': sticky_buffer = "http_cookie"; break;
++        case 'I': sticky_buffer = "http_raw_uri"; break;
++        case 'D': sticky_buffer = "http_raw_header"; break;
++        case 'K': sticky_buffer = "http_raw_cookie"; break;
++        case 'S': sticky_buffer = "http_stat_code"; break;
++        case 'Y': sticky_buffer = "http_stat_msg"; break;
++        case 'i':
++        case 's':
++        case 'm':
++        case 'x':
++        case 'A':
++        case 'E':
++        case 'G':
++        case 'O':
++        case 'R':
++        case '"':     // end of reg_ex
++            new_opts += c;
++            break;
++        default:
++        {
++            std::string dlt_opt = "unknown option - '";
++            dlt_opt.append(1, c);
++            dlt_opt += "'";
++            rule_api.bad_rule(data_stream, dlt_opt);
++            break;
++        }
++        }
++
++        if (!sticky_buffer.empty())
++        {
++            buffer = sticky_buffer;
++
++            if (sticky_buffer_set)
++                rule_api.bad_rule(data_stream,
++                    "Two sticky buffers set for this regular expression!");
++            else
++                sticky_buffer_set = true;
++        }
++    }
++
++    rule_api.add_option("pcre", pattern + new_opts);
++
++    rule_api.set_curr_options_buffer(buffer);
++
++    return set_next_rule_state(data_stream);
++}
++
++/**************************
++ *******  A P I ***********
++ **************************/
++
++static ConversionState* ctor(Converter& c)
++{ return new Pcre2(c); }
++
++static const ConvertMap pcre2_api =
++{
++    "pcre2",
++    ctor,
++};
++
++const ConvertMap* pcre2_map = &pcre2_api;
++} // namespace rules
++
+--- a/tools/snort2lua/rule_states/rule_sd_pattern.cc
++++ b/tools/snort2lua/rule_states/rule_sd_pattern.cc
+@@ -41,7 +41,7 @@ private:
+ std::string SDPattern::convert_pattern(const std::string& pattern)
+ {
+-    const std::string unused_pcre_tokens("()[].+*^$|");
++    const std::string unused_pcre2_tokens("()[].+*^$|");
+     std::string s3_pattern;
+@@ -100,7 +100,7 @@ std::string SDPattern::convert_pattern(c
+             break;
+         default:
+-            if (unused_pcre_tokens.find(sym) != std::string::npos)
++            if (unused_pcre2_tokens.find(sym) != std::string::npos)
+                 s3_pattern.push_back('\\');
+             s3_pattern.push_back(sym);
+             break;
diff --git a/net/speedtest-go/Makefile b/net/speedtest-go/Makefile
new file mode 100644 (file)
index 0000000..9c53d9e
--- /dev/null
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: GPL-3.0-only
+#
+# Copyright (C) 2021 ImmortalWrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=speedtest-go
+PKG_VERSION:=1.6.11
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/showwin/speedtest-go/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=e09e1532bf3d1d78cad6546e8614e72e818fb14c3a7c11d609905c9ae7337930
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=TeleostNaCl Dai <teleostnacl@gmail.com>
+
+PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=no-mips16
+
+GO_PKG:=github.com/showwin/speedtest-go
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/speedtest-go
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Test Internet Speed
+  URL:=https://github.com/showwin/speedtest-go
+  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
+endef
+
+define Package/speedtest-go/description
+  Command Line Interface and pure Go API to
+  Test Internet Speed using speedtest.net
+endef
+
+$(eval $(call GoBinPackage,speedtest-go))
+$(eval $(call BuildPackage,speedtest-go))
index c71f947a32cf76185a047e6baa9d807a6ddb5ebc..6bf487d55635402b07e035fe52e9fa897eec3891 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=transmission
-PKG_VERSION:=4.0.4
+PKG_VERSION:=4.0.5
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/transmission/transmission/releases/download/$(PKG_VERSION)/
-PKG_HASH:=15f7b4318fdfbffb19aa8d9a6b0fd89348e6ef1e86baa21a0806ffd1893bd5a6
+PKG_HASH:=fd68ff114a479200043c30c7e69dba4c1932f7af36ca4c5b5d2edcb5866e6357
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0-or-later
index acd584b3a1dc76204770cb632b3ed522118400d8..9477f5cf3601b4c3bc263310d0ab85bb32baa8f0 100644 (file)
@@ -8,9 +8,9 @@ PKG_MAINTAINER:=Thibaut VARÈNE <hacks@slashdirt.org>
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/f00b4r0/uspot.git
-PKG_SOURCE_DATE:=2024-03-25
-PKG_SOURCE_VERSION:=094f0df88150ff2c351cfca4fabf76a7edcac79d
-PKG_MIRROR_HASH:=9fb3020bbd6960642bbc59b4448f7922aca3ff50647d1bc6dcf59b8049506587
+PKG_SOURCE_DATE:=2024-05-03
+PKG_SOURCE_VERSION:=92d3356d3fb3ae36199dbd494b5d9a9ae1a9db07
+PKG_MIRROR_HASH:=ae6bb9245945cf207d91b1aa36fb0db2b03333343714c1cacd046dd2c7ee3c79
 
 CMAKE_SOURCE_SUBDIR:=src
 
@@ -25,7 +25,7 @@ define Package/uspot
   EXTRA_DEPENDS:=ucode (>= 2023-11-07)
   DEPENDS:=+conntrack \
           +libblobmsg-json +liblucihttp-ucode +libradcli +libubox +libubus +libuci \
-          +spotfilter \
+          +uspotfilter \
           +ucode +ucode-mod-log +ucode-mod-math +ucode-mod-nl80211 +ucode-mod-rtnl +uhttpd-mod-ucode +ucode-mod-uloop
 
 endef
@@ -61,16 +61,14 @@ endef
 define Package/uspotfilter
   SECTION:=net
   CATEGORY:=Network
-  TITLE:=uspot implementation of spotfilter
-  PROVIDES:=spotfilter
-  CONFLICTS:=spotfilter
+  TITLE:=uspot firewall interface
   EXTRA_DEPENDS:=ucode (>= 2023-11-07)
   DEPENDS:=+conntrack +nftables-json +ucode +ucode-mod-rtnl +ucode-mod-uloop
   PKGARCH:=all
 endef
 
 define Package/uspotfilter/description
-  This package provides the nftables firewall interface to spotfilter.
+  This package provides the nftables firewall interface to uspot.
   It is compatible with firewall4.
 endef
 
@@ -91,7 +89,7 @@ endef
 
 define Package/uspotfilter/install
        $(INSTALL_DIR) $(1)/usr/share $(1)/etc/init.d
-       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/spotfilter $(1)/etc/init.d/spotfilter
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/uspotfilter $(1)/etc/init.d/uspotfilter
        $(CP) $(PKG_BUILD_DIR)/files/usr/share/uspotfilter $(1)/usr/share/
 endef
 
index 1694e721c7ac02edfb4d0a4a73a14959dc9d2da8..ba1df4e599b250f1b8741c294a93f82a3ea8d45c 100644 (file)
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=v2ray-core
-PKG_VERSION:=5.15.3
+PKG_VERSION:=5.16.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/v2fly/v2ray-core/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=32b325e54ee93fb3563c33d3c097592aa857370055d8ef1c50fd2387678843df
+PKG_HASH:=d548b4df2c8dfe41fc6ef4b1d15b4c03bdf281913cea668cf784b25bb7e09897
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=LICENSE
index c87cbc4a2281413d61c5bdf2c5802473e34261a0..f9122c3f91f1d7d665b0397c1286b8330ce2466d 100644 (file)
@@ -12,31 +12,31 @@ PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 
 include $(INCLUDE_DIR)/package.mk
 
-GEOIP_VER:=202404110039
+GEOIP_VER:=202404250042
 GEOIP_FILE:=geoip.dat.$(GEOIP_VER)
 define Download/geoip
   URL:=https://github.com/v2fly/geoip/releases/download/$(GEOIP_VER)/
   URL_FILE:=geoip.dat
   FILE:=$(GEOIP_FILE)
-  HASH:=d4a2e3666139dc98b76f1b0bc7db6b9dd9b35a5d2b0aecb5943e4211c1ebd026
+  HASH:=8ad42be541dfa7c2e548ba94b6dcb3fe431a105ba14d3907299316a036723760
 endef
 
-GEOSITE_VER:=20240410101316
+GEOSITE_VER:=20240426060244
 GEOSITE_FILE:=dlc.dat.$(GEOSITE_VER)
 define Download/geosite
   URL:=https://github.com/v2fly/domain-list-community/releases/download/$(GEOSITE_VER)/
   URL_FILE:=dlc.dat
   FILE:=$(GEOSITE_FILE)
-  HASH:=e74d3da9d4db57fba399f9093ffabbc6630a7cf10965ebcde07725a0f00e24d7
+  HASH:=7aa19bb7fa5f99d62d3db87b632334caa356fb9b901f85f7168c064370973646
 endef
 
-GEOSITE_IRAN_VER:=202404150255
+GEOSITE_IRAN_VER:=202404290026
 GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER)
 define Download/geosite-ir
   URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/
   URL_FILE:=iran.dat
   FILE:=$(GEOSITE_IRAN_FILE)
-  HASH:=7b29fd53c2a25c6d79eeb6f76cc4b0a0770fe00eee1ea4d7a4a9f77d49ca44ad
+  HASH:=dcffe111e31e34bceba3b28afc74eb82df222f440145f46673c79186d392e4f8
 endef
 
 define Package/v2ray-geodata/template
index e7fd73c6b0da9ec4cd49cbe7262b4be530a18fc0..0b5d4dcda1ecd5a6fb2a3caa5a860cf61e7dcbf9 100644 (file)
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xray-core
-PKG_VERSION:=1.8.10
+PKG_VERSION:=1.8.11
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=af5bb501b50e3abe6b54c8d8ea764d7f8b021c4d53540a468254a24f3334afc5
+PKG_HASH:=d99ee6008c508abbad6bbb242d058b22efb50fb35867d15447a2b4602ab4b283
 
 PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
 PKG_LICENSE:=MPL-2.0
diff --git a/utils/apk/Makefile b/utils/apk/Makefile
deleted file mode 100644 (file)
index 56e473c..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=apk
-PKG_VERSION:=2.14.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=apk-tools-v$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://gitlab.alpinelinux.org/alpine/apk-tools/-/archive/v$(PKG_VERSION)
-PKG_HASH:=4c6db13039280814a10a3b3d89b29837b59769c69214a1861997e088eac107a5
-PKG_BUILD_DIR:=$(BUILD_DIR)/apk-tools-v$(PKG_VERSION)
-
-PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
-PKG_LICENSE:=GPL-2.0-only
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/apk
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=apk package manager
-  DEPENDS:=+zlib +libopenssl @!arc
-  URL:=$(PKG_SOURCE_URL)
-endef
-
-define Package/alpine-keys
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Alpine apk public signing keys
-  DEPENDS:=apk
-endef
-
-define Package/alpine-repositories
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=Official Alpine repositories
-  DEPENDS:=apk
-endef
-
-MAKE_FLAGS += LUA=no
-
-define Package/apk/install
-       $(INSTALL_DIR) $(1)/lib/apk/db
-
-       $(INSTALL_DIR) $(1)/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/apk $(1)/bin/apk
-
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/* $(1)/usr/lib/
-
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apk.pc \
-               $(1)/usr/lib/pkgconfig/
-
-       $(INSTALL_DIR) $(1)/etc/apk/
-       echo $(ARCH) > $(1)/etc/apk/arch
-       touch $(1)/etc/apk/world
-endef
-
-define Package/alpine-keys/install
-       $(INSTALL_DIR) $(1)/etc/apk/keys
-       $(INSTALL_DATA) ./files/alpine-keys/* $(1)/etc/apk/keys
-endef
-
-define Package/alpine-repositories/install
-       $(INSTALL_DIR) $(1)/etc/apk/keys
-       $(INSTALL_DATA) ./files/alpine-repositories $(1)/etc/apk/repositories
-endef
-
-$(eval $(call BuildPackage,apk))
-$(eval $(call BuildPackage,alpine-keys))
-$(eval $(call BuildPackage,alpine-repositories))
diff --git a/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub b/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
deleted file mode 100644 (file)
index bb4bdc8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1yHJxQgsHQREclQu4Ohe
-qxTxd1tHcNnvnQTu/UrTky8wWvgXT+jpveroeWWnzmsYlDI93eLI2ORakxb3gA2O
-Q0Ry4ws8vhaxLQGC74uQR5+/yYrLuTKydFzuPaS1dK19qJPXB8GMdmFOijnXX4SA
-jixuHLe1WW7kZVtjL7nufvpXkWBGjsfrvskdNA/5MfxAeBbqPgaq0QMEfxMAn6/R
-L5kNepi/Vr4S39Xvf2DzWkTLEK8pcnjNkt9/aafhWqFVW7m3HCAII6h/qlQNQKSo
-GuH34Q8GsFG30izUENV9avY7hSLq7nggsvknlNBZtFUcmGoQrtx3FmyYsIC8/R+B
-ywIDAQAB
------END PUBLIC KEY-----
diff --git a/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub b/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
deleted file mode 100644 (file)
index 6cbfad7..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvNijDxJ8kloskKQpJdx+
-mTMVFFUGDoDCbulnhZMJoKNkSuZOzBoFC94omYPtxnIcBdWBGnrm6ncbKRlR+6oy
-DO0W7c44uHKCFGFqBhDasdI4RCYP+fcIX/lyMh6MLbOxqS22TwSLhCVjTyJeeH7K
-aA7vqk+QSsF4TGbYzQDDpg7+6aAcNzg6InNePaywA6hbT0JXbxnDWsB+2/LLSF2G
-mnhJlJrWB1WGjkz23ONIWk85W4S0XB/ewDefd4Ly/zyIciastA7Zqnh7p3Ody6Q0
-sS2MJzo7p3os1smGjUF158s6m/JbVh4DN6YIsxwl2OjDOz9R0OycfJSDaBVIGZzg
-cQIDAQAB
------END PUBLIC KEY-----
diff --git a/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub b/utils/apk/files/alpine-keys/alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
deleted file mode 100644 (file)
index 83f0658..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwlzMkl7b5PBdfMzGdCT0
-cGloRr5xGgVmsdq5EtJvFkFAiN8Ac9MCFy/vAFmS8/7ZaGOXoCDWbYVLTLOO2qtX
-yHRl+7fJVh2N6qrDDFPmdgCi8NaE+3rITWXGrrQ1spJ0B6HIzTDNEjRKnD4xyg4j
-g01FMcJTU6E+V2JBY45CKN9dWr1JDM/nei/Pf0byBJlMp/mSSfjodykmz4Oe13xB
-Ca1WTwgFykKYthoLGYrmo+LKIGpMoeEbY1kuUe04UiDe47l6Oggwnl+8XD1MeRWY
-sWgj8sF4dTcSfCMavK4zHRFFQbGp/YFJ/Ww6U9lA3Vq0wyEI6MCMQnoSMFwrbgZw
-wwIDAQAB
------END PUBLIC KEY-----
diff --git a/utils/apk/files/alpine-repositories b/utils/apk/files/alpine-repositories
deleted file mode 100644 (file)
index 5babbb2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-https://dl-cdn.alpinelinux.org/alpine/edge/main
-https://dl-cdn.alpinelinux.org/alpine/edge/community
-
diff --git a/utils/apk/patches/0001-remove-doc-generation.patch b/utils/apk/patches/0001-remove-doc-generation.patch
deleted file mode 100644 (file)
index dee05c5..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-From b05a93c48fdbb50f0c464310dc2ce45777d32ea2 Mon Sep 17 00:00:00 2001
-From: Paul Spooren <mail@aparcar.org>
-Date: Fri, 2 Oct 2020 14:08:52 -1000
-Subject: [PATCH] remove doc generation
-
-Signed-off-by: Paul Spooren <mail@aparcar.org>
----
- Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/Makefile
-+++ b/Makefile
-@@ -25,7 +25,7 @@ export DESTDIR SBINDIR LIBDIR CONFDIR MA
- ##
- # Top-level subdirs
--subdirs               := libfetch/ src/ doc/
-+subdirs               := libfetch/ src/
- ##
- # Include all rules and stuff
diff --git a/utils/apk/patches/010-openssl-deprecated.patch b/utils/apk/patches/010-openssl-deprecated.patch
deleted file mode 100644 (file)
index bdfafb6..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-From c4c8aa5ba0ec6bf4c6d74c4807b66edfbd91be7c Mon Sep 17 00:00:00 2001
-From: Rosen Penev <rosenp@gmail.com>
-Date: Mon, 11 Jan 2021 01:51:58 -0800
-Subject: [PATCH] fix compilation without deprecated OpenSSL APIs
-
-(De)initialization is deprecated under OpenSSL 1.0 and above.
-
-[TT: Some simplifications, and additional edits.]
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- libfetch/common.c | 12 ++++--------
- src/apk.c         | 26 +-------------------------
- src/apk_openssl.h | 27 +++++++++++++++++++++++++++
- 3 files changed, 32 insertions(+), 33 deletions(-)
-
---- a/libfetch/common.c
-+++ b/libfetch/common.c
-@@ -583,15 +583,11 @@ static int fetch_ssl_setup_client_certif
- int
- fetch_ssl(conn_t *conn, const struct url *URL, int verbose)
- {
--      /* Init the SSL library and context */
--      if (!SSL_library_init()){
--              fprintf(stderr, "SSL library init failed\n");
--              return (-1);
--      }
--
--      SSL_load_error_strings();
--
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L
-       conn->ssl_meth = SSLv23_client_method();
-+#else
-+      conn->ssl_meth = TLS_client_method();
-+#endif
-       conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth);
-       SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY);
---- a/src/apk.c
-+++ b/src/apk.c
-@@ -20,11 +20,6 @@
- #include <unistd.h>
- #include <sys/stat.h>
--#include <openssl/crypto.h>
--#ifndef OPENSSL_NO_ENGINE
--#include <openssl/engine.h>
--#endif
--
- #include <fetch.h>
- #include "apk_defines.h"
-@@ -423,25 +418,6 @@ static int parse_options(int argc, char
-       return 0;
- }
--static void fini_openssl(void)
--{
--      EVP_cleanup();
--#ifndef OPENSSL_NO_ENGINE
--      ENGINE_cleanup();
--#endif
--      CRYPTO_cleanup_all_ex_data();
--}
--
--static void init_openssl(void)
--{
--      atexit(fini_openssl);
--      OpenSSL_add_all_algorithms();
--#ifndef OPENSSL_NO_ENGINE
--      ENGINE_load_builtin_engines();
--      ENGINE_register_all_complete();
--#endif
--}
--
- static void on_sigwinch(int s)
- {
-       apk_reset_screen_width();
-@@ -534,7 +510,7 @@ int main(int argc, char **argv)
-               apk_force |= applet->forced_force;
-       }
--      init_openssl();
-+      apk_openssl_init();
-       setup_automatic_flags();
-       fetchTimeout = 60;
-       fetchRedirectMethod = fetch_redirect;
---- a/src/apk_openssl.h
-+++ b/src/apk_openssl.h
-@@ -11,7 +11,11 @@
- #define APK_SSL_COMPAT_H
- #include <openssl/opensslv.h>
-+#include <openssl/crypto.h>
- #include <openssl/evp.h>
-+#ifndef OPENSSL_NO_ENGINE
-+#include <openssl/engine.h>
-+#endif
- #if OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
-@@ -25,6 +29,29 @@ static inline void EVP_MD_CTX_free(EVP_M
-       return EVP_MD_CTX_destroy(mdctx);
- }
-+static inline void apk_openssl_cleanup(void)
-+{
-+      EVP_cleanup();
-+#ifndef OPENSSL_NO_ENGINE
-+      ENGINE_cleanup();
-+#endif
-+      CRYPTO_cleanup_all_ex_data();
-+}
-+
-+static inline void apk_openssl_init(void)
-+{
-+      atexit(apk_openssl_cleanup);
-+      OpenSSL_add_all_algorithms();
-+#ifndef OPENSSL_NO_ENGINE
-+      ENGINE_load_builtin_engines();
-+      ENGINE_register_all_complete();
-+#endif
-+}
-+
-+#else
-+
-+static inline void apk_openssl_init(void) {}
-+
- #endif
- #endif
diff --git a/utils/apk/test.sh b/utils/apk/test.sh
deleted file mode 100644 (file)
index 234cf5a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-case "$1" in
-    "apk")
-        apk --version | grep "${2#*v}"
-        ;;
-esac
diff --git a/utils/audit/Makefile b/utils/audit/Makefile
deleted file mode 100644 (file)
index b610b55..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=audit
-PKG_VERSION:=2.8.5
-PKG_RELEASE:=7
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://people.redhat.com/sgrubb/audit
-PKG_HASH:=0e5d4103646e00f8d1981e1cd2faea7a2ae28e854c31a803e907a383c5e2ecb7
-
-PKG_MAINTAINER:=Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-PKG_LICENSE:=GPL-2.0-or-later
-PKG_LICENSE_FILES:=COPYING
-PKG_CPE_ID:=cpe:/a:linux_audit_project:linux_audit
-
-PKG_FIXUP:=autoreconf
-PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-packages/$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_BUILD_FLAGS:=no-mips16
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/audit/Default
-  TITLE:=Audit Daemon
-  URL:=http://people.redhat.com/sgrubb/audit/
-endef
-
-define Package/audit/Default/description
-       The audit package contains the user space utilities for
-       storing and searching the audit records generated by
-       the audit subsystem in the Linux 2.6 kernel
-endef
-
-define Package/libauparse
-$(call Package/audit/Default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+= (parsing shared library)
-  DEPENDS:= +libaudit
-endef
-
-define Package/libauparse/description
-$(call Package/audit/Default/description)
- This package contains the audit parsing shared library.
-endef
-
-define Package/audit-utils
-$(call Package/audit/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE+= (utilities)
-  DEPENDS:= +libaudit +libauparse
-endef
-
-define Package/audit-utils/description
-$(call Package/audit/Default/description)
- This package contains the audit utilities.
-endef
-
-define Package/audit
-$(call Package/audit/Default)
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE+= (daemon)
-  DEPENDS:= +libaudit +libauparse +audit-utils +libev
-endef
-
-define Package/audit/description
-$(call Package/audit/Default/description)
- This package contains the audit daemon.
-endef
-
-CONFIGURE_VARS += \
-       LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
-       CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
-       CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
-       CC_FOR_BUILD="$(HOSTCC)"
-
-CONFIGURE_ARGS += \
-       --without-libcap-ng \
-       --disable-systemd \
-       --without-python \
-       --without-python3 \
-       --disable-zos-remote
-
-ifeq ($(ARCH),aarch64)
-CONFIGURE_ARGS += --with-aarch64
-else ifeq ($(ARCH),arm)
-CONFIGURE_ARGS += --with-arm
-endif
-
-# We can't use the default, as the default passes $(MAKE_ARGS), which
-# overrides CC, CFLAGS, etc. and defeats the *_FOR_BUILD definitions
-# passed in CONFIGURE_VARS
-define Build/Compile
-       $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH)
-endef
-
-define Build/Install
-       $(call Build/Install/Default,install)
-       $(SED) 's%^dispatcher *=.*%dispatcher = /usr/sbin/audispd%' $(PKG_INSTALL_DIR)/etc/audit/auditd.conf
-endef
-
-define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
-       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
-endef
-
-define Package/libauparse/install
-       $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libauparse.so.* $(1)/usr/lib/
-endef
-
-define Package/audit-utils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) \
-               $(PKG_INSTALL_DIR)/usr/sbin/{augenrules,audispd,audisp-remote,auditctl,autrace,aureport,ausearch} \
-               $(1)/usr/sbin/
-endef
-
-define Package/audit/install
-       $(INSTALL_DIR) $(1)/etc/audit
-       $(CP) $(PKG_INSTALL_DIR)/etc/audit/* $(1)/etc/audit/
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/audit.init $(1)/etc/init.d/audit
-       $(INSTALL_DIR) $(1)/usr/sbin
-       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/auditd $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,libauparse))
-$(eval $(call BuildPackage,audit-utils))
-$(eval $(call BuildPackage,audit))
diff --git a/utils/audit/files/audit.init b/utils/audit/files/audit.init
deleted file mode 100644 (file)
index 4a9f538..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (c) 2014 OpenWrt.org
-
-START=11
-
-USE_PROCD=1
-PROG=/usr/sbin/auditd
-
-start_service() {
-       mkdir -p /var/log/audit
-       procd_open_instance
-       procd_set_param command "$PROG" -n
-       procd_set_param respawn
-       procd_close_instance
-       test -f /etc/audit/rules.d/audit.rules && /usr/sbin/auditctl -R /etc/audit/rules.d/audit.rules
-}
diff --git a/utils/audit/patches/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch b/utils/audit/patches/0001-Add-substitue-functions-for-strndupa-rawmemchr.patch
deleted file mode 100644 (file)
index 2fa5c59..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-From c39a071e7c021f6ff3554aca2758e97b47a9777c Mon Sep 17 00:00:00 2001
-From: Steve Grubb <sgrubb@redhat.com>
-Date: Tue, 26 Feb 2019 18:33:33 -0500
-Subject: [PATCH] Add substitue functions for strndupa & rawmemchr
-
-(cherry picked from commit d579a08bb1cde71f939c13ac6b2261052ae9f77e)
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
----
- auparse/auparse.c   | 12 +++++++++++-
- auparse/interpret.c |  9 ++++++++-
- configure.ac        | 14 +++++++++++++-
- src/ausearch-lol.c  | 12 +++++++++++-
- 4 files changed, 43 insertions(+), 4 deletions(-)
-
---- a/auparse/auparse.c
-+++ b/auparse/auparse.c
-@@ -1,5 +1,5 @@
- /* auparse.c --
-- * Copyright 2006-08,2012-17 Red Hat Inc., Durham, North Carolina.
-+ * Copyright 2006-08,2012-19 Red Hat Inc., Durham, North Carolina.
-  * All Rights Reserved.
-  *
-  * This library is free software; you can redistribute it and/or
-@@ -1118,6 +1118,16 @@ static int str2event(char *s, au_event_t
-       return 0;
- }
-+#ifndef HAVE_STRNDUPA
-+static inline char *strndupa(const char *old, size_t n)
-+{
-+      size_t len = strnlen(old, n);
-+      char *tmp = alloca(len + 1);
-+      tmp[len] = 0;
-+      return memcpy(tmp, old, len);
-+}
-+#endif
-+
- /* Returns 0 on success and 1 on error */
- static int extract_timestamp(const char *b, au_event_t *e)
- {
---- a/auparse/interpret.c
-+++ b/auparse/interpret.c
-@@ -853,6 +853,13 @@ err_out:
-               return print_escaped(id->val);
- }
-+// rawmemchr is faster. Let's use it if we have it.
-+#ifdef HAVE_RAWMEMCHR
-+#define STRCHR rawmemchr
-+#else
-+#define STRCHR strchr
-+#endif
-+
- static const char *print_proctitle(const char *val)
- {
-       char *out = (char *)print_escaped(val);
-@@ -863,7 +870,7 @@ static const char *print_proctitle(const
-               // Proctitle has arguments separated by NUL bytes
-               // We need to write over the NUL bytes with a space
-               // so that we can see the arguments
--              while ((ptr  = rawmemchr(ptr, '\0'))) {
-+              while ((ptr  = STRCHR(ptr, '\0'))) {
-                       if (ptr >= end)
-                               break;
-                       *ptr = ' ';
---- a/configure.ac
-+++ b/configure.ac
-@@ -1,7 +1,7 @@
- dnl
- define([AC_INIT_NOTICE],
- [### Generated automatically using autoconf version] AC_ACVERSION [
--### Copyright 2005-18 Steve Grubb <sgrubb@redhat.com>
-+### Copyright 2005-19 Steve Grubb <sgrubb@redhat.com>
- ###
- ### Permission is hereby granted, free of charge, to any person obtaining a
- ### copy of this software and associated documentation files (the "Software"),
-@@ -72,6 +72,18 @@ dnl; posix_fallocate is used in audisp-r
- AC_CHECK_FUNCS([posix_fallocate])
- dnl; signalfd is needed for libev
- AC_CHECK_FUNC([signalfd], [], [ AC_MSG_ERROR([The signalfd system call is necessary for auditd]) ])
-+dnl; check if rawmemchr is available
-+AC_CHECK_FUNCS([rawmemchr])
-+dnl; check if strndupa is available
-+AC_LINK_IFELSE(
-+  [AC_LANG_SOURCE(
-+    [[
-+      #define _GNU_SOURCE
-+      #include <string.h>
-+      int main() { (void) strndupa("test", 10); return 0; }]])],
-+ [AC_DEFINE(HAVE_STRNDUPA, 1, [Let us know if we have it or not])],
-+ []
-+)
- ALLWARNS=""
- ALLDEBUG="-g"
---- a/src/ausearch-lol.c
-+++ b/src/ausearch-lol.c
-@@ -1,6 +1,6 @@
- /*
- * ausearch-lol.c - linked list of linked lists library
--* Copyright (c) 2008,2010,2014,2016 Red Hat Inc., Durham, North Carolina.
-+* Copyright (c) 2008,2010,2014,2016,2019 Red Hat Inc., Durham, North Carolina.
- * All Rights Reserved. 
- *
- * This software may be freely redistributed and/or modified under the
-@@ -152,6 +152,16 @@ static int compare_event_time(event *e1,
-       return 0;
- }
-+#ifndef HAVE_STRNDUPA
-+static inline char *strndupa(const char *old, size_t n)
-+{
-+      size_t len = strnlen(old, n);
-+      char *tmp = alloca(len + 1);
-+      tmp[len] = 0;
-+      return memcpy(tmp, old, len);
-+}
-+#endif
-+
- /*
-  * This function will look at the line and pick out pieces of it.
-  */
diff --git a/utils/audit/patches/0002-fix-gcc-10.patch b/utils/audit/patches/0002-fix-gcc-10.patch
deleted file mode 100644 (file)
index 19c0c4c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-From 017e6c6ab95df55f34e339d2139def83e5dada1f Mon Sep 17 00:00:00 2001
-From: Steve Grubb <sgrubb@redhat.com>
-Date: Fri, 10 Jan 2020 21:13:50 -0500
-Subject: [PATCH 01/30] Header definitions need to be external when building
- with -fno-common (which is default in GCC 10) - Tony Jones
-
----
- src/ausearch-common.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/src/ausearch-common.h
-+++ b/src/ausearch-common.h
-@@ -50,7 +50,7 @@ extern pid_t event_pid;
- extern int event_exact_match;
- extern uid_t event_uid, event_euid, event_loginuid;
- extern const char *event_tuid, *event_teuid, *event_tauid;
--slist *event_node_list;
-+extern slist *event_node_list;
- extern const char *event_comm;
- extern const char *event_filename;
- extern const char *event_hostname;
diff --git a/utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch b/utils/audit/patches/0003-Make-IPX-packet-interpretation-dependent-on-th.patch
deleted file mode 100644 (file)
index f4b4492..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-From 6b09724c69d91668418ddb3af00da6db6755208c Mon Sep 17 00:00:00 2001
-From: Steve Grubb <sgrubb@redhat.com>
-Date: Thu, 2 Sep 2021 15:01:12 -0400
-Subject: [PATCH] Make IPX packet interpretation dependent on the ipx header
- file existing
-
---- a/auparse/interpret.c
-+++ b/auparse/interpret.c
-@@ -44,8 +44,10 @@
- #include <linux/ax25.h>
- #include <linux/atm.h>
- #include <linux/x25.h>
--#include <linux/if.h>   // FIXME: remove when ipx.h is fixed
--#include <linux/ipx.h>
-+#ifdef HAVE_IPX_HEADERS
-+  #include <linux/if.h>   // FIXME: remove when ipx.h is fixed
-+  #include <linux/ipx.h>
-+#endif
- #include <linux/capability.h>
- #include <sys/personality.h>
- #include <sys/prctl.h>
-@@ -1158,6 +1160,7 @@ static const char *print_sockaddr(const
-                                             x->sax25_call.ax25_call[6]);
-                         }
-                         break;
-+#ifdef HAVE_IPX_HEADERS
-                 case AF_IPX:
-                         {
-                                 const struct sockaddr_ipx *ip =
-@@ -1167,6 +1170,7 @@ static const char *print_sockaddr(const
-                                       str, ip->sipx_port, ip->sipx_network);
-                         }
-                         break;
-+#endif
-                 case AF_ATMPVC:
-                         {
-                                 const struct sockaddr_atmpvc* at =
---- a/configure.ac
-+++ b/configure.ac
-@@ -414,6 +414,12 @@ if test x"$LIBWRAP_LIBS" != "x"; then
-       AC_DEFINE_UNQUOTED(HAVE_LIBWRAP, [], Define if tcp_wrappers support is enabled )
- fi
-+# linux/ipx.h - deprecated in 2018
-+AC_CHECK_HEADER(linux/ipx.h, ipx_headers=yes, ipx_headers=no)
-+if test $ipx_headers = yes ; then
-+      AC_DEFINE(HAVE_IPX_HEADERS,1,[IPX packet interpretation])
-+fi
-+
- # See if we want to support lower capabilities for plugins
- LIBCAP_NG_PATH
index 6c94545f16a2a05c7497efc1033c894b83aa91a3..48f074d39e13bfd835560af3baadabf062f48544 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=containerd
-PKG_VERSION:=1.7.13
+PKG_VERSION:=1.7.15
 PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -9,7 +9,7 @@ PKG_CPE_ID:=cpe:/a:linuxfoundation:containerd
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/containerd/containerd/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=ae2b914bff0ddbb9b29d5fc689a51e1ce89ea4edfc4df9ae10517c6f5d2d5aaf
+PKG_HASH:=2dc491434b182334b51350f810ed68ace3624c8a2d6e1eac490d93c653498a33
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
@@ -36,8 +36,11 @@ define Package/containerd/description
 An industry-standard container runtime with an emphasis on simplicity, robustness and portability
 endef
 
-GO_PKG_BUILD_VARS += GO111MODULE=auto
-GO_PKG_INSTALL_ALL:=1
+GO_PKG_INSTALL_EXTRA:=\
+       vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb \
+       Makefile \
+       vendor/modules.txt
+
 MAKE_PATH:=$(GO_PKG_WORK_DIR_NAME)/build/src/$(GO_PKG)
 MAKE_VARS += $(GO_PKG_VARS)
 MAKE_FLAGS += \
index 621a6134a2e21c4ee281774b8cff75699b943158..d14dc8fe89d1159faab59b9fde5be204f634e427 100644 (file)
@@ -1,14 +1,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=compose
-PKG_VERSION:=2.26.1
-PKG_RELEASE:=2
+PKG_VERSION:=2.27.0
+PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/docker/compose/tar.gz/v${PKG_VERSION}?
-PKG_HASH:=081ad40241f8e144cad088a65e6fd0ec588e3d36931e5baabb3dc5ab068ceb60
+PKG_HASH:=29b2232d1609dff03db74188a7944c85ba8b612f47a7e39938a43db8fb7d7067
 
 PKG_MAINTAINER:=Javier Marcet <javier@marcet.info>
 
index cd1a398631f7b4465b72b39e3334d8f1205e4aa6..868954b5ae4c36ef6b88c0021ec6e2327269733e 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=docker
-PKG_VERSION:=25.0.3
+PKG_VERSION:=26.1.0
 PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_GIT_URL:=github.com/docker/cli
 PKG_GIT_REF:=v$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
-PKG_HASH:=04ad0cea992a65db20cb1b0dbf6d1ce32c705ce879de51b22095fe8d28030815
-PKG_GIT_SHORT_COMMIT:=4debf41 # SHA1 used within the docker executables
+PKG_HASH:=742d8297c8222d4c6e1a5840d1604e215c94cbbee1c275a12fb98abd572083de
+PKG_GIT_SHORT_COMMIT:=9714adc # SHA1 used within the docker executables
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
@@ -36,11 +36,13 @@ define Package/docker/description
 The CLI used in the Docker CE and Docker EE products.
 endef
 
-GO_PKG_BUILD_VARS += GO111MODULE=auto
+GO_PKG_INSTALL_EXTRA:=\
+       cli/compose/schema/data \
+       vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb
+
 TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
 TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lc -lgcc_eh)
-GO_PKG_INSTALL_EXTRA:=cli/compose/schema/data
 
 define Build/Prepare
        $(Build/Prepare/Default)
index a41b2195e7886e29adc9638360196af05a473053..bb36e8bbc882e65cbb0ed984aebcbb0f882cf4df 100644 (file)
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dockerd
-PKG_VERSION:=25.0.3
+PKG_VERSION:=26.1.0
 PKG_RELEASE:=1
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
@@ -10,8 +10,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_GIT_URL:=github.com/moby/moby
 PKG_GIT_REF:=v$(PKG_VERSION)
 PKG_SOURCE_URL:=https://codeload.$(PKG_GIT_URL)/tar.gz/$(PKG_GIT_REF)?
-PKG_HASH:=4cdb516f5d6f5caf8b3bcf93c2962277ba727cfd2d1620176a3bb0cf153b3590
-PKG_GIT_SHORT_COMMIT:=f417435 # SHA1 used within the docker executables
+PKG_HASH:=7a59781fe9e1d74d1ada53624f0bde909de503964b729dc9dfb21e56c3a9b8ae
+PKG_GIT_SHORT_COMMIT:=c8af8eb # SHA1 used within the docker executables
 
 PKG_MAINTAINER:=Gerard Ryan <G.M0N3Y.2503@gmail.com>
 
@@ -60,7 +60,6 @@ define Package/dockerd/description
 The Docker CE Engine.
 endef
 
-GO_PKG_BUILD_VARS += GO111MODULE=auto
 TAR_OPTIONS:=--strip-components 1 $(TAR_OPTIONS)
 TAR_CMD=$(HOST_TAR) -C $(1) $(TAR_OPTIONS)
 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lc -lgcc_eh)
index e75add75ed038b58edcf159c65f33cc3dcd3a28e..cced9a846e664cbf8647542e5647a8ac38def8cb 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=flashrom
 PKG_VERSION:=1.3.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://download.flashrom.org/releases
index 5ee91a8f063dc86184eec21d6669b8a88c104db7..454e954436d0a65a2eede0571f52b47141656662 100644 (file)
@@ -96,9 +96,8 @@ else
   $(eval $(call Programmer,satamv,$(FLASHROM_PCI)))
 endif
 
-comma := ,
 MESON_ARGS += \
        -Ddefault_programmer_name=$(DEFAULT_PROGRAMMER_NAME) \
-       -Dprogrammer=$(subst $() $(),$(comma),$(PROGRAMMER_ARGS)) \
+       -Dprogrammer=$(subst $(space),$(comma),$(strip $(PROGRAMMER_ARGS))) \
        -Dwerror=false \
        -Dtests=disabled
diff --git a/utils/ideviceinstaller/Makefile b/utils/ideviceinstaller/Makefile
new file mode 100644 (file)
index 0000000..ff79cc4
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ideviceinstaller
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/ideviceinstaller.git
+PKG_SOURCE_DATE:=2024-01-15
+PKG_SOURCE_VERSION:=22872c3571b8d2646a9fbb74ec1d7e186941053d
+PKG_MIRROR_HASH:=479d8694f36cf6aaa86dd4738d6fca29681b86957e516c317a3a58628f914fda
+
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_LICENSE:=GPL-2.0-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:libimobiledevice:ideviceinstaller
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ideviceinstaller
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=libimobiledevice
+  TITLE:=Manage apps and app archives on iOS devices
+  URL:=https://www.libimobiledevice.org/
+  DEPENDS:=+libimobiledevice +libzip
+endef
+
+define Package/ideviceinstaller/description
+  A command-line application to manage apps and app archives on iOS devices.
+  Allows interacting with the app installation service of an iOS device.
+  - Status: Install, upgrade, uninstall, and enumerate apps
+  - Browse: Allows to retrieve a list of installed apps with filter options
+  - Install: Supports app package, carrier bundle and developer .app directory
+  - Format: Allows command output in plist, XML, or JSON format
+  - Compatibility: Supports latest device firmware releases
+endef
+
+CONFIGURE_ARGS += \
+       PACKAGE_VERSION=$(PKG_VERSION)
+
+define Package/ideviceinstaller/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ideviceinstaller $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ideviceinstaller))
index 6138da0f31711c069d056b71cc17836ff7c032a1..afd184975685fc7ab2650f00a72cfd9196748ad9 100644 (file)
@@ -6,17 +6,19 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=idevicerestore
-PKG_VERSION:=1.0.0
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=32712e86315397fd2e8999e77a2d2f790c67f6b4aa50d4d1c64cb2c4609836f7
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/idevicerestore.git
+PKG_SOURCE_DATE:=2024-04-04
+PKG_SOURCE_VERSION:=6d40d0ab626eb0ffee4f005b7fdc915bc561deb9
+PKG_MIRROR_HASH:=96906ce58e21914961018adf160459386d322cdec4f66f311555c87bb4b9cbfa
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
@@ -37,6 +39,9 @@ define Package/idevicerestore/description
   during restore of a firmware to a device.
 endef
 
+CONFIGURE_ARGS += \
+       PACKAGE_VERSION=$(PKG_VERSION)
+
 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lpthread)
 
 define Package/idevicerestore/install
diff --git a/utils/ifuse/Makefile b/utils/ifuse/Makefile
new file mode 100644 (file)
index 0000000..75d8319
--- /dev/null
@@ -0,0 +1,55 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ifuse
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/ifuse.git
+PKG_SOURCE_DATE:=2023-01-06
+PKG_SOURCE_VERSION:=814a0e38050850937debd697fcfe6eca3de1b66f
+PKG_MIRROR_HASH:=702eb5f850eca4bb7e5ec82f25026d0a2240041e7c0f614322608ed238ebb789
+
+PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
+PKG_LICENSE:=LGPL-2.1-or-later
+PKG_LICENSE_FILES:=COPYING
+PKG_CPE_ID:=cpe:/a:libimobiledevice:ifuse
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ifuse
+  SECTION:=utils
+  CATEGORY:=Utilities
+  SUBMENU:=libimobiledevice
+  TITLE:=Fuse filesystem access to iOS devices
+  URL:=https://www.libimobiledevice.org/
+  DEPENDS:=+fuse-utils +libimobiledevice
+endef
+
+define Package/ifuse/description
+  A fuse filesystem implementation to access the contents of iOS devices.
+  This project allows mounting various directories of an iOS device locally
+  using the FUSE file system interface.
+  - Media: Mount media directory of an iOS device locally
+  - Apps: Mount sandbox container or document directory of an app
+  - Jailbreak: Mount root filesystem on jailbroken devices (requires AFC2 service)
+  - Browse: Allows to retrieve a list of installed file-sharing enabled apps
+endef
+
+CONFIGURE_ARGS += \
+       PACKAGE_VERSION=$(PKG_VERSION)
+
+define Package/ifuse/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ifuse $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ifuse))
index 064a25e3d57eaa807507ba86ca31742f679878d7..e54a722425c8fc4cce740bb6e44abfa0feef112c 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nano
-PKG_VERSION:=7.2
-PKG_RELEASE:=4
+PKG_VERSION:=8.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/nano
-PKG_HASH:=86f3442768bd2873cec693f83cdf80b4b444ad3cc14760b74361474fc87a4526
+PKG_HASH:=c17f43fc0e37336b33ee50a209c701d5beb808adc2d9f089ca831b40539c9ac4
 
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
diff --git a/utils/nano/patches/0001-post80-fix-minibar-do-not-falsely-report.patch b/utils/nano/patches/0001-post80-fix-minibar-do-not-falsely-report.patch
new file mode 100644 (file)
index 0000000..d85720d
--- /dev/null
@@ -0,0 +1,27 @@
+From e9c7dfa99221935ffa38b5b9dbf294933e0aa7c0 Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <bensberg@telfort.nl>
+Date: Fri, 3 May 2024 12:12:09 +0200
+Subject: minibar: do not falsely report that a new, empty file is in Mac
+ format
+
+The 'openfile->fmt' element gets initialized to 'UNSPECIFIED',
+so the code has to take that possibility into account.
+
+This fixes https://savannah.gnu.org/bugs/?65676.
+
+Bug existed since version 8.0, commit fe4f74f6.
+---
+ src/winio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/winio.c
++++ b/src/winio.c
+@@ -2213,7 +2213,7 @@ void minibar(void)
+               size_t count = openfile->filebot->lineno - (openfile->filebot->data[0] == '\0');
+               number_of_lines = nmalloc(49);
+-              if (openfile->fmt == NIX_FILE)
++              if (openfile->fmt == NIX_FILE || openfile->fmt == UNSPECIFIED)
+                       sprintf(number_of_lines, P_(" (%zu line)", " (%zu lines)", count), count);
+               else
+                       sprintf(number_of_lines, P_(" (%zu line, %s)", " (%zu lines, %s)", count),
index 5281742c1e2f4a7d74e96b695dd80951b6c0ad96..ffaff9c2045207154cd49eb8065e572867e437c3 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ncdu
-PKG_VERSION:=1.19
+PKG_VERSION:=1.20
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dev.yorhel.nl/download
-PKG_HASH:=30363019180cde0752c7fb006c12e154920412f4e1b5dc3090654698496bb17d
+PKG_HASH:=5fe2bb841abe72374bb242dbb93293c4ae053078432d896a7481b2ff10be9572
 
 PKG_MAINTAINER:=Charles E. Lehner <cel@celehner.com>
 PKG_LICENSE:=MIT
index 29e4fd5435ce21c5a96ac2555f2cb45b1b5e1382..aa6aed30f22e3a24e9b32317c38d8f3359b3334b 100644 (file)
@@ -9,10 +9,10 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qemu
-PKG_VERSION:=8.2.2
+PKG_VERSION:=9.0.0
 PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=847346c1b82c1a54b2c38f6edbd85549edeb17430b7d4d3da12620e2962bc4f3
+PKG_HASH:=32708ac66c30d8c892633ea968c771c1c76d597d70ddead21a0d22ccf386da69
 PKG_SOURCE_URL:=https://download.qemu.org/
 PKG_LICENSE:=GPL-2.0-only
 PKG_LICENSE_FILES:=LICENSE tcg/LICENSE
index 1843df22a21619311c5d0371fd2ba6dd483780da..ccd2fc6d0f6ef34c9ede857d2d1eb99d5eb59b0a 100644 (file)
@@ -11,7 +11,7 @@ OpenWrt base build system decide flavor of fortify_source to use
 
 --- a/configure
 +++ b/configure
-@@ -757,6 +757,8 @@ for opt do
+@@ -758,6 +758,8 @@ for opt do
    ;;
    --gdb=*) gdb_bin="$optarg"
    ;;
index 53c82f9901ebaa6a887cb7d4ee76abcbda5e66ce..94061b8bf281d28f34df693f99e23fe03a84b764 100644 (file)
@@ -13,7 +13,7 @@ https://gitlab.alpinelinux.org/alpine/aports/commit/76b81b486480fd9c3294cd420bcf
 
 --- a/qga/commands-posix.c
 +++ b/qga/commands-posix.c
-@@ -76,6 +76,7 @@ static void ga_wait_child(pid_t pid, int
+@@ -79,6 +79,7 @@ static void ga_wait_child(pid_t pid, int
  void qmp_guest_shutdown(const char *mode, Error **errp)
  {
      const char *shutdown_flag;
@@ -21,7 +21,7 @@ https://gitlab.alpinelinux.org/alpine/aports/commit/76b81b486480fd9c3294cd420bcf
      Error *local_err = NULL;
      pid_t pid;
      int status;
-@@ -97,10 +98,13 @@ void qmp_guest_shutdown(const char *mode
+@@ -100,10 +101,13 @@ void qmp_guest_shutdown(const char *mode
      slog("guest-shutdown called, mode: %s", mode);
      if (!mode || strcmp(mode, "powerdown") == 0) {
          shutdown_flag = powerdown_flag;
@@ -35,7 +35,7 @@ https://gitlab.alpinelinux.org/alpine/aports/commit/76b81b486480fd9c3294cd420bcf
      } else {
          error_setg(errp,
                     "mode is invalid (valid values are: halt|powerdown|reboot");
-@@ -125,6 +129,7 @@ void qmp_guest_shutdown(const char *mode
+@@ -128,6 +132,7 @@ void qmp_guest_shutdown(const char *mode
          execl("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
                 "hypervisor initiated shutdown", (char *)NULL);
  #endif
index 460f0fab2abda0f950ce4c5cdd7164ebdf048be6..92f8c5ac8b815d223347df606dc48bd876f0c826 100644 (file)
@@ -1,6 +1,6 @@
 --- a/meson.build
 +++ b/meson.build
-@@ -3513,10 +3513,6 @@ subdir('common-user')
+@@ -3576,10 +3576,6 @@ subdir('common-user')
  subdir('bsd-user')
  subdir('linux-user')
  
@@ -11,7 +11,7 @@
  # accel modules
  tcg_real_module_ss = ss.source_set()
  tcg_real_module_ss.add_all(when: 'CONFIG_TCG_MODULAR', if_true: tcg_module_ss)
-@@ -4012,10 +4008,6 @@ subdir('scripts')
+@@ -4094,10 +4090,6 @@ subdir('scripts')
  subdir('tools')
  subdir('pc-bios')
  subdir('docs')
index 3ace47d5773c0cc2c11192710a9a0b71cfb12bfb..4ce8296802246bd3d7ad1df0875ff00b3ed10bae 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rtty
-PKG_VERSION:=8.1.1
+PKG_VERSION:=8.1.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL=https://github.com/zhaojh329/rtty/releases/download/v$(PKG_VERSION)
-PKG_HASH:=077dd5d2939db2c09419aaba56cb99bf3cdd14ec4e88e99c7ff9e50df8a3d7f1
+PKG_HASH:=522b0fc5e032c3b84ac707abce8ac4ff5609900011f8f300ce4f4246abac0acc
 
 PKG_MAINTAINER:=Jianhui Zhao <zhaojh329@gmail.com>
 PKG_LICENSE:=MIT
diff --git a/utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch b/utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch
deleted file mode 100644 (file)
index 8493557..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke@hauke-m.de>
-Date: Sun, 14 Apr 2024 16:06:15 +0200
-Subject: Support POSIX basename() from musl libc
-
-Musl libc 1.2.5 removed the definition of the basename() function from
-string.h and only provides it in libgen.h as the POSIX standard
-defines it.
-
-This change fixes compilation with musl libc 1.2.5.
-````
-build_dir/target-mips_24kc_musl/rtty-mbedtls/rtty-8.1.1/src/file.c:156:24: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration]
-  156 |     const char *name = basename(path);
-      |                        ^~~~~~~~
-````
-
-basename() modifies the input string, copy it first with strdup(), If
-strdup() returns NULL the code will handle it.
-
-Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
----
- src/file.c    | 8 +++++++-
- src/filectl.c | 6 +++++-
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
---- a/src/file.c
-+++ b/src/file.c
-@@ -29,6 +29,7 @@
- #include <unistd.h>
- #include <mntent.h>
- #include <inttypes.h>
-+#include <libgen.h>
- #include <sys/statvfs.h>
- #include <linux/limits.h>
- #include <sys/sysinfo.h>
-@@ -153,13 +154,17 @@ static int start_upload_file(struct file
- {
-     struct tty *tty = container_of(ctx, struct tty, file);
-     struct rtty *rtty = tty->rtty;
--    const char *name = basename(path);
-+    const char *name;
-     struct stat st;
-     int fd;
-+    char *dirc;
-+    dirc = strdup(path);
-+    name = basename(dirc);
-     fd = open(path, O_RDONLY);
-     if (fd < 0) {
-         log_err("open '%s' fail: %s\n", path, strerror(errno));
-+        free(dirc);
-         return -1;
-     }
-@@ -177,6 +182,7 @@ static int start_upload_file(struct file
-     ctx->remain_size = st.st_size;
-     log_info("upload file: %s, size: %" PRIu64 "\n", path, (uint64_t)st.st_size);
-+    free(dirc);
-     return 0;
- }
---- a/src/filectl.c
-+++ b/src/filectl.c
-@@ -30,6 +30,7 @@
- #include <errno.h>
- #include <stdio.h>
- #include <fcntl.h>
-+#include <libgen.h>
- #include "utils.h"
- #include "file.h"
-@@ -75,6 +76,7 @@ static void handle_file_control_msg(int
- {
-     struct file_control_msg msg;
-     struct buffer b = {};
-+    char *dirc;
-     while (true) {
-         if (buffer_put_fd(&b, fd, -1, NULL) < 0)
-@@ -90,7 +92,9 @@ static void handle_file_control_msg(int
-             if (sfd > -1) {
-                 close(sfd);
-                 gettimeofday(&start_time, NULL);
--                printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(path));
-+                dirc = strdup(path);
-+                printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(dirc));
-+                free(dirc);
-                 if (total_size == 0) {
-                     printf("  100%%    0 B     0s\n");
index e584d9106c683008742e3ff9517c4f36ed166249..16fc543ecdaecc40d19d8538da508e4aa44a9121 100644 (file)
@@ -8,18 +8,20 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=usbmuxd
-PKG_VERSION:=1.1.1
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://www.libimobiledevice.org/downloads
-PKG_HASH:=c0ec9700172bf635ccb5bed98daae607d2925c2bc3597f25706ecd9dfbfd2d9e
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/libimobiledevice/usbmuxd.git
+PKG_SOURCE_DATE:=2023-10-11
+PKG_SOURCE_VERSION:=360619c5f721f93f0b9d8af1a2df0b926fbcf281
+PKG_MIRROR_HASH:=e674ee39abbbae6dea7364be8b8287db2e333d033c226d4b2ed95f2e61a78576
 
 PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING.GPLv2
 PKG_CPE_ID:=cpe:/a:libimobiledevice:usbmuxd
 
+PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 
@@ -47,7 +49,9 @@ define Package/usbmuxd/conffiles
 /etc/lockdown/SystemConfiguration.plist
 endef
 
-CONFIGURE_ARGS += --with-systemd
+CONFIGURE_ARGS += \
+       --with-systemd \
+       PACKAGE_VERSION=$(PKG_VERSION)
 
 define Package/usbmuxd/install
        $(INSTALL_DIR) $(1)/etc/hotplug.d/usb
diff --git a/utils/usbmuxd/patches/001-Revert-usb-Set-default-mode-to-3-to-include-CDC-NCM-.patch b/utils/usbmuxd/patches/001-Revert-usb-Set-default-mode-to-3-to-include-CDC-NCM-.patch
new file mode 100644 (file)
index 0000000..66af857
--- /dev/null
@@ -0,0 +1,22 @@
+From 906c7bbdd20e8d962f76364dea6e5486220c578b Mon Sep 17 00:00:00 2001
+From: Georgi Valkov <gvalkov@gmail.com>
+Date: Mon, 22 Apr 2024 23:13:48 +0300
+Subject: [PATCH] Revert "usb: Set default mode to 3 to include CDC NCM, and
+ fix a log message"
+
+This reverts commit c7a0dd9b82633ea347497626282e3051a469ef50.
+---
+ src/usb.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/usb.c
++++ b/src/usb.c
+@@ -691,7 +691,7 @@ static void get_mode_cb(struct libusb_tr
+       unsigned char *data = libusb_control_transfer_get_data(transfer);
+       char* desired_mode_char = getenv(ENV_DEVICE_MODE);
+-      int desired_mode = desired_mode_char ? atoi(desired_mode_char) : 3;
++      int desired_mode = desired_mode_char ? atoi(desired_mode_char) : 1;
+       int guessed_mode = guess_mode(context->dev, dev);
+       // Response is 3:3:3:0 for initial mode, 5:3:3:0 otherwise.
diff --git a/utils/usbmuxd/patches/002-version-print.patch b/utils/usbmuxd/patches/002-version-print.patch
new file mode 100644 (file)
index 0000000..4da3127
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/main.c
++++ b/src/main.c
+@@ -584,7 +584,7 @@ static void parse_opts(int argc, char **
+                       ++verbose;
+                       break;
+               case 'V':
+-                      printf("%s\n", PACKAGE_STRING);
++                      printf("%s %s\n", PACKAGE_STRING, PACKAGE_VERSION);
+                       exit(0);
+               case 'U':
+                       drop_privileges = 1;
index 31d9abcece70c899b041610f5e17fa61659da32c..32c0e056de2fb169c8498972c12829699761720a 100644 (file)
@@ -1,6 +1,6 @@
 --- a/src/conf.c
 +++ b/src/conf.c
-@@ -126,7 +126,7 @@ const char *config_get_config_dir()
+@@ -129,7 +129,7 @@ const char *config_get_config_dir()
  #ifdef __APPLE__
        base_config_dir = strdup("/var/db");
  #else