summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1997-03-11 04:41:41 +0000
committerPeter Wemm <peter@FreeBSD.org>1997-03-11 04:41:41 +0000
commit21aaf2b3060ca8f0f808de61522f671624e8e31c (patch)
treee25e6b47a8531a776de83a3056d0e9bc5469f582
parentAdd a search target. (diff)
Convert the changes from the version of sup in the src tree in recent
history to patch format to the native tree layout. The version in src/usr.sbin/sup can now die. :-)
Notes
Notes: svn path=/head/; revision=5934
-rw-r--r--net/sup/files/patch-ac219
1 files changed, 219 insertions, 0 deletions
diff --git a/net/sup/files/patch-ac b/net/sup/files/patch-ac
new file mode 100644
index 000000000000..9c8a3dd25b49
--- /dev/null
+++ b/net/sup/files/patch-ac
@@ -0,0 +1,219 @@
+Index: expand.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/lib/expand.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.2
+diff -u -r1.1.1.1 -r1.2
+--- expand.c 1995/12/26 04:54:46 1.1.1.1
++++ expand.c 1996/09/24 08:08:06 1.2
+@@ -61,7 +61,7 @@
+ */
+ #include <sys/param.h>
+ #include <sys/stat.h>
+-#include <sys/dir.h>
++#include <dirent.h>
+ #include <pwd.h>
+ #include <ctype.h>
+ #include <libc.h>
+@@ -159,7 +159,7 @@
+ static matchdir(pattern)
+ char *pattern;
+ {
+- register struct direct *dp;
++ register struct dirent *dp;
+ DIR *dirp;
+
+ dirp = opendir(path);
+Index: scan.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/lib/scan.c,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- scan.c 1995/12/26 05:10:59 1.3
++++ scan.c 1996/09/24 08:08:11 1.4
+@@ -104,8 +110,8 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/stat.h>
+-#include <sys/dir.h>
+ #include <sys/file.h>
++#include <dirent.h>
+ #include "sup.h"
+
+ /*************************
+@@ -714,7 +720,7 @@
+ char *name;
+ int always;
+ {
+- struct direct *dentry;
++ struct dirent *dentry;
+ register DIR *dirp;
+ char ename[STRINGLENGTH],newname[STRINGLENGTH],filename[STRINGLENGTH];
+ register char *p,*newp;
+Index: scm.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/lib/scm.c,v
+retrieving revision 1.2
+retrieving revision 1.3
+diff -u -r1.2 -r1.3
+--- scm.c 1995/12/26 05:02:49 1.2
++++ scm.c 1996/09/06 16:08:32 1.3
+@@ -271,6 +280,8 @@
+ return (scmerr (errno, stderr, "Can't create socket for connections"));
+ if (setsockopt (sock,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(int)) < 0)
+ (void) scmerr (errno, stderr, "Can't set SO_REUSEADDR socket option");
++ if (setsockopt (sock,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(int)) < 0)
++ (void) scmerr (errno, stderr, "Can't set SO_KEEPALIVE socket option");
+ (void) bzero ((char *)&sin,sizeof(sin));
+ sin.sin_family = AF_INET;
+ sin.sin_port = port;
+Index: supcmeat.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/sup/supcmeat.c,v
+retrieving revision 1.2
+retrieving revision 1.3
+diff -u -r1.2 -r1.3
+--- supcmeat.c 1995/12/26 05:03:05 1.2
++++ supcmeat.c 1996/10/30 23:58:07 1.3
+@@ -325,7 +331,7 @@
+ /* If protocol is > 7 then try compression */
+ if (protver > 7) {
+ cancompress = TRUE;
+- notify ("SUP Fileserver supports compression.\n");
++ vnotify ("SUP Fileserver supports compression.\n");
+ }
+ return (FALSE);
+ }
+@@ -635,7 +641,7 @@
+ denyone (t)
+ register TREE *t;
+ {
+- vnotify ("SUP: Access denied to %s\n",t->Tname);
++ notify ("SUP: Access denied to %s\n",t->Tname);
+ return (SCMOK);
+ }
+
+Index: supcmisc.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/sup/supcmisc.c,v
+retrieving revision 1.1.1.1
+retrieving revision 1.3
+diff -u -r1.1.1.1 -r1.3
+--- supcmisc.c 1995/12/26 04:54:46 1.1.1.1
++++ supcmisc.c 1996/10/31 00:03:14 1.3
+@@ -277,7 +287,7 @@
+ #endif
+ char buf[STRINGLENGTH];
+ char collrelname[STRINGLENGTH];
+- long tloc;
++ time_t tloc;
+ static FILE *noteF = NULL; /* mail program on pipe */
+ va_list ap;
+
+@@ -300,7 +310,7 @@
+
+ if (noteF == NULL) {
+ if ((thisC->Cflags&CFMAIL) && thisC->Cnotify) {
+- (void) sprintf (buf,"mail -s \"SUP Upgrade of %s\" %s >/dev/null",
++ (void) sprintf (buf,"/usr/bin/mail -s \"SUP Upgrade of %s\" %s >/dev/null",
+ collrelname,thisC->Cnotify);
+ noteF = popen (buf,"w");
+ if (noteF == NULL) {
+@@ -310,7 +320,7 @@
+ }
+ } else
+ noteF = stdout;
+- tloc = time ((long *)NULL);
++ tloc = time ((time_t *)NULL);
+ fprintf (noteF,"SUP Upgrade of %s at %s",
+ collrelname,ctime (&tloc));
+ (void) fflush (noteF);
+Index: supfilesrv.c
+===================================================================
+RCS file: /home/ncvs/src/usr.sbin/sup/supfilesrv/supfilesrv.c,v
+retrieving revision 1.4
+retrieving revision 1.6
+diff -u -r1.4 -r1.6
+--- supfilesrv.c 1996/02/06 19:03:58 1.4
++++ supfilesrv.c 1996/09/24 08:43:04 1.6
+@@ -268,7 +288,6 @@
+ #include <sys/wait.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+-#include <sys/dir.h>
+ #if MACH
+ #include <sys/ioctl.h>
+ #endif
+@@ -1233,6 +1252,7 @@
+ register int fdtmp;
+ char sys_com[STRINGLENGTH], temp_file[STRINGLENGTH], rcs_file[STRINGLENGTH];
+ union wait status;
++ int wstat;
+ char *uconvert(),*gconvert();
+ int sendfile ();
+
+@@ -1300,15 +1320,54 @@
+ #endif
+ if (fd == -1) {
+ if (docompress) {
+- tmpnam(temp_file);
+- sprintf(sys_com, "gzip -c < %s > %s\n", t->Tname, temp_file);
+- if (system(sys_com) != 0) {
+- /* Just in case */
+- unlink(temp_file);
+- goaway ("We died trying to \"%s\"", sys_com);
+- t->Tmode = 0;
+- }
+- fd = open (temp_file,O_RDONLY,0);
++ FILE *tf;
++ int pid;
++ int i;
++
++ tf = tmpfile();
++ if (tf == NULL) {
++ goaway("no temp file");
++ t->Tmode = 0;
++ goto out;
++ }
++ pid = fork();
++ switch (pid) {
++ case -1: /* fail */
++ goaway("Could not fork");
++ t->Tmode = 0;
++ fclose(tf);
++ break;
++ case 0: /* child */
++ close(1);
++ dup(fileno(tf));/* write end */
++ for(i = 3; i < 64; i++)
++ close(i);
++ execl("/usr/bin/gzip", "sup-gzip", "-c", t->Tname, 0);
++ execl("/usr/local/bin/gzip", "sup-gzip", "-c", t->Tname, 0);
++ execlp("gzip", "sup-gzip", "-c", t->Tname, 0);
++ perror("gzip");
++ _exit(1); /* pipe breaks */
++ default: /* parent */
++ wait(&wstat);
++ if (WIFEXITED(wstat) &&
++ WEXITSTATUS(wstat) > 0) {
++ fclose(tf);
++ goaway("gzip failed!");
++ t->Tmode = 0;
++ goto out;
++ }
++ if (WIFSIGNALED(wstat)) {
++ fclose(tf);
++ goaway("gzip died!");
++ t->Tmode = 0;
++ goto out;
++ }
++ fd = dup(fileno(tf));
++ fclose(tf);
++ lseek(fd, 0, 0);
++ break;
++ }
++ out:
+ }
+ else
+ fd = open (t->Tname,O_RDONLY,0);