git: c6dc382584dc - main - net/unfs3: update to 0.9.23

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Tue, 22 Nov 2022 06:23:50 UTC
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c6dc382584dcee8bca54884ec217c73f9ac621c3

commit c6dc382584dcee8bca54884ec217c73f9ac621c3
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2022-11-21 06:52:27 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-11-22 06:19:47 +0000

    net/unfs3: update to 0.9.23
    
    ChangeLog: https://github.com/unfs3/unfs3/blob/master/NEWS
    
     * include AFS support for better serving of files from AFS filesystems
     * use svc_getreq_poll() when available
     * fix serving files larger than 4GB from Windows
     * better support for 64-bit systems
     * fixes for macOS and Windows support
     * fixes when cross compiling
     * better support for exporting FAT filesystems
    
    PR:             267848
    Reported by:    fuz@fuz.su (maintainer)
    MFH:            2022Q4 (bugfix release)
---
 net/unfs3/Makefile                     | 10 ++++------
 net/unfs3/distinfo                     |  5 +++--
 net/unfs3/files/patch-Config_exports.h | 11 -----------
 net/unfs3/files/patch-Config_exports.l | 18 ------------------
 net/unfs3/files/patch-attr.c           | 11 +++++++++++
 net/unfs3/files/patch-configure.ac     | 15 +++++++++++----
 net/unfs3/files/patch-fh.c             | 29 +++++++++++++++++++++++++++++
 net/unfs3/files/patch-fh.h             | 11 +++++++++++
 net/unfs3/files/patch-md5.c            | 19 +++++++++++++++++++
 net/unfs3/files/patch-nfs.c            | 11 +++++++++++
 10 files changed, 99 insertions(+), 41 deletions(-)

diff --git a/net/unfs3/Makefile b/net/unfs3/Makefile
index d6ed9c5f87e5..917ea8e8e37c 100644
--- a/net/unfs3/Makefile
+++ b/net/unfs3/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	unfs3
-DISTVERSION=	0.9.22
-PORTREVISION=	2
+DISTVERSIONPREFIX=	unfs3-
+DISTVERSION=	0.9.23
 CATEGORIES=	net
-MASTER_SITES=	https://github.com/unfs3/unfs3/releases/download/unfs3-${DISTVERSION}/
 
 MAINTAINER=	fuz@fuz.su
 COMMENT=	User-space implementation of the NFSv3 server specification
@@ -12,6 +11,8 @@ LICENSE=	BSD3CLAUSE
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
 USES=		autoreconf
+USE_GITHUB=	yes
+
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	YACC=byacc
 
@@ -26,7 +27,4 @@ OPTIONS_DEFINE=	CLUSTER_EXT
 CLUSTER_EXT_DESC=	include clustering extensions
 CLUSTER_EXT_CONFIGURE_ON=	--enable-cluster
 
-post-extract:
-	@${RM} ${WRKSRC}/Config/lex.yy.c
-
 .include <bsd.port.mk>
diff --git a/net/unfs3/distinfo b/net/unfs3/distinfo
index 1da2d77fb35b..d78336587177 100644
--- a/net/unfs3/distinfo
+++ b/net/unfs3/distinfo
@@ -1,2 +1,3 @@
-SHA256 (unfs3-0.9.22.tar.gz) = 482222cae541172c155cd5dc9c2199763a6454b0c5c0619102d8143bb19fdf1c
-SIZE (unfs3-0.9.22.tar.gz) = 168447
+TIMESTAMP = 1668687846
+SHA256 (unfs3-unfs3-unfs3-0.9.23_GH0.tar.gz) = d0545286b559fa6ad8a28e77d69c26bdfa461922401c90cea46cb5d2584a8a93
+SIZE (unfs3-unfs3-unfs3-0.9.23_GH0.tar.gz) = 108616
diff --git a/net/unfs3/files/patch-Config_exports.h b/net/unfs3/files/patch-Config_exports.h
deleted file mode 100644
index fb11e191d1df..000000000000
--- a/net/unfs3/files/patch-Config_exports.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- Config/exports.h.orig	2021-09-06 22:17:18 UTC
-+++ Config/exports.h
-@@ -22,7 +22,7 @@
- extern exports	exports_nfslist;
- /* Options cache */
- extern int	exports_opts;
--const char      *export_path; 
-+extern const char      *export_path; 
- extern uint32 	export_fsid;
- extern uint32   export_password_hash;
- 
diff --git a/net/unfs3/files/patch-Config_exports.l b/net/unfs3/files/patch-Config_exports.l
deleted file mode 100644
index 5d4edc546521..000000000000
--- a/net/unfs3/files/patch-Config_exports.l
+++ /dev/null
@@ -1,18 +0,0 @@
---- Config/exports.l.orig	2021-09-06 22:20:46 UTC
-+++ Config/exports.l
-@@ -14,7 +14,7 @@
- 
- #define YY_NO_UNPUT
- 
--YYSTYPE yylval;
-+extern YYSTYPE yylval;
- extern int e_error;
- 
- /*
-@@ -67,4 +67,4 @@ OLDNET {IP}"/"{IP}
- 
- .			{ return *yytext; }
- \n			{ return '\n'; }
--   
-\ No newline at end of file
-+   
diff --git a/net/unfs3/files/patch-attr.c b/net/unfs3/files/patch-attr.c
new file mode 100644
index 000000000000..345f376e38ed
--- /dev/null
+++ b/net/unfs3/files/patch-attr.c
@@ -0,0 +1,11 @@
+--- attr.c.orig	2022-11-17 12:28:15 UTC
++++ attr.c
+@@ -7,6 +7,8 @@
+ 
+ #include "config.h"
+ 
++#include <stdlib.h>
++#include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <rpc/rpc.h>
diff --git a/net/unfs3/files/patch-configure.ac b/net/unfs3/files/patch-configure.ac
index 79f00d6a8146..1c75fd70cebe 100644
--- a/net/unfs3/files/patch-configure.ac
+++ b/net/unfs3/files/patch-configure.ac
@@ -1,10 +1,17 @@
---- ./configure.ac.orig	2008-02-16 14:45:54.000000000 -0500
-+++ ./configure.ac	2008-08-31 19:54:55.000000000 -0400
-@@ -29,7 +28,6 @@
+--- configure.ac.orig	2019-06-12 14:22:57 UTC
++++ configure.ac
+@@ -31,14 +31,12 @@ AC_CHECK_FUNCS(xdr_int xdr_u_int)
+ AC_CHECK_FUNCS(xdr_int32 xdr_int32_t)
+ AC_CHECK_FUNCS(xdr_uint32 xdr_uint32_t xdr_u_int32_t)
+ AC_CHECK_FUNCS(xdr_uint64 xdr_uint64_t xdr_u_int64_t)
+-AC_CHECK_FUNCS(svc_getreq_poll)
+ AC_CHECK_FUNCS(statvfs)
+ AC_CHECK_FUNCS(seteuid setegid)
+ AC_CHECK_FUNCS(setresuid setresgid)
  AC_CHECK_FUNCS(vsyslog)
  AC_CHECK_FUNCS(lchown)
  AC_CHECK_FUNCS(setgroups)
 -UNFS3_SOLARIS_RPC
  UNFS3_PORTMAP_DEFINE
  UNFS3_COMPILE_WARNINGS
- AC_ARG_ENABLE(cluster,[  --enable-cluster        include clustering extensions],[AC_DEFINE([WANT_CLUSTER], [], [Cluster extensions]) AC_SUBST([SUBDIRS],[Extras]) AC_SUBST([EXTRAOBJ],[Extras/lib.a])])
+ 
diff --git a/net/unfs3/files/patch-fh.c b/net/unfs3/files/patch-fh.c
new file mode 100644
index 000000000000..0d0abaa701b2
--- /dev/null
+++ b/net/unfs3/files/patch-fh.c
@@ -0,0 +1,29 @@
+--- fh.c.orig	2022-11-17 12:27:07 UTC
++++ fh.c
+@@ -86,7 +86,7 @@ uint32 get_gen(backend_statstruct obuf, U(int fd), U(c
+     backend_setegid(0);
+     backend_seteuid(0);
+ 
+-    if (fd != FD_NONE) {
++    if (fd != -1) {
+ 	res = ioctl(fd, EXT2_IOC_GETVERSION, &gen);
+ 	if (res == -1)
+ 	    gen = 0;
+@@ -220,7 +220,7 @@ unfs3_fh_t fh_comp_raw(const char *path, struct svc_re
+ 
+     fh.dev = buf.st_dev;
+     fh.ino = buf.st_ino;
+-    fh.gen = backend_get_gen(buf, FD_NONE, path);
++    fh.gen = backend_get_gen(buf, -1, path);
+ 
+     /* special case for root directory */
+     if (strcmp(path, "/") == 0)
+@@ -341,7 +341,7 @@ post_op_fh3 fh_extend_type(nfs_fh3 fh, const char *pat
+     st_cache = buf;
+ 
+     return fh_extend_post(fh, buf.st_dev, buf.st_ino,
+-			  backend_get_gen(buf, FD_NONE, path));
++			  backend_get_gen(buf, -1, path));
+ }
+ 
+ /*
diff --git a/net/unfs3/files/patch-fh.h b/net/unfs3/files/patch-fh.h
new file mode 100644
index 000000000000..ce686f8ada3c
--- /dev/null
+++ b/net/unfs3/files/patch-fh.h
@@ -0,0 +1,11 @@
+--- fh.h.orig	2022-11-17 12:27:31 UTC
++++ fh.h
+@@ -30,8 +30,6 @@ typedef struct {
+ #define FH_ANY 0
+ #define FH_DIR 1
+ 
+-#define FD_NONE (-1)			/* used for get_gen */
+-
+ extern int st_cache_valid;		/* stat value is valid */
+ extern backend_statstruct st_cache;	/* cached stat value */
+ 
diff --git a/net/unfs3/files/patch-md5.c b/net/unfs3/files/patch-md5.c
new file mode 100644
index 000000000000..b2342754c4d5
--- /dev/null
+++ b/net/unfs3/files/patch-md5.c
@@ -0,0 +1,19 @@
+--- md5.c.orig	2022-11-17 12:35:16 UTC
++++ md5.c
+@@ -54,6 +54,7 @@
+ 
+ #include "md5.h"
+ #include <string.h>
++#include <stdint.h>
+ 
+ #undef BYTE_ORDER		       /* 1 = big-endian, -1 = little-endian, 
+ 				          0 = unknown */
+@@ -162,7 +163,7 @@ static void md5_process(md5_state_t * pms, const md5_b
+ 	     * On little-endian machines, we can process properly aligned
+ 	     * data without copying it.
+ 	     */
+-	    if (!((data - (const md5_byte_t *) 0) & 3)) {
++	    if (((uintptr_t)data & 3) == 0) {
+ 		/* data are properly aligned */
+ 		X = (const md5_word_t *) data;
+ 	    } else {
diff --git a/net/unfs3/files/patch-nfs.c b/net/unfs3/files/patch-nfs.c
new file mode 100644
index 000000000000..7e736437b6b8
--- /dev/null
+++ b/net/unfs3/files/patch-nfs.c
@@ -0,0 +1,11 @@
+--- nfs.c.orig	2022-11-17 12:27:52 UTC
++++ nfs.c
+@@ -209,7 +209,7 @@ LOOKUP3res *nfsproc3_lookup_3_svc(LOOKUP3args * argp, 
+ 		strcmp(argp->what.name, "..") == 0) {
+ 		fh = fh_comp_ptr(obj, rqstp, 0);
+ 	    } else {
+-		gen = backend_get_gen(buf, FD_NONE, obj);
++		gen = backend_get_gen(buf, -1, obj);
+ 		fh = fh_extend(argp->what.dir, buf.st_dev, buf.st_ino, gen);
+ 		fh_cache_add(buf.st_dev, buf.st_ino, obj);
+ 	    }