still more fixes from rick@seismo
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 10 Oct 1985 09:10:31 +0000 (01:10 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 10 Oct 1985 09:10:31 +0000 (01:10 -0800)
SCCS-vsn: usr.bin/uucp/uux/uux.c 5.5
SCCS-vsn: usr.bin/uucp/uuxqt/uuxqt.c 5.7
SCCS-vsn: usr.bin/uucp/libuu/versys.c 5.5

usr/src/usr.bin/uucp/libuu/versys.c
usr/src/usr.bin/uucp/uux/uux.c
usr/src/usr.bin/uucp/uuxqt/uuxqt.c

index 6ed4ec9..c0c44c1 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)versys.c   5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)versys.c   5.5 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -8,6 +8,8 @@ static char sccsid[] = "@(#)versys.c    5.4 (Berkeley) %G%";
 
 /*LINTLIBRARY*/
 
 
 /*LINTLIBRARY*/
 
+char PhoneNumber[MAXPH];
+
 /*
  *     verify system names n1 and n2
  *     return codes:  SUCCESS  |  FAIL
 /*
  *     verify system names n1 and n2
  *     return codes:  SUCCESS  |  FAIL
@@ -35,12 +37,14 @@ register char **nameptr;
 
        fp = fopen(SYSFILE, "r");
        ASSERT(fp != NULL, CANTOPEN, SYSFILE, 0);
 
        fp = fopen(SYSFILE, "r");
        ASSERT(fp != NULL, CANTOPEN, SYSFILE, 0);
+       PhoneNumber[0] = '\0';
        while (cfgets(line, sizeof(line), fp) != NULL) {
                char *targs[100];
 
                getargs(line, targs, 100);
                if (strncmp(name, targs[0], MAXBASENAME) == SAME) {
                        fclose(fp);
        while (cfgets(line, sizeof(line), fp) != NULL) {
                char *targs[100];
 
                getargs(line, targs, 100);
                if (strncmp(name, targs[0], MAXBASENAME) == SAME) {
                        fclose(fp);
+                       strncpy(PhoneNumber, targs[F_PHONE], MAXPH);
                        return SUCCESS;
                }
        }
                        return SUCCESS;
                }
        }
@@ -61,10 +65,10 @@ register char **nameptr;
  *             SUCCESS         Anything else
  */
 
  *             SUCCESS         Anything else
  */
 
-uualias (hostptr)
+uualias(hostptr)
 char  **hostptr;                         /* we change it */
 {
 char  **hostptr;                         /* we change it */
 {
-       FILE * Aliases;                   /* list of aliases */
+       FILE *Aliases;                    /* list of aliases */
        char buf[BUFSIZ];
        int atend;
        char *p, *q;
        char buf[BUFSIZ];
        int atend;
        char *p, *q;
@@ -76,9 +80,7 @@ char  **hostptr;                        /* we change it */
        }
 
        DEBUG (11, "Alias expansion for %s\n", *hostptr);
        }
 
        DEBUG (11, "Alias expansion for %s\n", *hostptr);
-       while (fgets(buf, sizeof (buf), Aliases)) {
-               if (buf[0] == '#')                /* comment line */
-                       continue;
+       while (cfgets(buf, sizeof (buf), Aliases)) {
                p = &buf[0];
                atend = 0;
                DEBUG(11, "Alias line: %s\n", buf);
                p = &buf[0];
                atend = 0;
                DEBUG(11, "Alias line: %s\n", buf);
index 1d82f0f..aab134c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)uux.c      5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)uux.c      5.5 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -7,6 +7,9 @@ static char sccsid[] = "@(#)uux.c       5.4 (Berkeley) %G%";
 #define NOSYSPART 0
 #define HASSYSPART 1
 
 #define NOSYSPART 0
 #define HASSYSPART 1
 
+#define LQUOTE '('
+#define RQUOTE ')'
+
 #define APPCMD(d) {\
 char *p; for (p = d; *p != '\0';) *cmdp++ = *p++; *cmdp++ = ' '; *cmdp = '\0';}
 
 #define APPCMD(d) {\
 char *p; for (p = d; *p != '\0';) *cmdp++ = *p++; *cmdp++ = ' '; *cmdp = '\0';}
 
@@ -14,6 +17,8 @@ char *p; for (p = d; *p != '\0';) *cmdp++ = *p++; *cmdp++ = ' '; *cmdp = '\0';}
 fprintf(f, "S %s %s %s -%s %s 0666\n", a, b, c, d, e); }
 #define GENRCV(f, a, b, c) {fprintf(f, "R %s %s %s - \n", a, b, c);}
 
 fprintf(f, "S %s %s %s -%s %s 0666\n", a, b, c, d, e); }
 #define GENRCV(f, a, b, c) {fprintf(f, "R %s %s %s - \n", a, b, c);}
 
+struct timeb Now;
+
 main(argc, argv)
 char *argv[];
 {
 main(argc, argv)
 char *argv[];
 {
@@ -112,12 +117,10 @@ char *argv[];
                }
                --argc;  argv++;
        }
                }
                --argc;  argv++;
        }
-       if (argc > 2) {
-               ap = getwd(Wrkdir);
-               if (ap == 0) {
-                       fprintf(stderr, "can't get working directory; will try to continue\n");
-                       strcpy(Wrkdir, "/UNKNOWN");
-               }
+       ap = getwd(Wrkdir);
+       if (ap == 0) {
+               fprintf(stderr, "can't get working directory; will try to continue\n");
+               strcpy(Wrkdir, "/UNKNOWN");
        }
 
        DEBUG(4, "\n\n** %s **\n", "START");
        }
 
        DEBUG(4, "\n\n** %s **\n", "START");
@@ -161,14 +164,11 @@ char *argv[];
                        continue;
                }
 
                        continue;
                }
 
-
                split(prm, xsys, rest);
                break;
        }
        if (xsys[0] == '\0')
                strcpy(xsys, local);
                split(prm, xsys, rest);
                break;
        }
        if (xsys[0] == '\0')
                strcpy(xsys, local);
-       strncpy(Rmtname, xsys, MAXBASENAME);
-       DEBUG(4, "xsys %s\n", xsys);
        if (versys(&xsys) != 0) {
                /*  bad system name  */
                fprintf(stderr, "bad system name: %s\n", xsys);
        if (versys(&xsys) != 0) {
                /*  bad system name  */
                fprintf(stderr, "bad system name: %s\n", xsys);
@@ -177,6 +177,9 @@ char *argv[];
                cleanup(EX_NOHOST);
        }
 
                cleanup(EX_NOHOST);
        }
 
+       strncpy(Rmtname, xsys, MAXBASENAME);
+       DEBUG(4, "xsys %s\n", xsys);
+
        if (pipein) {
                gename(DATAPRE, local, 'B', dfile);
                fpd = ufopen(dfile, "w");
        if (pipein) {
                gename(DATAPRE, local, 'B', dfile);
                fpd = ufopen(dfile, "w");
@@ -188,7 +191,10 @@ char *argv[];
                fclose(fpd);
                strcpy(tfile, dfile);
                if (strcmp(local, xsys) != SAME) {
                fclose(fpd);
                strcpy(tfile, dfile);
                if (strcmp(local, xsys) != SAME) {
-                       tfile[strlen(local) + 2] = 'S';
+                       register int Len = strlen(local);
+                       if (Len > SYSNSIZE)
+                               Len = SYSNSIZE;
+                       tfile[Len + 2] = 'S';
                        GENSEND(fpc, dfile, tfile, User, "", dfile);
                        cflag++;
                }
                        GENSEND(fpc, dfile, tfile, User, "", dfile);
                        cflag++;
                }
@@ -478,3 +484,44 @@ char **argv;
        }
 }
 #endif VMS
        }
 }
 #endif VMS
+
+/*
+ *     split into system and file part
+ *
+ *     return codes:
+ *             NOSYSPART
+ *             HASSYSPART
+ */
+
+split(name, sys, rest)
+register char *name, *rest;
+char *sys;
+{
+       register char *c;
+       register int i;
+
+       if (*name == LQUOTE) {
+               if ((c = index(name + 1, RQUOTE)) != NULL) {
+               /* strip off quotes */
+                       name++;
+                       while (c != name)
+                               *rest++ = *name++;
+                       *rest = '\0';
+                       *sys = '\0';
+                       return NOSYSPART;
+               }
+       }
+
+       if ((c = index(name, '!')) == NULL) {
+               strcpy(rest, name);
+               *sys = '\0';
+               return NOSYSPART;
+       }
+
+       *c++ = '\0';
+       strncpy(sys, name, MAXBASENAME);
+       sys[MAXBASENAME] = '\0';
+
+       strcpy(rest, c);
+       return HASSYSPART;
+}
index 9e74651..82ed80c 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)uuxqt.c    5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)uuxqt.c    5.7 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -36,6 +36,8 @@ int TransferSucceeded = 1;
 int notiok = 1;
 int nonzero = 0;
 
 int notiok = 1;
 int nonzero = 0;
 
+struct timeb Now;
+
 char PATH[MAXFULLNAME] = "PATH=/bin:/usr/bin:/usr/ucb";
 char Shell[MAXFULLNAME];
 char HOME[MAXFULLNAME];
 char PATH[MAXFULLNAME] = "PATH=/bin:/usr/bin:/usr/ucb";
 char Shell[MAXFULLNAME];
 char HOME[MAXFULLNAME];
@@ -177,9 +179,13 @@ doprocess:
        DEBUG(4, "process %s\n", CNULL);
        time(&xstart);
        while (gtxfile(xfile) > 0) {
        DEBUG(4, "process %s\n", CNULL);
        time(&xstart);
        while (gtxfile(xfile) > 0) {
-               ultouch();
                /* if /etc/nologin exists, exit cleanly */
                /* if /etc/nologin exists, exit cleanly */
+#if defined(BSD4_2) || defined(USG)
+               if (access(NOLOGIN) == 0) {
+#else !BSD4_2 && ! USG
+               ultouch();
                if (nologinflag) {
                if (nologinflag) {
+#endif !BSD4_2 && !USG
                        logent(NOLOGIN, "UUXQT SHUTDOWN");
                        if (Debug)
                                logent("debugging", "continuing anyway");
                        logent(NOLOGIN, "UUXQT SHUTDOWN");
                        if (Debug)
                                logent("debugging", "continuing anyway");
@@ -681,7 +687,6 @@ char *cmd, *fi, *fo;
                signal(SIGINT, SIG_IGN);
                signal(SIGHUP, SIG_IGN);
                signal(SIGQUIT, SIG_IGN);
                signal(SIGINT, SIG_IGN);
                signal(SIGHUP, SIG_IGN);
                signal(SIGQUIT, SIG_IGN);
-               signal(SIGKILL, SIG_IGN);
                close(Ifn);
                close(Ofn);
                close(0);
                close(Ifn);
                close(Ofn);
                close(0);