jca (01/15/83)
MORE UUCP BUGS.
BUG 1: UUX
Have U had the problem with LOG.* files being left in
/usr/spool/uucp directory. Well that only takes the addition
of 2 lines of code. I will not go into a long winded explanation
of how the LOG.* files are created in mode 0222 and later
changed to mode 0666, U can get that out of the documentation.
The problem is uux.c never changes the mode like it should on a
good exit. The fix is in the subroutine cleanup(code).
**************** THE ORIGINAL CODE LOOKED LIKE THIS *************
cleanup(code)
int code;
{
int i;
void exit();
rmlock(CNULL);
if (code) {
for (i = 0; i < Fnamect; i++)
unlink(Fname[i]);
fprintf(stderr, "uux failed. code %d\n", code);
}
DEBUG(1, "exit code %d\n", code);
exit(code);
}
*************** THE NEW CODE SHOULD LOOK LIKE THIS *************
cleanup(code)
int code;
{
int i;
void exit();
rmlock(CNULL);
if (code) {
for (i = 0; i < Fnamect; i++)
unlink(Fname[i]);
fprintf(stderr, "uux failed. code %d\n", code);
}
+ else
+ logcls();
DEBUG(1, "exit code %d\n", code);
exit(code);
}
*****************************************************************
BUG 2: UUXQT
Have U had uuxqt to just quit, sometimes dropping core.
Well the bug I found is because a character array buffer is not
large enough. In uuxqt.c the allocation of (prm) is not large
enough. It uses a define of MAXFULLNAME which is 100 in uucp.h.
Well when U mail something using a long node-path name (USENET
address) they can be larger than 100. I changed it to BUFSIZ
which is default to 512 in stdio.h unless U define BUFSIZ before
stdio.h is included.
**************** THE ORIGINAL CODE LOOKED LIKE THIS *************
main(argc, argv)
char *argv[];
{
char xcmd[100];
int argnok;
char xfile[MAXFULLNAME], user[10], buf[BUFSIZ];
char lbuf[30];
char cfile[NAMESIZE], dfile[MAXFULLNAME];
char file[NAMESIZE];
char fin[MAXFULLNAME], sysout[NAMESIZE], fout[MAXFULLNAME];
FILE *xfp, *dfp, *fp;
char path[MAXFULLNAME];
char cmd[BUFSIZ];
char *cmdp, prm[MAXFULLNAME], *ptr;
char *getprm(), *strrchr(), *lxp;
int uid, ret, cret, badfiles;
int stcico = 0;
char retstat[30];
*************** THE NEW CODE SHOULD LOOK LIKE THIS *************
main(argc, argv)
char *argv[];
{
char xcmd[100];
int argnok;
char xfile[MAXFULLNAME], user[10], buf[BUFSIZ];
char lbuf[30];
char cfile[NAMESIZE], dfile[MAXFULLNAME];
char file[NAMESIZE];
char fin[MAXFULLNAME], sysout[NAMESIZE], fout[MAXFULLNAME];
FILE *xfp, *dfp, *fp;
char path[MAXFULLNAME];
char cmd[BUFSIZ];
! char *cmdp, prm[BUFSIZ], *ptr;
char *getprm(), *strrchr(), *lxp;
int uid, ret, cret, badfiles;
int stcico = 0;
char retstat[30];
******************************************************************
Hope this will help with some of your uucp problems.
Jack Allen
Southern Bell T & T
(404) 529-0911
...!sb1!jca