Update uucp.

This commit is contained in:
Serge
2022-06-18 21:50:44 -07:00
parent c849b8f1f8
commit 82817c9308
57 changed files with 684 additions and 865 deletions

View File

@@ -17,7 +17,7 @@ LIBOBJ = logent.o ulockf.o uucpdefs.o subdir.o gename.o assert.o expfile.o \
mailst.o systat.o cntrl.o imsg.o gio.o sysacct.o pk0.o pk1.o \ mailst.o systat.o cntrl.o imsg.o gio.o sysacct.o pk0.o pk1.o \
conn.o condevs.o chksum.o setline.o gnsys.o conn.o condevs.o chksum.o setline.o gnsys.o
CC = $(GCCPREFIX)gcc -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES) #CC = $(GCCPREFIX)gcc -EL -msoft-float -nostdinc -fshort-double -I$(TOPSRC)/include $(INCLUDES)
#CC += -mips16 #CC += -mips16

View File

@@ -1,9 +1,5 @@
#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)acucntrl.c 5.8.2 (2.11BSD GTE) 1996/3/22";
#endif
/* acucntrl - turn around tty line between dialin and dialout /* acucntrl - turn around tty line between dialin and dialout
* *
* Usage: acucntrl {enable,disable} /dev/ttydX * Usage: acucntrl {enable,disable} /dev/ttydX
* *
* History: * History:
@@ -354,7 +350,7 @@ char *device, *name;
fprintf(stderr, "on write in %s: %s", Etcutmp, fprintf(stderr, "on write in %s: %s", Etcutmp,
strerror(errno)); strerror(errno));
} }
/* poke process 1 and wait for it to do its thing */ /* poke process 1 and wait for it to do its thing */
pokeinit(device, uname, enable) pokeinit(device, uname, enable)
char *uname, *device; int enable; char *uname, *device; int enable;
@@ -395,7 +391,7 @@ char *uname, *device; int enable;
opnttys(device) opnttys(device)
char *device; char *device;
{ {
register int ndevice; register int ndevice;
register char *p; register char *p;
char *index(); char *index();
char linebuf[BUFSIZ]; char linebuf[BUFSIZ];
@@ -438,7 +434,7 @@ char *device;
Etcttys, strerror(errno)); Etcttys, strerror(errno));
exit(1); exit(1);
} }
} }
fprintf(stderr, "%s not found in %s\n", device, Etcttys); fprintf(stderr, "%s not found in %s\n", device, Etcttys);
exit(1); exit(1);
@@ -508,7 +504,7 @@ int enable;
exit(1); exit(1);
} }
} }
if (enable^resettty) if (enable^resettty)
(void) unlink(NEtcttys); (void) unlink(NEtcttys);
else { else {
@@ -531,7 +527,7 @@ opnttys(device)
char *device; char *device;
{ {
register FILE *ttysfile; register FILE *ttysfile;
register int ndevice, lnsiz; register int ndevice, lnsiz;
register char *p; register char *p;
char *index(); char *index();
char linebuf[BUFSIZ]; char linebuf[BUFSIZ];

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)hys.c 4.6 (Berkeley) 2/12/86";
#endif
#include "../condevs.h" #include "../condevs.h"
#ifdef HAYES #ifdef HAYES
@@ -15,38 +11,13 @@ static char sccsid[] = "@(#)hys.c 4.6 (Berkeley) 2/12/86";
*/ */
#endif #endif
/*
* hyspopn(telno, flds, dev) connect to hayes smartmodem (pulse call)
* hystopn(telno, flds, dev) connect to hayes smartmodem (tone call)
* char *flds[], *dev[];
*
* return codes:
* >0 - file number - ok
* CF_DIAL,CF_DEVICE - failed
*/
hyspopn(telno, flds, dev)
char *telno, *flds[];
struct Devices *dev;
{
return hysopn(telno, flds, dev, 0);
}
hystopn(telno, flds, dev)
char *telno, *flds[];
struct Devices *dev;
{
return hysopn(telno, flds, dev, 1);
}
/* ARGSUSED */ /* ARGSUSED */
hysopn(telno, flds, dev, toneflag) int hysopn(telno, flds, dev, toneflag)
char *telno; char *telno;
char *flds[]; char *flds[];
struct Devices *dev; struct Devices *dev;
int toneflag; int toneflag;
{ {
extern errno;
char dcname[20]; char dcname[20];
char cbuf[MAXPH]; char cbuf[MAXPH];
register char *cp; register char *cp;
@@ -130,7 +101,7 @@ int toneflag;
return CF_DIAL; return CF_DIAL;
} }
i = atoi(&cbuf[8]); i = atoi(&cbuf[8]);
if (i > 0 && i != dev->D_speed) { if (i > 0 && i != dev->D_speed) {
DEBUG(4,"Baudrate reset to %d\n", i); DEBUG(4,"Baudrate reset to %d\n", i);
fixline(dh, i); fixline(dh, i);
} }
@@ -144,14 +115,37 @@ int toneflag;
return dh; return dh;
} }
hyscls(fd) /*
* hyspopn(telno, flds, dev) connect to hayes smartmodem (pulse call)
* hystopn(telno, flds, dev) connect to hayes smartmodem (tone call)
* char *flds[], *dev[];
*
* return codes:
* >0 - file number - ok
* CF_DIAL,CF_DEVICE - failed
*/
int hyspopn(telno, flds, dev)
char *telno, *flds[];
struct Devices *dev;
{
return hysopn(telno, flds, dev, 0);
}
int hystopn(telno, flds, dev)
char *telno, *flds[];
struct Devices *dev;
{
return hysopn(telno, flds, dev, 1);
}
int hyscls(fd)
int fd; int fd;
{ {
char dcname[20]; char dcname[20];
#ifdef DROPDTR #ifdef DROPDTR
struct sgttyb hup, sav; struct sgttyb hup, sav;
#endif #endif
if (fd > 0) { if (fd > 0) {
sprintf(dcname, "/dev/%s", devSel); sprintf(dcname, "/dev/%s", devSel);
DEBUG(4, "Hanging up fd = %d\n", fd); DEBUG(4, "Hanging up fd = %d\n", fd);
@@ -187,5 +181,6 @@ int fd;
close(fd); close(fd);
delock(devSel); delock(devSel);
} }
return 0;
} }
#endif #endif

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)anlwrk.c 5.5.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -20,6 +16,10 @@ int Nfiles = 0;
char Filent[LLEN][NAMESIZE]; char Filent[LLEN][NAMESIZE];
extern int TransferSucceeded; extern int TransferSucceeded;
static void entflst(char *file);
static int pcompar(char *p1, char *p2);
static int newspool(time_t limit);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
@@ -50,7 +50,7 @@ register char *file, **wvec;
return 0; return 0;
} }
if (fp == NULL) { if (fp == NULL) {
if (strncmp(file, lastfile, MAXFULLNAME) == 0) { if (strncmp(file, lastfile, MAXFULLNAME) == 0) {
DEBUG(5,"Workfilename repeated: %s\n", file); DEBUG(5,"Workfilename repeated: %s\n", file);
return 0; return 0;
} }
@@ -113,7 +113,7 @@ char *reqst;
register char *dir, *pre; register char *dir, *pre;
{ {
static DIR *dirp = NULL; static DIR *dirp = NULL;
register nfound; register int nfound;
char filename[NAMESIZE]; char filename[NAMESIZE];
int plen = strlen (pre); int plen = strlen (pre);
int flen; int flen;
@@ -160,7 +160,7 @@ register char *dir, *pre;
*/ */
/* LOCAL only */ /* LOCAL only */
int void
entflst(file) entflst(file)
register char *file; register char *file;
{ {
@@ -183,7 +183,7 @@ register char *file;
} }
/* /*
Compare priority of filenames p1 and p2. Return: * Compare priority of filenames p1 and p2. Return:
* < 0 if p1 "has lower priority than" p2. * < 0 if p1 "has lower priority than" p2.
* = 0 if p1 "has priority equal to" p2. * = 0 if p1 "has priority equal to" p2.
* > 0 if p1 "has greater priority than" p2. * > 0 if p1 "has greater priority than" p2.
@@ -202,15 +202,20 @@ register char *p1, *p2;
/* assert: strlen(p1) and strlen(p2) are >= 5 */ /* assert: strlen(p1) and strlen(p2) are >= 5 */
p1 += strlen(p1)-5; p1 += strlen(p1)-5;
p2 += strlen(p2)-5; p2 += strlen(p2)-5;
/* check 'grade' */ /* check 'grade' */
if (rc = *p2++ - *p1++) if ((rc = *p2++ - *p1++))
return rc; return rc;
/* check for sequence wrap-around */ /* check for sequence wrap-around */
if (rc = *p2++ - *p1++) if ((rc = *p2++ - *p1++)) {
if (rc < -10 || rc > 10) if (rc < -10 || rc > 10) {
return -rc; return -rc;
else } else {
return rc; return rc;
}
}
/* check remaining digits */ /* check remaining digits */
return strcmp(p2, p1); return strcmp(p2, p1);
} }
@@ -226,7 +231,7 @@ register char *p1, *p2;
*/ */
/* LOCAL only */ /* LOCAL only */
gtwrkf(dir, file) int gtwrkf(dir, file)
char *file, *dir; char *file, *dir;
{ {
register int i; register int i;
@@ -284,7 +289,7 @@ iswrk(file, reqst, dir, pre)
register char *file, *reqst, *dir, *pre; register char *file, *reqst, *dir, *pre;
{ {
static char *lastpre = 0; static char *lastpre = 0;
register ret; register int ret;
/* Starting new system; re-init */ /* Starting new system; re-init */
if (lastpre == 0 || strcmp(lastpre,pre) != 0) { if (lastpre == 0 || strcmp(lastpre,pre) != 0) {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)anyread.c 5.4 (Berkeley) 6/19/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
@@ -11,7 +7,7 @@ static char sccsid[] = "@(#)anyread.c 5.4 (Berkeley) 6/19/85";
* anyread check if anybody can read * anyread check if anybody can read
* return SUCCESS ok: FAIL not ok * return SUCCESS ok: FAIL not ok
*/ */
anyread(file) int anyread(file)
char *file; char *file;
{ {
struct stat s; struct stat s;

View File

@@ -1,9 +1,6 @@
#ifndef lint
static char sccsid[] = "@(#)assert.c 5.5 (Berkeley) 6/19/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/time.h> #include <sys/time.h>
#include <sys/stat.h>
#include <errno.h> #include <errno.h>
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -11,8 +8,7 @@ static char sccsid[] = "@(#)assert.c 5.5 (Berkeley) 6/19/85";
/* /*
* print out assetion error * print out assetion error
*/ */
void assert(s1, s2, i1)
assert(s1, s2, i1)
char *s1, *s2; char *s1, *s2;
{ {
register FILE *errlog; register FILE *errlog;

View File

@@ -1,9 +1,5 @@
#ifndef lint
static char sccsid[] = "@(#)cfgets.c 5.3 (Berkeley) 6/19/85";
#endif
/* /*
* get nonblank, non-comment, (possibly continued) line. Alan S. Watt * get nonblank, non-comment, (possibly continued) line. Alan S. Watt
*/ */
#include <stdio.h> #include <stdio.h>
@@ -22,10 +18,10 @@ int siz;
FILE *fil; FILE *fil;
{ {
register char *s; register char *s;
register i, c, len; register int i, c, len;
char *fgets(); char *fgets();
for (i=0,s=buf; i = (fgets(s, siz-i, fil) != NULL); i = s - buf) { for (i = 0, s = buf; (i = (fgets(s, siz-i, fil) != NULL)); i = s - buf) {
/* get last character of line */ /* get last character of line */
c = s[len = (strlen(s) - 1)]; c = s[len = (strlen(s) - 1)];
@@ -46,7 +42,7 @@ FILE *fil;
break; break;
} }
} }
return i ? buf : NULL; return i ? buf : NULL;
} }

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)chkpth.c 5.4.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -13,10 +9,13 @@ struct userpath {
char **us_path; char **us_path;
struct userpath *unext; struct userpath *unext;
}; };
struct userpath *Uhead = NULL; struct userpath *Uhead = NULL;
struct userpath *Mchdef = NULL, *Logdef = NULL; struct userpath *Mchdef = NULL, *Logdef = NULL;
int Uptfirst = 1; int Uptfirst = 1;
static void rdpth(void);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
@@ -26,12 +25,10 @@ int Uptfirst = 1;
* *
* return codes: 0 | FAIL * return codes: 0 | FAIL
*/ */
int chkpth(logname, mchname, path)
chkpth(logname, mchname, path)
char *path, *logname, *mchname; char *path, *logname, *mchname;
{ {
register struct userpath *u; register struct userpath *u;
extern char *lastpart();
register char **p, *s; register char **p, *s;
/* Allow only rooted pathnames. Security wish. rti!trt */ /* Allow only rooted pathnames. Security wish. rti!trt */
@@ -79,7 +76,6 @@ char *path, *logname, *mchname;
return FAIL; return FAIL;
} }
/*** /***
* rdpth() * rdpth()
* *
@@ -87,8 +83,7 @@ char *path, *logname, *mchname;
* construct the userpath structure pointed to by (u); * construct the userpath structure pointed to by (u);
* *
*/ */
void rdpth()
rdpth()
{ {
char buf[100 + 1], *pbuf[50 + 1]; char buf[100 + 1], *pbuf[50 + 1];
register struct userpath *u; register struct userpath *u;
@@ -167,8 +162,7 @@ rdpth()
* 0 - no call back * 0 - no call back
* 1 - call back * 1 - call back
*/ */
int callback(name)
callback(name)
register char *name; register char *name;
{ {
register struct userpath *u; register struct userpath *u;
@@ -190,7 +184,6 @@ register char *name;
return 0; return 0;
} }
/*** /***
* chkperm(file, mopt) check write permission of file * chkperm(file, mopt) check write permission of file
* char *mopt; none NULL - create directories * char *mopt; none NULL - create directories
@@ -202,14 +195,12 @@ register char *name;
* *
* return SUCCESS | FAIL * return SUCCESS | FAIL
*/ */
int chkperm(file, mopt)
chkperm(file, mopt)
char *file, *mopt; char *file, *mopt;
{ {
struct stat s; struct stat s;
int ret; int ret;
char dir[MAXFULLNAME]; char dir[MAXFULLNAME];
extern char *lastpart();
if (stat(subfile(file), &s) == 0) { if (stat(subfile(file), &s) == 0) {
if ((s.st_mode & ANYWRITE) == 0) { if ((s.st_mode & ANYWRITE) == 0) {
@@ -240,7 +231,7 @@ char *file, *mopt;
/* /*
* Check for sufficient privilege to request debugging. * Check for sufficient privilege to request debugging.
*/ */
chkdebug() void chkdebug()
{ {
if (access(SYSFILE, 04) < 0) { if (access(SYSFILE, 04) < 0) {
fprintf(stderr, "Sorry, you must be able to read L.sys for debugging\n"); fprintf(stderr, "Sorry, you must be able to read L.sys for debugging\n");

View File

@@ -1,11 +1,7 @@
#ifndef lint
static char sccsid[] = "@(#)chksum.c 4.2 (Berkeley) 6/19/85";
#endif
#ifndef pdp11 #ifndef pdp11
chksum (s, n) int chksum(s, n)
register char *s; register char *s;
register n; register int n;
{ {
register long sum, x, t; register long sum, x, t;
@@ -26,12 +22,12 @@ register n;
return (long) (short) sum; return (long) (short) sum;
} }
#else #else
chksum(s,n) int chksum(s, n)
register char *s; register char *s;
register n; register int n;
{ {
register unsigned sum, t; register unsigned sum, t;
register x; register int x;
sum = -1; sum = -1;
x = 0; x = 0;

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)cico.c 5.14.1 (2.11BSD) 1997/10/2";
#endif
#include <signal.h> #include <signal.h>
#include "uucp.h" #include "uucp.h"
#include <setjmp.h> #include <setjmp.h>
@@ -78,11 +74,17 @@ struct termio Savettyb;
struct sgttyb Savettyb; struct sgttyb Savettyb;
#endif #endif
static void onintr(int inter);
static void dbg_signal(int inter);
static void setdebug(int parm);
static void timeout(int);
static char *pskip(char *p);
/* /*
* this program is used to place a call to a * this program is used to place a call to a
* remote machine, login, and copy files between the two machines. * remote machine, login, and copy files between the two machines.
*/ */
main(argc, argv) int main(argc, argv)
int argc; int argc;
register char *argv[]; register char *argv[];
{ {
@@ -91,8 +93,6 @@ register char *argv[];
char wkpre[NAMESIZE], file[NAMESIZE]; char wkpre[NAMESIZE], file[NAMESIZE];
char msg[MAXFULLNAME], *q; char msg[MAXFULLNAME], *q;
register char *p; register char *p;
extern onintr(), timeout(), dbg_signal();
extern char *pskip();
char rflags[MAXFULLNAME]; char rflags[MAXFULLNAME];
#ifdef NOGETPEER #ifdef NOGETPEER
u_long Hostnumber = 0; u_long Hostnumber = 0;
@@ -187,11 +187,9 @@ register char *argv[];
close(ret); close(ret);
} }
#endif #endif
#ifdef BSD4_2
if (getpgrp(0) == 0) { /* We have no controlling terminal */ if (getpgrp(0) == 0) { /* We have no controlling terminal */
setpgrp(0, getpid()); setpgrp();
} }
#endif
ret = subchdir(Spool); ret = subchdir(Spool);
ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret); ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret);
@@ -597,7 +595,7 @@ loop:
ttyn = ttyname(Ifn); ttyn = ttyname(Ifn);
alarm(MAXMSGTIME); alarm(MAXMSGTIME);
if (ret=setjmp(Sjbuf)) if ((ret = setjmp(Sjbuf)))
goto Failure; goto Failure;
ret = startup(Role); ret = startup(Role);
alarm(0); alarm(0);
@@ -612,7 +610,7 @@ Failure:
if (ttyn != NULL) { if (ttyn != NULL) {
char startupmsg[BUFSIZ]; char startupmsg[BUFSIZ];
extern int linebaudrate; extern int linebaudrate;
sprintf(startupmsg, "startup %s %d baud", &ttyn[5], sprintf(startupmsg, "startup %s %d baud", &ttyn[5],
linebaudrate); linebaudrate);
logent(startupmsg, "OK"); logent(startupmsg, "OK");
} else } else
@@ -664,7 +662,7 @@ struct sgttyb Hupvec;
/* /*
* cleanup and exit with "code" status * cleanup and exit with "code" status
*/ */
cleanup(code) void cleanup(code)
register int code; register int code;
{ {
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
@@ -720,8 +718,7 @@ register int code;
/* /*
* on interrupt - remove locks and exit * on interrupt - remove locks and exit
*/ */
void onintr(inter)
onintr(inter)
register int inter; register int inter;
{ {
char str[30]; char str[30];
@@ -741,7 +738,7 @@ register int inter;
* (SIGFPE, ugh), and toggle debugging between 0 and 30. * (SIGFPE, ugh), and toggle debugging between 0 and 30.
* Handy for looking in on long running uucicos. * Handy for looking in on long running uucicos.
*/ */
dbg_signal() void dbg_signal()
{ {
Debug = (Debug == 0) ? 30 : 0; Debug = (Debug == 0) ? 30 : 0;
setdebug(DBG_PERM); setdebug(DBG_PERM);
@@ -749,7 +746,6 @@ dbg_signal()
logent("Signal Enabled", "DEBUG"); logent("Signal Enabled", "DEBUG");
} }
/* /*
* Check debugging requests, and open RMTDEBUG audit file if necessary. If an * Check debugging requests, and open RMTDEBUG audit file if necessary. If an
* audit file is needed, the parm argument indicates how to create the file: * audit file is needed, the parm argument indicates how to create the file:
@@ -763,7 +759,7 @@ dbg_signal()
* Each call creates a new file; if an old one of the same name exists it will * Each call creates a new file; if an old one of the same name exists it will
* be overwritten. * be overwritten.
*/ */
setdebug(parm) void setdebug(parm)
int parm; int parm;
{ {
char buf[BUFSIZ]; /* Buffer for building filenames */ char buf[BUFSIZ]; /* Buffer for building filenames */
@@ -833,7 +829,7 @@ int parm;
/* /*
* We need RMTDEBUG directory to do auditing. If the file doesn't exist, * We need RMTDEBUG directory to do auditing. If the file doesn't exist,
* then we forget about debugging; if it exists but has improper owner- * then we forget about debugging; if it exists but has improper owner-
* ship or modes, we gripe about it in ERRLOG. * ship or modes, we gripe about it in ERRLOG.
*/ */
if (stat(RMTDEBUG, &stbuf) != SUCCESS) { if (stat(RMTDEBUG, &stbuf) != SUCCESS) {
Debug = 0; Debug = 0;
@@ -871,7 +867,7 @@ int parm;
/* /*
* catch SIGALRM routine * catch SIGALRM routine
*/ */
timeout() void timeout()
{ {
extern int HaveSentHup; extern int HaveSentHup;
if (!HaveSentHup) { if (!HaveSentHup) {
@@ -884,7 +880,7 @@ timeout()
longjmp(Sjbuf, 1); longjmp(Sjbuf, 1);
} }
char * static char *
pskip(p) pskip(p)
register char *p; register char *p;
{ {

View File

@@ -1,42 +1,27 @@
#ifndef lint
static char sccsid[] = "@(#)cntrl.c 5.8 (Berkeley) 1/24/86";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
#include <sys/wait.h>
#include <errno.h>
#include "uust.h" #include "uust.h"
extern int errno;
extern int turntime; extern int turntime;
int willturn; int willturn;
int HaveSentHup = 0; int HaveSentHup = 0;
static int nullf(void);
struct Proto { struct Proto {
char P_id; char P_id;
int (*P_turnon)(); int (*P_turnon)(void);
int (*P_rdmsg)(); int (*P_rdmsg)(char *amsg, int fn);
int (*P_wrmsg)(); int (*P_wrmsg)(char type, char *msg, int fn);
int (*P_rddata)(); int (*P_rddata)(int fn, FILE *fp);
int (*P_wrdata)(); int (*P_wrdata)(FILE *fp, int fn);
int (*P_turnoff)(); int (*P_turnoff)(void);
}; };
extern int gturnon(), gturnoff(); struct Proto Ptbl[] = {
extern int grdmsg(), grddata();
extern int gwrmsg(), gwrdata();
extern int imsg(), omsg(), nullf();
#ifdef TCPIP
extern int twrmsg(), trdmsg();
extern int twrdata(), trddata();
#endif
#ifdef PAD
extern int fturnon(), fturnoff();
extern int frdmsg(), frddata();
extern int fwrmsg(), fwrdata();
#endif
struct Proto Ptbl[]={
#ifdef TCPIP #ifdef TCPIP
't', nullf, trdmsg, twrmsg, trddata, twrdata, nullf, 't', nullf, trdmsg, twrmsg, trddata, twrdata, nullf,
#endif #endif
@@ -47,13 +32,17 @@ struct Proto Ptbl[]={
'\0' '\0'
}; };
int (*Imsg)() = imsg, (*Omsg)() = omsg; int (*Imsg)(char *amsg, int fn) = imsg;
int (*Omsg)(char type, char *msg, int fn) = omsg;
int (*Rdmsg)()=imsg, (*Rddata)(); int (*Rdmsg)(char *amsg, int fn) = imsg;
int (*Wrmsg)()=omsg, (*Wrdata)(); int (*Rddata)(int fn, FILE *fp);
int (*Turnon)()=nullf, (*Turnoff)() = nullf; int (*Wrmsg)(char type, char *msg, int fn) = omsg;
int (*Wrdata)(FILE *fp, int fn);
int (*Turnon)(void) = nullf;
int (*Turnoff)(void) = nullf;
struct timeb Now, LastTurned, LastCheckedNoLogin; struct timeval Now, LastTurned, LastCheckedNoLogin;
static char *YES = "Y"; static char *YES = "Y";
static char *NO = "N"; static char *NO = "N";
@@ -79,7 +68,6 @@ char *Em_msg[] = {
"can't copy to file/directory on local system - file left in PUBDIR/user/file" "can't copy to file/directory on local system - file left in PUBDIR/user/file"
}; };
#define XUUCP 'X' /* execute uucp (string) */ #define XUUCP 'X' /* execute uucp (string) */
#define SLTPTCL 'P' /* select protocol (string) */ #define SLTPTCL 'P' /* select protocol (string) */
#define USEPTCL 'U' /* use protocol (character) */ #define USEPTCL 'U' /* use protocol (character) */
@@ -113,6 +101,17 @@ static int nXfiles = 0; /* number of X files since last uuxqt start */
static char send_or_receive; static char send_or_receive;
struct stat stbuf; struct stat stbuf;
static int wmesg(char m, char *s);
static int rmesg(char c, char *msg, int n);
static void unlinkdf(char *file);
static void lnotify(char *user, char *file, char *mesg);
static void notify(int mailopt, char *user, char *file, char *sys, char *msgcode);
static void arrived(int opt, char *file, char *nuser, char *rmtsys, char *rmtuser);
static int putinpub(char *file, char *tmp, char *user);
static char fptcl(char *str);
static int stptcl(char *c);
static char *blptcl(char *str);
/* /*
* cntrl - this routine will execute the conversation * cntrl - this routine will execute the conversation
* between the two machines after both programs are * between the two machines after both programs are
@@ -122,8 +121,7 @@ struct stat stbuf;
* SUCCESS - ok * SUCCESS - ok
* FAIL - failed * FAIL - failed
*/ */
int cntrl(role, wkpre)
cntrl(role, wkpre)
int role; int role;
char *wkpre; char *wkpre;
{ {
@@ -131,8 +129,6 @@ char *wkpre;
register FILE *fp; register FILE *fp;
int filemode; int filemode;
char filename[MAXFULLNAME], wrktype, *wrkvec[20]; char filename[MAXFULLNAME], wrktype, *wrkvec[20];
extern (*Rdmsg)(), (*Wrmsg)();
extern char *index(), *lastpart();
int status = 1; int status = 1;
register int i, narg; register int i, narg;
int mailopt, ntfyopt; int mailopt, ntfyopt;
@@ -144,12 +140,8 @@ char *wkpre;
Wfile[0] = '\0'; Wfile[0] = '\0';
willturn = turntime > 0; willturn = turntime > 0;
remaster: remaster:
#ifdef USG gettimeofday(&LastTurned, NULL);
time(&LastTurned.time);
LastTurned.millitm = 0;
#else
ftime(&LastTurned);
#endif
send_or_receive = RESET; send_or_receive = RESET;
HaveSentHup = 0; HaveSentHup = 0;
top: top:
@@ -157,7 +149,7 @@ top:
wrkvec[i] = 0; wrkvec[i] = 0;
DEBUG(4, "*** TOP *** - role=%s\n", role ? "MASTER" : "SLAVE"); DEBUG(4, "*** TOP *** - role=%s\n", role ? "MASTER" : "SLAVE");
setupline(RESET); setupline(RESET);
if (Now.time > (LastCheckedNoLogin.time+60)) { if (Now.tv_sec > (LastCheckedNoLogin.tv_sec+60)) {
LastCheckedNoLogin = Now; LastCheckedNoLogin = Now;
if (access(NOLOGIN, 0) == 0) { if (access(NOLOGIN, 0) == 0) {
logent(NOLOGIN, "UUCICO SHUTDOWN"); logent(NOLOGIN, "UUCICO SHUTDOWN");
@@ -281,7 +273,7 @@ sendmsg:
RAMESG(msg, 1); RAMESG(msg, 1);
if (willturn < 0) if (willturn < 0)
willturn = msg[0] == HUP; willturn = msg[0] == HUP;
process: process:
DEBUG(4, "PROCESS: msg - %s\n", msg); DEBUG(4, "PROCESS: msg - %s\n", msg);
switch (msg[0]) { switch (msg[0]) {
@@ -308,12 +300,7 @@ process:
WMESG(HUP, ""); WMESG(HUP, "");
RMESG(HUP, msg, 1); RMESG(HUP, msg, 1);
logent(Rmtname, "TURNAROUND"); logent(Rmtname, "TURNAROUND");
#ifdef USG gettimeofday(&LastTurned, NULL);
time(&LastTurned.time);
LastTurned.millitm = 0;
#else
ftime(&LastTurned);
#endif
Nfiles = 0; /* force rescan of queue for work */ Nfiles = 0; /* force rescan of queue for work */
goto process; goto process;
} }
@@ -323,8 +310,9 @@ process:
DEBUG(4, "HUP:\n", CNULL); DEBUG(4, "HUP:\n", CNULL);
HaveSentHup = 1; HaveSentHup = 1;
if (msg[1] == 'Y') { if (msg[1] == 'Y') {
if (role == MASTER) if (role == MASTER) {
WMESG(HUP, YES); WMESG(HUP, YES);
}
(*Turnoff)(); (*Turnoff)();
Rdmsg = Imsg; Rdmsg = Imsg;
Wrmsg = Omsg; Wrmsg = Omsg;
@@ -497,7 +485,7 @@ process:
fflush(fp); fflush(fp);
if (ferror(fp) || fclose(fp)) if (ferror(fp) || fclose(fp))
ret = FAIL; ret = FAIL;
if (ret != SUCCESS) { if (ret != SUCCESS) {
(void) unlinkdf(Dfile); (void) unlinkdf(Dfile);
(*Turnoff)(); (*Turnoff)();
@@ -507,7 +495,7 @@ process:
ntfyopt = index(W_OPTNS, 'n') != NULL; ntfyopt = index(W_OPTNS, 'n') != NULL;
status = xmv(Dfile, filename); status = xmv(Dfile, filename);
if (willturn && Now.time > (LastTurned.time+turntime) if (willturn && Now.tv_sec > (LastTurned.tv_sec + turntime)
&& iswrk(Wfile, "chk", Spool, wkpre)) { && iswrk(Wfile, "chk", Spool, wkpre)) {
WMESG(RQSTCMPT, status ? EM_RMTCP : "YM"); WMESG(RQSTCMPT, status ? EM_RMTCP : "YM");
willturn = -1; willturn = -1;
@@ -571,7 +559,7 @@ process:
strcat(filename, lastpart(W_FILE1)); strcat(filename, lastpart(W_FILE1));
} }
status = xmv(Dfile, filename); status = xmv(Dfile, filename);
if (willturn && Now.time > (LastTurned.time+turntime) if (willturn && Now.tv_sec > (LastTurned.tv_sec + turntime)
&& iswrk(Wfile, "chk", Spool, wkpre)) { && iswrk(Wfile, "chk", Spool, wkpre)) {
WMESG(RQSTCMPT, status ? EM_RMTCP : "YM"); WMESG(RQSTCMPT, status ? EM_RMTCP : "YM");
willturn = -1; willturn = -1;
@@ -656,15 +644,12 @@ process:
return FAIL; return FAIL;
} }
/* /*
* read message 'c'. try 'n' times * read message 'c'. try 'n' times
* *
* return code: SUCCESS | FAIL * return code: SUCCESS | FAIL
*/ */
rmesg(c, msg, n) int rmesg(char c, char *msg, int n)
register char *msg, c;
register int n;
{ {
char str[MAXFULLNAME]; char str[MAXFULLNAME];
@@ -693,14 +678,12 @@ register int n;
return SUCCESS; return SUCCESS;
} }
/* /*
* write a message (type m) * write a message (type m)
* *
* return codes: SUCCESS - ok | FAIL - ng * return codes: SUCCESS - ok | FAIL - ng
*/ */
wmesg(m, s) int wmesg(char m, char *s)
register char *s, m;
{ {
DEBUG(4, "wmesg '%c' ", m); DEBUG(4, "wmesg '%c' ", m);
DEBUG(4, "%s\n", s); DEBUG(4, "%s\n", s);
@@ -712,7 +695,7 @@ register char *s, m;
* *
* return codes: none * return codes: none
*/ */
notify(mailopt, user, file, sys, msgcode) void notify(mailopt, user, file, sys, msgcode)
char *user, *file, *sys, *msgcode; char *user, *file, *sys, *msgcode;
{ {
char str[BUFSIZ]; char str[BUFSIZ];
@@ -740,7 +723,7 @@ char *user, *file, *sys, *msgcode;
* *
* return code - none * return code - none
*/ */
lnotify(user, file, mesg) void lnotify(user, file, mesg)
char *user, *file, *mesg; char *user, *file, *mesg;
{ {
char mbuf[200]; char mbuf[200];
@@ -757,11 +740,9 @@ char *user, *file, *mesg;
* SUCCESS - successful protocol selection * SUCCESS - successful protocol selection
* FAIL - can't find common or open failed * FAIL - can't find common or open failed
*/ */
startup(role) int startup(role)
int role; int role;
{ {
extern (*Rdmsg)(), (*Wrmsg)();
extern char *blptcl(), fptcl();
char msg[BUFSIZ], str[MAXFULLNAME]; char msg[BUFSIZ], str[MAXFULLNAME];
Rdmsg = Imsg; Rdmsg = Imsg;
@@ -828,7 +809,7 @@ register char *str;
} }
/* /*
* build a string of the letters of the available protocols * build a string of the letters of the available protocols
*/ */
char * char *
blptcl(str) blptcl(str)
@@ -853,7 +834,7 @@ register char *str;
* FAIL - no find or failed to open * FAIL - no find or failed to open
* *
*/ */
stptcl(c) int stptcl(c)
register char *c; register char *c;
{ {
register struct Proto *p; register struct Proto *p;
@@ -882,12 +863,10 @@ register char *c;
* *
* return code SUCCESS | FAIL * return code SUCCESS | FAIL
*/ */
int putinpub(file, tmp, user)
putinpub(file, tmp, user)
register char *file, *tmp, *user; register char *file, *tmp, *user;
{ {
char fullname[MAXFULLNAME]; char fullname[MAXFULLNAME];
char *lastpart();
int status; int status;
sprintf(fullname, "%s/%s/", PUBDIR, user); sprintf(fullname, "%s/%s/", PUBDIR, user);
@@ -910,8 +889,7 @@ register char *file, *tmp, *user;
* *
* return code - none * return code - none
*/ */
void unlinkdf(file)
unlinkdf(file)
register char *file; register char *file;
{ {
if (strlen(file) > 6) if (strlen(file) > 6)
@@ -924,7 +902,7 @@ register char *file;
* *
* return code - none * return code - none
*/ */
arrived(opt, file, nuser, rmtsys, rmtuser) void arrived(opt, file, nuser, rmtsys, rmtuser)
char *file, *nuser, *rmtsys, *rmtuser; char *file, *nuser, *rmtsys, *rmtuser;
{ {
char mbuf[200]; char mbuf[200];
@@ -936,7 +914,7 @@ char *file, *nuser, *rmtsys, *rmtuser;
return; return;
} }
nullf() static int nullf()
{ {
return SUCCESS; return SUCCESS;
} }

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)condevs.c 5.15.2 (2.11BSD) 1997/10/2";
#endif
/* /*
* Here are various dialers to establish the machine-machine connection. * Here are various dialers to establish the machine-machine connection.
* conn.c/condevs.c was glued together by Mike Mitchell. * conn.c/condevs.c was glued together by Mike Mitchell.
@@ -26,22 +22,26 @@ static char sccsid[] = "@(#)condevs.c 5.15.2 (2.11BSD) 1997/10/2";
#include "condevs.h" #include "condevs.h"
static int dircls(int fd);
static int nullopn(char *telno, char *flds[], struct Devices *dev);
static int Acuopn(char *flds[]);
struct condev condevs[] = { struct condev condevs[] = {
{ "DIR", "direct", diropn, nulldev, dircls }, { "DIR", "direct", diropn, nullopn, dircls },
#ifdef DATAKIT #ifdef DATAKIT
{ "DK", "datakit", dkopn, nulldev, nulldev }, { "DK", "datakit", dkopn, nullopn, nulldev },
#endif #endif
#ifdef PNET #ifdef PNET
{ "PNET", "pnet", pnetopn, nulldev, nulldev }, { "PNET", "pnet", pnetopn, nullopn, nulldev },
#endif #endif
#ifdef UNETTCP #ifdef UNETTCP
{ "TCP", "TCP", unetopn, nulldev, unetcls }, { "TCP", "TCP", unetopn, nullopn, unetcls },
#endif #endif
#ifdef BSDTCP #ifdef BSDTCP
{ "TCP", "TCP", bsdtcpopn, nulldev, bsdtcpcls }, { "TCP", "TCP", bsdtcpopn, nullopn, bsdtcpcls },
#endif #endif
#ifdef MICOM #ifdef MICOM
{ "MICOM", "micom", micopn, nulldev, miccls }, { "MICOM", "micom", micopn, nullopn, miccls },
#endif #endif
#ifdef DN11 #ifdef DN11
{ "ACU", "dn11", Acuopn, dnopn, dncls }, { "ACU", "dn11", Acuopn, dnopn, dncls },
@@ -101,7 +101,7 @@ struct condev condevs[] = {
{ "ACU", "vmacs", Acuopn, vmacsopn, vmacscls }, { "ACU", "vmacs", Acuopn, vmacsopn, vmacscls },
#endif #endif
#ifdef SYTEK #ifdef SYTEK
{ "SYTEK", "sytek", sykopn, nulldev, sykcls }, { "SYTEK", "sytek", sykopn, nullopn, sykcls },
#endif #endif
#ifdef ATT2224 #ifdef ATT2224
{ "ACU", "att", Acuopn, attopn, attcls }, { "ACU", "att", Acuopn, attopn, attcls },
@@ -112,10 +112,18 @@ struct condev condevs[] = {
{ NULL, NULL, NULL, NULL, NULL } { NULL, NULL, NULL, NULL, NULL }
}; };
/*
* nullopn a null device (returns CF_DIAL)
*/
int nullopn(char *telno, char *flds[], struct Devices *dev)
{
return CF_DIAL;
}
/* /*
* nulldev a null device (returns CF_DIAL) * nulldev a null device (returns CF_DIAL)
*/ */
nulldev() int nulldev()
{ {
return CF_DIAL; return CF_DIAL;
} }
@@ -123,7 +131,7 @@ nulldev()
/* /*
* nodev a null device (returns CF_NODEV) * nodev a null device (returns CF_NODEV)
*/ */
nodev() int nodev()
{ {
return CF_NODEV; return CF_NODEV;
} }
@@ -142,7 +150,7 @@ nodev()
* > 0 - file number - ok * > 0 - file number - ok
* FAIL - failed * FAIL - failed
*/ */
diropn(flds) int diropn(flds)
register char *flds[]; register char *flds[];
{ {
register int dcr, status; register int dcr, status;
@@ -170,7 +178,7 @@ register char *flds[];
continue; continue;
/* /*
* Modem control on vms(works dtr) Take anything in MOD class. * Modem control on vms(works dtr) Take anything in MOD class.
* It probably should work differently anyway so we can have * It probably should work differently anyway so we can have
* multiple hardwired lines. * multiple hardwired lines.
*/ */
if (!modem_control&&strcmp(flds[F_PHONE], dev.D_line) != SAME) if (!modem_control&&strcmp(flds[F_PHONE], dev.D_line) != SAME)
@@ -242,13 +250,14 @@ register char *flds[];
return dcr; return dcr;
} }
dircls(fd) int dircls(fd)
register int fd; register int fd;
{ {
if (fd > 0) { if (fd > 0) {
close(fd); close(fd);
delock(devSel); delock(devSel);
} }
return 0;
} }
/* /*
@@ -260,7 +269,7 @@ register int fd;
*/ */
char devSel[20]; /* used for later unlock() */ char devSel[20]; /* used for later unlock() */
Acuopn(flds) int Acuopn(flds)
register char *flds[]; register char *flds[];
{ {
char phone[MAXPH+1]; char phone[MAXPH+1];
@@ -359,10 +368,10 @@ register char *flds[];
/* /*
* intervaldelay: delay execution for numerator/denominator seconds. * intervaldelay: delay execution for numerator/denominator seconds.
*/ */
#ifdef INTERVALTIMER #ifdef INTERVALTIMER
#define uucpdelay(num,denom) intervaldelay(num,denom) #define uucpdelay(num,denom) intervaldelay(num,denom)
intervaldelay(num,denom)
void intervaldelay(num,denom)
int num, denom; int num, denom;
{ {
struct timeval tv; struct timeval tv;
@@ -372,10 +381,13 @@ int num, denom;
} }
#endif #endif
/*
* Sleep in increments of 60ths of second.
*/
#ifdef FASTTIMER #ifdef FASTTIMER
#define uucpdelay(num,denom) nap(60*num/denom) #define uucpdelay(num,denom) nap(60*num/denom)
/* Sleep in increments of 60ths of second. */
nap (time) void nap (time)
register int time; register int time;
{ {
static int fd; static int fd;
@@ -389,9 +401,10 @@ register int time;
#ifdef FTIME #ifdef FTIME
#define uucpdelay(num,denom) ftimedelay(1000*num/denom) #define uucpdelay(num,denom) ftimedelay(1000*num/denom)
ftimedelay(n)
void ftimedelay(n)
{ {
static struct timeb loctime; static struct timeval loctime;
register i = loctime.millitm; register i = loctime.millitm;
ftime(&loctime); ftime(&loctime);
@@ -404,13 +417,14 @@ ftimedelay(n)
#define uucpdelay(num,denom) busyloop(CPUSPEED*num/denom) #define uucpdelay(num,denom) busyloop(CPUSPEED*num/denom)
#define CPUSPEED 1000000 /* VAX 780 is 1MIPS */ #define CPUSPEED 1000000 /* VAX 780 is 1MIPS */
#define DELAY(n) { register long N = (n); while (--N > 0); } #define DELAY(n) { register long N = (n); while (--N > 0); }
busyloop(n)
void busyloop(n)
{ {
DELAY(n); DELAY(n);
} }
#endif #endif
slowrite(fd, str) void slowrite(fd, str)
register char *str; register char *str;
{ {
DEBUG(6, "slowrite ", CNULL); DEBUG(6, "slowrite ", CNULL);
@@ -428,32 +442,37 @@ register char *str;
/* /*
* send a break * send a break
*/ */
genbrk(fn, bnulls) void genbrk(fn, bnulls)
register int fn, bnulls; register int fn, bnulls;
{ {
#ifdef USG #ifdef USG
if (ioctl(fn, TCSBRK, STBNULL) < 0) if (ioctl(fn, TCSBRK, STBNULL) < 0) {
DEBUG(5, "break TCSBRK %s\n", strerror(errno)); DEBUG(5, "break TCSBRK %s\n", strerror(errno));
}
#else #else
# ifdef TIOCSBRK # ifdef TIOCSBRK
if (ioctl(fn, TIOCSBRK, STBNULL) < 0) if (ioctl(fn, TIOCSBRK, STBNULL) < 0) {
DEBUG(5, "break TIOCSBRK %s\n", strerror(errno)); DEBUG(5, "break TIOCSBRK %s\n", strerror(errno));
}
# ifdef TIOCCBRK # ifdef TIOCCBRK
uucpdelay(bnulls, 10); uucpdelay(bnulls, 10);
if (ioctl(fn, TIOCCBRK, STBNULL) < 0) if (ioctl(fn, TIOCCBRK, STBNULL) < 0) {
DEBUG(5, "break TIOCCBRK %s\n", strerror(errno)); DEBUG(5, "break TIOCCBRK %s\n", strerror(errno));
}
# endif # endif
DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 ); DEBUG(4, "ioctl %f second break\n", (float) bnulls/10 );
# else # else
struct sgttyb ttbuf; struct sgttyb ttbuf;
register int sospeed; register int sospeed;
if (ioctl(fn, TIOCGETP, &ttbuf) < 0) if (ioctl(fn, TIOCGETP, &ttbuf) < 0) {
DEBUG(5, "break TIOCGETP %s\n", strerror(errno)); DEBUG(5, "break TIOCGETP %s\n", strerror(errno));
}
sospeed = ttbuf.sg_ospeed; sospeed = ttbuf.sg_ospeed;
ttbuf.sg_ospeed = BSPEED; ttbuf.sg_ospeed = BSPEED;
if (ioctl(fn, TIOCSETP, &ttbuf) < 0) if (ioctl(fn, TIOCSETP, &ttbuf) < 0) {
DEBUG(5, "break TIOCSETP %s\n", strerror(errno)); DEBUG(5, "break TIOCSETP %s\n", strerror(errno));
}
if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) { if (write(fn, "\0\0\0\0\0\0\0\0\0\0\0\0", bnulls) != bnulls) {
badbreak: badbreak:
logent(strerror(errno), "BAD WRITE genbrk"); logent(strerror(errno), "BAD WRITE genbrk");
@@ -461,8 +480,9 @@ badbreak:
longjmp(Sjbuf, 3); longjmp(Sjbuf, 3);
} }
ttbuf.sg_ospeed = sospeed; ttbuf.sg_ospeed = sospeed;
if (ioctl(fn, TIOCSETP, &ttbuf) < 0) if (ioctl(fn, TIOCSETP, &ttbuf) < 0) {
DEBUG(5, "break ioctl %s\n", strerror(errno)); DEBUG(5, "break ioctl %s\n", strerror(errno));
}
if (write(fn, "@", 1) != 1) if (write(fn, "@", 1) != 1)
goto badbreak; goto badbreak;
DEBUG(4, "sent BREAK nulls - %d\n", bnulls); DEBUG(4, "sent BREAK nulls - %d\n", bnulls);
@@ -477,10 +497,9 @@ badbreak:
* disable and reenable: allow a single line to be use for dialin/dialout * disable and reenable: allow a single line to be use for dialin/dialout
* *
*/ */
char enbdev[16]; char enbdev[16];
disable(dev) int disable(dev)
register char *dev; register char *dev;
{ {
register char *rdev; register char *rdev;
@@ -506,7 +525,7 @@ register char *dev;
return SUCCESS; return SUCCESS;
} }
reenable() void reenable()
{ {
if (enbdev[0] == '\0') if (enbdev[0] == '\0')
return; return;
@@ -515,7 +534,7 @@ reenable()
enbdev[0] = '\0'; enbdev[0] = '\0';
} }
enbcall(type, dev) int enbcall(type, dev)
char *type, *dev; char *type, *dev;
{ {
int pid; int pid;

View File

@@ -5,6 +5,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>
#include <sgtty.h> #include <sgtty.h>
#include <fcntl.h>
#ifdef VMSDTR /* Modem control on vms(works dtr) */ #ifdef VMSDTR /* Modem control on vms(works dtr) */
#include <eunice/eunice.h> #include <eunice/eunice.h>
#define TT$M_MODEM 0x00200000 /* These should be in a '.h' somewhere */ #define TT$M_MODEM 0x00200000 /* These should be in a '.h' somewhere */
@@ -16,8 +17,6 @@
extern char devSel[]; /* name to pass to delock() in close */ extern char devSel[]; /* name to pass to delock() in close */
extern int next_fd; extern int next_fd;
extern jmp_buf Sjbuf; extern jmp_buf Sjbuf;
extern int alarmtr();
int nulldev(), nodev(), Acuopn(), diropn(), dircls();
#ifdef DATAKIT #ifdef DATAKIT
int dkopn(); int dkopn();
@@ -28,7 +27,8 @@ int dnopn(), dncls();
#endif #endif
#ifdef HAYES #ifdef HAYES
int hyspopn(), hystopn(), hyscls(); int hyspopn(), hystopn();
int hyscls(int fd);
#endif #endif
#ifdef HAYES2400 #ifdef HAYES2400
@@ -111,4 +111,3 @@ int sykopn(), sykcls();
#ifdef ATT2224 #ifdef ATT2224
int attopn(), attcls(); int attopn(), attcls();
#endif #endif

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)conn.c 5.10.2 (2.11BSD) 1997/10/2";
#endif
#include <signal.h> #include <signal.h>
#include <strings.h> #include <strings.h>
#include "uucp.h" #include "uucp.h"
@@ -37,10 +33,22 @@ int linebaudrate; /* used for the sleep test in pk1.c */
int next_fd = -1; /* predicted fd to close interrupted opens */ int next_fd = -1; /* predicted fd to close interrupted opens */
char *PCP = "PCP"; /* PC Pursuit device type */ char *PCP = "PCP"; /* PC Pursuit device type */
static int finds(FILE *fsys, char *sysnam, char info[], char *flds[]);
static int getto(char *flds[]);
static int login(int nf, char *flds[], int fn);
static char *fdig(char *cp);
static int ifdate(char *p);
static void sendthem(char *str, int fn);
static int notin(char *sh, char *lg);
static void bld_partab(int type);
static void p_chwrite(int fd, char c);
static int ifadate(char *string);
/* /*
* catch alarm routine for "expect". * catch alarm routine for "expect".
*/ */
alarmtr() void alarmtr(int sig)
{ {
signal(SIGALRM, (sig_t)alarmtr); signal(SIGALRM, (sig_t)alarmtr);
if (next_fd >= 0) { if (next_fd >= 0) {
@@ -51,7 +59,7 @@ alarmtr()
longjmp(Sjbuf, 1); longjmp(Sjbuf, 1);
} }
/* This template is for seismo to call ihnp4 /* This template is for seismo to call ihnp4
* the 3 lines marked ---> will be overwritten for the appropriate city * the 3 lines marked ---> will be overwritten for the appropriate city
*/ */
#define PCP_BAUD 3 #define PCP_BAUD 3
@@ -100,7 +108,7 @@ char *Flds[MAXC/10];
char LineType[10]; char LineType[10];
extern int LocalOnly; extern int LocalOnly;
conn(system) int conn(system)
char *system; char *system;
{ {
int nf; int nf;
@@ -166,9 +174,9 @@ keeplooking:
} }
Flds[F_CLASS] = dev.D_class; Flds[F_CLASS] = dev.D_class;
Flds[F_PHONE] = dev.D_line; Flds[F_PHONE] = dev.D_line;
} /* end PC Pursuit */ } /* end PC Pursuit */
if ((fcode = getto(Flds)) > 0) if ((fcode = getto(Flds)) > 0)
break; break;
} }
@@ -213,12 +221,10 @@ keeplooking:
* >0 - file number - ok * >0 - file number - ok
* FAIL - failed * FAIL - failed
*/ */
int getto(flds)
getto(flds)
register char *flds[]; register char *flds[];
{ {
register struct condev *cd; register struct condev *cd;
int nulldev(), diropn();
char *line; char *line;
DEBUG(4, "getto: call no. %s ", flds[F_PHONE]); DEBUG(4, "getto: call no. %s ", flds[F_PHONE]);
@@ -253,15 +259,14 @@ register char *flds[];
return diropn(flds); /* search failed, so use direct */ return diropn(flds); /* search failed, so use direct */
} }
int (*CU_end)() = nulldev;
/* /*
* close call unit * close call unit
* *
* return codes: none * return codes: none
*/ */
void clsacu()
int nulldev();
int (*CU_end)() = nulldev;
clsacu()
{ {
/* make *sure* Dcf is no longer exclusive. /* make *sure* Dcf is no longer exclusive.
* Otherwise dual call-in/call-out modems could get stuck. * Otherwise dual call-in/call-out modems could get stuck.
@@ -270,8 +275,9 @@ clsacu()
* Hopefully everyone honors the LCK protocol, of course * Hopefully everyone honors the LCK protocol, of course
*/ */
#ifdef TIOCNXCL #ifdef TIOCNXCL
if (!IsTcpIp && Dcf >= 0 && ioctl(Dcf, TIOCNXCL, STBNULL) < 0) if (!IsTcpIp && Dcf >= 0 && ioctl(Dcf, TIOCNXCL, STBNULL) < 0) {
DEBUG(5, "clsacu ioctl %s\n", strerror(errno)); DEBUG(5, "clsacu ioctl %s\n", strerror(errno));
}
#endif #endif
if (setjmp(Sjbuf)) if (setjmp(Sjbuf))
logent(Rmtname, "CLOSE TIMEOUT"); logent(Rmtname, "CLOSE TIMEOUT");
@@ -292,8 +298,7 @@ clsacu()
/* /*
* expand phone number for given prefix and number * expand phone number for given prefix and number
*/ */
void exphone(in, out)
exphone(in, out)
register char *in, *out; register char *in, *out;
{ {
FILE *fn; FILE *fn;
@@ -340,8 +345,7 @@ register char *in, *out;
* *
* return code - FAIL at end-of file; 0 otherwise * return code - FAIL at end-of file; 0 otherwise
*/ */
int rddev(fp, dev)
rddev(fp, dev)
register struct Devices *dev; register struct Devices *dev;
FILE *fp; FILE *fp;
{ {
@@ -368,8 +372,7 @@ FILE *fp;
* CF_SYSTEM - system name not found * CF_SYSTEM - system name not found
* CF_TIME - wrong time to call * CF_TIME - wrong time to call
*/ */
int finds(fsys, sysnam, info, flds)
finds(fsys, sysnam, info, flds)
char *sysnam, info[], *flds[]; char *sysnam, info[], *flds[];
FILE *fsys; FILE *fsys;
{ {
@@ -401,8 +404,7 @@ FILE *fsys;
* *
* return codes: SUCCESS | FAIL * return codes: SUCCESS | FAIL
*/ */
int login(nf, flds, fn)
login(nf, flds, fn)
register char *flds[]; register char *flds[];
int nf, fn; int nf, fn;
{ {
@@ -513,8 +515,7 @@ struct sg_spds {int sp_val, sp_name;} spds[] = {
* *
* return codes: none * return codes: none
*/ */
int fixline(tty, spwant)
fixline(tty, spwant)
int tty, spwant; int tty, spwant;
{ {
#ifdef USG #ifdef USG
@@ -570,8 +571,7 @@ int tty, spwant;
* FAIL - lost line or too many characters read * FAIL - lost line or too many characters read
* some character - timed out * some character - timed out
*/ */
int expect(str, fn)
expect(str, fn)
register char *str; register char *str;
int fn; int fn;
{ {
@@ -651,7 +651,7 @@ int fn;
* It is a UNIX kernel problem, but it has to be handled. * It is a UNIX kernel problem, but it has to be handled.
* unc!smb (Steve Bellovin) probably first discovered it. * unc!smb (Steve Bellovin) probably first discovered it.
*/ */
getnextfd() void getnextfd()
{ {
close(next_fd = open("/", 0)); close(next_fd = open("/", 0));
} }
@@ -661,7 +661,7 @@ getnextfd()
* *
* return codes: none * return codes: none
*/ */
sendthem(str, fn) void sendthem(str, fn)
register char *str; register char *str;
int fn; int fn;
{ {
@@ -801,9 +801,7 @@ int fn;
return; return;
} }
p_chwrite(fd, c) void p_chwrite(int fd, char c)
int fd;
char c;
{ {
c = par_tab[c&0177]; c = par_tab[c&0177];
if (write(fd, &c, 1) != 1) { if (write(fd, &c, 1) != 1) {
@@ -815,7 +813,7 @@ char c;
/* /*
* generate parity table for use by p_chwrite. * generate parity table for use by p_chwrite.
*/ */
bld_partab(type) void bld_partab(type)
int type; int type;
{ {
register int i, j, n; register int i, j, n;
@@ -839,7 +837,7 @@ int type;
* 0 - found the string * 0 - found the string
* 1 - not in the string * 1 - not in the string
*/ */
notin(sh, lg) int notin(sh, lg)
register char *sh, *lg; register char *sh, *lg;
{ {
while (*lg != '\0') { while (*lg != '\0') {
@@ -854,7 +852,7 @@ register char *sh, *lg;
/* /*
* Allow multiple date specifications separated by ','. * Allow multiple date specifications separated by ','.
*/ */
ifdate(p) int ifdate(p)
register char *p; register char *p;
{ {
register char *np; register char *np;
@@ -904,8 +902,7 @@ register char *p;
* 0 - not within limits * 0 - not within limits
* 1 - within limits * 1 - within limits
*/ */
int ifadate(string)
ifadate(string)
char *string; char *string;
{ {
static char *days[]={ static char *days[]={
@@ -962,13 +959,13 @@ char *string;
if (dayok == 0 && s != string) if (dayok == 0 && s != string)
return FAIL; return FAIL;
i = sscanf(s, "%d-%d", &tl, &th); i = sscanf(s, "%d-%d", &tl, &th);
if (i < 2) if (i < 2)
return MGrade; return MGrade;
tn = tp->tm_hour * 100 + tp->tm_min; tn = tp->tm_hour * 100 + tp->tm_min;
if (th < tl) { /* crosses midnight */ if (th < tl) { /* crosses midnight */
if (tl <= tn || tn < th) if (tl <= tn || tn < th)
return MGrade; return MGrade;
} else { } else {
if (tl <= tn && tn < th) if (tl <= tn && tn < th)
return MGrade; return MGrade;
} }
@@ -996,7 +993,7 @@ register char *cp;
* Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0 * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0
* Strings are compared as if they contain all capital letters. * Strings are compared as if they contain all capital letters.
*/ */
snccmp(s1, s2) int snccmp(s1, s2)
register char *s1, *s2; register char *s1, *s2;
{ {
char c1, c2; char c1, c2;
@@ -1030,7 +1027,7 @@ register char *s1, *s2;
* Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0 * Compare strings: s1>s2: >0 s1==s2: 0 s1<s2: <0
* Strings are compared as if they contain all capital letters. * Strings are compared as if they contain all capital letters.
*/ */
sncncmp(s1, s2, n) int sncncmp(s1, s2, n)
register char *s1, *s2; register char *s1, *s2;
register int n; register int n;
{ {
@@ -1060,12 +1057,13 @@ register int n;
} }
return n<0 ? 0 : (c1 - c2); return n<0 ? 0 : (c1 - c2);
} }
/* /*
* do chat script * do chat script
* occurs after local port is opened, * occurs after local port is opened,
* before 'dialing' the other machine. * before 'dialing' the other machine.
*/ */
dochat(dev, flds, fd) int dochat(dev, flds, fd)
register struct Devices *dev; register struct Devices *dev;
char *flds[]; char *flds[];
int fd; int fd;
@@ -1103,7 +1101,7 @@ int fd;
* *
* return codes: none * return codes: none
*/ */
fixmode(tty) void fixmode(tty)
register int tty; register int tty;
{ {
#ifdef USG #ifdef USG
@@ -1140,4 +1138,3 @@ register int tty;
} }
ASSERT(linebaudrate >= 0, "BAD SPEED", CNULL, speed); ASSERT(linebaudrate >= 0, "BAD SPEED", CNULL, speed);
} }

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)cpmv.c 5.5 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
@@ -12,13 +8,12 @@ static char sccsid[] = "@(#)cpmv.c 5.5 (Berkeley) 10/9/85";
* *
* return - SUCCESS | FAIL * return - SUCCESS | FAIL
*/ */
xcp(f1, f2) int xcp(f1, f2)
char *f1, *f2; char *f1, *f2;
{ {
char buf[BUFSIZ]; char buf[BUFSIZ];
register int len; register int len;
register int fp1, fp2; register int fp1, fp2;
char *lastpart();
char full[MAXFULLNAME]; char full[MAXFULLNAME];
struct stat s; struct stat s;
@@ -48,13 +43,12 @@ char *f1, *f2;
return len < 0 ? FAIL: SUCCESS; return len < 0 ? FAIL: SUCCESS;
} }
/* /*
* move f1 to f2 * move f1 to f2
* *
* return 0 ok | FAIL failed * return 0 ok | FAIL failed
*/ */
xmv(f1, f2) int xmv(f1, f2)
register char *f1, *f2; register char *f1, *f2;
{ {
register int ret; register int ret;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)expfile.c 5.5 (Berkeley) 6/19/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -15,8 +11,7 @@ static char sccsid[] = "@(#)expfile.c 5.5 (Berkeley) 6/19/85";
* 1 - Other normal file * 1 - Other normal file
* FAIL - no Wrkdir name available * FAIL - no Wrkdir name available
*/ */
int expfile(file)
expfile(file)
char *file; char *file;
{ {
register char *fpart, *p; register char *fpart, *p;
@@ -35,7 +30,7 @@ char *file;
if (!*user || gninfo(user, &uid, full) != 0) { if (!*user || gninfo(user, &uid, full) != 0) {
strcpy(full, PUBDIR); strcpy(full, PUBDIR);
} }
strcat(full, fpart); strcat(full, fpart);
strcpy(file, full); strcpy(file, full);
return 1; return 1;
@@ -59,8 +54,7 @@ char *file;
* *
* return codes: 0 - not directory | 1 - is directory * return codes: 0 - not directory | 1 - is directory
*/ */
int isdir(name)
isdir(name)
char *name; char *name;
{ {
register int ret; register int ret;
@@ -74,14 +68,12 @@ char *name;
return 0; return 0;
} }
/* /*
* make all necessary directories * make all necessary directories
* *
* return SUCCESS | FAIL * return SUCCESS | FAIL
*/ */
int mkdirs(name)
mkdirs(name)
char *name; char *name;
{ {
int ret, mask; int ret, mask;
@@ -112,8 +104,7 @@ char *name;
* *
* return code - SUCCESS - ok; FAIL if expfile failed * return code - SUCCESS - ok; FAIL if expfile failed
*/ */
int ckexpf(file)
ckexpf(file)
register char *file; register char *file;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)fio.c 5.3 (Berkeley) 10/9/85";
#endif
/* /*
* flow control protocol. * flow control protocol.
* *
@@ -20,7 +16,7 @@ static char sccsid[] = "@(#)fio.c 5.3 (Berkeley) 10/9/85";
* PAD X.28 command mode, be sure to disable that access * PAD X.28 command mode, be sure to disable that access
* (PAD par 1). Also make sure both flow control pars * (PAD par 1). Also make sure both flow control pars
* (5 and 12) are set. The CR used in this proto is meant * (5 and 12) are set. The CR used in this proto is meant
* to trigger packet transmission, hence par 3 should be * to trigger packet transmission, hence par 3 should be
* set to 2; a good value for the Idle Timer (par 4) is 10. * set to 2; a good value for the Idle Timer (par 4) is 10.
* All other pars should be set to 0. * All other pars should be set to 0.
* *
@@ -58,7 +54,7 @@ static char sccsid[] = "@(#)fio.c 5.3 (Berkeley) 10/9/85";
#define FOBUFSIZ 256 /* for X.25 interfaces: set equal to packet size; #define FOBUFSIZ 256 /* for X.25 interfaces: set equal to packet size;
* otherwise make as large as feasible to reduce * otherwise make as large as feasible to reduce
* number of write system calls * number of write system calls
*/ */
#ifndef MAXMSGLEN #ifndef MAXMSGLEN
@@ -83,7 +79,7 @@ static int (*fsig)();
#define termio sgttyb #define termio sgttyb
#endif USG #endif USG
fturnon() int fturnon()
{ {
int ret; int ret;
struct termio ttbuf; struct termio ttbuf;
@@ -109,7 +105,7 @@ fturnon()
return SUCCESS; return SUCCESS;
} }
fturnoff() int fturnoff()
{ {
(void) signal(SIGALRM, fsig); (void) signal(SIGALRM, fsig);
return SUCCESS; return SUCCESS;
@@ -174,7 +170,7 @@ int fn;
char ack, ibuf[MAXMSGLEN]; char ack, ibuf[MAXMSGLEN];
int flen, mil, retries = 0; int flen, mil, retries = 0;
long abytes, fbytes; long abytes, fbytes;
struct timeb t1, t2; struct timeval t1, t2;
ret = FAIL; ret = FAIL;
retry: retry:
@@ -248,7 +244,7 @@ register FILE *fp2;
char ibuf[FIBUFSIZ]; char ibuf[FIBUFSIZ];
int ret, mil, retries = 0; int ret, mil, retries = 0;
long alen, abytes, fbytes; long alen, abytes, fbytes;
struct timeb t1, t2; struct timeval t1, t2;
ret = FAIL; ret = FAIL;
retry: retry:
@@ -288,7 +284,7 @@ acct:
} }
sprintf(ibuf, "received data %ld bytes %ld.%02d secs", sprintf(ibuf, "received data %ld bytes %ld.%02d secs",
fbytes, (long)t2.time, mil/10); fbytes, (long)t2.time, mil/10);
if (retries > 0) if (retries > 0)
sprintf(&ibuf[strlen(ibuf)]," %d retries", retries); sprintf(&ibuf[strlen(ibuf)]," %d retries", retries);
sysacct(abytes, t2.time); sysacct(abytes, t2.time);
DEBUG(1, "%s\n", ibuf); DEBUG(1, "%s\n", ibuf);
@@ -546,4 +542,3 @@ dcorr:
} }
return FAIL; return FAIL;
} }

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)gename.c 5.6 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <strings.h> #include <strings.h>
@@ -23,8 +19,7 @@ static char alphabet[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
/* /*
* generate file name * generate file name
*/ */
gename(pre, sys, grade, file) void gename(char pre, char *sys, char grade, char *file)
char pre, *sys, grade, *file;
{ {
register int i, fd; register int i, fd;
static char snum[5]; static char snum[5];

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)getargs.c 5.3 (Berkeley) 6/19/85";
#endif
#include "uucp.h" #include "uucp.h"
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -22,8 +18,7 @@ static char sccsid[] = "@(#)getargs.c 5.3 (Berkeley) 6/19/85";
* *
* return - the number of subfields, or -1 if >= maxargs. * return - the number of subfields, or -1 if >= maxargs.
*/ */
int getargs(s, arps, maxargs)
getargs(s, arps, maxargs)
register char *s; register char *s;
char *arps[]; char *arps[];
int maxargs; int maxargs;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)getprm.c 5.4 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <strings.h> #include <strings.h>
@@ -15,7 +11,6 @@ static char sccsid[] = "@(#)getprm.c 5.4 (Berkeley) 10/9/85";
* *
* return - pointer to next character in s * return - pointer to next character in s
*/ */
char * char *
getprm(s, prm) getprm(s, prm)
register char *s, *prm; register char *s, *prm;

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)getpwinfo.c 5.3.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <pwd.h> #include <pwd.h>
@@ -13,8 +9,7 @@ static char sccsid[] = "@(#)getpwinfo.c 5.3.1 (2.11BSD) 1997/10/2";
* return codes: SUCCESS | FAIL * return codes: SUCCESS | FAIL
* *
*/ */
int guinfo(uid, name, path)
guinfo(uid, name, path)
int uid; int uid;
register char *path, *name; register char *path, *name;
{ {
@@ -42,14 +37,12 @@ register char *path, *name;
return SUCCESS; return SUCCESS;
} }
/* /*
* get passwd file info for name * get passwd file info for name
* *
* return codes: SUCCESS | FAIL * return codes: SUCCESS | FAIL
*/ */
int gninfo(name, uid, path)
gninfo(name, uid, path)
char *path, *name; char *path, *name;
int *uid; int *uid;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)gio.c 5.6 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include "pk.h" #include "pk.h"
#include <setjmp.h> #include <setjmp.h>
@@ -11,12 +7,15 @@ jmp_buf Failbuf;
int Retries = 0; int Retries = 0;
struct pack *Pk; struct pack *Pk;
pkfail() static int gwrblk(char *blk, int len, int fn);
static int grdblk(char *blk, int len, int fn);
void pkfail()
{ {
longjmp(Failbuf, 1); longjmp(Failbuf, 1);
} }
gturnon() int gturnon()
{ {
struct pack *pkopen(); struct pack *pkopen();
@@ -28,7 +27,7 @@ gturnon()
return SUCCESS; return SUCCESS;
} }
gturnoff() int gturnoff()
{ {
if(setjmp(Failbuf)) if(setjmp(Failbuf))
return(FAIL); return(FAIL);
@@ -36,10 +35,7 @@ gturnoff()
return SUCCESS; return SUCCESS;
} }
int gwrmsg(char type, char *str, int fn)
gwrmsg(type, str, fn)
char type;
register char *str;
{ {
char bufr[BUFSIZ]; char bufr[BUFSIZ];
register char *s; register char *s;
@@ -64,7 +60,7 @@ register char *str;
} }
/*ARGSUSED*/ /*ARGSUSED*/
grdmsg(str, fn) int grdmsg(str, fn)
register char *str; register char *str;
{ {
unsigned len; unsigned len;
@@ -82,14 +78,13 @@ register char *str;
return SUCCESS; return SUCCESS;
} }
int gwrdata(fp1, fn)
gwrdata(fp1, fn)
FILE *fp1; FILE *fp1;
{ {
char bufr[BUFSIZ]; char bufr[BUFSIZ];
register int len; register int len;
int ret, mil; int ret, mil;
struct timeb t1, t2; struct timeval t1, t2;
long bytes; long bytes;
char text[BUFSIZ]; char text[BUFSIZ];
@@ -97,12 +92,8 @@ FILE *fp1;
return FAIL; return FAIL;
bytes = 0L; bytes = 0L;
Retries = 0; Retries = 0;
#ifdef USG gettimeofday(&t1, NULL);
time(&t1.time);
t1.millitm = 0;
#else
ftime(&t1);
#endif
while ((len = read(fileno(fp1), bufr, BUFSIZ)) > 0) { while ((len = read(fileno(fp1), bufr, BUFSIZ)) > 0) {
bytes += len; bytes += len;
ret = gwrblk(bufr, len, fn); ret = gwrblk(bufr, len, fn);
@@ -113,35 +104,31 @@ FILE *fp1;
break; break;
} }
ret = gwrblk(bufr, 0, fn); ret = gwrblk(bufr, 0, fn);
#ifdef USG
time(&t2.time); gettimeofday(&t2, NULL);
t2.millitm = 0;
#else
ftime(&t2);
#endif
Now = t2; Now = t2;
t2.time -= t1.time; t2.tv_sec -= t1.tv_sec;
mil = t2.millitm - t1.millitm; mil = (t2.tv_usec - t1.tv_usec) / 1000;
if (mil < 0) { if (mil < 0) {
--t2.time; --t2.tv_sec;
mil += 1000; mil += 1000;
} }
sprintf(text, "sent data %ld bytes %ld.%02d secs", sprintf(text, "sent data %ld bytes %ld.%02d secs",
bytes, (long)t2.time, mil/10); bytes, (long)t2.tv_sec, mil/10);
sysacct(bytes, t2.time); sysacct(bytes, t2.tv_sec);
if (Retries > 0) if (Retries > 0)
sprintf((char *)text+strlen(text)," %d retries", Retries); sprintf((char *)text+strlen(text)," %d retries", Retries);
DEBUG(1, "%s\n", text); DEBUG(1, "%s\n", text);
syslog(text); syslog(text);
return SUCCESS; return SUCCESS;
} }
grddata(fn, fp2) int grddata(fn, fp2)
FILE *fp2; FILE *fp2;
{ {
register int len; register int len;
char bufr[BUFSIZ]; char bufr[BUFSIZ];
struct timeb t1, t2; struct timeval t1, t2;
int mil; int mil;
long bytes; long bytes;
char text[BUFSIZ]; char text[BUFSIZ];
@@ -150,12 +137,8 @@ FILE *fp2;
return FAIL; return FAIL;
bytes = 0L; bytes = 0L;
Retries = 0; Retries = 0;
#ifdef USG gettimeofday(&t1, NULL);
time(&t1.time);
t1.millitm = 0;
#else
ftime(&t1);
#endif
for (;;) { for (;;) {
len = grdblk(bufr, BUFSIZ, fn); len = grdblk(bufr, BUFSIZ, fn);
if (len < 0) { if (len < 0) {
@@ -167,23 +150,18 @@ FILE *fp2;
if (len < BUFSIZ) if (len < BUFSIZ)
break; break;
} }
#ifdef USG gettimeofday(&t2, NULL);
time(&t2.time);
t2.millitm = 0;
#else
ftime(&t2);
#endif
Now = t2; Now = t2;
t2.time -= t1.time; t2.tv_sec -= t1.tv_sec;
mil = t2.millitm - t1.millitm; mil = (t2.tv_usec - t1.tv_usec) / 1000;
if (mil < 0) { if (mil < 0) {
--t2.time; --t2.tv_sec;
mil += 1000; mil += 1000;
} }
sprintf(text, "received data %ld bytes %ld.%02d secs", sprintf(text, "received data %ld bytes %ld.%02d secs",
bytes, (long)t2.time, mil/10); bytes, (long)t2.tv_sec, mil/10);
sysacct(bytes, t2.time); sysacct(bytes, t2.tv_sec);
if (Retries > 0) if (Retries > 0)
sprintf((char *)text+strlen(text)," %d retries", Retries); sprintf((char *)text+strlen(text)," %d retries", Retries);
DEBUG(1, "%s\n", text); DEBUG(1, "%s\n", text);
syslog(text); syslog(text);
@@ -197,7 +175,7 @@ static int tc = TC;
#endif #endif
/*ARGSUSED*/ /*ARGSUSED*/
grdblk(blk, len, fn) int grdblk(blk, len, fn)
register int len; register int len;
char *blk; char *blk;
{ {
@@ -222,7 +200,7 @@ char *blk;
} }
/*ARGSUSED*/ /*ARGSUSED*/
gwrblk(blk, len, fn) int gwrblk(blk, len, fn)
register char *blk; register char *blk;
{ {
#if !defined(BSD4_2) && !defined(USG) #if !defined(BSD4_2) && !defined(USG)
@@ -232,5 +210,5 @@ register char *blk;
ultouch(); ultouch();
} }
#endif #endif
return pkwrite(Pk, blk, len); return pkwrite(Pk, blk, len);
} }

View File

@@ -1,13 +1,4 @@
#ifndef lint
static char sccsid[] = "@(#)gnamef.c 5.4 (Berkeley) 6/20/85";
#endif
#include "uucp.h" #include "uucp.h"
#ifdef NDIR
#include "ndir.h"
#else
#include <sys/dir.h>
#endif
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -18,8 +9,7 @@ static char sccsid[] = "@(#)gnamef.c 5.4 (Berkeley) 6/20/85";
* 0 - end of directory read * 0 - end of directory read
* 1 - returned name * 1 - returned name
*/ */
int gnamef(dirp, filename)
gnamef(dirp, filename)
register DIR *dirp; register DIR *dirp;
register char *filename; register char *filename;
{ {

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)gnsys.c 5.4.1 (2.11BSD) 1997/10/31";
#endif
#include "uucp.h" #include "uucp.h"
#include <strings.h> #include <strings.h>
#ifdef NDIR #ifdef NDIR
@@ -13,6 +9,8 @@ static char sccsid[] = "@(#)gnsys.c 5.4.1 (2.11BSD) 1997/10/31";
#define LSIZE 128 /* number of systems to store */ #define LSIZE 128 /* number of systems to store */
#define WSUFSIZE 6 /* work file name suffix size */ #define WSUFSIZE 6 /* work file name suffix size */
static int srchst(char *name, char **list, int n);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
@@ -26,9 +24,7 @@ static char sccsid[] = "@(#)gnsys.c 5.4.1 (2.11BSD) 1997/10/31";
* SUCCESS - no more names * SUCCESS - no more names
* FAIL - bad directory * FAIL - bad directory
*/ */
int gnsys(char *sname, char *dir, char pre)
gnsys(sname, dir, pre)
char *sname, *dir, pre;
{ {
register char *s, *p1, *p2; register char *s, *p1, *p2;
char px[3]; char px[3];
@@ -114,8 +110,7 @@ retry:
* return codes: * return codes:
* n - the number of items in the list * n - the number of items in the list
*/ */
int srchst(name, list, n)
srchst(name, list, n)
char *name; char *name;
register char **list; register char **list;
int n; int n;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)gnxseq.c 5.4 (Berkeley) 6/20/85";
#endif
#include "uucp.h" #include "uucp.h"
#ifdef BSD4_2 #ifdef BSD4_2
#include <sys/time.h> #include <sys/time.h>

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)imsg.c 5.3 (Berkeley) 1/6/86";
#endif
#include "uucp.h" #include "uucp.h"
#include <ctype.h> #include <ctype.h>
@@ -9,7 +5,7 @@ char Msync[2] = "\020";
/* to talk to both eunice and x.25 without also screwing up tcp/ip /* to talk to both eunice and x.25 without also screwing up tcp/ip
* we must adaptively choose what character to end the msg with * we must adaptively choose what character to end the msg with
* *
* The idea is that initially we send ....\000\n * The idea is that initially we send ....\000\n
* Then, after they have sent us a message, we use the first character * Then, after they have sent us a message, we use the first character
* they send. * they send.
@@ -26,8 +22,7 @@ char Mend = '\0';
* FAIL - no more messages * FAIL - no more messages
* SUCCESS - message returned * SUCCESS - message returned
*/ */
int imsg(amsg, fn)
imsg(amsg, fn)
char *amsg; char *amsg;
register int fn; register int fn;
{ {
@@ -42,7 +37,7 @@ register int fn;
c &= 0177; c &= 0177;
if (c == '\n' || c == '\r') if (c == '\n' || c == '\r')
DEBUG(5, "%c", c); DEBUG(5, "%c", c);
else else
DEBUG(5, (isprint(c) || isspace(c)) ? "%c" : "\\%o", DEBUG(5, (isprint(c) || isspace(c)) ? "%c" : "\\%o",
c & 0377); c & 0377);
if (c == Msync[0]) { if (c == Msync[0]) {
@@ -68,18 +63,13 @@ register int fn;
return foundsync; return foundsync;
} }
/* /*
* this is the initial write message routine - * this is the initial write message routine -
* used before a protocol is agreed upon. * used before a protocol is agreed upon.
* *
* return code: always 0 * return code: always 0
*/ */
int omsg(char type, char *msg, int fn)
omsg(type, msg, fn)
register char *msg;
char type;
int fn;
{ {
char buf[MAXFULLNAME]; char buf[MAXFULLNAME];
register char *c; register char *c;
@@ -92,7 +82,7 @@ int fn;
*c++ = *msg++; *c++ = *msg++;
*c++ = '\0'; *c++ = '\0';
DEBUG(5, "omsg <%s>\n", buf); DEBUG(5, "omsg <%s>\n", buf);
if (seenend) if (seenend)
c[-1] = Mend; c[-1] = Mend;
else else
*c++ = '\n'; *c++ = '\n';

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)lastpart.c 5.4 (Berkeley) 6/20/85";
#endif
#include <strings.h> #include <strings.h>
#include "uucp.h" #include "uucp.h"
@@ -12,7 +8,6 @@ static char sccsid[] = "@(#)lastpart.c 5.4 (Berkeley) 6/20/85";
* *
* return - pointer to last part * return - pointer to last part
*/ */
char * char *
lastpart(file) lastpart(file)
register char *file; register char *file;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)logent.c 5.6 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#ifdef BSD4_2 #ifdef BSD4_2
#include <sys/time.h> #include <sys/time.h>
@@ -11,18 +7,21 @@ static char sccsid[] = "@(#)logent.c 5.6 (Berkeley) 10/9/85";
#if defined(USG) || defined(BSD4_2) #if defined(USG) || defined(BSD4_2)
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#include <sys/stat.h>
static FILE *Lp = NULL; static FILE *Lp = NULL;
static FILE *Sp = NULL; static FILE *Sp = NULL;
static Ltried = 0; static int Ltried = 0;
static Stried = 0; static int Stried = 0;
static void mlogent(FILE *fp, char *status, char *text);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
* make log entry * make log entry
*/ */
logent(text, status) void logent(text, status)
char *text, *status; char *text, *status;
{ {
#ifdef LOGBYSITE #ifdef LOGBYSITE
@@ -73,12 +72,11 @@ char *text, *status;
/* /*
* make a log entry * make a log entry
*/ */
void mlogent(fp, status, text)
mlogent(fp, status, text)
char *text, *status; char *text, *status;
register FILE *fp; register FILE *fp;
{ {
static pid = 0; static int pid = 0;
register struct tm *tp; register struct tm *tp;
extern struct tm *localtime(); extern struct tm *localtime();
@@ -88,13 +86,10 @@ register FILE *fp;
status = ""; status = "";
if (!pid) if (!pid)
pid = getpid(); pid = getpid();
#ifdef USG
time(&Now.time); gettimeofday(&Now, NULL);
Now.millitm = 0;
#else tp = localtime(&Now.tv_sec);
ftime(&Now);
#endif
tp = localtime(&Now.time);
#ifdef USG #ifdef USG
fprintf(fp, "%s %s (%d/%d-%2.2d:%2.2d-%d) ", fprintf(fp, "%s %s (%d/%d-%2.2d:%2.2d-%d) ",
#else #else
@@ -125,7 +120,7 @@ register FILE *fp;
/* /*
* close log file * close log file
*/ */
logcls() void logcls()
{ {
if (Lp != NULL) if (Lp != NULL)
fclose(Lp); fclose(Lp);
@@ -138,11 +133,10 @@ logcls()
Stried = 0; Stried = 0;
} }
/* /*
* make system log entry * make system log entry
*/ */
syslog(text) void syslog(text)
char *text; char *text;
{ {
register struct tm *tp; register struct tm *tp;
@@ -185,23 +179,19 @@ char *text;
fioclex(fileno(Sp)); fioclex(fileno(Sp));
} }
#ifdef USG gettimeofday(&Now, NULL);
time(&Now.time);
Now.millitm = 0; tp = localtime(&Now.tv_sec);
#else
ftime(&Now);
#endif
tp = localtime(&Now.time);
fprintf(Sp, "%s %s ", User, Rmtname); fprintf(Sp, "%s %s ", User, Rmtname);
#ifdef USG #ifdef USG
fprintf(Sp, "(%d/%d-%2.2d:%2.2d) ", tp->tm_mon + 1, fprintf(Sp, "(%d/%d-%2.2d:%2.2d) ", tp->tm_mon + 1,
tp->tm_mday, tp->tm_hour, tp->tm_min); tp->tm_mday, tp->tm_hour, tp->tm_min);
fprintf(Sp, "(%ld) %s\n", Now.time, text); fprintf(Sp, "(%ld) %s\n", Now.tv_sec, text);
#else #else
fprintf(Sp, "(%d/%d-%02d:%02d) ", tp->tm_mon + 1, fprintf(Sp, "(%d/%d-%02d:%02d) ", tp->tm_mon + 1,
tp->tm_mday, tp->tm_hour, tp->tm_min); tp->tm_mday, tp->tm_hour, tp->tm_min);
fprintf(Sp, "(%ld.%02u) %s\n", Now.time, Now.millitm/10, text); fprintf(Sp, "(%ld.%02u) %s\n", Now.tv_sec, Now.tv_usec/10000, text);
#endif #endif
/* Position at end and flush */ /* Position at end and flush */
@@ -220,7 +210,7 @@ char *text;
#include <sgtty.h> #include <sgtty.h>
#endif #endif
fioclex(fd) void fioclex(fd)
int fd; int fd;
{ {
register int ret; register int ret;
@@ -230,6 +220,7 @@ int fd;
#else #else
ret = ioctl(fd, FIOCLEX, STBNULL); ret = ioctl(fd, FIOCLEX, STBNULL);
#endif #endif
if (ret) if (ret) {
DEBUG(2, "CAN'T FIOCLEX %d\n", fd); DEBUG(2, "CAN'T FIOCLEX %d\n", fd);
}
} }

View File

@@ -1,12 +1,12 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)mailst.c 5.6.1 (2.11BSD GTE) 6/11/94";
#endif
#include <signal.h> #include <signal.h>
#include "uucp.h" #include "uucp.h"
#ifdef USG #ifdef USG
#include <fcntl.h> #include <fcntl.h>
#endif #endif
#include <sys/wait.h>
static FILE *rpopen(char *cmd, char *mode);
static int rpclose(FILE *ptr);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -16,8 +16,7 @@ static char sccsid[] = "@(#)mailst.c 5.6.1 (2.11BSD GTE) 6/11/94";
* If file is non-null, the file is also sent. * If file is non-null, the file is also sent.
* (this is used for mail returned to sender.) * (this is used for mail returned to sender.)
*/ */
void mailst(user, str, file)
mailst(user, str, file)
char *user, *str, *file; char *user, *str, *file;
{ {
register FILE *fp, *fi; register FILE *fp, *fi;
@@ -53,7 +52,7 @@ char *cmd;
char *mode; char *mode;
{ {
int p[2]; int p[2];
register myside, hisside, pid; register int myside, hisside, pid;
if(pipe(p) < 0) if(pipe(p) < 0)
return NULL; return NULL;
@@ -82,10 +81,10 @@ char *mode;
return(fdopen(myside, mode)); return(fdopen(myside, mode));
} }
rpclose(ptr) int rpclose(ptr)
FILE *ptr; FILE *ptr;
{ {
register f, r; register int f, r;
register sig_t hstat, istat, qstat; register sig_t hstat, istat, qstat;
int status; int status;

View File

@@ -126,3 +126,15 @@ struct piocb {
}; };
extern int pksizes[]; extern int pksizes[];
void pkclose(struct pack *pk);
int pkread(struct pack *pk, char *ibuf, int icount);
int pkwrite(struct pack *pk, char *ibuf, int icount);
int pksack(struct pack *pk);
void pkoutput(struct pack *pk);
void pkgetpack(struct pack *pk);
void pkmove(char *p1, char *p2, int count, int flag);
void pkxstart(struct pack *pk, char cntl, int x);
void pkreset(struct pack *pk);
void pkfail(void);
void pkcntl(int c, struct pack *pk);

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)pk0.c 5.7.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include "pk.h" #include "pk.h"
@@ -20,15 +16,18 @@ int Reacks;
#define PKWTIME 4 #define PKWTIME 4
#define PKRSKEW 3 #define PKRSKEW 3
#define PKWSKEW 2 #define PKWSKEW 2
extern int pktimeout, pktimeskew, Ntimeout; extern int pktimeout, pktimeskew, Ntimeout;
static int pksize(int n);
/* /*
* receive control messages * receive control messages
*/ */
pkcntl(c, pk) void pkcntl(c, pk)
register struct pack *pk; register struct pack *pk;
{ {
register cntl, val; register int cntl, val;
val = c & MOD8; val = c & MOD8;
cntl = (c>>3) & MOD8; cntl = (c>>3) & MOD8;
@@ -109,10 +108,10 @@ register struct pack *pk;
pkoutput(pk); pkoutput(pk);
} }
pkaccept(pk) int pkaccept(pk)
register struct pack *pk; register struct pack *pk;
{ {
register x, seq; register int x, seq;
char m, cntl, *p, imask, **bp; char m, cntl, *p, imask, **bp;
int bad, accept, skip, t, cc; int bad, accept, skip, t, cc;
unsigned short sum; unsigned short sum;
@@ -230,12 +229,12 @@ free:
} }
/*ARGSUSED*/ /*ARGSUSED*/
pkread(pk, ibuf, icount) int pkread(pk, ibuf, icount)
register struct pack *pk; register struct pack *pk;
char *ibuf; char *ibuf;
int icount; int icount;
{ {
register x; register int x;
int is, cc, xfr, count; int is, cc, xfr, count;
char *cp, **bp; char *cp, **bp;
@@ -293,17 +292,17 @@ int icount;
} }
/*ARGSUSED*/ /*ARGSUSED*/
pkwrite(pk, ibuf, icount) int pkwrite(pk, ibuf, icount)
register struct pack *pk; register struct pack *pk;
char *ibuf; char *ibuf;
int icount; int icount;
{ {
register x; register int x;
int partial; int partial;
caddr_t cp; caddr_t cp;
int cc, fc, count; int cc, fc, count;
if (pk->p_state&DOWN || !pk->p_state&LIVE) { if ((pk->p_state & DOWN) || !(pk->p_state & LIVE)) {
return -1; return -1;
} }
@@ -349,10 +348,10 @@ int icount;
return count; return count;
} }
pksack(pk) int pksack(pk)
register struct pack *pk; register struct pack *pk;
{ {
register x, i; register int x, i;
i = 0; i = 0;
for(x=pk->p_ps; x!=pk->p_rpr; ) { for(x=pk->p_ps; x!=pk->p_rpr; ) {
@@ -369,10 +368,10 @@ register struct pack *pk;
return i; return i;
} }
pkoutput(pk) void pkoutput(pk)
register struct pack *pk; register struct pack *pk;
{ {
register x; register int x;
int i; int i;
char bstate; char bstate;
@@ -476,10 +475,10 @@ out:
* releasing space and turning off line discipline * releasing space and turning off line discipline
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
pkclose(pk) void pkclose(pk)
register struct pack *pk; register struct pack *pk;
{ {
register i; register int i;
char **bp; char **bp;
int rcheck = 0; int rcheck = 0;
@@ -543,28 +542,27 @@ register struct pack *pk;
free((char *)pk); free((char *)pk);
} }
pkreset(pk) void pkreset(pk)
register struct pack *pk; register struct pack *pk;
{ {
pk->p_ps = pk->p_pr = pk->p_rpr = 0; pk->p_ps = pk->p_pr = pk->p_rpr = 0;
pk->p_nxtps = 1; pk->p_nxtps = 1;
} }
#ifndef BSD4_2 #ifndef BSD4_2
bzero(s,n) void bzero(s,n)
register char *s; register char *s;
register n; register int n;
{ {
while (n--) while (n--)
*s++ = 0; *s++ = 0;
} }
#endif #endif
pksize(n) int pksize(n)
register n; register int n;
{ {
register k; register int k;
n >>= 5; n >>= 5;
for(k=0; n >>= 1; k++) for(k=0; n >>= 1; k++)

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)pk1.c 5.9.2 (2.11BSD) 1997/10/2";
#endif
#include <signal.h> #include <signal.h>
#include <strings.h> #include <strings.h>
#include "uucp.h" #include "uucp.h"
@@ -32,6 +28,7 @@ int Connodata = 0;
int Ntimeout = 0; int Ntimeout = 0;
int pktimeout = 4; int pktimeout = 4;
int pktimeskew = 2; int pktimeskew = 2;
/* /*
* packet driver support routines * packet driver support routines
* *
@@ -39,10 +36,12 @@ int pktimeskew = 2;
extern struct pack *pklines[]; extern struct pack *pklines[];
static int pkcget(int fn, char *b, int n);
static void pkdata(char c, unsigned short sum, struct pack *pk, char **bp);
/* /*
* start initial synchronization. * start initial synchronization.
*/ */
struct pack * struct pack *
pkopen(ifn, ofn) pkopen(ifn, ofn)
int ifn, ofn; int ifn, ofn;
@@ -120,11 +119,11 @@ int pksizes[] = {
}; };
#define GETRIES 10 #define GETRIES 10
/* /*
* Pseudo-dma byte collection. * Pseudo-dma byte collection.
*/ */
void pkgetpack(pk)
pkgetpack(pk)
register struct pack *pk; register struct pack *pk;
{ {
int k, tries, noise; int k, tries, noise;
@@ -217,13 +216,9 @@ register struct pack *pk;
} }
} }
pkdata(c, sum, pk, bp) void pkdata(char c, unsigned short sum, register struct pack *pk, char **bp)
char c;
unsigned short sum;
register struct pack *pk;
char **bp;
{ {
register x; register int x;
int t; int t;
char m; char m;
@@ -254,6 +249,7 @@ slot:
* setup input transfers * setup input transfers
*/ */
#define PKMAXBUF 128 #define PKMAXBUF 128
/* /*
* Start transmission on output device associated with pk. * Start transmission on output device associated with pk.
* For asynch devices (t_line==1) framing is * For asynch devices (t_line==1) framing is
@@ -261,10 +257,7 @@ slot:
* in the driver (t_line==2) the transfer is * in the driver (t_line==2) the transfer is
* passed on to the driver. * passed on to the driver.
*/ */
pkxstart(pk, cntl, x) void pkxstart(register struct pack *pk, char cntl, register int x)
register struct pack *pk;
char cntl;
register x;
{ {
register char *p; register char *p;
short checkword; short checkword;
@@ -319,8 +312,7 @@ register x;
pkoutput(pk); pkoutput(pk);
} }
void pkmove(p1, p2, count, flag)
pkmove(p1, p2, count, flag)
char *p1, *p2; char *p1, *p2;
int count, flag; int count, flag;
{ {
@@ -338,7 +330,6 @@ int count, flag;
*d++ = *s++; *d++ = *s++;
} }
/* /*
* get n characters from input * get n characters from input
* *
@@ -348,12 +339,13 @@ int count, flag;
*/ */
jmp_buf Getjbuf; jmp_buf Getjbuf;
cgalarm()
void cgalarm()
{ {
longjmp(Getjbuf, 1); longjmp(Getjbuf, 1);
} }
pkcget(fn, b, n) int pkcget(fn, b, n)
int fn; int fn;
register char *b; register char *b;
register int n; register int n;
@@ -423,7 +415,7 @@ register int n;
logent(strerror(errno),"FAILED pkcget Read"); logent(strerror(errno),"FAILED pkcget Read");
longjmp(Sjbuf, 6); longjmp(Sjbuf, 6);
} }
b += ret; b += ret;
n -= ret; n -= ret;
} }
alarm(0); alarm(0);

View File

@@ -1,17 +1,12 @@
#ifndef lint
static char sccsid[] = "@(#)prefix.c 5.3 (Berkeley) 6/20/85";
#endif
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
* check s2 for prefix s1 * check s2 for prefix s1
* *
* return 0 - != * return 0 - !=
* return 1 - == * return 1 - ==
*/ */
int prefix(s1, s2)
prefix(s1, s2)
register char *s1, *s2; register char *s1, *s2;
{ {
register char c; register char c;
@@ -26,9 +21,9 @@ register char *s1, *s2;
* check s2 for prefix s1 with a wildcard character ? * check s2 for prefix s1 with a wildcard character ?
* *
* return 0 - != * return 0 - !=
* return 1 - == * return 1 - ==
*/ */
int
wprefix(s1, s2) wprefix(s1, s2)
register char *s1, *s2; register char *s1, *s2;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)setline.c 5.3 (Berkeley) 6/20/85";
#endif
#include "uucp.h" #include "uucp.h"
#ifdef USG #ifdef USG
#include <termio.h> #include <termio.h>
@@ -20,8 +16,7 @@ static char sccsid[] = "@(#)setline.c 5.3 (Berkeley) 6/20/85";
* return code - none * return code - none
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
setupline(type) void setupline(char type)
char type;
{ {
#ifdef USG #ifdef USG
static struct termio tbuf, sbuf; static struct termio tbuf, sbuf;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)subdir.c 5.4 (Berkeley) 6/23/85";
#endif
#include "uucp.h" #include "uucp.h"
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -85,7 +81,7 @@ char *as;
/* /*
* save away filename * save away filename
*/ */
subchdir(s) int subchdir(s)
register char *s; register char *s;
{ {
inspool = (strcmp(s, Spool) == 0); inspool = (strcmp(s, Spool) == 0);
@@ -99,10 +95,12 @@ char *
subdir(d, pre) subdir(d, pre)
register char *d, pre; register char *d, pre;
{ {
if (strcmp(d, Spool) == 0) if (strcmp(d, Spool) == 0) {
if (pre == CMDPRE) if (pre == CMDPRE) {
return CMDSDIR; return CMDSDIR;
else if (pre == XQTPRE) } else if (pre == XQTPRE) {
return XEQTDIR; return XEQTDIR;
}
}
return d; return d;
} }

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)sysacct.c 5.3 (Berkeley) 6/23/85";
#endif
#include <sys/types.h> #include <sys/types.h>
/*LINTLIBRARY*/ /*LINTLIBRARY*/
@@ -11,7 +7,7 @@ static char sccsid[] = "@(#)sysacct.c 5.3 (Berkeley) 6/23/85";
*/ */
/*ARGSUSED*/ /*ARGSUSED*/
sysacct(bytes, time) void sysacct(bytes, time)
time_t time; time_t time;
long bytes; long bytes;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)systat.c 5.4 (Berkeley) 6/23/85";
#endif
#include "uucp.h" #include "uucp.h"
#define STATNAME(f, n) sprintf(f, "%s/%s/%s", Spool, "STST", n) #define STATNAME(f, n) sprintf(f, "%s/%s/%s", Spool, "STST", n)
@@ -13,7 +9,7 @@ static char sccsid[] = "@(#)systat.c 5.4 (Berkeley) 6/23/85";
* make system status entry * make system status entry
* return codes: none * return codes: none
*/ */
systat(name, type, text) void systat(name, type, text)
char *name, *text; char *name, *text;
int type; int type;
{ {
@@ -71,8 +67,7 @@ int type;
* *
* return codes: none * return codes: none
*/ */
void rmstat(name)
rmstat(name)
char *name; char *name;
{ {
char filename[MAXFULLNAME]; char filename[MAXFULLNAME];
@@ -86,8 +81,7 @@ char *name;
* *
* return codes 0 - ok | >0 system status * return codes 0 - ok | >0 system status
*/ */
int callok(name)
callok(name)
char *name; char *name;
{ {
char filename[MAXFULLNAME], line[S_SIZE]; char filename[MAXFULLNAME], line[S_SIZE];

View File

@@ -1,14 +1,9 @@
#ifndef lint
static char sccsid[] = "@(#)tio.c 4.6 (Berkeley) 1/24/86";
#endif
#include <signal.h> #include <signal.h>
#include "uucp.h" #include "uucp.h"
#include <setjmp.h> #include <setjmp.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <netinet/in.h> #include <netinet/in.h>
extern int pkfail();
#define TPACKSIZE 512 #define TPACKSIZE 512
#define TBUFSIZE 1024 #define TBUFSIZE 1024
#define LBUFSIZE 128 #define LBUFSIZE 128
@@ -95,7 +90,7 @@ FILE *fp1;
struct tbuf bufr; struct tbuf bufr;
register int len; register int len;
int ret, mil; int ret, mil;
struct timeb t1, t2; struct timeval t1, t2;
long bytes; long bytes;
char text[LBUFSIZE]; char text[LBUFSIZE];
@@ -159,7 +154,7 @@ FILE *fp2;
{ {
register int len, nread; register int len, nread;
char bufr[TBUFSIZE]; char bufr[TBUFSIZE];
struct timeb t1, t2; struct timeval t1, t2;
int mil; int mil;
long bytes, Nbytes; long bytes, Nbytes;

View File

@@ -1,10 +1,7 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)ulockf.c 5.5.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <signal.h>
#define LCKMODE 0444 /* File mode for lock files */ #define LCKMODE 0444 /* File mode for lock files */
#define MAXLOCKS 16 /* Maximum number of lock files */ #define MAXLOCKS 16 /* Maximum number of lock files */
@@ -13,6 +10,8 @@ char *Lockfile[MAXLOCKS];
char *LockDirectory = LOCKDIR; char *LockDirectory = LOCKDIR;
int Nlocks = 0; int Nlocks = 0;
static int onelock(int pid, char *tempfile, char *name);
/*LINTLIBRARY*/ /*LINTLIBRARY*/
/* /*
@@ -21,7 +20,7 @@ int Nlocks = 0;
* *
* return codes: SUCCESS | FAIL * return codes: SUCCESS | FAIL
*/ */
ulockf(hfile, atime) int ulockf(hfile, atime)
char *hfile; char *hfile;
time_t atime; time_t atime;
{ {
@@ -85,7 +84,7 @@ time_t atime;
/* /*
* remove all lock files in list or name * remove all lock files in list or name
*/ */
rmlock(name) void rmlock(name)
register char *name; register char *name;
{ {
register int i; register int i;
@@ -110,7 +109,7 @@ register char *name;
* makes lock a name on behalf of pid. Tempfile must be in the same * makes lock a name on behalf of pid. Tempfile must be in the same
* file system as name. * file system as name.
*/ */
onelock(pid, tempfile, name) int onelock(pid, tempfile, name)
int pid; int pid;
char *tempfile, *name; char *tempfile, *name;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uuclean.c 5.6 (Berkeley) 10/9/85";
#endif
#include <signal.h> #include <signal.h>
#include "uucp.h" #include "uucp.h"
#include <pwd.h> #include <pwd.h>
@@ -12,6 +8,11 @@ static char sccsid[] = "@(#)uuclean.c 5.6 (Berkeley) 10/9/85";
#include <sys/dir.h> #include <sys/dir.h>
#endif #endif
static void stpre(char *p);
static int chkpre(char *file);
static void notfyuser(char *file);
static void sdmail(char *file, int uid);
/* /*
* *
* this program will search through the spool * this program will search through the spool
@@ -34,9 +35,9 @@ static char sccsid[] = "@(#)uuclean.c 5.6 (Berkeley) 10/9/85";
#define NOMTIME 72 /* hours to age files before deletion */ #define NOMTIME 72 /* hours to age files before deletion */
int checkprefix = 0; int checkprefix = 0;
struct timeb Now; struct timeval Now;
main(argc, argv) int main(argc, argv)
char *argv[]; char *argv[];
{ {
DIR *dirp; DIR *dirp;
@@ -62,7 +63,7 @@ char *argv[];
break; break;
case 'p': case 'p':
checkprefix = 1; checkprefix = 1;
if (&argv[1][2] != '\0') if (argv[1][2] != '\0')
stpre(&argv[1][2]); stpre(&argv[1][2]);
break; break;
case 'x': case 'x':
@@ -115,10 +116,10 @@ char *argv[];
exit(0); exit(0);
} }
#define MAXPRE 10 #define MAXPRE 10
char Pre[MAXPRE][NAMESIZE]; char Pre[MAXPRE][NAMESIZE];
int Npre = 0; int Npre = 0;
/*** /***
* chkpre(file) check for prefix * chkpre(file) check for prefix
* char *file; * char *file;
@@ -127,8 +128,7 @@ int Npre = 0;
* 0 - not prefix * 0 - not prefix
* 1 - is prefix * 1 - is prefix
*/ */
int chkpre(file)
chkpre(file)
char *file; char *file;
{ {
int i; int i;
@@ -146,8 +146,7 @@ char *file;
* *
* return codes: none * return codes: none
*/ */
void stpre(p)
stpre(p)
char *p; char *p;
{ {
if (Npre < MAXPRE - 2) if (Npre < MAXPRE - 2)
@@ -160,8 +159,7 @@ char *p;
* *
* return code - none * return code - none
*/ */
void notfyuser(file)
notfyuser(file)
char *file; char *file;
{ {
FILE *fp; FILE *fp;
@@ -195,7 +193,6 @@ char *file;
mailst(args[3], msg, CNULL); mailst(args[3], msg, CNULL);
} }
/*** /***
* sdmail(file, uid) * sdmail(file, uid)
* *
@@ -205,8 +202,7 @@ char *file;
* This is only implemented for local system * This is only implemented for local system
* mail at this time. * mail at this time.
*/ */
void sdmail(file, uid)
sdmail(file, uid)
char *file; char *file;
{ {
static struct passwd *pwd; static struct passwd *pwd;
@@ -224,7 +220,7 @@ char *file;
mailst(pwd->pw_name, mstr, CNULL); mailst(pwd->pw_name, mstr, CNULL);
} }
cleanup(code) void cleanup(code)
int code; int code;
{ {
exit(code); exit(code);

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uucp.c 5.5 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -16,11 +12,11 @@ char Path[100], Optns[10], Ename[MAXBASENAME+1];
char Grade = 'n'; char Grade = 'n';
#ifdef DONTCOPY #ifdef DONTCOPY
int Copy = 0; int Copy = 0;
#else #else
int Copy = 1; int Copy = 1;
#endif #endif
char Nuser[32]; char Nuser[32];
struct timeb Now; struct timeval Now;
/* variables used to check if talking to more than one system. */ /* variables used to check if talking to more than one system. */
int xsflag = -1; int xsflag = -1;
@@ -30,7 +26,12 @@ long Nbytes = 0;
#define MAXBYTES 50000 /* maximun number of bytes of data per C. file */ #define MAXBYTES 50000 /* maximun number of bytes of data per C. file */
#define MAXCOUNT 15 /* maximun number of files per C. file */ #define MAXCOUNT 15 /* maximun number of files per C. file */
main(argc, argv) static int copy(char *s1, char *f1, char *s2, char *f2);
static void clscfile(void);
static void chsys(char *s1);
static void xuux(char *ename, char *s1, char *f1, char *s2, char *f2, char *opts);
int main(argc, argv)
char *argv[]; char *argv[];
{ {
int ret; int ret;
@@ -100,7 +101,7 @@ char *argv[];
DEBUG(4, "\n\n** %s **\n", "START"); DEBUG(4, "\n\n** %s **\n", "START");
if (!avoidgwd) { if (!avoidgwd) {
cp = getwd(Wrkdir); cp = getwd(Wrkdir);
ASSERT(cp != 0, "GETWD FAILED", Wrkdir, cp); ASSERT(cp != 0, "GETWD FAILED", Wrkdir, 0);
} }
ret = subchdir(Spool); ret = subchdir(Spool);
ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret); ASSERT(ret >= 0, "CHDIR FAILED", Spool, ret);
@@ -183,7 +184,7 @@ char *argv[];
cleanup(0); cleanup(0);
} }
cleanup(code) void cleanup(code)
int code; int code;
{ {
logcls(); logcls();
@@ -193,14 +194,12 @@ int code;
exit(code); exit(code);
} }
/* /*
* generate copy files * generate copy files
* *
* return codes 0 | FAIL * return codes 0 | FAIL
*/ */
int copy(s1, f1, s2, f2)
copy(s1, f1, s2, f2)
register char *s1, *f1, *s2, *f2; register char *s1, *f1, *s2, *f2;
{ {
int type, statret; int type, statret;
@@ -369,8 +368,7 @@ register char *s1, *f1, *s2, *f2;
* *
* return code - none * return code - none
*/ */
void xuux(ename, s1, f1, s2, f2, opts)
xuux(ename, s1, f1, s2, f2, opts)
char *ename, *s1, *s2, *f1, *f2, *opts; char *ename, *s1, *s2, *f1, *f2, *opts;
{ {
char cmd[200]; char cmd[200];
@@ -396,7 +394,6 @@ char Cfile[NAMESIZE];
* *
* return an open file descriptor * return an open file descriptor
*/ */
FILE * FILE *
gtcfile(sys) gtcfile(sys)
register char *sys; register char *sys;
@@ -416,7 +413,7 @@ register char *sys;
gename(CMDPRE, sys, Grade, Cfile); gename(CMDPRE, sys, Grade, Cfile);
#ifdef VMS #ifdef VMS
savemask = umask(~0600); /* vms must have read permission */ savemask = umask(~0600); /* vms must have read permission */
#else #else
savemask = umask(~0200); savemask = umask(~0200);
#endif #endif
Cfp = fopen(subfile(Cfile), "w"); Cfp = fopen(subfile(Cfile), "w");
@@ -432,8 +429,7 @@ register char *sys;
* *
* return code - none * return code - none
*/ */
void clscfile()
clscfile()
{ {
if (Cfp == NULL) if (Cfp == NULL)
return; return;
@@ -447,7 +443,7 @@ clscfile()
/* /*
* compile a list of all systems we are referencing * compile a list of all systems we are referencing
*/ */
chsys(s1) void chsys(s1)
register char *s1; register char *s1;
{ {
if (xsflag < 0) if (xsflag < 0)

View File

@@ -6,14 +6,13 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h>
#ifdef NDIR
struct timeb { #include "ndir.h"
time_t time; #else
u_short millitm; #include <sys/dir.h>
short timezone; #endif
short dstflag;
};
/* /*
* Determine local uucp name of this machine. * Determine local uucp name of this machine.
@@ -48,11 +47,11 @@ struct timeb {
* If everything fails, it uses "unknown" for the system name. * If everything fails, it uses "unknown" for the system name.
*/ */
#define GETHOSTNAME /**/ #define GETHOSTNAME /**/
/* #define UNAME /**/ // #define UNAME /**/
/* #define WHOAMI /**/ // #define WHOAMI /**/
/* #define CCWHOAMI /**/ // #define CCWHOAMI /**/
/* #define UUNAME /**/ // #define UUNAME /**/
/* #define GETMYHNAME /**/ // #define GETMYHNAME /**/
/* If the above fails ... */ /* If the above fails ... */
#define MYNAME "wlonex" #define MYNAME "wlonex"
@@ -62,38 +61,38 @@ struct timeb {
* Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT. * Otherwise, define EX_NOHOST, EX_CANTCREAT, and EX_NOINPUT.
*/ */
#include <sysexits.h> #include <sysexits.h>
/*#define EX_NOINPUT 66 /**/ //#define EX_NOINPUT 66 /**/
/*#define EX_NOHOST 68 /**/ //#define EX_NOHOST 68 /**/
/*#define EX_CANTCREAT 73 /**/ //#define EX_CANTCREAT 73 /**/
/* /*
* Define the various kinds of connections to include. * Define the various kinds of connections to include.
* The complete list is in the condevs array in condevs.c * The complete list is in the condevs array in condevs.c
*/ */
/* #define ATT2224 /* AT&T 2224 */ // #define ATT2224 /* AT&T 2224 */
//#define BSDTCP /* 4.2bsd or 2.9bsd TCP/IP */ //#define BSDTCP /* 4.2bsd or 2.9bsd TCP/IP */
/* #define CDS224 /* Concord Data Systems 2400 */ // #define CDS224 /* Concord Data Systems 2400 */
/* #define DATAKIT /* ATT's datakit */ // #define DATAKIT /* ATT's datakit */
/* #define DF02 /* Dec's DF02/DF03 */ // #define DF02 /* Dec's DF02/DF03 */
/* #define DF112 /* Dec's DF112 */ // #define DF112 /* Dec's DF112 */
/* #define DN11 /* "standard" DEC dialer */ // #define DN11 /* "standard" DEC dialer */
#define HAYES /* Hayes' Smartmodem */ #define HAYES /* Hayes' Smartmodem */
/* #define HAYES2400 /* Hayes' 2400 baud Smartmodem */ // #define HAYES2400 /* Hayes' 2400 baud Smartmodem */
/* #define MICOM /* Micom Mux port */ // #define MICOM /* Micom Mux port */
/* #define NOVATION /* Novation modem */ // #define NOVATION /* Novation modem */
/* #define PAD /* X.25 PAD */ // #define PAD /* X.25 PAD */
/* #define PENRIL /* PENRIL Dialer */ // #define PENRIL /* PENRIL Dialer */
/* #define PNET /* Purdue network */ // #define PNET /* Purdue network */
/* #define RVMACS /* Racal-Vadic MACS 820 dialer, 831 adaptor */ // #define RVMACS /* Racal-Vadic MACS 820 dialer, 831 adaptor */
/* #define SYTEK /* Sytek Local Area Net */ // #define SYTEK /* Sytek Local Area Net */
/* #define UNETTCP /* 3Com's UNET */ // #define UNETTCP /* 3Com's UNET */
/* #define USR2400 /* USRobotics Courier 2400 */ // #define USR2400 /* USRobotics Courier 2400 */
/* #define VA212 /* Racal-Vadic 212 */ // #define VA212 /* Racal-Vadic 212 */
/* #define VA811S /* Racal-Vadic 811S dialer, 831 adaptor */ // #define VA811S /* Racal-Vadic 811S dialer, 831 adaptor */
/* #define VA820 /* Racal-Vadic 820 dialer, 831 adaptor */ // #define VA820 /* Racal-Vadic 820 dialer, 831 adaptor */
/* #define VADIC /* Racal-Vadic 345x */ // #define VADIC /* Racal-Vadic 345x */
/* #define VENTEL /* Ventel Dialer */ // #define VENTEL /* Ventel Dialer */
/* #define VMACS /* Racal-Vadic MACS 811 dialer, 831 adaptor */ // #define VMACS /* Racal-Vadic MACS 811 dialer, 831 adaptor */
#if defined(USR2400) && !defined(HAYES) #if defined(USR2400) && !defined(HAYES)
#define HAYES #define HAYES
@@ -114,9 +113,9 @@ struct timeb {
* Look at uucpdelay() in condevs.c for details. * Look at uucpdelay() in condevs.c for details.
*/ */
#define INTERVALTIMER /**/ #define INTERVALTIMER /**/
/*#define FASTTIMER /**/ //#define FASTTIMER /**/
/*#define FTIME /**/ //#define FTIME /**/
/*#define BUSYLOOP /**/ //#define BUSYLOOP /**/
/* /*
* If your site is using "ndir.h" to retrofit the Berkeley * If your site is using "ndir.h" to retrofit the Berkeley
@@ -124,12 +123,12 @@ struct timeb {
* You will probably also have to set LIBNDIR in Makefile. * You will probably also have to set LIBNDIR in Makefile.
* Otherwise, <dir.h> is assumed to have the Berkeley directory definitions. * Otherwise, <dir.h> is assumed to have the Berkeley directory definitions.
*/ */
/*#define NDIR /**/ //#define NDIR /**/
/* /*
* If yours is a BTL system III, IV, V or so-on site, define USG. * If yours is a BTL system III, IV, V or so-on site, define USG.
*/ */
/*#define USG /**/ //#define USG /**/
/* /*
* If you are running 4.3bsd, define BSD4_3 and BSD4_2 * If you are running 4.3bsd, define BSD4_3 and BSD4_2
@@ -139,7 +138,7 @@ struct timeb {
*/ */
#define BSD4_3 /**/ #define BSD4_3 /**/
#define BSD4_2 /**/ #define BSD4_2 /**/
/*#define BRL4_2 /**/ //#define BRL4_2 /**/
#if defined(BRL4_2) && !defined(BSD4_2) #if defined(BRL4_2) && !defined(BSD4_2)
#define BSD4_2 #define BSD4_2
@@ -149,12 +148,12 @@ struct timeb {
/* /*
* If you are running 2.9bsd define BSD2_9 * If you are running 2.9bsd define BSD2_9
*/ */
/*#define BSD2_9 /**/ //#define BSD2_9 /**/
/* /*
* If you are using 'inetd' with 4.2bsd, define BSDINETD * If you are using 'inetd' with 4.2bsd, define BSDINETD
*/ */
/* #define BSDINETD /**/ // #define BSDINETD /**/
/* /*
* If you are running 4.3bsd, 2.11bsd or BRL 4.2, you are running 'inetd' * If you are running 4.3bsd, 2.11bsd or BRL 4.2, you are running 'inetd'
@@ -164,18 +163,19 @@ struct timeb {
#define BSDINETD #define BSDINETD
#endif #endif
/*#define VMSDTR /* Turn on modem control on vms(works DTR) for //#define VMSDTR
/* Turn on modem control on vms(works DTR) for
develcon and gandalf ports to gain access */ develcon and gandalf ports to gain access */
/* /*
* If you want to use the same modem for dialing in and out define * If you want to use the same modem for dialing in and out define
* DIALINOUT to be the localtion of the acucntrl program * DIALINOUT to be the localtion of the acucntrl program
*/ */
/* #define DIALINOUT "/usr/libexec/acucntrl" /**/ // #define DIALINOUT "/usr/libexec/acucntrl" /**/
/* /*
* If you want all ACU lines to be DIALINOUT, define ALLACUINOUT * If you want all ACU lines to be DIALINOUT, define ALLACUINOUT
*/ */
/* #define ALLACUINOUT /**/ // #define ALLACUINOUT /**/
/* define the value of WFMASK - for umask call - used for all uucp work files */ /* define the value of WFMASK - for umask call - used for all uucp work files */
#define WFMASK 0137 #define WFMASK 0137
@@ -205,7 +205,7 @@ struct timeb {
* know where the LCK files are kept, and you have to change your /etc/rc * know where the LCK files are kept, and you have to change your /etc/rc
* if your rc cleans out the lock files (as it should). * if your rc cleans out the lock files (as it should).
*/ */
/*#define LOCKDIR "LCK" /**/ //#define LOCKDIR "LCK" /**/
#define LOCKDIR "." /**/ #define LOCKDIR "." /**/
/* /*
@@ -221,14 +221,14 @@ struct timeb {
* If you are not going to use it (hint: you are not), * If you are not going to use it (hint: you are not),
* do not define GNXSEQ. This saves precious room on PDP11s. * do not define GNXSEQ. This saves precious room on PDP11s.
*/ */
/*#define GNXSEQ /* comment this out to save space */ //#define GNXSEQ /* comment this out to save space */
/* /*
* If you want the logfile stored in a file for each site instead * If you want the logfile stored in a file for each site instead
* of one file * of one file
* define LOGBYSITE as the directory to put the files in * define LOGBYSITE as the directory to put the files in
*/ */
/*#define LOGBYSITE "/usr/spool/uucp/LOG" /**/ //#define LOGBYSITE "/usr/spool/uucp/LOG" /**/
#define XQTDIR "/usr/spool/uucp/XTMP" #define XQTDIR "/usr/spool/uucp/XTMP"
#define SQFILE "/etc/uucp/SQFILE" #define SQFILE "/etc/uucp/SQFILE"
@@ -314,15 +314,6 @@ struct timeb {
#define MAXPH 60 /* maximum length of a phone number */ #define MAXPH 60 /* maximum length of a phone number */
/* This structure tells how to get to a device */
struct condev {
char *CU_meth; /* method, such as 'ACU' or 'DIR' */
char *CU_brand; /* brand, such as 'Hayes' or 'Vadic' */
int (*CU_gen)(); /* what to call to search for brands */
int (*CU_open)(); /* what to call to open brand */
int (*CU_clos)(); /* what to call to close brand */
};
/* This structure tells about a device */ /* This structure tells about a device */
struct Devices { struct Devices {
#define D_type D_arg[0] #define D_type D_arg[0]
@@ -337,6 +328,16 @@ struct Devices {
char D_argbfr[100]; char D_argbfr[100];
}; };
/* This structure tells how to get to a device */
struct condev {
char *CU_meth; /* method, such as 'ACU' or 'DIR' */
char *CU_brand; /* brand, such as 'Hayes' or 'Vadic' */
int (*CU_gen)(char *flds[]); /* what to call to search for brands */
int (*CU_open)(char *telno, char *flds[], struct Devices *dev);
/* what to call to open brand */
int (*CU_clos)(int fd); /* what to call to close brand */
};
/* system status stuff */ /* system status stuff */
#define SS_OK 0 #define SS_OK 0
#define SS_NODEVICE 1 #define SS_NODEVICE 1
@@ -366,21 +367,11 @@ struct Devices {
#define WKDSIZE 100 /* size of work dir name */ #define WKDSIZE 100 /* size of work dir name */
#include <sys/types.h> #include <sys/types.h>
#ifndef USG
//#include <sys/timeb.h>
#else
struct timeb
{
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
#define rindex strrchr #define rindex strrchr
#define index strchr #define index strchr
#endif
extern struct timeb Now; extern struct timeval Now;
extern int Ifn, Ofn; extern int Ifn, Ofn;
extern char *Rmtname; extern char *Rmtname;
@@ -400,11 +391,7 @@ extern int (*CU_end)();
extern struct condev condevs[]; extern struct condev condevs[];
extern char NOLOGIN[]; extern char NOLOGIN[];
extern char DLocal[], DLocalX[], *subfile(), *subdir(); extern char DLocal[], DLocalX[];
/* Commonly called routines which return non-int value */
extern char *fdig(), *cfgets();
extern FILE *rpopen();
extern char _FAILED[], CANTOPEN[], DEVNULL[]; extern char _FAILED[], CANTOPEN[], DEVNULL[];
@@ -422,3 +409,76 @@ extern int main();
#endif #endif
#define DEBUG(a,b,c) #define DEBUG(a,b,c)
#endif #endif
void logent(char *text, char *status);
void getnextfd(void);
int fixline(int tty, int spwant);
int dochat(struct Devices *dev, char *flds[], int fd);
int expect(char *str, int fn);
void rmlock(char *name);
int guinfo(int uid, char *name, char *path);
void uucpname(char *name);
void assert(char *s1, char *s2, int i1);
void chkdebug(void);
int subchdir(char *s);
void fixmode(int tty);
int omsg(char type, char *msg, int fn);
int imsg(char *amsg, int fn);
int versys(char **nameptr);
int ulockf(char *hfile, time_t atime);
int callback(char *name);
void systat(char *name, int type, char *text);
void gename(char pre, char *sys, char grade, char *file);
char *subfile(char *as);
void xuucico(char *rmtname);
int callok(char *name);
void clsacu(void);
int gnsys(char *sname, char *dir, char pre);
int conn(char *system);
int startup(int role);
int cntrl(int role, char *wkpre);
void rmstat(char *name);
void logcls(void);
void xuuxqt(void);
void fioclex(int fd);
void cleanup(int code);
int gninfo(char *name, int *uid, char *path);
int prefix(char *s1, char *s2);
int wprefix(char *s1, char *s2);
char *cfgets(char *buf, int siz, FILE *fil);
int getargs(char *s, char *arps[], int maxargs);
int mkdirs(char *name);
int xmv(char *f1, char *f2);
char *subdir(char *d, char pre);
int gnamef(DIR *dirp, char *filename);
int iswrk(char *file, char *reqst, char *dir, char *pre);
int gturnon(void);
int gturnoff(void);
int grdmsg(char *str, int fn);
int gwrmsg(char type, char *str, int fn);
int grddata(int fn, FILE *fp);
int gwrdata(FILE *fp, int fn);
void setupline(char type);
int gtwvec(char *file, char *dir, char *wkpre, char **wrkvec);
int expfile(char *file);
int chkpth(char *logname, char *mchname, char *path);
int chkperm(char *file, char *mopt);
void xuucp(char *str);
int isdir(char *name);
char *lastpart(char *file);
int anyread(char *file);
void mailst(char *user, char *str, char *file);
void sysacct(long bytes, time_t time);
void syslog(char *text);
int chksum(char *s, int n);
int snccmp(char *s1, char *s2);
int rddev(FILE *fp, struct Devices *dev);
void alarmtr(int sig);
int nulldev(void);
int diropn(char *flds[]);
void genbrk(int fn, int bnulls);
void exphone(char *in, char *out);
int ckexpf(char *file);
int xcp(char *f1, char *f2);
char *getprm(char *s, char *prm);
int gtwrkf(char *dir, char *file);

View File

@@ -1,7 +1,3 @@
#if defined(DOSCCS) && !defined(lint)
static char sccsid[] = "@(#)uucpd.c 5.4.1 (2.11BSD GTE) 1/1/94";
#endif
/* /*
* 4.2BSD or 2.9BSD TCP/IP server for uucico * 4.2BSD or 2.9BSD TCP/IP server for uucico
* uucico's TCP channel causes this server to be run at the remote end. * uucico's TCP channel causes this server to be run at the remote end.
@@ -98,7 +94,7 @@ char **argv;
for(;;) { for(;;) {
s = accept(tcp_socket, &hisctladdr, &hisaddrlen); s = accept(tcp_socket, &hisctladdr, &hisaddrlen);
if (s < 0){ if (s < 0){
if (errno == EINTR) if (errno == EINTR)
continue; continue;
perror("uucpd: accept"); perror("uucpd: accept");
exit(1); exit(1);

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)uucpdefs.c 5.5.1 (2.11BSD) 1996/11/27";
#endif
#include "uucp.h" #include "uucp.h"
char Progname[64]; char Progname[64];

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uucpname.c 5.5 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -28,7 +24,7 @@ char Myfullname[64];
* *
* return code - none * return code - none
*/ */
uucpname(name) void uucpname(name)
register char *name; register char *name;
{ {
register char *s; register char *s;
@@ -119,7 +115,7 @@ register char *name;
p = index(s, '\n'); p = index(s, '\n');
if (p) if (p)
*p = '\0'; *p = '\0';
} }
if (uucpf != NULL) if (uucpf != NULL)
fclose(uucpf); fclose(uucpf);
} }
@@ -190,11 +186,11 @@ int len;
register char *p, *q, *nptr; register char *p, *q, *nptr;
int i; int i;
register FILE *fd; register FILE *fd;
fd = fopen(HDRFILE, "r"); fd = fopen(HDRFILE, "r");
if (fd == NULL) if (fd == NULL)
return(-1); return(-1);
hname[0] = 0; hname[0] = 0;
nname[0] = 0; nname[0] = 0;
nptr = nname; nptr = nname;

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uudecode.c 5.3 (Berkeley) 4/10/85";
#endif
/* /*
* uudecode [input] * uudecode [input]
* *
@@ -19,7 +15,10 @@ static char sccsid[] = "@(#)uudecode.c 5.3 (Berkeley) 4/10/85";
/* single character decode */ /* single character decode */
#define DEC(c) (((c) - ' ') & 077) #define DEC(c) (((c) - ' ') & 077)
main(argc, argv) static void decode(FILE *in, FILE *out);
static void outdec(char *p, FILE *f, int n);
int main(argc, argv)
char **argv; char **argv;
{ {
FILE *in, *out; FILE *in, *out;
@@ -98,7 +97,7 @@ char **argv;
/* /*
* copy from in to out, decoding as you go along. * copy from in to out, decoding as you go along.
*/ */
decode(in, out) void decode(in, out)
FILE *in; FILE *in;
FILE *out; FILE *out;
{ {
@@ -131,7 +130,7 @@ FILE *out;
* be output to file f. n is used to tell us not to * be output to file f. n is used to tell us not to
* output all of them at the end of the file. * output all of them at the end of the file.
*/ */
outdec(p, f, n) void outdec(p, f, n)
char *p; char *p;
FILE *f; FILE *f;
{ {
@@ -166,10 +165,3 @@ int cnt;
} }
return (cnt); return (cnt);
} }
/*
* Return the ptr in sp at which the character c appears;
* NULL if not found
*/
#define NULL 0

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uuencode.c 5.3 (Berkeley) 1/22/85";
#endif
/* /*
* uuencode [input] output * uuencode [input] output
* *
@@ -11,11 +7,16 @@ static char sccsid[] = "@(#)uuencode.c 5.3 (Berkeley) 1/22/85";
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h>
/* ENC is the basic 1 character encoding function to make a char printing */ /* ENC is the basic 1 character encoding function to make a char printing */
#define ENC(c) ((c) ? ((c) & 077) + ' ': '`') #define ENC(c) ((c) ? ((c) & 077) + ' ': '`')
main(argc, argv) static void encode(FILE *in, FILE *out);
static int fr(FILE *fd, char *buf, int cnt);
static void outdec(char *p, FILE *f);
int main(argc, argv)
char **argv; char **argv;
{ {
FILE *in; FILE *in;
@@ -51,7 +52,7 @@ char **argv;
/* /*
* copy from in to out, encoding as you go along. * copy from in to out, encoding as you go along.
*/ */
encode(in, out) void encode(in, out)
FILE *in; FILE *in;
FILE *out; FILE *out;
{ {
@@ -75,7 +76,7 @@ FILE *out;
/* /*
* output one group of 3 bytes, pointed at by p, on file f. * output one group of 3 bytes, pointed at by p, on file f.
*/ */
outdec(p, f) void outdec(p, f)
char *p; char *p;
FILE *f; FILE *f;
{ {

View File

@@ -1,14 +1,10 @@
#ifndef lint
static char sccsid[] = "@(#)uulog.c 5.4 (Berkeley) 6/23/85";
#endif
#include "uucp.h" #include "uucp.h"
#ifndef SYSBUF #ifndef SYSBUF
static char SYSBUF[BUFSIZ]; static char SYSBUF[BUFSIZ];
#endif #endif
main(argc, argv) int main(argc, argv)
char *argv[]; char *argv[];
{ {
FILE *plogf; FILE *plogf;
@@ -87,7 +83,7 @@ char *argv[];
exit(0); exit(0);
} }
cleanup(code) void cleanup(code)
int code; int code;
{ {
exit(code); exit(code);

View File

@@ -1,26 +1,23 @@
#ifndef lint
static char sccsid[] = "@(#)uuname.c 5.3 (Berkeley) 10/9/85";
#endif
#include "uucp.h" #include "uucp.h"
#include <signal.h> #include <signal.h>
/* /*
* return list of all remote systems * return list of all remote systems
* recognized by uucp, or (with -l) the local uucp name. * recognized by uucp, or (with -l) the local uucp name.
* *
* return codes: 0 | 1 (can't read) * return codes: 0 | 1 (can't read)
*/ */
struct timeb Now; struct timeval Now;
main(argc,argv) static void intrEXIT(int inter);
int main(argc,argv)
char *argv[]; char *argv[];
int argc; int argc;
{ {
int ret; int ret;
int i; int i;
int intrEXIT();
FILE *np; FILE *np;
/* Increase buffers for s and prev. cornell!pavel */ /* Increase buffers for s and prev. cornell!pavel */
char prev[1000]; char prev[1000];
@@ -52,7 +49,7 @@ int argc;
printf("%s (name file) protected\n",SYSFILE); printf("%s (name file) protected\n",SYSFILE);
exit(1); exit(1);
} }
while ( cfgets(s,sizeof(s),np) != NULL ) { while (cfgets(s,sizeof(s),np) != NULL ) {
for(i=0; s[i]!=' ' && s[i]!='\t'; i++) for(i=0; s[i]!=' ' && s[i]!='\t'; i++)
; ;
s[i]='\0'; s[i]='\0';
@@ -63,15 +60,16 @@ int argc;
printf("%s\n",s); printf("%s\n",s);
strcpy(prev, s); strcpy(prev, s);
} }
exit(0); exit(0);
} }
intrEXIT(inter)
void intrEXIT(inter)
{ {
exit(inter); exit(inter);
} }
cleanup(code) void cleanup(code)
int code; int code;
{ {
exit(code); exit(code);

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uupoll.c 5.5 (Berkeley) 10/9/85";
#endif
/* /*
* Poll named system(s). * Poll named system(s).
* *
@@ -15,9 +11,9 @@ static char sccsid[] = "@(#)uupoll.c 5.5 (Berkeley) 10/9/85";
#include "uucp.h" #include "uucp.h"
int TransferSucceeded = 1; int TransferSucceeded = 1;
struct timeb Now; struct timeval Now;
main(argc, argv) int main(argc, argv)
register int argc; register int argc;
register char **argv; register char **argv;
{ {
@@ -72,7 +68,7 @@ register char **argv;
cleanup(0); cleanup(0);
} }
cleanup(code) void cleanup(code)
int code; int code;
{ {
exit(code); exit(code);

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)uuq.c 4.6.1 (2.11BSD) 1997/10/2";
#endif
/* /*
* uuq - looks at uucp queues * uuq - looks at uucp queues
* *
@@ -65,12 +61,15 @@ float baudrate = 1200.;
char Username[BUFSIZ]; char Username[BUFSIZ];
char Filename[BUFSIZ]; char Filename[BUFSIZ];
int Maxulen = 0; int Maxulen = 0;
struct timeb Now; struct timeval Now;
main(argc, argv) static void gather(void);
static int analjob(char *filename);
int main(argc, argv)
char **argv; char **argv;
{ {
register i; register int i;
register struct sys *sp; register struct sys *sp;
register struct job *jp; register struct job *jp;
struct job **sortjob; struct job **sortjob;
@@ -172,7 +171,7 @@ char **argv;
exit(0); exit(0);
} }
jcompare(j1, j2) int jcompare(j1, j2)
struct job **j1, **j2; struct job **j1, **j2;
{ {
int delta; int delta;
@@ -186,7 +185,7 @@ struct job **j1, **j2;
/* /*
* Get all the command file names * Get all the command file names
*/ */
gather() void gather()
{ {
struct direct *d; struct direct *d;
DIR *df; DIR *df;
@@ -215,7 +214,7 @@ gather()
/* /*
* analjob does the grunge work of verifying jobs * analjob does the grunge work of verifying jobs
*/ */
analjob(filename) int analjob(filename)
char *filename; char *filename;
{ {
struct job *jp; struct job *jp;

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)uusend.c 5.2.1 (2.11BSD) 1996/10/24";
#endif
/* /*
* uusend: primitive operation to allow uucp like copy of binary files * uusend: primitive operation to allow uucp like copy of binary files
* but handle indirection over systems. * but handle indirection over systems.
@@ -26,6 +22,7 @@ static char sccsid[] = "@(#)uusend.c 5.2.1 (2.11BSD) 1996/10/24";
#include <pwd.h> #include <pwd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
@@ -39,7 +36,7 @@ static char sccsid[] = "@(#)uusend.c 5.2.1 (2.11BSD) 1996/10/24";
* which they certainly should to avoid security holes * which they certainly should to avoid security holes
*/ */
#define RECOVER #define RECOVER
/*#define DEBUG "/usr/spool/uucp/uusend.log"/**/ //#define DEBUG "/usr/spool/uucp/uusend.log"/**/
FILE *in, *out; FILE *in, *out;
FILE *dout; FILE *dout;
@@ -76,7 +73,7 @@ char f[100]; /* name of default output file */
char *f = ""; /* so we waste a little space */ char *f = ""; /* so we waste a little space */
#endif #endif
main(argc, argv) int main(argc, argv)
int argc; int argc;
char **argv; char **argv;
{ {
@@ -327,7 +324,7 @@ register char *p;
} }
#ifndef BSD4_2 #ifndef BSD4_2
makedir(dirname, mode) int makedir(dirname, mode)
char *dirname; char *dirname;
int mode; int mode;
{ {

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)uusnap.c 5.7 (Berkeley) 10/9/85";
#endif
/* /*
* Uusnap - displays a snapshot of the uucp system. * Uusnap - displays a snapshot of the uucp system.
* originally by RJKing WECo-MG6565 May 83 * originally by RJKing WECo-MG6565 May 83
@@ -46,7 +42,10 @@ int sndx; /* Number of systems */
struct scnt sys[NSYSTEM]; /* Systems queued */ struct scnt sys[NSYSTEM]; /* Systems queued */
int xqtisrunning = 0; int xqtisrunning = 0;
main() static void scandir(char *dnam, char *prfx, int flen, char fchr, int type);
static void getstst(char *sdir);
int main()
{ register int i, j, nlen = 0; { register int i, j, nlen = 0;
time_t curtime, t; time_t curtime, t;
@@ -125,8 +124,7 @@ main()
exit(0); exit(0);
} }
scandir(dnam, prfx, flen, fchr, type) void scandir(char *dnam, char *prfx, int flen, char fchr, int type)
char *dnam, *prfx, fchr;
{ {
register struct direct *dentp; register struct direct *dentp;
register DIR *dirp; register DIR *dirp;
@@ -189,7 +187,7 @@ char *dnam, *prfx, fchr;
closedir(dirp); closedir(dirp);
} }
getstst(sdir) void getstst(sdir)
char *sdir; char *sdir;
{ {
register int i, csys; register int i, csys;
@@ -263,7 +261,7 @@ char *sdir;
buff[0] = '\0'; buff[0] = '\0';
fgets(buff, sizeof(buff), st); fgets(buff, sizeof(buff), st);
fclose(st); fclose(st);
if(tp = rindex(buff, ' ')) if ((tp = rindex(buff, ' ')))
*tp = NULL; /* drop system name */ *tp = NULL; /* drop system name */
else else
continue; continue;

View File

@@ -1,9 +1,6 @@
#ifndef lint
static char sccsid[] = "@(#)uux.c 5.6 (Berkeley) 1/24/86";
#endif
#include "uucp.h" #include "uucp.h"
#include <strings.h> #include <strings.h>
#include <sys/stat.h>
#define NOSYSPART 0 #define NOSYSPART 0
#define HASSYSPART 1 #define HASSYSPART 1
@@ -25,9 +22,12 @@ register char *p; for (p = d; *p != '\0';)\
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);} #define GENRCV(f, a, b, c) {fprintf(f, "R %s %s %s - \n", a, b, c);}
struct timeb Now; struct timeval Now;
main(argc, argv) static FILE *ufopen(char *file, char *mode);
static int split(char *name, char *sys, char *rest);
int main(argc, argv)
char *argv[]; char *argv[];
{ {
char cfile[NAMESIZE]; /* send commands for files from here */ char cfile[NAMESIZE]; /* send commands for files from here */
@@ -57,8 +57,6 @@ char *argv[];
char Xsys[MAXBASENAME+1], local[MAXBASENAME+1]; char Xsys[MAXBASENAME+1], local[MAXBASENAME+1];
char *xsys = Xsys; char *xsys = Xsys;
FILE *fprx, *fpc, *fpd, *fp; FILE *fprx, *fpc, *fpd, *fp;
extern char *getprm(), *lastpart();
extern FILE *ufopen();
int uid, ret; int uid, ret;
char redir = '\0'; char redir = '\0';
int nonoti = 0; int nonoti = 0;
@@ -316,8 +314,7 @@ char *argv[];
fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); fprintf(fprx, "%c %s\n", X_RQDFILE, dfile);
} else { } else {
APPCMD(lastpart(rest)); APPCMD(lastpart(rest));
fprintf(fprx, "%c %s %s\n", X_RQDFILE, fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile, lastpart(rest));
dfile, lastpart(rest));
} }
redir = '\0'; redir = '\0';
continue; continue;
@@ -342,8 +339,7 @@ char *argv[];
fprintf(fprx, "%c %s\n", X_RQDFILE, dfile); fprintf(fprx, "%c %s\n", X_RQDFILE, dfile);
fprintf(fprx, "%c %s\n", X_STDIN, dfile); fprintf(fprx, "%c %s\n", X_STDIN, dfile);
} else { } else {
fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile, fprintf(fprx, "%c %s %s\n", X_RQDFILE, dfile, lastpart(rest));
lastpart(rest));
APPCMD(lastpart(rest)); APPCMD(lastpart(rest));
} }
@@ -367,8 +363,7 @@ char *argv[];
fprintf(fprx, "%c %s\n", X_RQDFILE, t2file); fprintf(fprx, "%c %s\n", X_RQDFILE, t2file);
fprintf(fprx, "%c %s\n", X_STDIN, t2file); fprintf(fprx, "%c %s\n", X_STDIN, t2file);
} else { } else {
fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file, fprintf(fprx, "%c %s %s\n", X_RQDFILE, t2file, lastpart(rest));
lastpart(rest));
APPCMD(lastpart(rest)); APPCMD(lastpart(rest));
} }
redir = '\0'; redir = '\0';
@@ -412,11 +407,13 @@ char *argv[];
if (strcmp(xsys, local) == SAME) { if (strcmp(xsys, local) == SAME) {
/* rti!trt: xmv() works across filesystems, link(II) doesnt */ /* rti!trt: xmv() works across filesystems, link(II) doesnt */
xmv(rxfile, tfile); xmv(rxfile, tfile);
if (startjob) if (startjob) {
if (rflag) if (rflag) {
xuucico(xsys); xuucico(xsys);
else } else {
xuuxqt(); xuuxqt();
}
}
} }
else { else {
GENSEND(fpc, rxfile, tfile, User, "", rxfile); GENSEND(fpc, rxfile, tfile, User, "", rxfile);
@@ -448,8 +445,7 @@ int Fnamect = 0;
* *
* return - none - do exit() * return - none - do exit()
*/ */
void cleanup(code)
cleanup(code)
int code; int code;
{ {
int i; int i;
@@ -470,7 +466,6 @@ int code;
* *
* return file pointer. * return file pointer.
*/ */
FILE *ufopen(file, mode) FILE *ufopen(file, mode)
char *file, *mode; char *file, *mode;
{ {
@@ -480,6 +475,7 @@ char *file, *mode;
logent("Fname", "TABLE OVERFLOW"); logent("Fname", "TABLE OVERFLOW");
return fopen(subfile(file), mode); return fopen(subfile(file), mode);
} }
#ifdef VMS #ifdef VMS
/* /*
* EUNICE bug: * EUNICE bug:
@@ -487,7 +483,7 @@ char *file, *mode;
* Note if we are running under Unix shell we don't * Note if we are running under Unix shell we don't
* do the right thing. * do the right thing.
*/ */
arg_fix(argc, argv) void arg_fix(argc, argv)
char **argv; char **argv;
{ {
register char *cp, *tp; register char *cp, *tp;
@@ -514,8 +510,7 @@ char **argv;
* NOSYSPART * NOSYSPART
* HASSYSPART * HASSYSPART
*/ */
int split(name, sys, rest)
split(name, sys, rest)
register char *name, *rest; register char *name, *rest;
char *sys; char *sys;
{ {

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)uuxqt.c 5.8.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <strings.h> #include <strings.h>
@@ -11,6 +7,7 @@ static char sccsid[] = "@(#)uuxqt.c 5.8.1 (2.11BSD) 1997/10/2";
#include <sys/dir.h> #include <sys/dir.h>
#endif #endif
#include <signal.h> #include <signal.h>
#include <sys/wait.h>
#define BADCHARS "&^|(`\\<>;\"{}\n'" #define BADCHARS "&^|(`\\<>;\"{}\n'"
#define RECHECKTIME 60*10 /* 10 minutes */ #define RECHECKTIME 60*10 /* 10 minutes */
@@ -37,7 +34,7 @@ int TransferSucceeded = 1;
int notiok = 1; int notiok = 1;
int nonzero = 0; int nonzero = 0;
struct timeb Now; struct timeval Now;
char PATH[MAXFULLNAME] = "PATH=/bin:/usr/bin:/usr/ucb"; char PATH[MAXFULLNAME] = "PATH=/bin:/usr/bin:/usr/ucb";
char Shell[MAXFULLNAME]; char Shell[MAXFULLNAME];
@@ -51,13 +48,22 @@ char *nenv[] = {
0 0
}; };
static int gtxfile(char *file);
static int argok(char *xc, char *cmd);
static void notify(char *user, char *rmt, char *cmd, char *str);
static void mvxfiles(char *xfile);
static int shio(char *cmd, char *fi, char *fo);
static int chknotify(char *cmd);
static void rmxfiles(char *xfile);
static int gotfiles(char *file);
/* to remove restrictions from uuxqt /* to remove restrictions from uuxqt
* define ALLOK 1 * define ALLOK 1
* *
* to add allowable commands, add to the file CMDFILE * to add allowable commands, add to the file CMDFILE
* A line of form "PATH=..." changes the search path * A line of form "PATH=..." changes the search path
*/ */
main(argc, argv) int main(argc, argv)
char *argv[]; char *argv[];
{ {
char xcmd[MAXFULLNAME]; char xcmd[MAXFULLNAME];
@@ -73,7 +79,6 @@ char *argv[];
char path[MAXFULLNAME]; char path[MAXFULLNAME];
char cmd[BUFSIZ]; char cmd[BUFSIZ];
char *cmdp, prm[1000], *ptr; char *cmdp, prm[1000], *ptr;
char *getprm(), *lastpart();
int uid, ret, ret2, badfiles; int uid, ret, ret2, badfiles;
register int i; register int i;
int stcico = 0; int stcico = 0;
@@ -379,8 +384,7 @@ doprocess:
cleanup(0); cleanup(0);
} }
void cleanup(code)
cleanup(code)
int code; int code;
{ {
logcls(); logcls();
@@ -396,14 +400,12 @@ int code;
exit(code); exit(code);
} }
/* /*
* get a file to execute * get a file to execute
* *
* return codes: 0 - no file | 1 - file to execute * return codes: 0 - no file | 1 - file to execute
*/ */
int gtxfile(file)
gtxfile(file)
register char *file; register char *file;
{ {
char pre[3]; char pre[3];
@@ -460,8 +462,7 @@ retry:
* *
* return codes: 0 - not ready | 1 - all files ready * return codes: 0 - not ready | 1 - all files ready
*/ */
int gotfiles(file)
gotfiles(file)
register char *file; register char *file;
{ {
struct stat stbuf; struct stat stbuf;
@@ -488,12 +489,10 @@ register char *file;
return 1; return 1;
} }
/* /*
* remove execute files to x-directory * remove execute files to x-directory
*/ */
void rmxfiles(xfile)
rmxfiles(xfile)
register char *xfile; register char *xfile;
{ {
register FILE *fp; register FILE *fp;
@@ -515,12 +514,10 @@ register char *xfile;
return; return;
} }
/* /*
* move execute files to x-directory * move execute files to x-directory
*/ */
void mvxfiles(xfile)
mvxfiles(xfile)
char *xfile; char *xfile;
{ {
register FILE *fp; register FILE *fp;
@@ -546,13 +543,12 @@ char *xfile;
} }
/* /*
* check for valid command/argument * check for valid command/argument
* *NOTE - side effect is to set xc to the command to be executed. * *NOTE - side effect is to set xc to the command to be executed.
* *
* return 0 - ok | 1 nok * return 0 - ok | 1 nok
*/ */
int argok(xc, cmd)
argok(xc, cmd)
register char *xc, *cmd; register char *xc, *cmd;
{ {
register char **ptr; register char **ptr;
@@ -587,7 +583,6 @@ register char *xc, *cmd;
return SUCCESS; return SUCCESS;
} }
/* /*
* if notification should be sent for successful execution of cmd * if notification should be sent for successful execution of cmd
* *
@@ -595,8 +590,7 @@ register char *xc, *cmd;
* NT_ERR - do notification if exit status != 0 * NT_ERR - do notification if exit status != 0
* NT_NO - don't do notification ever * NT_NO - don't do notification ever
*/ */
int chknotify(cmd)
chknotify(cmd)
char *cmd; char *cmd;
{ {
register char **ptr; register char **ptr;
@@ -613,13 +607,10 @@ char *cmd;
return NT_YES; /* "shouldn't happen" */ return NT_YES; /* "shouldn't happen" */
} }
/* /*
* send mail to user giving execution results * send mail to user giving execution results
*/ */
void notify(user, rmt, cmd, str)
notify(user, rmt, cmd, str)
char *user, *rmt, *cmd, *str; char *user, *rmt, *cmd, *str;
{ {
char text[MAXFULLNAME]; char text[MAXFULLNAME];
@@ -643,7 +634,7 @@ char *user, *rmt, *cmd, *str;
* return mail to sender * return mail to sender
* *
*/ */
retosndr(user, rmt, file) void retosndr(user, rmt, file)
char *user, *rmt, *file; char *user, *rmt, *file;
{ {
char ruser[MAXFULLNAME]; char ruser[MAXFULLNAME];
@@ -669,8 +660,7 @@ char *user, *rmt, *file;
/* /*
* execute shell of command with fi and fo as standard input/output * execute shell of command with fi and fo as standard input/output
*/ */
int shio(cmd, fi, fo)
shio(cmd, fi, fo)
char *cmd, *fi, *fo; char *cmd, *fi, *fo;
{ {
int status, f; int status, f;

View File

@@ -1,7 +1,3 @@
#if !defined(lint) && defined(DOSCCS)
static char sccsid[] = "@(#)versys.c 5.5.1 (2.11BSD) 1997/10/2";
#endif
#include "uucp.h" #include "uucp.h"
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
@@ -10,6 +6,8 @@ static char sccsid[] = "@(#)versys.c 5.5.1 (2.11BSD) 1997/10/2";
char PhoneNumber[MAXPH]; char PhoneNumber[MAXPH];
static int uualias(char **hostptr);
/* /*
* verify system names n1 and n2 * verify system names n1 and n2
* return codes: SUCCESS | FAIL * return codes: SUCCESS | FAIL
@@ -20,7 +18,7 @@ char PhoneNumber[MAXPH];
* See accompanying changes in uucp.c and uux.c * See accompanying changes in uucp.c and uux.c
* -- Ray Essick, April 27, 1984 * -- Ray Essick, April 27, 1984
*/ */
versys(nameptr) int versys(nameptr)
register char **nameptr; register char **nameptr;
{ {
register FILE *fp; register FILE *fp;
@@ -64,8 +62,7 @@ register char **nameptr;
* FAIL No L.aliases file * FAIL No L.aliases file
* SUCCESS Anything else * SUCCESS Anything else
*/ */
int uualias(hostptr)
uualias(hostptr)
char **hostptr; /* we change it */ char **hostptr; /* we change it */
{ {
FILE *Aliases; /* list of aliases */ FILE *Aliases; /* list of aliases */

View File

@@ -1,7 +1,3 @@
#ifndef lint
static char sccsid[] = "@(#)xqt.c 5.3 (Berkeley) 6/23/85";
#endif
#include <signal.h> #include <signal.h>
#include "uucp.h" #include "uucp.h"
@@ -19,7 +15,7 @@ int LocalOnly = 0;
#define fork vfork #define fork vfork
#endif #endif
xuucico(rmtname) void xuucico(rmtname)
char *rmtname; char *rmtname;
{ {
if (fork() == 0) { if (fork() == 0) {
@@ -60,14 +56,12 @@ char *rmtname;
return; return;
} }
/* /*
* start up uuxqt * start up uuxqt
* *
* return codes: none * return codes: none
*/ */
void xuuxqt()
xuuxqt()
{ {
if (fork() == 0) { if (fork() == 0) {
/* start uuxqt */ /* start uuxqt */
@@ -87,7 +81,7 @@ xuuxqt()
return; return;
} }
xuucp(str) void xuucp(str)
char *str; char *str;
{ {
char text[300]; char text[300];