diff options
author | B. Watson <urchlay@slackware.uk> | 2023-02-08 15:07:22 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-02-11 09:30:42 +0700 |
commit | 4acd08adfe7400890592b53be3459d221b343ae4 (patch) | |
tree | eace6bf6160c62c20d8f4acdfad145b91d15cf92 | |
parent | 3b90538ed0d5bc7ef342494cb3bba46582c1ec08 (diff) |
network/tnfsd: Updated for version 23.0207.1_95c5b55.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | network/tnfsd/git2tarxz.sh | 75 | ||||
-rw-r--r-- | network/tnfsd/remove_broken_tcp_support.diff | 65 | ||||
-rw-r--r-- | network/tnfsd/tnfsd.1 | 8 | ||||
-rw-r--r-- | network/tnfsd/tnfsd.SlackBuild | 30 | ||||
-rw-r--r-- | network/tnfsd/tnfsd.info | 6 | ||||
-rw-r--r-- | network/tnfsd/tnfsd.rst | 3 |
6 files changed, 130 insertions, 57 deletions
diff --git a/network/tnfsd/git2tarxz.sh b/network/tnfsd/git2tarxz.sh new file mode 100644 index 000000000000..751a3f6bc9a6 --- /dev/null +++ b/network/tnfsd/git2tarxz.sh @@ -0,0 +1,75 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version number. + +# This is not a generic git2tarxz script, it's specific to tnfsd. +# Upstream doesn't use tags for version bumps, so the version number +# is extracted from main.c. Also, the repo contains a bunch of +# other stuff unrelated to tnfs, which we don't include in our +# tarball. + +# Takes one optional argument, which is the commit or tag to create a +# tarball of. With no arg, HEAD is used. + +# Version number example: 0.0.1+20200227_ad7ec17 + +# Notes: + +# Do not use this if you're packaging a release. + +# This script doesn't need to be run as root. It does need to be able +# to write to the current directory it's run from. + +# Running this script twice for the same commit will NOT give identical +# tarballs, even if the contents are identical. This is because tar +# includes the current time in a newly-created tarball (plus there may +# be other git-related reasons). + +# Once you've generated a tarball, you'll still need a place to host it. +# Ask on the mailing list, if you don't have your own web server to +# play with. + +## Config: +PRGNAM=tnfsd +CLONE_URL=https://github.com/FujiNetWIFI/spectranet/ +## End of config. + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +# the version hardcoded in main.c includes the date, so +# don't use this. +#DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) +#VERSION=${DATE}_${GIT_SHA} + +VERMAIN="$( grep 'const *char *\*version' tnfs/tnfsd/main.c | cut -d'"' -f2 )" +VERSION=${VERMAIN}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +rm -rf tnfs/tnfsd/{vscode_sample,bin/*} +mv tnfs/*.{md,txt} tnfs/tnfsd + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR/tnfs/tnfsd $PRGNAM-$VERSION +rm -rf $GITDIR +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=\"$VERSION\"" +echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\"" diff --git a/network/tnfsd/remove_broken_tcp_support.diff b/network/tnfsd/remove_broken_tcp_support.diff index b87483207938..010f04baf4c6 100644 --- a/network/tnfsd/remove_broken_tcp_support.diff +++ b/network/tnfsd/remove_broken_tcp_support.diff @@ -1,17 +1,17 @@ -diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/config.h spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/config.h ---- spectranet-TNFSD-2020-10-19/tnfs/tnfsd/config.h 2020-09-23 14:06:09.000000000 -0400 -+++ spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/config.h 2022-08-18 17:20:04.008064003 -0400 +diff -Naur tnfsd-23.0207.1_95c5b55/config.h tnfsd-23.0207.1_95c5b55.patched/config.h +--- tnfsd-23.0207.1_95c5b55/config.h 2023-02-08 13:35:32.000000000 -0500 ++++ tnfsd-23.0207.1_95c5b55.patched/config.h 2023-02-08 13:37:37.069280883 -0500 @@ -28,7 +28,6 @@ #define MAX_DHND_PER_CONN 8 /* max open directories per client */ - #define MAX_CLIENTS 256 /* maximum number of UDP clients */ - #define MAX_CLIENTS_PER_IP 8 /* maximum number of UDP clients from single IP */ + #define MAX_CLIENTS 4096 /* maximum number of UDP clients */ + #define MAX_CLIENTS_PER_IP 4096 /* maximum number of UDP clients from single IP */ -#define MAX_TCP_CONN 256 /* Maximum number of TCP clients */ + #define SESSION_TIMEOUT 21600 /* Sessions are thrown out after no contact for this many seconds. 0 = no timeout */ #define TNFS_HEADERSZ 4 /* minimum header size */ #define TNFS_MAX_PAYLOAD (MAXMSGSZ - TNFS_HEADERSZ - 1) /* Maximum usuable payload in a UDP datagram (-1 for status byte) */ - #define MAX_TNFSPATH 256 /* maximum path length */ -diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/datagram.c ---- spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c 2020-09-23 14:06:09.000000000 -0400 -+++ spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/datagram.c 2022-08-18 17:19:22.440374999 -0400 +diff -Naur tnfsd-23.0207.1_95c5b55/datagram.c tnfsd-23.0207.1_95c5b55.patched/datagram.c +--- tnfsd-23.0207.1_95c5b55/datagram.c 2023-02-08 13:35:32.000000000 -0500 ++++ tnfsd-23.0207.1_95c5b55.patched/datagram.c 2023-02-08 13:40:57.701262001 -0500 @@ -50,7 +50,6 @@ #include "tnfs_file.h" @@ -20,11 +20,10 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 tnfs_cmdfunc dircmd[NUM_DIRCMDS] = {&tnfs_opendir, &tnfs_readdir, &tnfs_closedir, -@@ -140,24 +139,6 @@ - +@@ -141,23 +140,6 @@ if (bind(sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) die("Unable to bind"); -- + - /* Create the TCP socket */ - tcplistenfd = socket(AF_INET, SOCK_STREAM, 0); - if (tcplistenfd < 0) @@ -45,7 +44,7 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 } void tnfs_mainloop() -@@ -165,25 +146,13 @@ +@@ -165,25 +147,13 @@ int readyfds, i; fd_set fdset; fd_set errfdset; @@ -58,7 +57,7 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 FD_ZERO(&fdset); - /* add UDP socket and TCP listen socket to fdset */ -+ /* add UDP socket socket to fdset */ ++ /* add UDP socket to fdset */ FD_SET(sockfd, &fdset); - FD_SET(tcplistenfd, &fdset); - @@ -72,7 +71,7 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 FD_COPY(&fdset, &errfdset); if ((readyfds = select(FD_SETSIZE, &fdset, NULL, &errfdset, NULL)) != 0) -@@ -199,53 +168,8 @@ +@@ -199,55 +169,10 @@ { tnfs_handle_udpmsg(); } @@ -94,10 +93,10 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 - } - } - } -- } -- } --} -- + } + } + } + -void tcp_accept(int *socklist) -{ - int acc_fd, i; @@ -119,14 +118,16 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 - { - *fdptr = acc_fd; - return; - } - } +- } +- } - - /* tell the client 'too many connections' */ - } - +-} +- void tnfs_handle_udpmsg() -@@ -273,15 +197,6 @@ + { + socklen_t len; +@@ -273,15 +198,6 @@ *(rxbuf + rxbytes) = 0; } @@ -142,9 +143,9 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.c spectranet-TNFSD-20 void tnfs_decode(struct sockaddr_in *cliaddr, int rxbytes, unsigned char *rxbuf) { Header hdr; -diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.h spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/datagram.h ---- spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.h 2020-09-23 14:06:09.000000000 -0400 -+++ spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/datagram.h 2022-08-18 17:20:12.070197634 -0400 +diff -Naur tnfsd-23.0207.1_95c5b55/datagram.h tnfsd-23.0207.1_95c5b55.patched/datagram.h +--- tnfsd-23.0207.1_95c5b55/datagram.h 2023-02-08 13:35:32.000000000 -0500 ++++ tnfsd-23.0207.1_95c5b55.patched/datagram.h 2023-02-08 13:39:55.229267881 -0500 @@ -51,8 +51,6 @@ void tnfs_sockinit(); void tnfs_mainloop(); @@ -153,11 +154,11 @@ diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/datagram.h spectranet-TNFSD-20 -void tnfs_handle_tcpmsg(int cli_fd); void tnfs_decode(struct sockaddr_in *cliaddr, int rxbytes, unsigned char *rxbuf); - void tnfs_badcommand(Header *hdr, Session *sess); -diff -Naur spectranet-TNFSD-2020-10-19/tnfs/tnfsd/tnfs.h spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/tnfs.h ---- spectranet-TNFSD-2020-10-19/tnfs/tnfsd/tnfs.h 2020-09-23 14:06:09.000000000 -0400 -+++ spectranet-TNFSD-2020-10-19.patched/tnfs/tnfsd/tnfs.h 2022-08-18 17:20:22.625372592 -0400 -@@ -134,7 +134,6 @@ + void tnfs_invalidsession(Header *hdr); +diff -Naur tnfsd-23.0207.1_95c5b55/tnfs.h tnfsd-23.0207.1_95c5b55.patched/tnfs.h +--- tnfsd-23.0207.1_95c5b55/tnfs.h 2023-02-08 13:35:32.000000000 -0500 ++++ tnfsd-23.0207.1_95c5b55.patched/tnfs.h 2023-02-08 13:40:15.637265960 -0500 +@@ -136,7 +136,6 @@ #endif int lastmsgsz; /* last message's size inc. hdr */ uint8_t lastseqno; /* last sequence number */ diff --git a/network/tnfsd/tnfsd.1 b/network/tnfsd/tnfsd.1 index 0b05bb4a7d50..b8f41d2ed78f 100644 --- a/network/tnfsd/tnfsd.1 +++ b/network/tnfsd/tnfsd.1 @@ -27,15 +27,13 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. -.TH "TNFSD" 1 "2022-08-19" "20201019" "SlackBuilds.org" +.TH "TNFSD" 1 "2023-02-08" "23.0207.1_95c5b55" "SlackBuilds.org" .SH NAME tnfsd \- trivial network filesystem daemon .\" RST source for tnfsd(1) man page. Convert with: . .\" rst2man.py tnfsd.rst > tnfsd.1 . -.\" rst2man.py comes from the SBo development/docutils package. -. .SH SYNOPSIS .sp tnfsd \fBdirectory\fP [\fB\-c\fP \fIusername\fP] @@ -89,7 +87,7 @@ There isn\(aqt a way to share a directory read\-only with the current to prevent the daemon from writing to the shared directory. .SH COPYRIGHT .sp -See the file /usr/doc/tnfsd\-20201019/COPYING for license information. +See the file /usr/doc/tnfsd\-23.0207.1_95c5b55/COPYING for license information. .SH AUTHORS .sp tnfsd was written by Dylan Smith. @@ -100,6 +98,6 @@ by B. Watson, and is licensed under the WTFPL. .sp \fBtnfs\-fuse\fP(1), \fBfujinet\-pc\fP(1) .sp -/usr/doc/tnfsd\-20201019/tnfs\-protocol.md +/usr/doc/tnfsd\-23.0207.1_95c5b55/tnfs\-protocol.md .\" Generated by docutils manpage writer. . diff --git a/network/tnfsd/tnfsd.SlackBuild b/network/tnfsd/tnfsd.SlackBuild index 5b9195ea801c..cc841748c9cd 100644 --- a/network/tnfsd/tnfsd.SlackBuild +++ b/network/tnfsd/tnfsd.SlackBuild @@ -6,6 +6,11 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20230208 bkw: update for v23.0207.1_95c5b55. +# - this is a security update, see: +# https://forums.atariage.com/topic/347648-tnfsd-directory-listing-vulnerability/ +# - use self-hosted source, with the non-tnfsd-related stuff removed. + # 20220818 bkw: BUILD=2 # - remove TCP support entirely. it's incomplete & thoroughly broken. # - mention UDP port 16384 in slack-desc. @@ -18,14 +23,11 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=tnfsd -VERSION=${VERSION:-20201019} -BUILD=${BUILD:-2} +VERSION=${VERSION:-23.0207.1_95c5b55} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} -SRCNAM="spectranet" -SRCVER="TNFSD-$( echo $VERSION | sed 's,\(....\)\(..\)\(..\),\1-\2-\3,' )" - if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i586 ;; @@ -87,9 +89,9 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $SRCNAM-$SRCVER -tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz --wildcards '*/tnfs/*' -cd $SRCNAM-$SRCVER +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ @@ -104,15 +106,13 @@ find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ # it's non-functional anyway, this patch just dikes out TCP support # completely. So far as I know, there are no TNFS clients which use # TCP anyway. - +# 20230208 bkw: reworked this patch for the new source. patch -p1 < $CWD/remove_broken_tcp_support.diff -cd tnfs -rm -f tnfsd/bin/* # guarantee we don't use prebuilt binary! - [ "${USAGELOG:-yes}" = "yes" ] && SLKCFLAGS+=" -DUSAGELOG" -sed -i "s,-Wall,& $SLKCFLAGS," tnfsd/Makefile -make -C tnfsd OS=LINUX +sed -i "s,-Wall,& $SLKCFLAGS," Makefile +mkdir -p bin +make OS=LINUX PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION PKGBIN=$PKG/usr/bin @@ -120,7 +120,7 @@ PKGMAN1=$PKG/usr/man/man1 PKGRCD=$PKG/etc/rc.d PKGVAR=$PKG/var/tnfs mkdir -p $PKGDOC $PKGBIN $PKGMAN1 $PKGRCD $PKGVAR -install -s -m0755 tnfsd/bin/tnfsd $PKGBIN/tnfsd +install -s -m0755 bin/tnfsd $PKGBIN/tnfsd cp -a *.md *.txt $PKGDOC cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild diff --git a/network/tnfsd/tnfsd.info b/network/tnfsd/tnfsd.info index f286dc0f78cb..a8cb27219ee9 100644 --- a/network/tnfsd/tnfsd.info +++ b/network/tnfsd/tnfsd.info @@ -1,8 +1,8 @@ PRGNAM="tnfsd" -VERSION="20201019" +VERSION="23.0207.1_95c5b55" HOMEPAGE="https://github.com/FujiNetWIFI/spectranet/" -DOWNLOAD="https://github.com/FujiNetWIFI/spectranet/archive/TNFSD-2020-10-19/spectranet-TNFSD-2020-10-19.tar.gz" -MD5SUM="052e01e46bdf91f403060e126373e8b3" +DOWNLOAD="https://slackware.uk/~urchlay/src/tnfsd-23.0207.1_95c5b55.tar.xz" +MD5SUM="667313c10c9d809e33ad58c6a59998b7" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" diff --git a/network/tnfsd/tnfsd.rst b/network/tnfsd/tnfsd.rst index 5ae4610a0797..23dcb6b28b1d 100644 --- a/network/tnfsd/tnfsd.rst +++ b/network/tnfsd/tnfsd.rst @@ -1,8 +1,7 @@ .. RST source for tnfsd(1) man page. Convert with: .. rst2man.py tnfsd.rst > tnfsd.1 -.. rst2man.py comes from the SBo development/docutils package. -.. |version| replace:: 20201019 +.. |version| replace:: 23.0207.1_95c5b55 .. |date| date:: ===== |