still more fixes and changes from rick@seismo
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 25 Jan 1986 05:20:23 +0000 (21:20 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Sat, 25 Jan 1986 05:20:23 +0000 (21:20 -0800)
SCCS-vsn: usr.bin/uucp/acucntrl/acucntrl.c 5.7
SCCS-vsn: usr.bin/uucp/uucico/cico.c 5.12
SCCS-vsn: usr.bin/uucp/uucico/cntrl.c 5.8
SCCS-vsn: usr.bin/uucp/uucico/condevs.c 5.14
SCCS-vsn: usr.bin/uucp/includes/condevs.h 4.4
SCCS-vsn: usr.bin/uucp/uucico/conn.c 5.10
SCCS-vsn: usr.bin/uucp/uucico/tio.c 4.6
SCCS-vsn: usr.bin/uucp/uux/uux.c 5.6
SCCS-vsn: usr.bin/uucp/uuxqt/uuxqt.c 5.8

usr/src/usr.bin/uucp/acucntrl/acucntrl.c
usr/src/usr.bin/uucp/includes/condevs.h
usr/src/usr.bin/uucp/uucico/cico.c
usr/src/usr.bin/uucp/uucico/cntrl.c
usr/src/usr.bin/uucp/uucico/condevs.c
usr/src/usr.bin/uucp/uucico/conn.c
usr/src/usr.bin/uucp/uucico/tio.c
usr/src/usr.bin/uucp/uux/uux.c
usr/src/usr.bin/uucp/uuxqt/uuxqt.c

index 2dea231..71db3d2 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)acucntrl.c 5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)acucntrl.c 5.7 (Berkeley) %G%";
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
 #endif
 
 /*  acucntrl - turn around tty line between dialin and dialout
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)acucntrl.c        5.6 (Berkeley) %G%";
 /* #define SENSECARRIER */
 
 #include "uucp.h"
 /* #define SENSECARRIER */
 
 #include "uucp.h"
+#ifdef DIALINOUT
 #include <sys/buf.h>
 #include <signal.h>
 #include <sys/conf.h>
 #include <sys/buf.h>
 #include <signal.h>
 #include <sys/conf.h>
@@ -417,13 +418,18 @@ char *device;
        }
 
        ndevice = strlen(device);
        }
 
        ndevice = strlen(device);
+#ifndef BRL4_2
        utmploc = sizeof(utmp);
        utmploc = sizeof(utmp);
+#else BRL4_2
+       utmploc = 0;
+#endif BRL4_2
 
        while(fgets(linebuf, sizeof(linebuf) - 1, ttysfile) != NULL) {
                if(strncmp(device, linebuf, ndevice) == 0)
                        return;
                ttyslnbeg += strlen(linebuf);
 
        while(fgets(linebuf, sizeof(linebuf) - 1, ttysfile) != NULL) {
                if(strncmp(device, linebuf, ndevice) == 0)
                        return;
                ttyslnbeg += strlen(linebuf);
-               utmploc += sizeof(utmp);
+               if (linebuf[0] != '#' && linebuf[0] != '\0')
+                       utmploc += sizeof(utmp);
                if (fputs(linebuf, nttysfile) == NULL) {
                        fprintf(stderr, "On %s write: %s\n",
                                Etcttys, sys_errlist[errno]);
                if (fputs(linebuf, nttysfile) == NULL) {
                        fprintf(stderr, "On %s write: %s\n",
                                Etcttys, sys_errlist[errno]);
@@ -723,3 +729,4 @@ prefix(s1, s2)
                        return (1);
        return (c == '\0');
 }
                        return (1);
        return (c == '\0');
 }
+#endif DIALINOUT
index 830e899..83adb39 100644 (file)
@@ -1,4 +1,4 @@
-/*     condevs.h       4.3     85/06/19        */
+/*     condevs.h       4.4     86/01/24        */
 
 #include "uucp.h"
 #include <errno.h>
 
 #include "uucp.h"
 #include <errno.h>
@@ -31,6 +31,10 @@ int dnopn(), dncls();
 int hyspopn(), hystopn(), hyscls();
 #endif HAYES
 
 int hyspopn(), hystopn(), hyscls();
 #endif HAYES
 
+#ifdef HAYES2400
+int hyspopn24(), hystop24n(), hyscls();
+#endif HAYES2400
+
 #ifdef HAYESQ
 int hysqopn(), hysqcls();  /* a version of hayes that doesn't use ret codes */
 #endif HAYESQ
 #ifdef HAYESQ
 int hysqopn(), hysqcls();  /* a version of hayes that doesn't use ret codes */
 #endif HAYESQ
@@ -39,6 +43,10 @@ int hysqopn(), hysqcls();  /* a version of hayes that doesn't use ret codes */
 int novopn(), novcls();
 #endif NOVATION
 
 int novopn(), novcls();
 #endif NOVATION
 
+#ifdef CDS224
+int cdsopn224(), cdscls224();
+#endif CDs224
+
 #ifdef DF02
 int df2opn(), df2cls();
 #endif DF02
 #ifdef DF02
 int df2opn(), df2cls();
 #endif DF02
index 14e8d8b..ef724ff 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cico.c     5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)cico.c     5.12 (Berkeley) %G%";
 #endif
 
 #include <signal.h>
 #endif
 
 #include <signal.h>
@@ -238,7 +238,6 @@ register char *argv[];
                        ttyn = ttyname(Ifn);
                }
                fixmode(Ifn);
                        ttyn = ttyname(Ifn);
                }
                fixmode(Ifn);
-               getbaud(Ifn);
 
                /*
                 * Initial Message -- tell them we're here, and who we are.
 
                /*
                 * Initial Message -- tell them we're here, and who we are.
@@ -539,14 +538,11 @@ loop:
                seq = 0;
 #endif !GNXSEQ
                if (MaxGrade != '\177') {
                seq = 0;
 #endif !GNXSEQ
                if (MaxGrade != '\177') {
-                       char buf[MAXFULLNAME];
-                       sprintf(buf, " -p%c -vgrade=%c", MaxGrade, MaxGrade);
-                       strcat(rflags, buf);
-               }
-
-               sprintf(msg, "%s -Q%d %s", Myname, seq, rflags);
-               if (MaxGrade != '\177')
                        DEBUG(2, "Max Grade this transfer is %c\n", MaxGrade);
                        DEBUG(2, "Max Grade this transfer is %c\n", MaxGrade);
+                       sprintf(msg, "%s -Q%d -p%c -vgrade=%c %s",
+                               Myname, seq, MaxGrade, MaxGrade, rflags);
+               } else
+                       sprintf(msg, "%s -Q%d %s", Myname, seq, rflags);
                omsg('S', msg, Ofn);
                for (;;) {
                        ret = imsg(msg, Ifn);
                omsg('S', msg, Ofn);
                for (;;) {
                        ret = imsg(msg, Ifn);
index 8f78a03..4f013d4 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cntrl.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)cntrl.c    5.8 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -577,15 +577,14 @@ process:
                        } else
                                WMESG(RQSTCMPT, status ? EM_RMTCP : YES);
                        notify(mailopt, W_USER, filename, Rmtname,
                        } else
                                WMESG(RQSTCMPT, status ? EM_RMTCP : YES);
                        notify(mailopt, W_USER, filename, Rmtname,
-                         status ? EM_LOCCP : YES);
+                               status ? EM_LOCCP : YES);
                        if (status == 0) {
                                sscanf(&msg[2], "%o", &filemode);
                                if (filemode <= 0)
                                        filemode = BASEMODE;
                                chmod(subfile(filename), (filemode|BASEMODE)&0777);
                                USRF(USR_COK);
                        if (status == 0) {
                                sscanf(&msg[2], "%o", &filemode);
                                if (filemode <= 0)
                                        filemode = BASEMODE;
                                chmod(subfile(filename), (filemode|BASEMODE)&0777);
                                USRF(USR_COK);
-                       }
-                       else {
+                       } else {
                                logent(_FAILED, "COPY");
                                putinpub(filename, Dfile, W_USER);
                                USRF(USR_LOCCP);
                                logent(_FAILED, "COPY");
                                putinpub(filename, Dfile, W_USER);
                                USRF(USR_LOCCP);
@@ -657,19 +656,16 @@ process:
 }
 
 
 }
 
 
-/***
- *     rmesg(c, msg, n)        read message 'c'
- *                             try 'n' times
- *     char *msg, c;
+/*
+ *     read message 'c'. try 'n' times
  *
  *
- *     return code:  0  |  FAIL
+ *     return code:  SUCCESS  |  FAIL
  */
  */
-
 rmesg(c, msg, n)
 register char *msg, c;
 register int n;
 {
 rmesg(c, msg, n)
 register char *msg, c;
 register int n;
 {
-       char str[128];
+       char str[MAXFULLNAME];
 
        DEBUG(4, "rmesg - '%c' ", c);
        while ((*Rdmsg)(msg, Ifn) != SUCCESS) {
 
        DEBUG(4, "rmesg - '%c' ", c);
        while ((*Rdmsg)(msg, Ifn) != SUCCESS) {
@@ -697,13 +693,11 @@ register int n;
 }
 
 
 }
 
 
-/***
- *     wmesg(m, s)     write a message (type m)
- *     char *s, m;
+/*
+ *     write a message (type m)
  *
  *
- *     return codes: 0 - ok | FAIL - ng
+ *     return codes: SUCCESS - ok | FAIL - ng
  */
  */
-
 wmesg(m, s)
 register char *s, m;
 {
 wmesg(m, s)
 register char *s, m;
 {
@@ -712,17 +706,15 @@ register char *s, m;
        return (*Wrmsg)(m, s, Ofn);
 }
 
        return (*Wrmsg)(m, s, Ofn);
 }
 
-
-/***
- *     notify          mail results of command
+/*
+ *     mail results of command
  *
  *     return codes:  none
  */
  *
  *     return codes:  none
  */
-
 notify(mailopt, user, file, sys, msgcode)
 char *user, *file, *sys, *msgcode;
 {
 notify(mailopt, user, file, sys, msgcode)
 char *user, *file, *sys, *msgcode;
 {
-       char str[200];
+       char str[BUFSIZ];
        int i;
        char *msg;
 
        int i;
        char *msg;
 
@@ -742,12 +734,11 @@ char *user, *file, *sys, *msgcode;
        return;
 }
 
        return;
 }
 
-/***
- *     lnotify(user, file, mesg)       - local notify
+/*
+ *     local notify
  *
  *     return code - none
  */
  *
  *     return code - none
  */
-
 lnotify(user, file, mesg)
 char *user, *file, *mesg;
 {
 lnotify(user, file, mesg)
 char *user, *file, *mesg;
 {
@@ -757,20 +748,14 @@ char *user, *file, *mesg;
        return;
 }
 
        return;
 }
 
-
-/***
- *     startup(role)
- *     int role;
- *
- *     startup  -  this routine will converse with the remote
- *     machine, agree upon a protocol (if possible) and start the
- *     protocol.
+/*
+ *     converse with the remote machine, agree upon a protocol (if possible)
+ *     and start the protocol.
  *
  *     return codes:
  *             SUCCESS - successful protocol selection
  *             FAIL - can't find common or open failed
  */
  *
  *     return codes:
  *             SUCCESS - successful protocol selection
  *             FAIL - can't find common or open failed
  */
-
 startup(role)
 int role;
 {
 startup(role)
 int role;
 {
@@ -808,36 +793,29 @@ int role;
        }
 }
 
        }
 }
 
-
-/*******
- *     char
- *     fptcl(str)
- *     char *str;
- *
- *     fptcl  -  this routine will choose a protocol from
- *     the input string (str) and return the found letter.
+/*
+ *     choose a protocol from the input string (str) and return the it
  *
  *     return codes:
  *             '\0'  -  no acceptable protocol
  *             any character  -  the chosen protocol
  */
  *
  *     return codes:
  *             '\0'  -  no acceptable protocol
  *             any character  -  the chosen protocol
  */
-
 char
 fptcl(str)
 register char *str;
 {
        register struct Proto *p;
 char
 fptcl(str)
 register char *str;
 {
        register struct Proto *p;
-       extern char *Flds[];
+       extern char LineType[];
 
        for (p = Ptbl; p->P_id != '\0'; p++) {
 #ifdef TCPIP
                /* Only use 't' on TCP/IP */
 
        for (p = Ptbl; p->P_id != '\0'; p++) {
 #ifdef TCPIP
                /* Only use 't' on TCP/IP */
-               if (p->P_id == 't' && strcmp("TCP", Flds[F_LINE]))
+               if (p->P_id == 't' && strcmp("TCP", LineType))
                        continue;
 #endif TCPIP
 #ifdef PAD
                /* only use 'f' protocol on PAD */
                        continue;
 #endif TCPIP
 #ifdef PAD
                /* only use 'f' protocol on PAD */
-               if (p->P_id == 'f' && strcmp("PAD", Flds[F_LINE]))
+               if (p->P_id == 'f' && strcmp("PAD", LineType))
                        continue;
 #endif PAD
                if (index(str, p->P_id) != NULL) {
                        continue;
 #endif PAD
                if (index(str, p->P_id) != NULL) {
@@ -848,20 +826,9 @@ register char *str;
        return '\0';
 }
 
        return '\0';
 }
 
-
-/***
- *     char *
- *     blptcl(str)
- *     char *str;
- *
- *     blptcl  -  this will build a string of the
- *     letters of the available protocols and return
- *     the string (str).
- *
- *     return:
- *             a pointer to string (str)
+/*
+ *     build a string of the letters of the available protocols 
  */
  */
-
 char *
 blptcl(str)
 register char *str;
 char *
 blptcl(str)
 register char *str;
@@ -875,11 +842,8 @@ register char *str;
        return str;
 }
 
        return str;
 }
 
-/***
- *     stptcl(c)
- *     char *c;
- *
- *     stptcl  -  this routine will set up the six routines
+/*
+ *     this routine will set up the six routines
  *     (Rdmsg, Wrmsg, Rddata, Wrdata, Turnon, Turnoff) for the
  *     desired protocol.
  *
  *     (Rdmsg, Wrmsg, Rddata, Wrdata, Turnon, Turnoff) for the
  *     desired protocol.
  *
@@ -888,7 +852,6 @@ register char *str;
  *             FAIL - no find or failed to open
  *
  */
  *             FAIL - no find or failed to open
  *
  */
-
 stptcl(c)
 register char *c;
 {
 stptcl(c)
 register char *c;
 {
@@ -913,15 +876,14 @@ register char *c;
        return FAIL;
 }
 
        return FAIL;
 }
 
-/***
- *     putinpub        put file in public place
- *                     if successful, filename is modified
+/*
+ *     put file in public place. if successful, filename is modified
  *
  *
- *     return code  0 | FAIL
+ *     return code  SUCCESS | FAIL
  */
 
 putinpub(file, tmp, user)
  */
 
 putinpub(file, tmp, user)
-register char *file, *user, *tmp;
+register char *file, *tmp, *user;
 {
        char fullname[MAXFULLNAME];
        char *lastpart();
 {
        char fullname[MAXFULLNAME];
        char *lastpart();
@@ -930,6 +892,7 @@ register char *file, *user, *tmp;
        sprintf(fullname, "%s/%s/", PUBDIR, user);
        if (mkdirs(fullname) != 0) {
                /* can not make directories */
        sprintf(fullname, "%s/%s/", PUBDIR, user);
        if (mkdirs(fullname) != 0) {
                /* can not make directories */
+               DEBUG(1, "Cannot mkdirs(%s)\n", fullname);
                return FAIL;
        }
        strcat(fullname, lastpart(file));
                return FAIL;
        }
        strcat(fullname, lastpart(file));
@@ -941,8 +904,8 @@ register char *file, *user, *tmp;
        return status;
 }
 
        return status;
 }
 
-/***
- *     unlinkdf(file)  - unlink D. file
+/*
+ *     unlink D. file
  *
  *     return code - none
  */
  *
  *     return code - none
  */
@@ -955,12 +918,11 @@ register char *file;
        return;
 }
 
        return;
 }
 
-/***
- *     arrived - notify receiver of arrived file
+/*
+ *     notify receiver of arrived file
  *
  *     return code - none
  */
  *
  *     return code - none
  */
-
 arrived(opt, file, nuser, rmtsys, rmtuser)
 char *file, *nuser, *rmtsys, *rmtuser;
 {
 arrived(opt, file, nuser, rmtsys, rmtuser)
 char *file, *nuser, *rmtsys, *rmtuser;
 {
index 43228ff..ce125e3 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)condevs.c  5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)condevs.c  5.14 (Berkeley) %G%";
 #endif
 
 extern int errno;
 #endif
 
 extern int errno;
@@ -55,11 +55,19 @@ struct condev condevs[] = {
        { "ACU", "hayestone", Acuopn, hystopn, hyscls },
        { "WATS", "hayestone", Acuopn, hystopn, hyscls },
 #endif HAYES
        { "ACU", "hayestone", Acuopn, hystopn, hyscls },
        { "WATS", "hayestone", Acuopn, hystopn, hyscls },
 #endif HAYES
+#ifdef HAYES2400
+       { "ACU", "hayes2400", Acuopn, hyspopn24, hyscls24 },
+       { "ACU", "hayes2400pulse", Acuopn, hyspopn24, hyscls24 },
+       { "ACU", "hayes2400tone", Acuopn, hystopn24, hyscls24 },
+#endif HAYES2400
 #ifdef HAYESQ  /* a version of hayes that doesn't use result codes */
        { "ACU", "hayesq", Acuopn, hysqpopn, hysqcls },
        { "ACU", "hayesqpulse", Acuopn, hysqpopn, hysqcls },
        { "ACU", "hayesqtone", Acuopn, hysqtopn, hysqcls },
 #endif HAYESQ
 #ifdef HAYESQ  /* a version of hayes that doesn't use result codes */
        { "ACU", "hayesq", Acuopn, hysqpopn, hysqcls },
        { "ACU", "hayesqpulse", Acuopn, hysqpopn, hysqcls },
        { "ACU", "hayesqtone", Acuopn, hysqtopn, hysqcls },
 #endif HAYESQ
+#ifdef CDS224
+       { "ACU", "cds224", Acuopn, cdsopn224, cdscls224},
+#endif CDS224
 #ifdef NOVATION
        { "ACU", "novation", Acuopn, novopn, novcls},
 #endif NOVATION
 #ifdef NOVATION
        { "ACU", "novation", Acuopn, novopn, novcls},
 #endif NOVATION
index 7a2f4b5..281a704 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)conn.c     5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)conn.c     5.10 (Berkeley) %G%";
 #endif
 
 #include <signal.h>
 #endif
 
 #include <signal.h>
@@ -102,6 +102,7 @@ static char PCP_brand[20];
 
 int Dcf = -1;
 char *Flds[MAXC/10];
 
 int Dcf = -1;
 char *Flds[MAXC/10];
+char LineType[10];
 extern int LocalOnly;
 
 conn(system)
 extern int LocalOnly;
 
 conn(system)
@@ -120,10 +121,11 @@ char *system;
        DEBUG(4, "finds (%s) called\n", system);
 keeplooking:
        while((nf = finds(fsys, system, info, Flds)) > 0) {
        DEBUG(4, "finds (%s) called\n", system);
 keeplooking:
        while((nf = finds(fsys, system, info, Flds)) > 0) {
+               strncpy(LineType, Flds[F_LINE], 10);
                if (LocalOnly) {
                if (LocalOnly) {
-                       if (strcmp("TCP", Flds[F_LINE])
-                               && strcmp("DIR", Flds[F_LINE])
-                               && strcmp("LOCAL", Flds[F_LINE]) ) {
+                       if (strcmp("TCP", LineType)
+                               && strcmp("DIR", LineType)
+                               && strcmp("LOCAL", LineType) ) {
                                        fcode = CF_TIME;
                                        continue;
                        }
                                        fcode = CF_TIME;
                                        continue;
                        }
@@ -135,7 +137,7 @@ keeplooking:
                                continue;
                }
                /* For GTE's PC Pursuit */
                                continue;
                }
                /* For GTE's PC Pursuit */
-               if (snccmp(Flds[F_LINE], PCP) == SAME) {
+               if (snccmp(LineType, PCP) == SAME) {
                        FILE *dfp;
                        int status;
                        static struct Devices dev;
                        FILE *dfp;
                        int status;
                        static struct Devices dev;
@@ -182,7 +184,7 @@ keeplooking:
 
        Dcf = fcode;
 
 
        Dcf = fcode;
 
-       if (fcode >= 0 && snccmp(Flds[F_LINE], PCP) == SAME) {
+       if (fcode >= 0 && snccmp(LineType, PCP) == SAME) {
                AbortOn = "Good";       /* .... Good Bye */
                fcode = expect("****~300", Dcf);
                if (fcode != SUCCESS) {
                AbortOn = "Good";       /* .... Good Bye */
                fcode = expect("****~300", Dcf);
                if (fcode != SUCCESS) {
@@ -562,39 +564,6 @@ int tty, spwant;
        return SUCCESS;
 }
 
        return SUCCESS;
 }
 
-/*
- *     getbaud(tty)    set linebaudrate variable
- *
- *     return codes:  none
- */
-
-getbaud(tty)
-int tty;
-{
-#ifdef USG
-       struct termio ttbuf;
-#else
-       struct sgttyb ttbuf;
-#endif
-       register struct sg_spds *ps;
-       register int name;
-
-       if (IsTcpIp)
-               return;
-#ifdef USG
-       ioctl(tty, TCGETA, &ttbuf);
-       name = ttbuf.c_cflag & CBAUD;
-#else
-       ioctl(tty, TIOCGETP, &ttbuf);
-       name = ttbuf.sg_ispeed;
-#endif
-       for (ps = spds; ps->sp_val; ps++)
-               if (ps->sp_name == name) {
-                       linebaudrate = ps->sp_val;
-                       break;
-               }
-}
-
 #define MR 100
 
 /*
 #define MR 100
 
 /*
@@ -1003,16 +972,10 @@ char *string;
        if (th < tl) {          /* crosses midnight */
                if (tl <= tn || tn < th)
                        return MGrade;
        if (th < tl) {          /* crosses midnight */
                if (tl <= tn || tn < th)
                        return MGrade;
-       } else
-
-       if (i < 2)
-               return MGrade;
-       if (th < tl) {  /* crosses midnight */
-               if (tl <= tn || tn < th)
-                       return MGrade;
-       } else
+       } else {
                if (tl <= tn && tn < th)
                        return MGrade;
                if (tl <= tn && tn < th)
                        return MGrade;
+       }
        return FAIL;
 }
 
        return FAIL;
 }
 
index 26ee947..ff6b910 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)tio.c      4.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)tio.c      4.6 (Berkeley) %G%";
 #endif
 
 #include <signal.h>
 #endif
 
 #include <signal.h>
@@ -109,11 +109,11 @@ FILE *fp1;
 #endif !USG
        while ((len = read(fileno(fp1), bufr.t_data, TBUFSIZE)) > 0) {
                bytes += len;
 #endif !USG
        while ((len = read(fileno(fp1), bufr.t_data, TBUFSIZE)) > 0) {
                bytes += len;
-#if defined(vax) || defined(pdp11)
+#if defined(vax) || defined(pdp11) || defined(ns32000)
                bufr.t_nbytes = htonl((long)len);
                bufr.t_nbytes = htonl((long)len);
-#else !vax and !pdp11
+#else !vax and !pdp11 and !ns32000
                bufr.t_nbytes = len;
                bufr.t_nbytes = len;
-#endif !vax and !pdp11
+#endif !vax and !pdp11 and !ns32000
                DEBUG(8,"twrdata sending %d bytes\n",len);
                len += sizeof(long);
                alarm(MAXMSGTIME);
                DEBUG(8,"twrdata sending %d bytes\n",len);
                len += sizeof(long);
                alarm(MAXMSGTIME);
@@ -152,7 +152,6 @@ FILE *fp1;
        return SUCCESS;
 }
 
        return SUCCESS;
 }
 
-
 trddata(fn, fp2)
 FILE *fp2;
 {
 trddata(fn, fp2)
 FILE *fp2;
 {
@@ -178,9 +177,9 @@ FILE *fp2;
                alarm(0);
                if (len != sizeof Nbytes)
                        return FAIL;
                alarm(0);
                if (len != sizeof Nbytes)
                        return FAIL;
-#if defined(vax) || defined(pdp11)
+#if defined(vax) || defined(pdp11) || defined(ns32000)
                Nbytes = ntohl(Nbytes);
                Nbytes = ntohl(Nbytes);
-#endif vax or pdp11
+#endif vax or pdp11 or ns32000
                DEBUG(8,"trddata expecting %ld bytes\n",Nbytes);
                nread = Nbytes;
                if (nread == 0)
                DEBUG(8,"trddata expecting %ld bytes\n",Nbytes);
                nread = Nbytes;
                if (nread == 0)
index aab134c..03400e9 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)uux.c      5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)uux.c      5.6 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -11,10 +11,17 @@ static char sccsid[] = "@(#)uux.c   5.5 (Berkeley) %G%";
 #define RQUOTE ')'
 
 #define APPCMD(d) {\
 #define RQUOTE ')'
 
 #define APPCMD(d) {\
-char *p; for (p = d; *p != '\0';) *cmdp++ = *p++; *cmdp++ = ' '; *cmdp = '\0';}
+register char *p; for (p = d; *p != '\0';)\
+       {*cmdp++ = *p++;\
+               if(cmdp>(sizeof(cmd)+&cmd[0])){\
+                       fprintf(stderr,"argument list too long\n");\
+                       cleanup(EX_SOFTWARE);\
+               }\
+       }\
+       *cmdp++ = ' '; *cmdp = '\0';}
 
 #define GENSEND(f, a, b, c, d, e) {\
 
 #define GENSEND(f, a, b, c, d, e) {\
-fprintf(f, "S %s %s %s -%s %s 0666\n", a, b, c, d, e); }
+       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;
 #define GENRCV(f, a, b, c) {fprintf(f, "R %s %s %s - \n", a, b, c);}
 
 struct timeb Now;
@@ -36,15 +43,15 @@ char *argv[];
        int Copy = 1;           /* Copy spool files */
 #endif !DONTCOPY
        int Linkit = 0;         /* Try link before copy */
        int Copy = 1;           /* Copy spool files */
 #endif !DONTCOPY
        int Linkit = 0;         /* Try link before copy */
-       char buf[BUFSIZ];
-       char inargs[BUFSIZ];
+       char buf[2*BUFSIZ];
+       char inargs[2*BUFSIZ];
        int pipein = 0;
        int startjob = 1;
        char Grade = 'A';
        char path[MAXFULLNAME];
        int pipein = 0;
        int startjob = 1;
        char Grade = 'A';
        char path[MAXFULLNAME];
-       char cmd[BUFSIZ];
+       char cmd[2*BUFSIZ];
        char *ap, *cmdp;
        char *ap, *cmdp;
-       char prm[BUFSIZ];
+       char prm[2*BUFSIZ];
        char syspart[MAXBASENAME+1], rest[MAXFULLNAME];
        char Xsys[MAXBASENAME+1], local[MAXBASENAME+1];
        char *xsys = Xsys;
        char syspart[MAXBASENAME+1], rest[MAXFULLNAME];
        char Xsys[MAXBASENAME+1], local[MAXBASENAME+1];
        char *xsys = Xsys;
@@ -187,6 +194,14 @@ char *argv[];
                while (!feof(stdin)) {
                        ret = fread(buf, 1, BUFSIZ, stdin);
                        fwrite(buf, 1, ret, fpd);
                while (!feof(stdin)) {
                        ret = fread(buf, 1, BUFSIZ, stdin);
                        fwrite(buf, 1, ret, fpd);
+                       if (ferror(stdin)) {
+                               perror("stdin");
+                               cleanup(EX_IOERR);
+                       }
+                       if (ferror(fpd)) {
+                               perror(dfile);
+                               cleanup(EX_IOERR);
+                       }
                }
                fclose(fpd);
                strcpy(tfile, dfile);
                }
                fclose(fpd);
                strcpy(tfile, dfile);
@@ -381,11 +396,15 @@ char *argv[];
                if (*ap == '!') {
                        fprintf(stderr, "uux handles only adjacent sites.\n");
                        fprintf(stderr, "Try uusend for multi-hop delivery.\n");
                if (*ap == '!') {
                        fprintf(stderr, "uux handles only adjacent sites.\n");
                        fprintf(stderr, "Try uusend for multi-hop delivery.\n");
-                       cleanup(1);
+                       cleanup(EX_USAGE);
                }
 
        fprintf(fprx, "%c %s\n", X_CMD, cmd);
                }
 
        fprintf(fprx, "%c %s\n", X_CMD, cmd);
-       logent(cmd, "XQT QUE'D");
+       if (ferror(fprx)) {
+               logent(cmd, "COULD NOT QUEUE XQT");
+               cleanup(EX_IOERR);
+       } else
+               logent(cmd, "XQT QUE'D");
        fclose(fprx);
 
        gename(XQTPRE, local, Grade, tfile);
        fclose(fprx);
 
        gename(XQTPRE, local, Grade, tfile);
@@ -403,6 +422,8 @@ char *argv[];
                cflag++;
        }
 
                cflag++;
        }
 
+       if (ferror(fpc))
+               cleanup(EX_IOERR);
        fclose(fpc);
        if (cflag) {
                gename(CMDPRE, xsys, Grade, cfile);
        fclose(fpc);
        if (cflag) {
                gename(CMDPRE, xsys, Grade, cfile);
index 82ed80c..3402f91 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)uuxqt.c    5.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)uuxqt.c    5.8 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -290,11 +290,6 @@ doprocess:
                 */
                if (cmdp > buf && cmdp[0] == '\0' && cmdp[-1] == ' ')
                        *--cmdp = '\0';
                 */
                if (cmdp > buf && cmdp[0] == '\0' && cmdp[-1] == ' ')
                        *--cmdp = '\0';
-               if (strpbrk(user, BADCHARS) != NULL) {
-                       sprintf(lbuf, "%s INVALID CHARACTER IN USERNAME", user);
-                       logent(cmd, lbuf);
-                       strcpy(user, "postmaster");
-               }
                if (argnok || badfiles) {
                        sprintf(lbuf, "%s XQT DENIED", user);
                        logent(cmd, lbuf);
                if (argnok || badfiles) {
                        sprintf(lbuf, "%s XQT DENIED", user);
                        logent(cmd, lbuf);
@@ -629,25 +624,35 @@ char *user, *rmt, *cmd, *str;
        char text[MAXFULLNAME];
        char ruser[MAXFULLNAME];
 
        char text[MAXFULLNAME];
        char ruser[MAXFULLNAME];
 
+       if (strpbrk(user, BADCHARS) != NULL) {
+               char lbuf[MAXFULLNAME];
+               sprintf(lbuf, "%s INVALID CHARACTER IN USERNAME", user);
+               logent(cmd, lbuf);
+               strcpy(user, "postmaster");
+       }
        sprintf(text, "uuxqt cmd (%s) status (%s)", cmd, str);
        if (prefix(rmt, Myname))
                strcpy(ruser, user);
        else
                sprintf(ruser, "%s!%s", rmt, user);
        mailst(ruser, text, CNULL);
        sprintf(text, "uuxqt cmd (%s) status (%s)", cmd, str);
        if (prefix(rmt, Myname))
                strcpy(ruser, user);
        else
                sprintf(ruser, "%s!%s", rmt, user);
        mailst(ruser, text, CNULL);
-       return;
 }
 
 /*
  *     return mail to sender
  *
  */
 }
 
 /*
  *     return mail to sender
  *
  */
-
 retosndr(user, rmt, file)
 char *user, *rmt, *file;
 {
        char ruser[MAXFULLNAME];
 
 retosndr(user, rmt, file)
 char *user, *rmt, *file;
 {
        char ruser[MAXFULLNAME];
 
+       if (strpbrk(user, BADCHARS) != NULL) {
+               char lbuf[MAXFULLNAME];
+               sprintf(lbuf, "%s INVALID CHARACTER IN USERNAME", user);
+               logent(file, lbuf);
+               strcpy(user, "postmaster");
+       }
        if (strcmp(rmt, Myname) == SAME)
                strcpy(ruser, user);
        else
        if (strcmp(rmt, Myname) == SAME)
                strcpy(ruser, user);
        else