diff --git a/net/rdist6/Makefile b/net/rdist6/Makefile index d740af9e0353..c8335f64dcff 100644 --- a/net/rdist6/Makefile +++ b/net/rdist6/Makefile @@ -1,35 +1,35 @@ PORTNAME= rdist PORTVERSION= 6.1.5 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= net MASTER_SITES= https://fossies.org/linux/misc/old/ \ http://www.magnicomp.com/download/rdist/ MAINTAINER= cy@FreeBSD.org COMMENT= Network file distribution/synchronisation utility WWW= https://www.magnicomp.com/ MAKE_JOBS_UNSAFE= yes # Years ago base FreeBSD maintained /usr/bin/rdist, but since then it was # removed. Users who wish to continue to use the rdist6 name can set # RDIST_NAME=rdist6 in their make.conf. Otherwise we install binary named # rdist. RDIST_NAME?= rdist INSTALL_TARGET= install install.man MAKE_ENV= BUILD_OPT="${CFLAGS}" BUILD_CLIENT=${RDIST_NAME} \ STAGEDIR=${STAGEDIR} PLIST_SUB= RDIST_NAME=${RDIST_NAME} .include .if ${OPSYS} == FreeBSD RUN_DEPENDS+= rsh:net/bsdrcmds .endif post-install: @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${RDIST_NAME} @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/rdistd .include diff --git a/net/rdist6/files/patch-doc_rdist.man b/net/rdist6/files/patch-doc_rdist.man new file mode 100644 index 000000000000..0c92425b02b9 --- /dev/null +++ b/net/rdist6/files/patch-doc_rdist.man @@ -0,0 +1,35 @@ +--- doc/rdist.man.orig 1998-11-09 21:38:53.000000000 -0800 ++++ doc/rdist.man 2024-03-19 08:57:42.415646000 -0700 +@@ -242,6 +242,21 @@ + .RE + .sp + .fi ++The ++.I rsh(1) ++method can be overridden to ssh using the ++.I RDIST_RSH ++environment variable. ++.nf ++.sp ++.RS ++\fBexport RDIST_RSH=/usr/local/bin/ssh\fR ++.RE ++.sp ++.fi ++See the ++.I ENVIRONMENT ++section below. + .PP + If the + .I rcmd(3) +@@ -870,6 +885,10 @@ + .IP TMPDIR + Name of temporary directory to use. Default is + .B /tmp. ++.IP RDIST_RSH ++This environment variable lets you override the default remote shell used ++to transport the rdist protocol. By default it is net/bsdrcmds rsh. To ++use ssh simply assign the full pathname of the ssh binary. + .SH FILES + .nf + .ta \w'/tmp/rdist* 'u diff --git a/net/rdist6/files/patch-src_rdist.c b/net/rdist6/files/patch-src_rdist.c index e1752e33b5ad..b1b9dcde4dcb 100644 --- a/net/rdist6/files/patch-src_rdist.c +++ b/net/rdist6/files/patch-src_rdist.c @@ -1,53 +1,80 @@ ---- src/rdist.c.orig 1998-11-10 04:13:50 UTC -+++ src/rdist.c -@@ -62,8 +62,8 @@ static char copyright[] = +--- src/rdist.c.orig 1998-11-09 20:13:50.000000000 -0800 ++++ src/rdist.c 2024-03-19 09:08:42.194504000 -0700 +@@ -62,8 +62,8 @@ char *distfile = NULL; /* Name of distfile to use */ int maxchildren = MAXCHILDREN; /* Max no of concurrent PIDs */ int nflag = 0; /* Say without doing */ -long min_freespace = 0; /* Min filesys free space */ -long min_freefiles = 0; /* Min filesys free # files */ +int64_t min_freespace = 0; /* Min filesys free space */ +int64_t min_freefiles = 0; /* Min filesys free # files */ FILE *fin = NULL; /* Input file pointer */ struct group *gr = NULL; /* Static area for getgrent */ char localmsglist[] = "stdout=all:notify=all:syslog=nerror,ferror"; -@@ -107,12 +107,13 @@ main(argc, argv, envp) +@@ -72,6 +72,8 @@ + FILE *opendist(); + char *path_rdistd = _PATH_RDISTD; + char *path_remsh = _PATH_REMSH; ++char *path_remsh_env; ++#define RDIST_RSH_ENV "RDIST_RSH" + + /* + * Add a hostname to the host list +@@ -107,12 +109,13 @@ register char *cp; int cmdargs = 0; int c; + const char *errstr; /* * We initialize progname here instead of init() because * things in msgparseopts() need progname set. */ - setprogname(argv); + progname = basename(argv[0]); if (cp = msgparseopts(localmsglist, TRUE)) { error("Bad builtin log option (%s): %s.", -@@ -176,10 +177,20 @@ main(argc, argv, envp) +@@ -155,6 +158,17 @@ + fatalerr("This version of rdist should not be installed setuid."); + #endif /* DIRECT_RCMD */ + ++ path_remsh_env = getenv(RDIST_RSH_ENV); ++ if (path_remsh_env) { ++ if (cp = searchpath(path_remsh_env)) ++ path_remsh = strdup(cp); ++ else { ++ error("Environment incorrect: No component of path \"%s\" exists.", ++ path_remsh_env); ++ exit(1); ++ } ++ } ++ + while ((c = getopt(argc, argv, optchars)) != -1) + switch (c) { + case 'l': +@@ -176,10 +190,20 @@ error("\"%s\" is not a number.", optarg); usage(); } - if (c == 'a') - min_freespace = atoi(optarg); - else if (c == 'A') - min_freefiles = atoi(optarg); + if (c == 'a') { + min_freespace = (int64_t)strtonum(optarg, + 0, LLONG_MAX, &errstr); + if (errstr) + fatalerr("Minimum free space is %s: " + "'%s'", errstr, optarg); + } + else if (c == 'A') { + min_freefiles = (int64_t)strtonum(optarg, + 0, LLONG_MAX, &errstr); + if (errstr) + fatalerr("Minimum free files is %s: " + "'%s'", errstr, optarg); + } else if (c == 'M') maxchildren = atoi(optarg); else if (c == 't')