diff options
author | Mikhail Teterin <mi@FreeBSD.org> | 2005-02-04 00:45:31 +0000 |
---|---|---|
committer | Mikhail Teterin <mi@FreeBSD.org> | 2005-02-04 00:45:31 +0000 |
commit | cfae8997c751d279d25bba42dca968a7dc32e776 (patch) | |
tree | 73b939b9f01e5039b5a3639f6c9ce4237e12e376 /net/rdist6 | |
parent | 277fa15535ae5a5aee79ede55b2d1cd509999b41 (diff) | |
download | ports-cfae8997c751d279d25bba42dca968a7dc32e776.tar.gz ports-cfae8997c751d279d25bba42dca968a7dc32e776.zip |
Notes
Diffstat (limited to 'net/rdist6')
-rw-r--r-- | net/rdist6/Makefile | 1 | ||||
-rw-r--r-- | net/rdist6/files/patch-ag | 19 | ||||
-rw-r--r-- | net/rdist6/files/patch-ah | 24 | ||||
-rw-r--r-- | net/rdist6/files/patch-client.c | 9 | ||||
-rw-r--r-- | net/rdist6/files/patch-defs.h | 34 | ||||
-rw-r--r-- | net/rdist6/files/patch-mkstemp | 47 | ||||
-rw-r--r-- | net/rdist6/files/patch-progname | 45 |
7 files changed, 168 insertions, 11 deletions
diff --git a/net/rdist6/Makefile b/net/rdist6/Makefile index 6897ad9496a6..dbf1791903a4 100644 --- a/net/rdist6/Makefile +++ b/net/rdist6/Makefile @@ -7,6 +7,7 @@ PORTNAME= rdist PORTVERSION= 6.1.5 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= http://www.magnicomp.com/download/rdist/ \ ftp://ftp.rge.com/pub/admin/rdist/ \ diff --git a/net/rdist6/files/patch-ag b/net/rdist6/files/patch-ag index 0083dd610f1e..cb5ef75631fb 100644 --- a/net/rdist6/files/patch-ag +++ b/net/rdist6/files/patch-ag @@ -1,9 +1,10 @@ ---- config/os-freebsd2.h.orig Mon Nov 9 19:59:55 1998 -+++ config/os-freebsd2.h Fri Nov 3 02:40:25 2000 -@@ -116,8 +116,10 @@ +--- config/os-freebsd2.h Mon Nov 9 22:59:55 1998 ++++ config/os-freebsd2.h Tue Jan 18 15:13:07 2005 +@@ -116,18 +116,23 @@ */ #define HAVE_FCHOWN /* Have fchown() */ #define HAVE_FCHMOD /* Have fchmod() */ ++#define HAVE_FTRUNCATE /* Have ftruncate() */ +#define HAVE_PATHS_H /* Have paths.h */ #define HAVE_SELECT /* Have select() */ #define HAVE_SAVED_IDS /* Have POSIX style saved [ug]id's */ @@ -11,8 +12,16 @@ #define POSIX_SIGNALS /* Have POSIX signals */ /* -@@ -131,3 +133,4 @@ + * Things we need + */ + #define NEED_UNISTD_H /* Need <unistd.h> */ ++#define NEED_STRING_H /* Need <string.h> -- for strerror(3) */ + + /* + * Path to the remote shell command. + * Define this only if the pathname is different than * that which appears in "include/paths.h". */ - #define _PATH_REMSH "/usr/bin/rsh" /**/ +-#define _PATH_REMSH "/usr/bin/rsh" /**/ ++#define _PATH_REMSH "/usr/bin/ssh" /**/ +#define _PATH_OLDRDIST "/usr/bin/rdist" /* Enable compat */ diff --git a/net/rdist6/files/patch-ah b/net/rdist6/files/patch-ah index 19ded6be538b..5e08b75206f2 100644 --- a/net/rdist6/files/patch-ah +++ b/net/rdist6/files/patch-ah @@ -1,6 +1,24 @@ ---- src/rshrcmd.c.dist Tue Dec 12 08:20:56 1995 -+++ src/rshrcmd.c Wed Dec 11 07:14:13 1996 -@@ -64,5 +64,5 @@ +--- src/rshrcmd.c Mon Nov 9 23:15:07 1998 ++++ src/rshrcmd.c Tue Jan 18 14:53:29 2005 +@@ -42,5 +42,4 @@ + { + int cpid; +- struct hostent *hp; + int sp[2]; + +@@ -48,11 +47,4 @@ + if (fd2p != 0) + return -1; +- /* validate remote hostname. */ +- hp = gethostbyname(*ahost); +- if (hp == 0) { +- error("%s: unknown host", *ahost); +- return -1; +- } +- /* *ahost = hp->h_name;*/ /* This makes me nervous. */ + + /* get a socketpair we'll use for stdin and stdout. */ +@@ -72,5 +64,5 @@ sp[0]. */ (void) close(sp[0]); - if (dup2(sp[1], 0) < 0 || dup2(0,1) < 0 || dup2(0, 2) < 0) { diff --git a/net/rdist6/files/patch-client.c b/net/rdist6/files/patch-client.c new file mode 100644 index 000000000000..3a951081b1a6 --- /dev/null +++ b/net/rdist6/files/patch-client.c @@ -0,0 +1,9 @@ +--- src/client.c Mon Nov 9 23:08:47 1998 ++++ src/client.c Tue Jan 18 15:47:15 2005 +@@ -762,5 +762,5 @@ + char *owner = NULL, *group = NULL; + int done, n; +- u_char *cp; ++ char *cp; + + debugmsg(DM_CALL, "update(%s, 0x%x, 0x%x)\n", rname, opts, statp); diff --git a/net/rdist6/files/patch-defs.h b/net/rdist6/files/patch-defs.h index 932b0713dca3..362f93e0ad35 100644 --- a/net/rdist6/files/patch-defs.h +++ b/net/rdist6/files/patch-defs.h @@ -1,6 +1,34 @@ ---- include/defs.h.orig Mon Nov 9 20:23:54 1998 -+++ include/defs.h Fri Nov 3 02:39:45 2000 -@@ -379,7 +379,9 @@ +--- include/defs.h Mon Nov 9 23:23:54 1998 ++++ include/defs.h Tue Jan 18 15:41:40 2005 +@@ -17,10 +17,9 @@ + /* + * POSIX settings + */ +-#if defined(_POSIX_SOURCE) + #include <unistd.h> + #include <stdlib.h> +-#endif /* _POSIX_SOURCE */ ++#include <libgen.h> + #include <stdio.h> + #include <ctype.h> + #include <errno.h> +@@ -357,7 +355,6 @@ + extern void complain(); + extern void docmds(); + extern void finish(); +-extern void log(); + extern void logmsg(); + extern void lostconn(); + extern void markassigned(); +@@ -366,7 +363,6 @@ + extern void runcmdspecial(); + extern void runcommand(); + extern void server(); +-extern void setprogname(); + extern void sighandler(); + extern void waitup(); + struct namelist *expand(); +@@ -379,7 +375,9 @@ extern void error(char *, ...); extern void fatalerr(char *, ...); extern void message(int, char *, ...); diff --git a/net/rdist6/files/patch-mkstemp b/net/rdist6/files/patch-mkstemp new file mode 100644 index 000000000000..db2356b78a72 --- /dev/null +++ b/net/rdist6/files/patch-mkstemp @@ -0,0 +1,47 @@ +These patches replace mktemp with mkstemp in the client code entirely. + +In the server code more intrusive changes would be needed, so the hunk +simply ensures, the file is not created between the mktemp() and the +open() calls. + + -mi + +--- src/message.c Mon Nov 9 23:13:30 1998 ++++ src/message.c Tue Jan 18 15:23:32 2005 +@@ -463,6 +463,6 @@ + + if (!msgfac->mf_fptr) { +- register char *cp; +- char *getenv(); ++ const char *cp; ++ int fd; + + /* +@@ -476,6 +476,6 @@ + + msgfac->mf_filename = tempfile; +- (void) mktemp(msgfac->mf_filename); +- if ((msgfac->mf_fptr = fopen(msgfac->mf_filename, "w"))==NULL) ++ fd = mkstemp(tempfile); ++ if (fd == -1 || (msgfac->mf_fptr = fdopen(fd, "w"))==NULL) + fatalerr("Cannot open notify file for writing: %s: %s.", + msgfac->mf_filename, SYSERR); +@@ -514,5 +514,5 @@ + static void _message(flags, msgbuf) + int flags; +- char *msgbuf; ++ const char *msgbuf; + { + register int i, x; +--- src/server.c Mon Nov 9 23:15:31 1998 ++++ src/server.c Tue Jan 18 16:34:26 2005 +@@ -768,7 +768,7 @@ + * Create temporary file + */ +- if ((f = creat(new, mode)) < 0) { ++ if ((f = open(new, O_CREAT|O_TRUNC|O_WRONLY|O_EXCL, mode)) < 0) { + if (errno != ENOENT || chkparent(new, opts) < 0 || +- (f = creat(new, mode)) < 0) { ++ (f = open(new, O_CREAT|O_TRUNC|O_WRONLY|O_EXCL, mode)) < 0) { + error("%s: create failed: %s", new, SYSERR); + (void) unlink(new); diff --git a/net/rdist6/files/patch-progname b/net/rdist6/files/patch-progname new file mode 100644 index 000000000000..e4e9bc65eda9 --- /dev/null +++ b/net/rdist6/files/patch-progname @@ -0,0 +1,45 @@ +setprogname() is a standard library function. Instead of renaming +rdist6' (incompatible) implementation, remove it entirely replacing with +much simpler code. + + -mi + +--- src/rdist.c Mon Nov 9 23:13:50 1998 ++++ src/rdist.c Tue Jan 18 15:36:30 2005 +@@ -113,5 +113,5 @@ + * things in msgparseopts() need progname set. + */ +- setprogname(argv); ++ progname = basename(argv[0]); + + if (cp = msgparseopts(localmsglist, TRUE)) { +--- src/common.c Mon Nov 9 23:09:01 1998 ++++ src/common.c Tue Jan 18 15:40:19 2005 +@@ -109,19 +109,4 @@ + + /* +- * Set program name +- */ +-extern void setprogname(argv) +- char **argv; +-{ +- register char *cp; +- +- if (!progname) { +- progname = strdup(argv[0]); +- if (cp = strrchr(progname, '/')) +- progname = cp + 1; +- } +-} +- +-/* + * Do run-time initialization + */ +@@ -138,5 +123,6 @@ + (void) signal(SIGSEGV, sighandler); + +- setprogname(argv); ++ if (progname == NULL) ++ progname = basename(argv[0]); + + /* |