diff -cr mh-6.7/conf/mhconfig.c /achates/u1/mh-6.7/conf/mhconfig.c *** mh-6.7/conf/mhconfig.c Fri Dec 14 16:24:11 1990 --- /achates/u1/mh-6.7/conf/mhconfig.c Tue Jun 11 20:36:04 1991 *************** *** 78,83 **** --- 78,85 ---- static char *oldload = "off"; static char *options = NULL; static char *pop = "off"; + static char *kpop = "off"; + static char *hesiod = "off"; static char *ranlib = "on"; static char *sharedlib = "off"; static char *slibdir = "/usr/local/lib"; *************** *** 142,147 **** --- 144,151 ---- "oldload", &oldload, BD_NIL, "options", &options, BD_ADD, "pop", &pop, BD_NIL, + "kpop", &kpop, BD_NIL, + "hesiod", &hesiod, BD_NIL, "ranlib", &ranlib, BD_NIL, "remove", &removeit, BD_NIL, "sharedlib", &sharedlib, BD_NIL, *************** *** 444,449 **** --- 448,463 ---- else fprintf (fp, "/^@BEGIN: POP$/,/^@END: POP$/d\n"); + if (strcmp (kpop, "on") == 0) + fprintf (fp, "/^@BEGIN: KPOP$/d\n/^@END: KPOP$/d\n"); + else + fprintf (fp, "/^@BEGIN: KPOP$/,/^@END: KPOP$/d\n"); + + if (strcmp (hesiod, "on") == 0) + fprintf (fp, "/^@BEGIN: HESIOD$/d\n/^@END: HESIOD$/d\n"); + else + fprintf (fp, "/^@BEGIN: HESIOD$/,/^@END: HESIOD$/d\n"); + if (strcmp (bboards, "pop") == 0) fprintf (fp, "/^@BEGIN: BPOP$/d\n/^@END: BPOP$/d\n"); else *************** *** 568,588 **** while (fgets (buffer, sizeof buffer, fp)) { if (ap = index (buffer, '\n')) ! *ap-- = NULL; else ap = &buffer[strlen (buffer) - 1]; while (ap >= buffer) if (isspace (*ap)) ! *ap = NULL; else break; for (cp = buffer; isspace (*cp); cp++) continue; ! if (*cp == NULL || *cp == '#') continue; for (ap = cp; *ap; ap++) if (isspace (*ap)) { ! *ap++ = NULL; while (isspace (*ap)) ap++; break; --- 582,602 ---- while (fgets (buffer, sizeof buffer, fp)) { if (ap = index (buffer, '\n')) ! *ap-- = '\0'; else ap = &buffer[strlen (buffer) - 1]; while (ap >= buffer) if (isspace (*ap)) ! *ap = '\0'; else break; for (cp = buffer; isspace (*cp); cp++) continue; ! if (*cp == '\0' || *cp == '#') continue; for (ap = cp; *ap; ap++) if (isspace (*ap)) { ! *ap++ = '\0'; while (isspace (*ap)) ap++; break; *************** *** 699,705 **** *ap = ' '; options = NULL; for (ap = cp; dp = index (ap, ' '); ap = dp) { ! *dp++ = NULL; add_myopt (ap); (void) sprintf (buffer, "%s-D%s", options ? " " : "", ap); ap = buffer; --- 713,719 ---- *ap = ' '; options = NULL; for (ap = cp; dp = index (ap, ' '); ap = dp) { ! *dp++ = '\0'; add_myopt (ap); (void) sprintf (buffer, "%s-D%s", options ? " " : "", ap); ap = buffer; *************** *** 790,797 **** if (s == NULL || (p = rindex (s, '/')) == NULL) return; ! if (*++p == NULL) ! *--p = NULL; } --- 804,811 ---- if (s == NULL || (p = rindex (s, '/')) == NULL) return; ! if (*++p == '\0') ! *--p = '\0'; } *************** *** 802,808 **** if (p = rindex (s, '/')) p++; ! return ((p == NULL || *p == NULL) ? s : p); } /* */ --- 816,822 ---- if (p = rindex (s, '/')) p++; ! return ((p == NULL || *p == '\0') ? s : p); } /* */ *************** *** 813,819 **** { char *p; ! if (s1 == NULL || *s1 == NULL) return s2; if (s2 == NULL) return strdup (s1); --- 827,833 ---- { char *p; ! if (s1 == NULL || *s1 == '\0') return s2; if (s2 == NULL) return strdup (s1); diff -cr mh-6.7/conf/config/config.c /achates/u1/mh-6.7/conf/config/config.c *** mh-6.7/conf/config/config.c Fri Dec 14 16:23:47 1990 --- /achates/u1/mh-6.7/conf/config/config.c Wed Jun 12 02:47:52 1991 *************** *** 11,17 **** #include ! #if defined(__STDC__) && !defined(__HIGHC__) #define binpath(file) "@(MHBINPATH)/"#file #define etcpath(file) "@(MHETCPATH)/"#file #else --- 11,17 ---- #include ! #if defined(__STDC__) #define binpath(file) "@(MHBINPATH)/"#file #define etcpath(file) "@(MHETCPATH)/"#file #else *************** *** 53,60 **** #ifdef MHRC case '~': if (cp = index (pp = file + 1, '/')) ! *cp++ = NULL; ! if (*pp == NULL) pp = mypath; else if (pw = getpwnam (pp)) --- 53,60 ---- #ifdef MHRC case '~': if (cp = index (pp = file + 1, '/')) ! *cp++ = '\0'; ! if (*pp == '\0') pp = mypath; else if (pw = getpwnam (pp)) *************** *** 92,98 **** struct swit anoyes[] = { "no", 0, "yes", 0, ! NULL, NULL }; /* */ --- 92,98 ---- struct swit anoyes[] = { "no", 0, "yes", 0, ! NULL, 0 }; /* */ diff -cr mh-6.7/conf/config/mts.c /achates/u1/mh-6.7/conf/config/mts.c *** mh-6.7/conf/config/mts.c Fri Dec 14 16:23:48 1990 --- /achates/u1/mh-6.7/conf/config/mts.c Thu Jun 13 05:23:05 1991 *************** *** 8,14 **** #undef NETWORK #if defined(BSD41A) || defined(BSD42) || defined(SOCKETS) #define NETWORK ! #endif not (defined(BSD41A) || defined(BSD42) || defined(SOCKETS)) #include "../h/strings.h" #include --- 8,14 ---- #undef NETWORK #if defined(BSD41A) || defined(BSD42) || defined(SOCKETS) #define NETWORK ! #endif #include "../h/strings.h" #include *************** *** 17,30 **** #ifdef NETWORK #if defined(BSD42) || defined(SOCKETS) #include ! #endif BSD42 or SOCKETS ! #else not NETWORK #ifndef SYS5 #include ! #else SYS5 #include ! #endif SYS5 ! #endif not NETWORK #include --- 17,30 ---- #ifdef NETWORK #if defined(BSD42) || defined(SOCKETS) #include ! #endif ! #else /* NETWORK */ #ifndef SYS5 #include ! #else #include ! #endif /* SYS5 */ ! #endif /* NETWORK */ #include *************** *** 43,50 **** #define rindex strrchr #endif SYS5 - char *index (), *malloc (), *mktemp (), *rindex (), *strcpy (); - struct passwd *getpwuid (); /* */ --- 43,48 ---- *************** *** 240,253 **** while (fgets (buffer, sizeof buffer, fp)) { if ((cp = index (buffer, '\n')) == NULL) break; ! *cp = NULL; ! if (*buffer == '#' || *buffer == NULL) continue; if ((bp = index (buffer, ':')) == NULL) break; ! *bp++ = NULL; while (isspace (*bp)) ! *bp++ = NULL; for (b = binds; b -> keyword; b++) if (strcmp (buffer, b -> keyword) == 0) --- 238,251 ---- while (fgets (buffer, sizeof buffer, fp)) { if ((cp = index (buffer, '\n')) == NULL) break; ! *cp = 0; ! if (*buffer == '#' || *buffer == '\0') continue; if ((bp = index (buffer, ':')) == NULL) break; ! *bp++ = 0; while (isspace (*bp)) ! *bp++ = 0; for (b = binds; b -> keyword; b++) if (strcmp (buffer, b -> keyword) == 0) *************** *** 292,298 **** grot ('t', '\t'); #undef grot ! case NULL: s--; case QUOTE: *bp = QUOTE; break; --- 290,296 ---- grot ('t', '\t'); #undef grot ! case 0: s--; case QUOTE: *bp = QUOTE; break; *************** *** 309,315 **** *bp = toascii (i); break; } ! *bp = NULL; bp = malloc ((unsigned) (strlen (buffer) + 1)); if (bp != NULL) --- 307,313 ---- *bp = toascii (i); break; } ! *bp = 0; bp = malloc ((unsigned) (strlen (buffer) + 1)); if (bp != NULL) *************** *** 443,449 **** if (fp = fopen ("/etc/systemid", "r")) { if (fgets (name, len, fp)) { if (cp = index (name, '\n')) ! *cp = NULL; (void) fclose (fp); return OK; } --- 441,447 ---- if (fp = fopen ("/etc/systemid", "r")) { if (fgets (name, len, fp)) { if (cp = index (name, '\n')) ! *cp = 0; (void) fclose (fp); return OK; } *************** *** 457,477 **** /* */ ! static char username[BUFSIZ] = ""; ! static char fullname[BUFSIZ] = ""; char *getusr () { register char *cp, *np; register struct passwd *pw; if (username[0]) return username; ! if ((pw = getpwuid (getuid ())) == NULL ! || pw -> pw_name == NULL ! || *pw -> pw_name == NULL) { (void) strcpy (username, "unknown"); (void) sprintf (fullname, "The Unknown User-ID (%d)", getuid ()); return username; --- 455,480 ---- /* */ ! static char username[BUFSIZ]; ! static char fullname[BUFSIZ]; char *getusr () { register char *cp, *np; + int uid; register struct passwd *pw; if (username[0]) return username; ! uid = getuid (); ! if (uid == geteuid () && (cp = getenv ("USER")) != NULL ! && (pw = getpwnam (cp)) != NULL) ! strcpy (username, cp); ! else if ((pw = getpwuid (uid)) == NULL ! || pw -> pw_name == NULL ! || *pw -> pw_name == '\0') { (void) strcpy (username, "unknown"); (void) sprintf (fullname, "The Unknown User-ID (%d)", getuid ()); return username; *************** *** 481,496 **** np = pw -> pw_gecos; for (cp = fullname; *np && *np != '<'; *cp++ = *np++) continue; ! *cp = NULL; if (*np) np++; for (cp = username; *np && *np != '>'; *cp++ = *np++) continue; ! *cp = NULL; } ! if (MMailids == 0 || *np == NULL) { (void) strcpy (username, pw -> pw_name); ! fullname[0] = NULL; } if ((cp = getenv ("SIGNATURE")) && *cp) (void) strcpy (fullname, cp); --- 484,499 ---- np = pw -> pw_gecos; for (cp = fullname; *np && *np != '<'; *cp++ = *np++) continue; ! *cp = '\0'; if (*np) np++; for (cp = username; *np && *np != '>'; *cp++ = *np++) continue; ! *cp = '\0'; } ! if (MMailids == 0 || *np == '\0') { (void) strcpy (username, pw -> pw_name); ! fullname[0] = '\0'; } if ((cp = getenv ("SIGNATURE")) && *cp) (void) strcpy (fullname, cp); *************** *** 505,511 **** char *getfullname () { ! if (username[0] == NULL) (void) getusr (); return fullname; --- 508,514 ---- char *getfullname () { ! if (username[0] == '\0') (void) getusr (); return fullname; diff -cr mh-6.7/conf/makefiles/uip /achates/u1/mh-6.7/conf/makefiles/uip *** mh-6.7/conf/makefiles/uip Fri Dec 14 16:24:10 1990 --- /achates/u1/mh-6.7/conf/makefiles/uip Wed Jun 12 09:05:31 1991 *************** *** 76,81 **** --- 76,86 ---- TPOPMISC= xspop @END: SENDMTSHACK @END: POP + @BEGIN: KPOP + KPOPLIB = kclient.o + KRBLIB = -lkrb -ldes -lhesiod + @END: KPOP + @BEGIN: BPOP PSHLIB = popsbr.o PSHLLIBS= popsbr.c *************** *** 100,105 **** --- 105,112 ---- KDSLLIBS= ../tma/llib-lkds @END: TMA + CP = cp -p + CC = @(MHCOMPILER) @BEGIN: OPTIM CFLAGS = $(OPTIONS) *************** *** 207,213 **** $(BINDIR)/ali: xali -$(REMOVE) $@ zali ! cp xali $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 214,220 ---- $(BINDIR)/ali: xali -$(REMOVE) $@ zali ! $(CP) xali $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 224,230 **** $(BINDIR)/anno: xanno -$(REMOVE) $@ zanno ! cp xanno $@ -@chmod $(PGMPROT) $@ @BEGIN: UCI -@ln -s $@ $(BINDIR)/fanno --- 231,237 ---- $(BINDIR)/anno: xanno -$(REMOVE) $@ zanno ! $(CP) xanno $@ -@chmod $(PGMPROT) $@ @BEGIN: UCI -@ln -s $@ $(BINDIR)/fanno *************** *** 244,250 **** $(ETCDIR)/ap: xap -$(REMOVE) $@ zap ! cp xap $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 251,257 ---- $(ETCDIR)/ap: xap -$(REMOVE) $@ zap ! $(CP) xap $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 264,270 **** @BEGIN: BPOP -chmod u-s zbbc @END: BPOP ! cp xbbc $@ -@chmod $(PGMPROT) $@ @BEGIN: BPOP -$(CHOWN) root $@ --- 271,277 ---- @BEGIN: BPOP -chmod u-s zbbc @END: BPOP ! $(CP) xbbc $@ -@chmod $(PGMPROT) $@ @BEGIN: BPOP -$(CHOWN) root $@ *************** *** 286,292 **** $(BINDIR)/bbl: xbbl -$(REMOVE) $@ zbbl -chmod u-s zbbl ! cp xbbl $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(BBUID) $@ chmod u+s $@ --- 293,299 ---- $(BINDIR)/bbl: xbbl -$(REMOVE) $@ zbbl -chmod u-s zbbl ! $(CP) xbbl $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(BBUID) $@ chmod u+s $@ *************** *** 305,311 **** $(BINDIR)/burst: xburst -$(REMOVE) $@ zburst ! cp xburst $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 312,318 ---- $(BINDIR)/burst: xburst -$(REMOVE) $@ zburst ! $(CP) xburst $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 322,328 **** $(BINDIR)/cipher: xcipher -$(REMOVE) $@ zcipher ! cp xcipher $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 329,335 ---- $(BINDIR)/cipher: xcipher -$(REMOVE) $@ zcipher ! $(CP) xcipher $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 339,345 **** $(BINDIR)/comp: xcomp -$(REMOVE) $@ zcomp ! cp xcomp $@ -@chmod $(PGMPROT) $@ -@ls -l $(BINDIR)/comp -@echo "" --- 346,352 ---- $(BINDIR)/comp: xcomp -$(REMOVE) $@ zcomp ! $(CP) xcomp $@ -@chmod $(PGMPROT) $@ -@ls -l $(BINDIR)/comp -@echo "" *************** *** 359,365 **** $(ETCDIR)/conflict: xconflict -$(REMOVE) $@ zconflict ! cp xconflict $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 366,372 ---- $(ETCDIR)/conflict: xconflict -$(REMOVE) $@ zconflict ! $(CP) xconflict $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 376,382 **** $(BINDIR)/decipher: xdecipher -$(REMOVE) $@ zdecipher ! cp xdecipher $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 383,389 ---- $(BINDIR)/decipher: xdecipher -$(REMOVE) $@ zdecipher ! $(CP) xdecipher $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 393,399 **** $(BINDIR)/dist: xdist -$(REMOVE) $@ zdist ! cp xdist $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 400,406 ---- $(BINDIR)/dist: xdist -$(REMOVE) $@ zdist ! $(CP) xdist $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 413,419 **** $(ETCDIR)/dp: xdp -$(REMOVE) $@ zdp ! cp xdp $@ -@chmod $(PGMPROT) $@ -@ls -l $(ETCDIR)/dp -@echo "" --- 420,426 ---- $(ETCDIR)/dp: xdp -$(REMOVE) $@ zdp ! $(CP) xdp $@ -@chmod $(PGMPROT) $@ -@ls -l $(ETCDIR)/dp -@echo "" *************** *** 431,437 **** $(BINDIR)/folder: xfolder -$(REMOVE) $@ zfolder ! cp xfolder $@ -@chmod $(PGMPROT) $@ rm -f $(BINDIR)/folders -ln $@ $(BINDIR)/folders --- 438,444 ---- $(BINDIR)/folder: xfolder -$(REMOVE) $@ zfolder ! $(CP) xfolder $@ -@chmod $(PGMPROT) $@ rm -f $(BINDIR)/folders -ln $@ $(BINDIR)/folders *************** *** 451,457 **** $(BINDIR)/forw: xforw -$(REMOVE) $@ zforw ! cp xforw $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 458,464 ---- $(BINDIR)/forw: xforw -$(REMOVE) $@ zforw ! $(CP) xforw $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 474,480 **** @BEGIN: POP -chmod u-s zinc @END: POP ! cp xinc $@ -@chmod $(PGMPROT) $@ @BEGIN: MAILGROUP -@chgrp @(MAILGROUP) $@ --- 481,487 ---- @BEGIN: POP -chmod u-s zinc @END: POP ! $(CP) xinc $@ -@chmod $(PGMPROT) $@ @BEGIN: MAILGROUP -@chgrp @(MAILGROUP) $@ *************** *** 490,498 **** inc: xinc xinc: inc.o scansbr.o \ ! dropsbr.o trmsbr.o $(POPLIB) $(TMALIB) $(LIBES) $(CC) $(LDFLAGS) -o $@ inc.o scansbr.o \ ! dropsbr.o trmsbr.o $(POPLIB) $(TMALIB) $(LDLIBS) \ $(LDCURSES) l-inc:; $(LINT) $(LFLAGS) inc.c scansbr.c \ --- 497,505 ---- inc: xinc xinc: inc.o scansbr.o \ ! dropsbr.o trmsbr.o $(POPLIB) $(KPOPLIB) $(TMALIB) $(LIBES) $(CC) $(LDFLAGS) -o $@ inc.o scansbr.o \ ! dropsbr.o trmsbr.o $(POPLIB) $(TMALIB) $(KPOPLIB) $(KRBLIB) $(LDLIBS) \ $(LDCURSES) l-inc:; $(LINT) $(LFLAGS) inc.c scansbr.c \ *************** *** 503,509 **** $(ETCDIR)/install-mh: xinstall-mh -$(REMOVE) $@ zinstall-mh ! cp xinstall-mh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 510,516 ---- $(ETCDIR)/install-mh: xinstall-mh -$(REMOVE) $@ zinstall-mh ! $(CP) xinstall-mh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 520,526 **** $(ETCDIR)/kdsc: xkdsc -$(REMOVE) $@ zkdsc ! cp xkdsc $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 527,533 ---- $(ETCDIR)/kdsc: xkdsc -$(REMOVE) $@ zkdsc ! $(CP) xkdsc $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 537,543 **** $(BINDIR)/mark: xmark -$(REMOVE) $@ zmark ! cp xmark $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 544,550 ---- $(BINDIR)/mark: xmark -$(REMOVE) $@ zmark ! $(CP) xmark $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 554,560 **** $(ETCDIR)/mhl: xmhl -$(REMOVE) $@ zmhl ! cp xmhl $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 561,567 ---- $(ETCDIR)/mhl: xmhl -$(REMOVE) $@ zmhl ! $(CP) xmhl $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 574,580 **** $(BINDIR)/mhmail: xmhmail -$(REMOVE) $@ zmhmail ! cp xmhmail $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 581,587 ---- $(BINDIR)/mhmail: xmhmail -$(REMOVE) $@ zmhmail ! $(CP) xmhmail $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 591,597 **** $(BINDIR)/mhpath: xmhpath -$(REMOVE) $@ zmhpath ! cp xmhpath $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 598,604 ---- $(BINDIR)/mhpath: xmhpath -$(REMOVE) $@ zmhpath ! $(CP) xmhpath $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 611,617 **** @BEGIN: POP -chmod u-s zmsgchk @END: POP ! cp xmsgchk $@ -@chmod $(PGMPROT) $@ @BEGIN: POP -$(CHOWN) root $@ --- 618,624 ---- @BEGIN: POP -chmod u-s zmsgchk @END: POP ! $(CP) xmsgchk $@ -@chmod $(PGMPROT) $@ @BEGIN: POP -$(CHOWN) root $@ *************** *** 622,629 **** msgchk: xmsgchk ! xmsgchk: msgchk.o $(POPLIB) $(LIBES) ! $(CC) $(LDFLAGS) -o $@ msgchk.o $(POPLIB) $(LDLIBS) l-msgchk:; $(LINT) $(LFLAGS) msgchk.c $(POPLLIBS) $(LLIBS) --- 629,636 ---- msgchk: xmsgchk ! xmsgchk: msgchk.o $(POPLIB) $(KPOPLIB) $(LIBES) ! $(CC) $(LDFLAGS) -o $@ msgchk.o $(POPLIB) $(KPOPLIB) $(KRBLIB) $(LDLIBS) l-msgchk:; $(LINT) $(LFLAGS) msgchk.c $(POPLLIBS) $(LLIBS) *************** *** 632,638 **** $(BINDIR)/msh: xmsh -$(REMOVE) $@ zmsh ! cp xmsh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 639,645 ---- $(BINDIR)/msh: xmsh -$(REMOVE) $@ zmsh ! $(CP) xmsh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 655,661 **** $(BINDIR)/packf: xpackf -$(REMOVE) $@ zpackf ! cp xpackf $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 662,668 ---- $(BINDIR)/packf: xpackf -$(REMOVE) $@ zpackf ! $(CP) xpackf $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 672,678 **** $(BINDIR)/pick: xpick -$(REMOVE) $@ zpick ! cp xpick $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 679,685 ---- $(BINDIR)/pick: xpick -$(REMOVE) $@ zpick ! $(CP) xpick $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 692,698 **** @BEGIN: MHMTS -chmod u-s zpost @END: MHMTS ! cp xpost $@ -@chmod $(PGMPROT) $@ @BEGIN: MHMTS -$(CHOWN) root $@ --- 699,705 ---- @BEGIN: MHMTS -chmod u-s zpost @END: MHMTS ! $(CP) xpost $@ -@chmod $(PGMPROT) $@ @BEGIN: MHMTS -$(CHOWN) root $@ *************** *** 716,722 **** $(BINDIR)/prompter: xprompter -$(REMOVE) $@ zprompter ! cp xprompter $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 723,729 ---- $(BINDIR)/prompter: xprompter -$(REMOVE) $@ zprompter ! $(CP) xprompter $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 733,739 **** $(ETCDIR)/rcvdist: xrcvdist -$(REMOVE) $@ zrcvdist ! cp xrcvdist $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 740,746 ---- $(ETCDIR)/rcvdist: xrcvdist -$(REMOVE) $@ zrcvdist ! $(CP) xrcvdist $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 750,756 **** $(ETCDIR)/rcvpack: xrcvpack -$(REMOVE) $@ zrcvpack ! cp xrcvpack $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 757,763 ---- $(ETCDIR)/rcvpack: xrcvpack -$(REMOVE) $@ zrcvpack ! $(CP) xrcvpack $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 767,773 **** $(ETCDIR)/rcvstore: xrcvstore -$(REMOVE) $@ zrcvstore ! cp xrcvstore $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 774,780 ---- $(ETCDIR)/rcvstore: xrcvstore -$(REMOVE) $@ zrcvstore ! $(CP) xrcvstore $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 784,790 **** $(ETCDIR)/rcvtty: xrcvtty -$(REMOVE) $@ zrcvtty ! cp xrcvtty $@ -@chmod $(PGMPROT) $@ @BEGIN: BSD43 -@chgrp tty $@ --- 791,797 ---- $(ETCDIR)/rcvtty: xrcvtty -$(REMOVE) $@ zrcvtty ! $(CP) xrcvtty $@ -@chmod $(PGMPROT) $@ @BEGIN: BSD43 -@chgrp tty $@ *************** *** 808,814 **** $(BINDIR)/refile: xrefile -$(REMOVE) $@ zrefile ! cp xrefile $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 815,821 ---- $(BINDIR)/refile: xrefile -$(REMOVE) $@ zrefile ! $(CP) xrefile $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 825,831 **** $(BINDIR)/repl: xrepl -$(REMOVE) $@ zrepl ! cp xrepl $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 832,838 ---- $(BINDIR)/repl: xrepl -$(REMOVE) $@ zrepl ! $(CP) xrepl $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 846,852 **** /bin/rmail: xrmail -$(REMOVE) $@ zrmail -chmod u-s zrmail ! cp xrmail $@ -@chmod $(PGMPROT) $@ -$(CHOWN) root $@ chmod u+s $@ --- 853,859 ---- /bin/rmail: xrmail -$(REMOVE) $@ zrmail -chmod u-s zrmail ! $(CP) xrmail $@ -@chmod $(PGMPROT) $@ -$(CHOWN) root $@ chmod u+s $@ *************** *** 865,871 **** $(BINDIR)/rmf: xrmf -$(REMOVE) $@ zrmf ! cp xrmf $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 872,878 ---- $(BINDIR)/rmf: xrmf -$(REMOVE) $@ zrmf ! $(CP) xrmf $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 882,888 **** $(BINDIR)/rmm: xrmm -$(REMOVE) $@ zrmm ! cp xrmm $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 889,895 ---- $(BINDIR)/rmm: xrmm -$(REMOVE) $@ zrmm ! $(CP) xrmm $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 899,905 **** $(BINDIR)/scan: xscan -$(REMOVE) $@ zscan ! cp xscan $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 906,912 ---- $(BINDIR)/scan: xscan -$(REMOVE) $@ zscan ! $(CP) xscan $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 919,925 **** $(BINDIR)/send: xsend -$(REMOVE) $@ zsend ! cp xsend $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 926,932 ---- $(BINDIR)/send: xsend -$(REMOVE) $@ zsend ! $(CP) xsend $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 941,947 **** $(BINDIR)/show: xshow -$(REMOVE) $@ zshow ! cp xshow $@ -@chmod $(PGMPROT) $@ rm -f $(BINDIR)/next -ln $@ $(BINDIR)/next --- 948,954 ---- $(BINDIR)/show: xshow -$(REMOVE) $@ zshow ! $(CP) xshow $@ -@chmod $(PGMPROT) $@ rm -f $(BINDIR)/next -ln $@ $(BINDIR)/next *************** *** 970,976 **** @BEGIN: SENDMTS -chmod u-s zsbboards @END: SENDMTS ! cp xsbboards $@ -chmod $(PGMPROT) $@ @BEGIN: SENDMTS -$(CHOWN) $(BBUID) $@ --- 977,983 ---- @BEGIN: SENDMTS -chmod u-s zsbboards @END: SENDMTS ! $(CP) xsbboards $@ -chmod $(PGMPROT) $@ @BEGIN: SENDMTS -$(CHOWN) $(BBUID) $@ *************** *** 991,997 **** $(ETCDIR)/slocal: xslocal -$(REMOVE) $@ zslocal ! cp xslocal $@ -chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 998,1004 ---- $(ETCDIR)/slocal: xslocal -$(REMOVE) $@ zslocal ! $(CP) xslocal $@ -chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1008,1014 **** $(BINDIR)/sortm: xsortm -$(REMOVE) $@ zsortm ! cp xsortm $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1015,1021 ---- $(BINDIR)/sortm: xsortm -$(REMOVE) $@ zsortm ! $(CP) xsortm $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1026,1032 **** $(ETCDIR)/spop: xspop -$(REMOVE) $@ zspop -chmod u-s zspop ! cp xspop $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(POPUID) $@ chmod u+s $@ --- 1033,1039 ---- $(ETCDIR)/spop: xspop -$(REMOVE) $@ zspop -chmod u-s zspop ! $(CP) xspop $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(POPUID) $@ chmod u+s $@ *************** *** 1049,1055 **** $(ETCDIR)/spost: xspost -$(REMOVE) $@ zspost ! cp xspost $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1056,1062 ---- $(ETCDIR)/spost: xspost -$(REMOVE) $@ zspost ! $(CP) xspost $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1067,1073 **** $(BINDIR)/tma: xtma -$(REMOVE) $@ ztma ! cp xtma $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1074,1080 ---- $(BINDIR)/tma: xtma -$(REMOVE) $@ ztma ! $(CP) xtma $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1084,1090 **** $(BINDIR)/umhook: xumhook -$(REMOVE) $@ zumhook ! cp xumhook $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1091,1097 ---- $(BINDIR)/umhook: xumhook -$(REMOVE) $@ zumhook ! $(CP) xumhook $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1101,1107 **** $(BINDIR)/vmh: xvmh -$(REMOVE) $@ zvmh ! cp xvmh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1108,1114 ---- $(BINDIR)/vmh: xvmh -$(REMOVE) $@ zvmh ! $(CP) xvmh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1122,1128 **** $(BINDIR)/whatnow: xwhatnow -$(REMOVE) $@ zwhatnow ! cp xwhatnow $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1129,1135 ---- $(BINDIR)/whatnow: xwhatnow -$(REMOVE) $@ zwhatnow ! $(CP) xwhatnow $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1142,1148 **** $(BINDIR)/whom: xwhom -$(REMOVE) $@ zwhom ! cp xwhom $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1149,1155 ---- $(BINDIR)/whom: xwhom -$(REMOVE) $@ zwhom ! $(CP) xwhom $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 1159,1165 **** $(BINDIR)/wmh: xwmh -$(REMOVE) $@ zwmh ! cp xwmh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 1166,1172 ---- $(BINDIR)/wmh: xwmh -$(REMOVE) $@ zwmh ! $(CP) xwmh $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" diff -cr mh-6.7/conf/makefiles/support/general /achates/u1/mh-6.7/conf/makefiles/support/general *** mh-6.7/conf/makefiles/support/general Fri Dec 14 16:24:09 1990 --- /achates/u1/mh-6.7/conf/makefiles/support/general Thu Jun 13 05:08:05 1991 *************** *** 16,21 **** --- 16,22 ---- @END: BBSERVER REMOVE = @(MHREMOVE) FILPROT = 0644 + CP = cp -p TALL = MailAliases components digestcomps distcomps forwcomps \ rcvdistcomps replcomps mhl.digest mhl.format mhl.forward \ *************** *** 62,68 **** $(ETCDIR)/MailAliases: MailAliases -@if [ ! -f $@ ]; then \ $(REMOVE) $@ zMailAliases; \ ! cp MailAliases $@; \ else \ echo "Will not overwrite existing $@"; \ fi --- 63,69 ---- $(ETCDIR)/MailAliases: MailAliases -@if [ ! -f $@ ]; then \ $(REMOVE) $@ zMailAliases; \ ! $(CP) MailAliases $@; \ else \ echo "Will not overwrite existing $@"; \ fi *************** *** 75,81 **** $(ETCDIR)/components: components -$(REMOVE) $@ zcomponents ! cp components $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 76,82 ---- $(ETCDIR)/components: components -$(REMOVE) $@ zcomponents ! $(CP) components $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 85,91 **** $(ETCDIR)/digestcomps: digestcomps -$(REMOVE) $@ zdigestcomps ! cp digestcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 86,92 ---- $(ETCDIR)/digestcomps: digestcomps -$(REMOVE) $@ zdigestcomps ! $(CP) digestcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 95,101 **** $(ETCDIR)/distcomps: distcomps -$(REMOVE) $@ zdistcomps ! cp distcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 96,102 ---- $(ETCDIR)/distcomps: distcomps -$(REMOVE) $@ zdistcomps ! $(CP) distcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 105,111 **** $(ETCDIR)/forwcomps: forwcomps -$(REMOVE) $@ zforwcomps ! cp forwcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 106,112 ---- $(ETCDIR)/forwcomps: forwcomps -$(REMOVE) $@ zforwcomps ! $(CP) forwcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 115,121 **** $(ETCDIR)/rcvdistcomps: rcvdistcomps -$(REMOVE) $@ zrcvdistcomps ! cp rcvdistcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 116,122 ---- $(ETCDIR)/rcvdistcomps: rcvdistcomps -$(REMOVE) $@ zrcvdistcomps ! $(CP) rcvdistcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 125,131 **** $(ETCDIR)/replcomps: replcomps -$(REMOVE) $@ zreplcomps ! cp replcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 126,132 ---- $(ETCDIR)/replcomps: replcomps -$(REMOVE) $@ zreplcomps ! $(CP) replcomps $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 135,141 **** $(ETCDIR)/mhl.digest: mhl.digest -$(REMOVE) $@ zmhl.digest ! cp mhl.digest $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 136,142 ---- $(ETCDIR)/mhl.digest: mhl.digest -$(REMOVE) $@ zmhl.digest ! $(CP) mhl.digest $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 145,151 **** $(ETCDIR)/mhl.format: mhl.format -$(REMOVE) $@ zmhl.format ! cp mhl.format $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 146,152 ---- $(ETCDIR)/mhl.format: mhl.format -$(REMOVE) $@ zmhl.format ! $(CP) mhl.format $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 155,161 **** $(ETCDIR)/mhl.forward: mhl.forward -$(REMOVE) $@ zmhl.forward ! cp mhl.forward $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 156,162 ---- $(ETCDIR)/mhl.forward: mhl.forward -$(REMOVE) $@ zmhl.forward ! $(CP) mhl.forward $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 165,171 **** $(ETCDIR)/mhl.body: mhl.body -$(REMOVE) $@ zmhl.body ! cp mhl.body $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 166,172 ---- $(ETCDIR)/mhl.body: mhl.body -$(REMOVE) $@ zmhl.body ! $(CP) mhl.body $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 175,181 **** $(ETCDIR)/scan.mailx: scan.mailx -$(REMOVE) $@ zscan.mailx ! cp scan.mailx $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 176,182 ---- $(ETCDIR)/scan.mailx: scan.mailx -$(REMOVE) $@ zscan.mailx ! $(CP) scan.mailx $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 185,191 **** $(ETCDIR)/scan.size: scan.size -$(REMOVE) $@ zscan.size ! cp scan.size $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 186,192 ---- $(ETCDIR)/scan.size: scan.size -$(REMOVE) $@ zscan.size ! $(CP) scan.size $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 195,201 **** $(ETCDIR)/scan.time: scan.time -$(REMOVE) $@ zscan.time ! cp scan.time $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 196,202 ---- $(ETCDIR)/scan.time: scan.time -$(REMOVE) $@ zscan.time ! $(CP) scan.time $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 205,211 **** $(ETCDIR)/scan.timely: scan.timely -$(REMOVE) $@ zscan.timely ! cp scan.timely $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" --- 206,212 ---- $(ETCDIR)/scan.timely: scan.timely -$(REMOVE) $@ zscan.timely ! $(CP) scan.timely $@ -@chmod $(FILPROT) $@ -@ls -l $@ -@echo "" *************** *** 216,222 **** $(ETCDIR)/BBoardAliases: BBoardAliases -@if [ ! -f $@ ]; then \ $(REMOVE) $@ zBBoardAliases; \ ! cp BBoardAliases $@; \ else \ echo "Will not overwrite existing $@"; \ fi --- 217,223 ---- $(ETCDIR)/BBoardAliases: BBoardAliases -@if [ ! -f $@ ]; then \ $(REMOVE) $@ zBBoardAliases; \ ! $(CP) BBoardAliases $@; \ else \ echo "Will not overwrite existing $@"; \ fi diff -cr mh-6.7/conf/makefiles/support/pop /achates/u1/mh-6.7/conf/makefiles/support/pop *** mh-6.7/conf/makefiles/support/pop Fri Dec 14 16:24:09 1990 --- /achates/u1/mh-6.7/conf/makefiles/support/pop Thu Jun 13 06:23:45 1991 *************** *** 17,28 **** CHOWN = @(MHCHOWNPATH) POPUID = pop @BEGIN: POP ! ALL = popd popaka popwrd popsbr INST-ALL= inst-popd inst-popaka inst-popwrd LALL = l-popd l-popaka l-popwrd l-popsbr TALL = xpopd xpopaka xpopwrd @END: POP CC = @(MHCOMPILER) @BEGIN: OPTIM CFLAGS = $(OPTIONS) --- 17,34 ---- CHOWN = @(MHCHOWNPATH) POPUID = pop @BEGIN: POP ! @BEGIN: KPOP ! KALL = ../../uip/kclient.o ! KLINT = l-kclient ! KPOPLIBS= -lkrb -ldes ! @END: KPOP ! ALL = popd popaka popwrd popsbr $(KALL) INST-ALL= inst-popd inst-popaka inst-popwrd LALL = l-popd l-popaka l-popwrd l-popsbr TALL = xpopd xpopaka xpopwrd @END: POP + CP = cp -p CC = @(MHCOMPILER) @BEGIN: OPTIM CFLAGS = $(OPTIONS) *************** *** 84,90 **** $(ETCDIR)/popd: xpopd -$(REMOVE) $@ zpopd -rm -f $@ ! cp xpopd $@ -chmod 700 $@ -@ls -l $@ -@echo "" --- 90,96 ---- $(ETCDIR)/popd: xpopd -$(REMOVE) $@ zpopd -rm -f $@ ! $(CP) xpopd $@ -chmod 700 $@ -@ls -l $@ -@echo "" *************** *** 91,100 **** popd: xpopd ! xpopd: popd.o popser.o syslog.o \ ../../uip/dropsbr.o $(LIBES2) $(CC) $(LDFLAGS) -o $@ popd.o popser.o syslog.o \ ! ../../uip/dropsbr.o $(LDLIBS2) l-popd:; $(LINT) $(LFLAGS) popd.c popser.c \ ../../uip/dropsbr.c $(LLIBS2) --- 97,106 ---- popd: xpopd ! xpopd: popd.o popser.o syslog.o $(KALL) \ ../../uip/dropsbr.o $(LIBES2) $(CC) $(LDFLAGS) -o $@ popd.o popser.o syslog.o \ ! ../../uip/dropsbr.o $(KALL) $(KPOPLIBS) $(LDLIBS2) l-popd:; $(LINT) $(LFLAGS) popd.c popser.c \ ../../uip/dropsbr.c $(LLIBS2) *************** *** 108,114 **** $(LIBDIR)/popaka: xpopaka -$(REMOVE) $@ zpopaka ! cp xpopaka $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" --- 114,120 ---- $(LIBDIR)/popaka: xpopaka -$(REMOVE) $@ zpopaka ! $(CP) xpopaka $@ -@chmod $(PGMPROT) $@ -@ls -l $@ -@echo "" *************** *** 130,136 **** $(LIBDIR)/popwrd: xpopwrd -$(REMOVE) $@ zpopwrd -chmod u-s zpopwrd ! cp xpopwrd $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(POPUID) $@ chmod u+s $@ --- 136,142 ---- $(LIBDIR)/popwrd: xpopwrd -$(REMOVE) $@ zpopwrd -chmod u-s zpopwrd ! $(CP) xpopwrd $@ -chmod $(PGMPROT) $@ -$(CHOWN) $(POPUID) $@ chmod u+s $@ *************** *** 155,160 **** --- 161,175 ---- ################################################################ + # kclient + ################################################################ + + kclient: kclient.o + + l-kclient:; $(LINT) $(LFLAGS) kclient.c $(LLIBS) + + + ################################################################ # smtpd ################################################################ *************** *** 162,168 **** $(ETCDIR)/smtpd: xsmtpd -$(REMOVE) $@ zsmtpd ! cp xsmtpd $@ -chmod 700 $@ -@ls -l $@ -@echo "" --- 177,183 ---- $(ETCDIR)/smtpd: xsmtpd -$(REMOVE) $@ zsmtpd ! $(CP) xsmtpd $@ -chmod 700 $@ -@ls -l $@ -@echo "" *************** *** 194,200 **** # Dependencies ############################################################################## ! MODULES = popd popser popaka popwrd popsbr depend:; for m in $(MODULES); do ( \ i=`basename $$m .c`; \ --- 209,215 ---- # Dependencies ############################################################################## ! MODULES = popd popser popaka popwrd popsbr $(KALL) depend:; for m in $(MODULES); do ( \ i=`basename $$m .c`; \ *************** *** 208,214 **** echo '/^# DO NOT DELETE THIS LINE/+2,$$d' > eddep echo '$$r makedep' >> eddep echo 'w' >> eddep ! cp Makefile _Makefile ed - Makefile < eddep rm eddep makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile --- 223,229 ---- echo '/^# DO NOT DELETE THIS LINE/+2,$$d' > eddep echo '$$r makedep' >> eddep echo 'w' >> eddep ! $(CP) Makefile _Makefile ed - Makefile < eddep rm eddep makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile diff -cr mh-6.7/config/version.sh /achates/u1/mh-6.7/config/version.sh *** mh-6.7/config/version.sh Fri Dec 14 16:24:13 1990 --- /achates/u1/mh-6.7/config/version.sh Thu Jun 13 04:23:52 1991 *************** *** 41,49 **** cat version ${Patch} |\ awk -F. ' BEGIN { split ("'"${1}"'", ver, ".");\ ! major = ver[1]; minor = ver[2]; patch = ver[3]}\ ! NR == 1 { local = $(NF) }\ ! NR == 2 { patch = $(NF) }\ END { local++;\ if (patch > 0) {\ printf "char *version = \"MH %s.%s.%s #%d[UCI] ", \ --- 41,49 ---- cat version ${Patch} |\ awk -F. ' BEGIN { split ("'"${1}"'", ver, ".");\ ! major = ver[1]; minor = ver[2]; patch = ver[3]} \ ! NR == 1 { local = $(NF) } ;\ ! NR == 2 { patch = $(NF) } ;\ END { local++;\ if (patch > 0) {\ printf "char *version = \"MH %s.%s.%s #%d[UCI] ", \ diff -cr mh-6.7/h/mh.h /achates/u1/mh-6.7/h/mh.h *** mh-6.7/h/mh.h Fri Dec 14 16:24:16 1990 --- /achates/u1/mh-6.7/h/mh.h Thu Jun 13 01:40:34 1991 *************** *** 18,26 **** #define MAXFOLDER 1000 /* message increment */ #define DMAXFOLDER 4 /* typical number of digits */ ! #if !defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && !defined(hpux) #define vfork fork ! #endif not BSD /* how sad... */ /* */ --- 18,26 ---- #define MAXFOLDER 1000 /* message increment */ #define DMAXFOLDER 4 /* typical number of digits */ ! #if (!defined(BSD42) && !defined(BSD41A) && !defined(VMUNIX) && !defined(hpux)) || defined(_AIX) #define vfork fork ! #endif /* not BSD */ /* how sad... */ /* */ *************** *** 330,335 **** --- 330,338 ---- /* should be in */ + #ifdef _AIX + #define FP FILE* + #else #ifndef SYS5 typedef struct _iobuf *FP; FP popen (); *************** *** 336,348 **** #else SYS5 #define FP FILE* #endif SYS5 - /* miscellaneous */ ! #if !defined(BSD42) && !defined(hpux) #define rename(f1,f2) (link (f1, f2) != NOTOK ? unlink (f1) : NOTOK) ! #endif not BSD42 #define setsig(s,f) if (signal (s, SIG_IGN) != SIG_IGN) \ (void) signal (s, f) --- 339,351 ---- #else SYS5 #define FP FILE* #endif SYS5 + #endif /* miscellaneous */ ! #if !defined(BSD42) && !defined(hpux) && !defined(_AIX) #define rename(f1,f2) (link (f1, f2) != NOTOK ? unlink (f1) : NOTOK) ! #endif #define setsig(s,f) if (signal (s, SIG_IGN) != SIG_IGN) \ (void) signal (s, f) diff -cr mh-6.7/h/strings.h /achates/u1/mh-6.7/h/strings.h *** mh-6.7/h/strings.h Fri Dec 14 16:24:17 1990 --- /achates/u1/mh-6.7/h/strings.h Thu Jun 13 04:32:17 1991 *************** *** 4,14 **** --- 4,31 ---- #ifndef _STRINGS /* once-only... */ #define _STRINGS + #ifdef _AIX + #include + #include + + #define index strchr + #define rindex strrchr + + #define bcmp(b1,b2,length) memcmp(b1, b2, length) + #define bcopy(b1,b2,length) (void) memcpy (b2, b1, length) + #define bcpy(b1,b2,length) memcmp (b1, b2, length) + #define bzero(b,length) (void) memset (b, 0, length) + + #else /* _AIX */ + #ifdef SYS5 #define index strchr #define rindex strrchr #endif SYS5 + #ifdef BSD42 + #include + #else char *index (); char *mktemp (); char *rindex (); *************** *** 24,33 **** --- 41,55 ---- char *strncat (); int strncmp (); char *strncpy (); + #endif char *getenv (); char *calloc (), *malloc (), *realloc (); + #if defined(__HIGHC__) || __GNUC__ == 2 + #define bcopy(s,d,l) memcpy(d,s,l) + #endif + #ifdef SYS5 #include #define bcmp(b1,b2,length) memcmp(b1, b2, length) *************** *** 35,39 **** #define bcpy(b1,b2,length) memcmp (b1, b2, length) #define bzero(b,length) (void) memset (b, 0, length) #endif SYS5 ! #endif not _STRINGS --- 57,61 ---- #define bcpy(b1,b2,length) memcmp (b1, b2, length) #define bzero(b,length) (void) memset (b, 0, length) #endif SYS5 ! #endif /* _AIX */ #endif not _STRINGS diff -cr mh-6.7/mts/mh/hosts.c /achates/u1/mh-6.7/mts/mh/hosts.c *** mh-6.7/mts/mh/hosts.c Fri Dec 14 16:24:58 1990 --- /achates/u1/mh-6.7/mts/mh/hosts.c Tue Jun 11 21:57:26 1991 *************** *** 35,41 **** for (p = name, q = site; *p; p++, q++) *q = isupper (*p) ? tolower (*p) : *p; ! *q = NULL; q = site; if (uleq (LocalName (), site)) --- 35,41 ---- for (p = name, q = site; *p; p++, q++) *q = isupper (*p) ? tolower (*p) : *p; ! *q = 0; q = site; if (uleq (LocalName (), site)) diff -cr mh-6.7/mts/sendmail/hosts.c /achates/u1/mh-6.7/mts/sendmail/hosts.c *** mh-6.7/mts/sendmail/hosts.c Fri Dec 14 16:25:00 1990 --- /achates/u1/mh-6.7/mts/sendmail/hosts.c Tue Jun 11 21:58:13 1991 *************** *** 47,53 **** for (p = name, q = site; *p; p++, q++) *q = isupper (*p) ? tolower (*p) : *p; ! *q = NULL; q = site; if (uleq (LocalName (), site)) --- 47,53 ---- for (p = name, q = site; *p; p++, q++) *q = isupper (*p) ? tolower (*p) : *p; ! *q = 0; q = site; if (uleq (LocalName (), site)) *************** *** 108,134 **** h = &hosts; while (fgets (buffer, sizeof buffer, fp) != NULL) { if (cp = index (buffer, '#')) ! *cp = NULL; if (cp = index (buffer, '\n')) ! *cp = NULL; for (cp = buffer; *cp; cp++) if (isspace (*cp)) *cp = ' '; for (cp = buffer; isspace (*cp); cp++) continue; ! if (*cp == NULL) continue; q = aliases; if (cp = index (dp = cp, ' ')) { ! *cp = NULL; for (cp++; *cp; cp++) { while (isspace (*cp)) cp++; ! if (*cp == NULL) break; if (cp = index (*q++ = cp, ' ')) ! *cp = NULL; else break; if (q >= aliases + NALIASES) --- 108,134 ---- h = &hosts; while (fgets (buffer, sizeof buffer, fp) != NULL) { if (cp = index (buffer, '#')) ! *cp = 0; if (cp = index (buffer, '\n')) ! *cp = 0; for (cp = buffer; *cp; cp++) if (isspace (*cp)) *cp = ' '; for (cp = buffer; isspace (*cp); cp++) continue; ! if (*cp == 0) continue; q = aliases; if (cp = index (dp = cp, ' ')) { ! *cp = 0; for (cp++; *cp; cp++) { while (isspace (*cp)) cp++; ! if (*cp == 0) break; if (cp = index (*q++ = cp, ' ')) ! *cp = 0; else break; if (q >= aliases + NALIASES) *************** *** 136,142 **** } } ! *q = NULL; h -> h_next = (struct host *) calloc (1, sizeof *h); h = h -> h_next; --- 136,142 ---- } } ! *q = 0; h -> h_next = (struct host *) calloc (1, sizeof *h); h = h -> h_next; *************** *** 145,151 **** (char **) calloc ((unsigned) (q - aliases + 1), sizeof *q); for (q = aliases; *q; q++) *r++ = getcpy (*q); ! *r = NULL; } (void) fclose (fp); --- 145,151 ---- (char **) calloc ((unsigned) (q - aliases + 1), sizeof *q); for (q = aliases; *q; q++) *r++ = getcpy (*q); ! *r = 0; } (void) fclose (fp); diff -cr mh-6.7/mts/sendmail/smail.c /achates/u1/mh-6.7/mts/sendmail/smail.c *** mh-6.7/mts/sendmail/smail.c Fri Dec 14 16:25:01 1990 --- /achates/u1/mh-6.7/mts/sendmail/smail.c Tue Jun 11 21:59:14 1991 *************** *** 574,580 **** register int len; { register char *bp; ! static char lc = NULL; if (sm_wfp == NULL) return sm_werror (); --- 574,580 ---- register int len; { register char *bp; ! static char lc = 0; if (sm_wfp == NULL) return sm_werror (); *************** *** 582,588 **** if (buffer == NULL && len == 0) { if (lc != '\n') fputs ("\r\n", sm_wfp); ! lc = NULL; return (ferror (sm_wfp) ? sm_werror () : OK); } --- 582,588 ---- if (buffer == NULL && len == 0) { if (lc != '\n') fputs ("\r\n", sm_wfp); ! lc = 0; return (ferror (sm_wfp) ? sm_werror () : OK); } *************** *** 641,647 **** again: ; ! sm_reply.text[sm_reply.length = 0] = NULL; rp = sm_reply.text, rc = sizeof sm_reply.text - 1; for (more = FALSE; sm_rrecord (bp = buffer, &bc) != NOTOK;) { --- 641,647 ---- again: ; ! sm_reply.text[sm_reply.length = 0] = 0; rp = sm_reply.text, rc = sizeof sm_reply.text - 1; for (more = FALSE; sm_rrecord (bp = buffer, &bc) != NOTOK;) { *************** *** 712,718 **** if (sm_rfp == NULL) return sm_rerror (); ! buffer[*len = 0] = NULL; (void) fgets (buffer, BUFSIZ, sm_rfp); *len = strlen (buffer); --- 712,718 ---- if (sm_rfp == NULL) return sm_rerror (); ! buffer[*len = 0] = 0; (void) fgets (buffer, BUFSIZ, sm_rfp); *len = strlen (buffer); *************** *** 724,730 **** else if (buffer[*len - 2] == '\r') *len -= 1; ! buffer[*len - 1] = NULL; return OK; } --- 724,730 ---- else if (buffer[*len - 2] == '\r') *len -= 1; ! buffer[*len - 1] = 0; return OK; } diff -cr mh-6.7/mts/sendmail/smail.h /achates/u1/mh-6.7/mts/sendmail/smail.h *** mh-6.7/mts/sendmail/smail.h Fri Dec 14 16:25:01 1990 --- /achates/u1/mh-6.7/mts/sendmail/smail.h Tue Jun 11 23:39:32 1991 *************** *** 207,213 **** /* PSEUDO-FUNCTIONS TO ACCESS REPLY INFO */ ! #define rp_gval(val) ((char) (val)) /* get the entire return value */ --- 207,213 ---- /* PSEUDO-FUNCTIONS TO ACCESS REPLY INFO */ ! #define rp_gval(val) ((signed char) (val)) /* get the entire return value */ diff -cr mh-6.7/sbr/addrsbr.c /achates/u1/mh-6.7/sbr/addrsbr.c *** mh-6.7/sbr/addrsbr.c Fri Dec 14 16:25:31 1990 --- /achates/u1/mh-6.7/sbr/addrsbr.c Tue Jun 11 21:05:57 1991 *************** *** 194,200 **** *ep; if (cp = index (++addrs, '>')) { ! *++cp = NULL; if (dp = wp_expand (addrs, NULLCP)) { *(addrs - 1) = NULL; ep = concat (saved_addr, dp, cp, NULLCP); --- 194,200 ---- *ep; if (cp = index (++addrs, '>')) { ! *++cp = '\0'; if (dp = wp_expand (addrs, NULLCP)) { *(addrs - 1) = NULL; ep = concat (saved_addr, dp, cp, NULLCP); *************** *** 748,754 **** if (mp -> m_mbox[mp -> m_ingrp - 1] == '*') { mp -> m_type |= W_MEND; mp -> m_ingrp--; ! mp -> m_mbox[mp -> m_ingrp] = NULL; } #else not BERK /* owing to screwy munging, wildcarding is a great idea --- 748,754 ---- if (mp -> m_mbox[mp -> m_ingrp - 1] == '*') { mp -> m_type |= W_MEND; mp -> m_ingrp--; ! mp -> m_mbox[mp -> m_ingrp] = 0; } #else not BERK /* owing to screwy munging, wildcarding is a great idea diff -cr mh-6.7/sbr/cpydgst.c /achates/u1/mh-6.7/sbr/cpydgst.c *** mh-6.7/sbr/cpydgst.c Fri Dec 14 16:25:33 1990 --- /achates/u1/mh-6.7/sbr/cpydgst.c Tue Jun 11 21:07:29 1991 *************** *** 46,52 **** dp = (bp = outbuf) + sizeof outbuf; for (state = S1; (i = read (in, buffer, sizeof buffer)) > 0;) for (ep = (cp = buffer) + i; cp < ep; cp++) { ! if (*cp == NULL) continue; switch (state) { case S1: --- 46,52 ---- dp = (bp = outbuf) + sizeof outbuf; for (state = S1; (i = read (in, buffer, sizeof buffer)) > 0;) for (ep = (cp = buffer) + i; cp < ep; cp++) { ! if (*cp == '\0') continue; switch (state) { case S1: diff -cr mh-6.7/sbr/formatsbr.c /achates/u1/mh-6.7/sbr/formatsbr.c *** mh-6.7/sbr/formatsbr.c Fri Dec 14 16:25:34 1990 --- /achates/u1/mh-6.7/sbr/formatsbr.c Tue Jun 11 21:11:32 1991 *************** *** 93,99 **** case '\n': break; ! case NULL: cp--; /* fall */ default: *dp++ = *cp; --- 93,99 ---- case '\n': break; ! case 0: cp--; /* fall */ default: *dp++ = *cp; *************** *** 100,106 **** break; } ! *dp = NULL; } /* */ --- 100,106 ---- break; } ! *dp = 0; } /* */ *************** *** 295,301 **** goto finished; case FT_IF_S: ! if (str == NULLCP || *str == NULL) { fmt += fmt->f_skip; continue; } --- 295,301 ---- goto finished; case FT_IF_S: ! if (str == NULLCP || *str == 0) { fmt += fmt->f_skip; continue; } *************** *** 302,308 **** break; case FT_IF_S_NULL: ! if (str != NULLCP && *str != NULL) { fmt += fmt->f_skip; continue; } --- 302,308 ---- break; case FT_IF_S_NULL: ! if (str != NULLCP && *str != 0) { fmt += fmt->f_skip; continue; } *************** *** 355,365 **** break; case FT_S_NONNULL: ! value = (str != NULLCP && *str != NULL); break; case FT_S_NULL: ! value = (str == NULLCP || *str == NULL); break; case FT_V_EQ: --- 355,365 ---- break; case FT_S_NONNULL: ! value = (str != NULLCP && *str != 0); break; case FT_S_NULL: ! value = (str == NULLCP || *str == 0); break; case FT_V_EQ: *************** *** 737,742 **** finished:; if (cp[-1] != '\n') *cp++ = '\n'; ! *cp = NULL; return (value); } --- 737,742 ---- finished:; if (cp[-1] != '\n') *cp++ = '\n'; ! *cp = 0; return (value); } diff -cr mh-6.7/sbr/m_convert.c /achates/u1/mh-6.7/sbr/m_convert.c *** mh-6.7/sbr/m_convert.c Fri Dec 14 16:25:36 1990 --- /achates/u1/mh-6.7/sbr/m_convert.c Tue Jun 11 21:13:26 1991 *************** *** 210,216 **** bp = buf; while ((*cp >= 'a' && *cp <= 'z') || *cp == '.') *bp++ = *cp++; ! *bp++ = NULL; delimp = cp; if (strcmp (buf, "first") == 0) --- 210,216 ---- bp = buf; while ((*cp >= 'a' && *cp <= 'z') || *cp == '.') *bp++ = *cp++; ! *bp++ = 0; delimp = cp; if (strcmp (buf, "first") == 0) diff -cr mh-6.7/sbr/m_draft.c /achates/u1/mh-6.7/sbr/m_draft.c *** mh-6.7/sbr/m_draft.c Fri Dec 14 16:25:36 1990 --- /achates/u1/mh-6.7/sbr/m_draft.c Tue Jun 11 21:14:12 1991 *************** *** 21,27 **** struct stat st; static char buffer[BUFSIZ]; ! if (*isdf == NOTOK || folder == NULL || *folder == NULL) { if (*isdf == NOTOK || (cp = m_find ("Draft-Folder")) == NULL) { *isdf = 0; return m_maildir (msg && *msg ? msg : draft); --- 21,27 ---- struct stat st; static char buffer[BUFSIZ]; ! if (*isdf == NOTOK || folder == NULL || *folder == 0) { if (*isdf == NOTOK || (cp = m_find ("Draft-Folder")) == NULL) { *isdf = 0; return m_maildir (msg && *msg ? msg : draft); diff -cr mh-6.7/sbr/m_getdefs.c /achates/u1/mh-6.7/sbr/m_getdefs.c *** mh-6.7/sbr/m_getdefs.c Fri Dec 14 16:25:36 1990 --- /achates/u1/mh-6.7/sbr/m_getdefs.c Tue Jun 11 21:15:31 1991 *************** *** 44,55 **** else if ((pw = getpwuid (getuid ())) == NULL || pw -> pw_dir == NULL ! || *pw -> pw_dir == NULL) adios (NULLCP, "no HOME envariable"); else mypath = getcpy (pw -> pw_dir); if ((cp = mypath + strlen (mypath) - 1) > mypath && *cp == '/') ! *cp = NULL; } if ((cp = getenv ("MH")) && *cp) { --- 44,55 ---- else if ((pw = getpwuid (getuid ())) == NULL || pw -> pw_dir == NULL ! || *pw -> pw_dir == 0) adios (NULLCP, "no HOME envariable"); else mypath = getcpy (pw -> pw_dir); if ((cp = mypath + strlen (mypath) - 1) > mypath && *cp == '/') ! *cp = 0; } if ((cp = getenv ("MH")) && *cp) { *************** *** 138,144 **** free (ctxpath); #endif COMPAT ! if ((cp = getenv ("MHCONTEXT")) == NULL || *cp == NULL) cp = context; if ((ib = FOpen (ctxpath = getcpy (m_maildir (cp)), "r", "MHCONTEXTFD", 1)) == NULL) { --- 138,144 ---- free (ctxpath); #endif COMPAT ! if ((cp = getenv ("MHCONTEXT")) == NULL || *cp == 0) cp = context; if ((ib = FOpen (ctxpath = getcpy (m_maildir (cp)), "r", "MHCONTEXTFD", 1)) == NULL) { *************** *** 172,178 **** struct stat st1; register FILE * fp; ! if ((cp = getenv (envariable)) == NULL || *cp == NULL) goto not_open; if ((fd = atoi (cp)) <= fileno (stderr)) { --- 172,178 ---- struct stat st1; register FILE * fp; ! if ((cp = getenv (envariable)) == NULL || *cp == 0) goto not_open; if ((fd = atoi (cp)) <= fileno (stderr)) { diff -cr mh-6.7/sbr/m_getfld.c /achates/u1/mh-6.7/sbr/m_getfld.c *** mh-6.7/sbr/m_getfld.c Fri Dec 14 16:25:37 1990 --- /achates/u1/mh-6.7/sbr/m_getfld.c Tue Jun 11 21:16:50 1991 *************** *** 245,251 **** j = bp - sp; if ((cnt -= j) <= 0) { if (_filbuf(iob) == EOF) { ! *cp = *buf = NULL; advise (NULLCP, "eof encountered in field \"%s\"", name); return FMTERR; --- 245,251 ---- j = bp - sp; if ((cnt -= j) <= 0) { if (_filbuf(iob) == EOF) { ! *cp = *buf = 0; advise (NULLCP, "eof encountered in field \"%s\"", name); return FMTERR; *************** *** 264,276 **** * . hit the end of the buffer. (loop) */ if (c == '\n') { ! *cp = *buf = NULL; advise (NULLCP, "eol encountered in field \"%s\"", name); state = FMTERR; goto finish; } if ((i -= j) <= 0) { ! *cp = *buf = NULL; advise (NULLCP, "field name \"%s\" exceeds %d bytes", name, NAMESZ - 1); state = LENERR; --- 264,276 ---- * . hit the end of the buffer. (loop) */ if (c == '\n') { ! *cp = *buf = 0; advise (NULLCP, "eol encountered in field \"%s\"", name); state = FMTERR; goto finish; } if ((i -= j) <= 0) { ! *cp = *buf = 0; advise (NULLCP, "field name \"%s\" exceeds %d bytes", name, NAMESZ - 1); state = LENERR; *************** *** 280,286 **** while (isspace (*--cp) && cp >= name) ; ! *++cp = NULL; /* fall through */ case FLDPLUS: --- 280,286 ---- while (isspace (*--cp) && cp >= name) ; ! *++cp = 0; /* fall through */ case FLDPLUS: *************** *** 416,422 **** adios (NULLCP, "m_getfld() called with bogus state of %d", state); } finish:; ! *cp = NULL; msg_count = cp - buf; return (state); } --- 416,422 ---- adios (NULLCP, "m_getfld() called with bogus state of %d", state); } finish:; ! *cp = 0; msg_count = cp - buf; return (state); } *************** *** 462,473 **** cp = unixbuf; while ((c = getc (iob)) != '\n') *cp++ = c; ! *cp = NULL; #endif RPATHS } else { /* not a Unix style maildrop */ (void) fseek (iob, pos, 0); ! if (mmdlm2 == NULLCP || *mmdlm2 == NULL) mmdlm2 = "\001\001\001\001\n"; delimstr = mmdlm2; msg_style = MS_MMDF; --- 462,473 ---- cp = unixbuf; while ((c = getc (iob)) != '\n') *cp++ = c; ! *cp = 0; #endif RPATHS } else { /* not a Unix style maildrop */ (void) fseek (iob, pos, 0); ! if (mmdlm2 == NULLCP || *mmdlm2 == 0) mmdlm2 = "\001\001\001\001\n"; delimstr = mmdlm2; msg_style = MS_MMDF; *************** *** 564,570 **** cp = unixbuf; while ((c = getc (iob)) != '\n' && c >= 0) *cp++ = c; ! *cp = NULL; #endif RPATHS } --- 564,570 ---- cp = unixbuf; while ((c = getc (iob)) != '\n' && c >= 0) *cp++ = c; ! *cp = 0; #endif RPATHS } *************** *** 584,590 **** if (cp = dp = index (unixbuf, ' ')) { while (cp = index (cp + 1, 'r')) if (strncmp (cp, "remote from ", 12) == 0) { ! *cp = NULL; (void) sprintf (pp, "%s!", cp + 12); pp += strlen (pp); break; --- 584,590 ---- if (cp = dp = index (unixbuf, ' ')) { while (cp = index (cp + 1, 'r')) if (strncmp (cp, "remote from ", 12) == 0) { ! *cp = 0; (void) sprintf (pp, "%s!", cp + 12); pp += strlen (pp); break; *************** *** 592,602 **** if (cp == NULL) cp = unixbuf + strlen (unixbuf); if ((cp -= 25) >= dp) ! *cp = NULL; } (void) sprintf (pp, "%s\n", unixbuf); ! unixbuf[0] = NULL; return unixfrom; } #endif RPATHS --- 592,602 ---- if (cp == NULL) cp = unixbuf + strlen (unixbuf); if ((cp -= 25) >= dp) ! *cp = 0; } (void) sprintf (pp, "%s\n", unixbuf); ! unixbuf[0] = 0; return unixfrom; } #endif RPATHS *************** *** 699,704 **** register int length; { while (length-- > 0) ! *b++ = NULL; } #endif not BSD42 --- 699,704 ---- register int length; { while (length-- > 0) ! *b++ = 0; } #endif not BSD42 diff -cr mh-6.7/sbr/m_maildir.c /achates/u1/mh-6.7/sbr/m_maildir.c *** mh-6.7/sbr/m_maildir.c Fri Dec 14 16:25:37 1990 --- /achates/u1/mh-6.7/sbr/m_maildir.c Tue Jun 11 21:27:06 1991 *************** *** 25,31 **** if ((cp = exmaildir (folder)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') ! *ep = NULL; return cp; } --- 25,31 ---- if ((cp = exmaildir (folder)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') ! *ep = 0; return cp; } diff -cr mh-6.7/sbr/m_remsg.c /achates/u1/mh-6.7/sbr/m_remsg.c *** mh-6.7/sbr/m_remsg.c Fri Dec 14 16:25:38 1990 --- /achates/u1/mh-6.7/sbr/m_remsg.c Tue Jun 11 21:27:59 1991 *************** *** 48,56 **** adios (NULLCP, "m_remsg() botch -- you lose big[2]"); #endif MTR for (msgnum = mp -> lowmsg - 1; msgnum >= lo; msgnum--) ! mp -> msgstats[msgnum] = NULL; for (msgnum = mp -> hghmsg + 1; msgnum <= hi; msgnum++) ! mp -> msgstats[msgnum] = NULL; return mp; } --- 48,56 ---- adios (NULLCP, "m_remsg() botch -- you lose big[2]"); #endif MTR for (msgnum = mp -> lowmsg - 1; msgnum >= lo; msgnum--) ! mp -> msgstats[msgnum] = 0; for (msgnum = mp -> hghmsg + 1; msgnum <= hi; msgnum++) ! mp -> msgstats[msgnum] = 0; return mp; } diff -cr mh-6.7/sbr/m_seqnew.c /achates/u1/mh-6.7/sbr/m_seqnew.c *** mh-6.7/sbr/m_seqnew.c Fri Dec 14 16:25:39 1990 --- /achates/u1/mh-6.7/sbr/m_seqnew.c Tue Jun 11 21:28:56 1991 *************** *** 140,146 **** { register char *pp; ! if (cp == NULL || *cp == NULL) { advise (NULLCP, "empty sequence name"); return 0; } --- 140,146 ---- { register char *pp; ! if (cp == NULL || *cp == 0) { advise (NULLCP, "empty sequence name"); return 0; } diff -cr mh-6.7/sbr/m_sync.c /achates/u1/mh-6.7/sbr/m_sync.c *** mh-6.7/sbr/m_sync.c Fri Dec 14 16:25:39 1990 --- /achates/u1/mh-6.7/sbr/m_sync.c Tue Jun 11 21:32:06 1991 *************** *** 44,50 **** fp = NULL; flags = mp -> msgflags; ! if (mh_seq == NULL || *mh_seq == NULL) mp -> msgflags |= READONLY; for (i = 0; mp -> msgattrs[i]; i++) { --- 44,50 ---- fp = NULL; flags = mp -> msgflags; ! if (mh_seq == NULL || *mh_seq == 0) mp -> msgflags |= READONLY; for (i = 0; mp -> msgattrs[i]; i++) { diff -cr mh-6.7/sbr/path.c /achates/u1/mh-6.7/sbr/path.c *** mh-6.7/sbr/path.c Fri Dec 14 16:25:40 1990 --- /achates/u1/mh-6.7/sbr/path.c Tue Jun 11 21:33:37 1991 *************** *** 27,33 **** if ((cp = expath (name, flag)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') ! *ep = NULL; return cp; } --- 27,33 ---- if ((cp = expath (name, flag)) && (ep = cp + strlen (cp) - 1) > cp && *ep == '/') ! *ep = 0; return cp; } *************** *** 107,115 **** for (cp = f; *cp;) if (*cp == '/') { switch (*++cp) { ! case NULL: if (--cp > f) ! *cp = NULL; break; case '/': --- 107,115 ---- for (cp = f; *cp;) if (*cp == '/') { switch (*++cp) { ! case 0: if (--cp > f) ! *cp = 0; break; case '/': *************** *** 122,128 **** if (strcmp (cp, DOT) == 0) { if (cp > f + 1) cp--; ! *cp = NULL; break; } if (strcmp (cp, DOTDOT) == 0) { --- 122,128 ---- if (strcmp (cp, DOT) == 0) { if (cp > f + 1) cp--; ! *cp = 0; break; } if (strcmp (cp, DOTDOT) == 0) { *************** *** 131,137 **** break; if (cp <= f) cp = f + 1; ! *cp = NULL; break; } if (strncmp (cp, PWD, NPWD) == 0) { --- 131,137 ---- break; if (cp <= f) cp = f + 1; ! *cp = 0; break; } if (strncmp (cp, PWD, NPWD) == 0) { diff -cr mh-6.7/sbr/pwd.c /achates/u1/mh-6.7/sbr/pwd.c *** mh-6.7/sbr/pwd.c Fri Dec 14 16:25:41 1990 --- /achates/u1/mh-6.7/sbr/pwd.c Tue Jun 11 21:37:41 1991 *************** *** 24,34 **** admonish (NULL, "unable to determine working directory"); #endif SYS5DIR #else BSD42 ! if (getwd (curwd) == NULL) { admonish (NULLCP, "unable to determine working directory: %s", curwd); #endif BSD42 if (mypath == NULL ! || *mypath == NULL || ((void) strcpy (curwd, mypath), chdir (curwd)) == NOTOK) { (void) strcpy (curwd, "/"); (void) chdir (curwd); --- 24,34 ---- admonish (NULL, "unable to determine working directory"); #endif SYS5DIR #else BSD42 ! if (getwd (curwd) == 0) { admonish (NULLCP, "unable to determine working directory: %s", curwd); #endif BSD42 if (mypath == NULL ! || *mypath == 0 || ((void) strcpy (curwd, mypath), chdir (curwd)) == NOTOK) { (void) strcpy (curwd, "/"); (void) chdir (curwd); *************** *** 37,43 **** } if ((cp = curwd + strlen (curwd) - 1) > curwd && *cp == '/') ! *cp = NULL; return curwd; } --- 37,43 ---- } if ((cp = curwd + strlen (curwd) - 1) > curwd && *cp == '/') ! *cp = 0; return curwd; } diff -cr mh-6.7/sbr/sprintb.c /achates/u1/mh-6.7/sbr/sprintb.c *** mh-6.7/sbr/sprintb.c Fri Dec 14 16:25:42 1990 --- /achates/u1/mh-6.7/sbr/sprintb.c Tue Jun 11 21:38:40 1991 *************** *** 31,37 **** for (; *bits > 32; bits++) continue; *bp++ = '>'; ! *bp = NULL; } return buffer; --- 31,37 ---- for (; *bits > 32; bits++) continue; *bp++ = '>'; ! *bp = 0; } return buffer; diff -cr mh-6.7/sbr/trimcpy.c /achates/u1/mh-6.7/sbr/trimcpy.c *** mh-6.7/sbr/trimcpy.c Fri Dec 14 16:25:43 1990 --- /achates/u1/mh-6.7/sbr/trimcpy.c Tue Jun 11 21:39:22 1991 *************** *** 14,20 **** cp++; for (sp = cp + strlen (cp) - 1; sp >= cp; sp--) if (isspace (*sp)) ! *sp = NULL; else break; for (sp = cp; *sp; sp++) --- 14,20 ---- cp++; for (sp = cp + strlen (cp) - 1; sp >= cp; sp--) if (isspace (*sp)) ! *sp = 0; else break; for (sp = cp; *sp; sp++) diff -cr mh-6.7/sbr/vfgets.c /achates/u1/mh-6.7/sbr/vfgets.c *** mh-6.7/sbr/vfgets.c Fri Dec 14 16:25:43 1990 --- /achates/u1/mh-6.7/sbr/vfgets.c Tue Jun 11 21:40:19 1991 *************** *** 52,58 **** if (toggle) goto wrong_guess; if (*++dp == '\n') ! *--dp = NULL, cp = dp; else cp = ++dp; } --- 52,58 ---- if (toggle) goto wrong_guess; if (*++dp == '\n') ! *--dp = 0, cp = dp; else cp = ++dp; } diff -cr mh-6.7/support/pop/popd.c /achates/u1/mh-6.7/support/pop/popd.c *** mh-6.7/support/pop/popd.c Fri Dec 14 16:26:00 1990 --- /achates/u1/mh-6.7/support/pop/popd.c Wed Jun 12 00:35:59 1991 *************** *** 21,44 **** #include #ifndef NOIOCTLH #include ! #endif NOIOCTLH #include #include #ifdef SIGTSTP #include #include ! #endif SIGTSTP #include #include #include #ifdef SYS5 #include ! #endif SYS5 #ifdef SYS5 #define u_short ushort ! #endif SYS5 #define NOTOK (-1) #define OK 0 --- 21,51 ---- #include #ifndef NOIOCTLH #include ! #endif #include #include #ifdef SIGTSTP #include #include ! #endif #include #include #include + #ifdef KPOP + #include + + static Key_schedule schedule; + static KTEXT_ST ticket; + static AUTH_DAT kdata; + #endif #ifdef SYS5 #include ! #endif #ifdef SYS5 #define u_short ushort ! #endif #define NOTOK (-1) #define OK 0 *************** *** 72,77 **** --- 79,87 ---- static struct sockaddr_in in_socket; static struct sockaddr_in *isock = &in_socket; + #ifdef KPOP + static AUTH_DAT kdata; + #endif static int chldser (); void padios (), padvise (); *************** *** 86,91 **** --- 96,104 ---- char **argv, **envp; { + #ifdef KPOP + int i; + #else int fd, sd; int on = 1; *************** *** 92,106 **** --- 105,127 ---- struct servent *sp; struct sockaddr_in out_socket, *osock = &out_socket; + #endif + #ifdef KPOP + i = sizeof(in_socket); + if (getpeername(0, &in_socket, &i) < 0) + padios("getpeername", "bad status"); + #else if ((sp = getservbyname (myservice, myprotocol)) == NULL) padios (NULLCP, "%s/%s: unknown service", myprotocol, myservice); isock -> sin_family = AF_INET; isock -> sin_port = sp -> s_port; isock -> sin_addr.s_addr = INADDR_ANY; + #endif arginit (argv); envinit (); + #ifndef KPOP #ifdef RESTART for (;;) { char reason[BUFSIZ]; *************** *** 167,175 **** --- 188,198 ---- (void) signal (SIGCHLD, chldser); #endif SIGCHLD (void) listen (sd, SOMAXCONN); + #endif /* KPOP */ #ifdef FAST popinit (); #endif FAST + #ifndef KPOP for (;;) { int i = sizeof *osock; *************** *** 179,187 **** --- 202,212 ---- "unable to accept connection on"); continue; } + #endif #ifdef FAST popassert (); #endif FAST + #ifndef KPOP switch (fork ()) { case OK: (void) close (sd); *************** *** 198,203 **** --- 223,231 ---- (void) close (fd); } } + #else + server (0, isock); + #endif } /* */ *************** *** 209,214 **** --- 237,250 ---- u_short port; struct hostent *hp; struct in_addr *addr; + #ifdef KPOP + int auth; + int sin_len; + struct sockaddr_in faddr; + char instance[INST_SZ]; + char version[9]; + char user[ANAME_SZ]; + #endif closelog (); #ifndef BSD43 *************** *** 221,233 **** hp = gethostbyaddr (addr, sizeof *addr, sin -> sin_family); padvise (NULLCP, LOG_INFO, "servicing %s/%d", hp ? hp -> h_name : inet_ntoa (*addr), port); ! ! (void) dup2 (fd, 0); ! (void) close (fd); (void) dup2 (0, 1); pop (0, 1, sin -> sin_family == AF_INET && port < IPPORT_RESERVED && hp, hp ? hp -> h_name : NULLCP); } /* */ --- 257,292 ---- hp = gethostbyaddr (addr, sizeof *addr, sin -> sin_family); padvise (NULLCP, LOG_INFO, "servicing %s/%d", hp ? hp -> h_name : inet_ntoa (*addr), port); ! if (fd != 0) ! { ! (void) dup2 (fd, 0); ! (void) close (fd); ! } (void) dup2 (0, 1); + #ifdef KPOP + sin_len = sizeof (struct sockaddr_in); + if (getpeername(0, &faddr, &sin_len) < 0) { + padvise("getpeername", LOG_INFO, ""); + exit(1); + } + strcpy(instance, "*"); + auth = krb_recvauth(0L, 0, &ticket, "pop", instance, + &faddr, (struct sockaddr_in *)NULL, + &kdata, "", schedule, version); + if (auth == KSUCCESS) + auth = krb_kntoln(&kdata, user); + + if (auth != KSUCCESS) { + padvise(NULLCP, LOG_INFO, "bad kerberos data, not ok'ing"); + kpop (0, 1, NULLCP, NULLCP, auth); /* respond(NOTOK, krb_err_txt[auth]); */ + } else { + kpop (0, 1, user, (hp ? hp -> h_name : NULLCP), 0); + } + #else pop (0, 1, sin -> sin_family == AF_INET && port < IPPORT_RESERVED && hp, hp ? hp -> h_name : NULLCP); + #endif } /* */ *************** *** 241,247 **** if (myname = rindex (*vec, '/')) myname++; ! if (myname == NULL || *myname == NULL) myname = *vec; (void) gethostname (myhost, sizeof myhost); --- 300,306 ---- if (myname = rindex (*vec, '/')) myname++; ! if (myname == NULL || *myname == 0) myname = *vec; (void) gethostname (myhost, sizeof myhost); *************** *** 275,280 **** --- 334,340 ---- /* */ static envinit () { + #ifndef KPOP int i, sd; *************** *** 313,318 **** --- 373,379 ---- for (sd = 3; sd < nbits; sd++) (void) close (sd); + #endif /* KPOP */ (void) signal (SIGPIPE, SIG_IGN); *************** *** 329,334 **** --- 390,397 ---- /* */ + #ifndef KPOP + /* ARGSUSED */ #ifdef SIGCHLD *************** *** 344,350 **** continue; } ! #endif SIGCHLD /* */ --- 407,414 ---- continue; } ! #endif /* SIGCHLD */ ! #endif /* KPOP */ /* */ diff -cr mh-6.7/support/pop/popsbr.c /achates/u1/mh-6.7/support/pop/popsbr.c *** mh-6.7/support/pop/popsbr.c Fri Dec 14 16:26:00 1990 --- /achates/u1/mh-6.7/support/pop/popsbr.c Wed Jun 12 01:49:17 1991 *************** *** 32,38 **** static FILE *input; static FILE *output; ! static int traverse(), command(), multiline(), getline(); static putline(); /* */ --- 32,43 ---- static FILE *input; static FILE *output; ! #ifdef __STDC__ ! static int traverse (int (*)(), const char*, char *, char *, char *, char *); ! #else ! static int traverse(); ! #endif ! static int command(), multiline(), getline(); static putline(); /* */ *************** *** 54,61 **** --- 59,71 ---- #endif RPOP char buffer[BUFSIZ]; + #ifdef KPOP + if ((fd1 = kclient (host, "tcp", POPSERVICE, rpop, response)) == NOTOK) + return NOTOK; + #else if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response)) == NOTOK) return NOTOK; + #endif if ((fd2 = dup (fd1)) == NOTOK) { (void) sprintf (response, "unable to dup connection descriptor: %s", *************** *** 74,81 **** if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+' ! && command ("USER %s", user) != NOTOK ! && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), pass) != NOTOK) return OK; if (*response != '+') { --- 84,95 ---- if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+' ! && command ("USER %s", user) != NOTOK ! #ifndef KPOP ! && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), ! #else ! && command ("PASS %s", ! #endif pass) != NOTOK) return OK; if (*response != '+') { *************** *** 157,163 **** int i; #ifndef BPOP int *ids = NULL; ! #endif not BPOP if (msgno) { if (command ("LIST %d", msgno) == NOTOK) --- 171,177 ---- int i; #ifndef BPOP int *ids = NULL; ! #endif if (msgno) { if (command ("LIST %d", msgno) == NOTOK) *************** *** 211,217 **** int msgno, (*action) (); { ! return traverse (action, "RETR %d", msgno); } --- 225,231 ---- int msgno, (*action) (); { ! return traverse (action, "RETR %d", (char *)msgno, 0, 0, 0); } *************** *** 219,226 **** static int traverse (action, fmt, a, b, c, d) int (*action) (); ! char *fmt, ! *a, *b, *c, *d; --- 233,244 ---- static int traverse (action, fmt, a, b, c, d) int (*action) (); ! #ifdef __STDC__ ! const char *fmt; ! #else ! char *fmt; ! #endif ! char *a, *b, *c, *d; *************** *** 271,277 **** lines, (*action) (); { ! return traverse (action, "TOP %d %d", msgno, lines); } --- 289,295 ---- lines, (*action) (); { ! return traverse (action, "TOP %d %d", (char *)msgno, (char *)lines, 0, 0); } *************** *** 328,334 **** if (poprint) if (pophack) { if (cp = index (buffer, ' ')) ! *cp = NULL; fprintf (stderr, "---> %s ********\n", buffer); if (cp) *cp = ' '; --- 346,352 ---- if (poprint) if (pophack) { if (cp = index (buffer, ' ')) ! *cp = 0; fprintf (stderr, "---> %s ********\n", buffer); if (cp) *cp = ' '; *************** *** 361,367 **** if (getline (buffer, sizeof buffer, input) != OK) return NOTOK; if (strncmp (buffer, TRM, TRMLEN) == 0) { ! if (buffer[TRMLEN] == NULL) return DONE; else (void) strcpy (response, buffer + TRMLEN); --- 379,385 ---- if (getline (buffer, sizeof buffer, input) != OK) return NOTOK; if (strncmp (buffer, TRM, TRMLEN) == 0) { ! if (buffer[TRMLEN] == 0) return DONE; else (void) strcpy (response, buffer + TRMLEN); *************** *** 394,404 **** (void) strcpy (response, "connection closed by foreign host"); return DONE; } ! *p = NULL; if (*--p == '\n') ! *p = NULL; if (*--p == '\r') ! *p = NULL; return OK; } --- 412,422 ---- (void) strcpy (response, "connection closed by foreign host"); return DONE; } ! *p = 0; if (*--p == '\n') ! *p = 0; if (*--p == '\r') ! *p = 0; return OK; } diff -cr mh-6.7/support/pop/popser.c /achates/u1/mh-6.7/support/pop/popser.c *** mh-6.7/support/pop/popser.c Fri Dec 14 16:26:00 1990 --- /achates/u1/mh-6.7/support/pop/popser.c Wed Jun 12 00:48:27 1991 *************** *** 15,20 **** --- 15,23 ---- #include "syslog.h" #include #include + #ifdef KPOP + #include + #endif #ifdef SYS5 #include #endif SYS5 *************** *** 278,288 **** --- 281,301 ---- /* */ + #ifdef KPOP + static char *kusername; + + kpop (in, out, principal, rhost, auth) + int in, + out; + char *principal, *rhost; + int auth; + #else pop (in, out, priv, rhost) int in, out, priv; char *rhost; + #endif { char buffer[BUFSIZ], *vec[NVEC + 1]; *************** *** 294,302 **** m_foil (NULLCP); mts_init (myname); - rproto = priv; hostname = rhost; (void) sprintf (server, "%s %s server", myhost, priv ? "RPOP" : "POP"); if ((input = fdopen (in, "r")) == NULL || (output = fdopen (out, "w")) == NULL) {/* you lose big */ --- 307,320 ---- m_foil (NULLCP); mts_init (myname); hostname = rhost; + #ifdef KPOP + rproto = 1; + (void) sprintf (server, "%s KPOP server", myhost); + #else + rproto = priv; (void) sprintf (server, "%s %s server", myhost, priv ? "RPOP" : "POP"); + #endif if ((input = fdopen (in, "r")) == NULL || (output = fdopen (out, "w")) == NULL) {/* you lose big */ *************** *** 304,309 **** --- 322,337 ---- return; } (void) signal (SIGPIPE, pipeser); + #ifdef KPOP + if (principal == NULLCP) { + char buf[512]; + strcpy(buf, "Authentication failed: "); + strcat(buf, krb_err_txt[auth]); + (void) respond (NOTOK, buf); + return; + } + kusername = principal; + #endif #ifdef DPOP if ((pw = getpwnam (POPUID)) == NULL || !setpwinfo (pw, POPDB, 1)) { *************** *** 360,367 **** register char **vec; { make_lower (username, vec[1]); ! return respond (OK, "password required for %s", username); } /* */ --- 388,406 ---- register char **vec; { make_lower (username, vec[1]); ! #ifdef KPOP ! if (!strcmp(username, kusername)) ! return respond (OK, "Kerberos authentication succeeded. Send username as password (%s)", username); ! #else return respond (OK, "password required for %s", username); + #endif + #ifdef KPOP + else { + respond (NOTOK, "Wrong username supplied (%s vs. %s)", + kusername, username); + return (NOTOK); + } + #endif } /* */ *************** *** 379,384 **** --- 418,443 ---- register struct bboard *pw; #endif DPOP + #ifdef KPOP + #ifndef DPOP + if ((pw = getpwnam (username)) != NULL) + return setup(pw, FALSE); + else + return respond (NOTOK, "no local password entry"); + #else + { + static struct bboard entry; + static char entry_file[BUFSIZ] = "/usr/spool/pop"; + + pw = &entry; + pw->bb_name = username; + strcat(entry_file, username); + pw->bb_file = entry_file; + return setup(pw, FALSE); + } + #endif + #else + #ifndef DPOP #ifdef BPOP if (isguest ()) { *************** *** 446,451 **** --- 505,511 ---- return respond (NOTOK, "permission denied"); #endif TRUSTED return setup (pw, guest); + #endif /* KPOP */ } /* */ *************** *** 530,536 **** (void) sprintf (buffer, "%s@%s", vec[1], hostname); for (bp = pw -> bb_addr; bp; bp = cp) { if ((cp = index (bp, ','))) ! *cp = NULL; hostok = uleq (bp, buffer); if (cp) *cp++ = ','; --- 590,596 ---- (void) sprintf (buffer, "%s@%s", vec[1], hostname); for (bp = pw -> bb_addr; bp; bp = cp) { if ((cp = index (bp, ','))) ! *cp = 0; hostok = uleq (bp, buffer); if (cp) *cp++ = ','; *************** *** 945,951 **** fgets (buffer, sizeof buffer, dp) != NULL && pos < Msgs[i].m_stop; pos += (long) (cp - buffer + 1)) { if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = NULL; multiline ("%s", buffer); } #ifdef POP2 --- 1005,1011 ---- fgets (buffer, sizeof buffer, dp) != NULL && pos < Msgs[i].m_stop; pos += (long) (cp - buffer + 1)) { if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = 0; multiline ("%s", buffer); } #ifdef POP2 *************** *** 1034,1046 **** fgets (buffer, sizeof buffer, dp) != NULL && pos < Msgs[i].m_stop; pos += (long) (cp - buffer + 1)) { if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = NULL; if (body) { if (lines++ >= j) break; } else ! if (*buffer == NULL) body++; multiline ("%s", buffer); } --- 1094,1106 ---- fgets (buffer, sizeof buffer, dp) != NULL && pos < Msgs[i].m_stop; pos += (long) (cp - buffer + 1)) { if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = 0; if (body) { if (lines++ >= j) break; } else ! if (*buffer == 0) body++; multiline ("%s", buffer); } *************** *** 1403,1410 **** for (i = 0; i < NVEC; i++) { while (isspace (*bp)) ! *bp++ = NULL; ! if (*bp == NULL) { vec[i] = NULL; break; } --- 1463,1470 ---- for (i = 0; i < NVEC; i++) { while (isspace (*bp)) ! *bp++ = 0; ! if (*bp == 0) { vec[i] = NULL; break; } *************** *** 1415,1425 **** i--; vec[NVEC] = NULL; ! if (*bp != NULL) { (void) respond (NOTOK, "too many arguments"); return NULL; } ! if (*vec[0] == NULL) { (void) respond (NOTOK, "null command"); return NULL; } --- 1475,1485 ---- i--; vec[NVEC] = NULL; ! if (*bp != 0) { (void) respond (NOTOK, "too many arguments"); return NULL; } ! if (*vec[0] == 0) { (void) respond (NOTOK, "null command"); return NULL; } *************** *** 1531,1537 **** return NOTOK; if (c == EOF && p == s) return DONE; ! *p++ = NULL; if (debug) padvise (NULLCP, LOG_DEBUG, "<--- %s", s); --- 1591,1597 ---- return NOTOK; if (c == EOF && p == s) return DONE; ! *p++ = 0; if (debug) padvise (NULLCP, LOG_DEBUG, "<--- %s", s); diff -cr mh-6.7/uip/ali.c /achates/u1/mh-6.7/uip/ali.c *** mh-6.7/uip/ali.c Fri Dec 14 16:26:02 1990 --- /achates/u1/mh-6.7/uip/ali.c Tue Jun 11 21:50:56 1991 *************** *** 37,43 **** #define HELPSW 8 "help", 4, ! NULL, NULL }; /* */ --- 37,43 ---- #define HELPSW 8 "help", 4, ! NULL, 0 }; /* */ *************** *** 191,197 **** pos += 2; } ! case NULL: break; default: --- 191,197 ---- pos += 2; } ! case 0: break; default: diff -cr mh-6.7/uip/aliasbr.c /achates/u1/mh-6.7/uip/aliasbr.c *** mh-6.7/uip/aliasbr.c Fri Dec 14 16:26:02 1990 --- /achates/u1/mh-6.7/uip/aliasbr.c Tue Jun 11 21:55:11 1991 *************** *** 110,116 **** else aliasent++; ! return (*aliasent == NULL || *aliasent == '*'); } /* */ --- 110,116 ---- else aliasent++; ! return (*aliasent == 0 || *aliasent == '*'); } /* */ *************** *** 152,158 **** case ':': /* comment */ case ';': case '#': ! case NULL: continue; } --- 152,158 ---- case ':': /* comment */ case ';': case '#': ! case 0: continue; } *************** *** 180,186 **** } switch (*(pp = scanp (ap))) { ! case NULL: /* EOL */ (void) fclose (fp); return AK_ERROR; --- 180,186 ---- } switch (*(pp = scanp (ap))) { ! case 0: /* EOL */ (void) fclose (fp); return AK_ERROR; *************** *** 283,289 **** p = cp; while (!isspace (*cp) && *cp) cp++; ! *cp = NULL; return p; } --- 283,289 ---- p = cp; while (!isspace (*cp) && *cp) cp++; ! *cp = 0; return p; } *************** *** 300,306 **** while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';') cp++; *c = *cp; ! *cp++ = NULL; *a = cp; return p; --- 300,306 ---- while (!isspace (*cp) && *cp && *cp != ':' && *cp != ';') cp++; *c = *cp; ! *cp++ = 0; *a = cp; return p; *************** *** 318,324 **** if ((fp = fopen (libpath (file), "r")) == NULL) { akerrst = file; ! return NULL; } while (fgets (buffer, sizeof buffer, fp) != NULL) --- 318,324 ---- if ((fp = fopen (libpath (file), "r")) == NULL) { akerrst = file; ! return 0; } while (fgets (buffer, sizeof buffer, fp) != NULL) *************** *** 343,349 **** gr = getgrgid (atoi (grp)); if (!gr) { akerrst = grp; ! return NULL; } #ifndef DBM --- 343,349 ---- gr = getgrgid (atoi (grp)); if (!gr) { akerrst = grp; ! return 0; } #ifndef DBM *************** *** 391,397 **** } if (!gr) { akerrst = grp; ! return NULL; } #ifndef DBM --- 391,397 ---- } if (!gr) { akerrst = grp; ! return 0; } #ifndef DBM *************** *** 411,417 **** static int addall (ak) register struct aka *ak; { ! int noshell = NoShell == NULLCP || *NoShell == NULL; register struct home *hm; #ifndef DBM --- 411,417 ---- static int addall (ak) register struct aka *ak; { ! int noshell = NoShell == NULLCP || *NoShell == 0; register struct home *hm; #ifndef DBM *************** *** 443,463 **** if (cp == NULL) cp = addrs; else ! if (*cp == NULL) return (cp = NULL); for (pp = cp; isspace (*pp); pp++) continue; ! if (*pp == NULL) return (cp = NULL); ! for (qp = pp; *qp != NULL && *qp != ','; qp++) continue; if (*qp == ',') ! *qp++ = NULL; for (cp = qp, qp--; qp > pp; qp--) ! if (*qp != NULL) if (isspace (*qp)) ! *qp = NULL; else break; --- 443,463 ---- if (cp == NULL) cp = addrs; else ! if (*cp == 0) return (cp = NULL); for (pp = cp; isspace (*pp); pp++) continue; ! if (*pp == 0) return (cp = NULL); ! for (qp = pp; *qp != 0 && *qp != ','; qp++) continue; if (*qp == ',') ! *qp++ = 0; for (cp = qp, qp--; qp > pp; qp--) ! if (*qp != 0) if (isspace (*qp)) ! *qp = 0; else break; diff -cr mh-6.7/uip/anno.c /achates/u1/mh-6.7/uip/anno.c *** mh-6.7/uip/anno.c Fri Dec 14 16:26:02 1990 --- /achates/u1/mh-6.7/uip/anno.c Tue Jun 11 21:56:09 1991 *************** *** 30,36 **** #define HELPSW 6 "help", 4, ! NULL, NULL }; /* */ --- 30,36 ---- #define HELPSW 6 "help", 4, ! NULL, 0 }; /* */ *************** *** 179,185 **** } if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':') ! *cp = NULL; if (strlen (*ap) == 0) adios (NULLCP, "null component name"); if (**ap == '-') --- 179,185 ---- } if ((cp = *ap + strlen (*ap) - 1) > *ap && *cp == ':') ! *cp = 0; if (strlen (*ap) == 0) adios (NULLCP, "null component name"); if (**ap == '-') diff -cr mh-6.7/uip/ap.c /achates/u1/mh-6.7/uip/ap.c *** mh-6.7/uip/ap.c Fri Dec 14 16:26:02 1990 --- /achates/u1/mh-6.7/uip/ap.c Tue Jun 11 23:22:21 1991 *************** *** 35,41 **** #define HELPSW 5 "help", 4, ! NULL, NULL }; /* */ --- 35,41 ---- #define HELPSW 5 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/burst.c /achates/u1/mh-6.7/uip/burst.c *** mh-6.7/uip/burst.c Fri Dec 14 16:26:03 1990 --- /achates/u1/mh-6.7/uip/burst.c Tue Jun 11 22:15:04 1991 *************** *** 30,36 **** #define HELPSW 6 "help", 4, ! NULL, NULL }; /* */ --- 30,36 ---- #define HELPSW 6 "help", 4, ! NULL, 0 }; /* */ *************** *** 216,222 **** (void) fseek (in, pos, 0); smsgs[msgp].s_start = pos; ! for (c = NULL; fgets (buffer, sizeof buffer, in) != NULL; c = buffer[0]) if (strncmp (buffer, delim3, ld3) == 0 --- 216,222 ---- (void) fseek (in, pos, 0); smsgs[msgp].s_start = pos; ! for (c = 0; fgets (buffer, sizeof buffer, in) != NULL; c = buffer[0]) if (strncmp (buffer, delim3, ld3) == 0 *************** *** 283,289 **** if (rename (f2, f1) == NOTOK) admonish (f1, "unable to rename %s to", f2); mp -> msgstats[i] = mp -> msgstats[j]; ! mp -> msgstats[j] = NULL; mp -> msgflags |= SEQMOD; } } --- 283,289 ---- if (rename (f2, f1) == NOTOK) admonish (f1, "unable to rename %s to", f2); mp -> msgstats[i] = mp -> msgstats[j]; ! mp -> msgstats[j] = 0; mp -> msgflags |= SEQMOD; } } *************** *** 337,343 **** state; for (state = S1; (c = fgetc (in)) != EOF && len > 0; len--) { ! if (c == NULL) continue; switch (state) { case S1: --- 337,343 ---- state; for (state = S1; (c = fgetc (in)) != EOF && len > 0; len--) { ! if (c == 0) continue; switch (state) { case S1: diff -cr mh-6.7/uip/comp.c /achates/u1/mh-6.7/uip/comp.c *** mh-6.7/uip/comp.c Fri Dec 14 16:26:03 1990 --- /achates/u1/mh-6.7/uip/comp.c Tue Jun 11 22:16:04 1991 *************** *** 42,48 **** "help", 4, ! NULL, NULL }; /* */ --- 42,48 ---- "help", 4, ! NULL, 0 }; /* */ *************** *** 61,67 **** #define NEWSW 5 "new", 0, ! NULL, NULL }; --- 61,67 ---- #define NEWSW 5 "new", 0, ! NULL, 0 }; *************** *** 72,78 **** "list", 0, "refile", 0, ! NULL, NULL }; /* */ --- 72,78 ---- "list", 0, "refile", 0, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/conflict.c /achates/u1/mh-6.7/uip/conflict.c *** mh-6.7/uip/conflict.c Fri Dec 14 16:26:03 1990 --- /achates/u1/mh-6.7/uip/conflict.c Wed Jun 12 09:28:21 1991 *************** *** 10,15 **** --- 10,18 ---- #include "../zotnet/mts.h" #include #include + #ifdef _AIX /* Need declaration of free() */ + #include + #endif #define NDIRS 100 diff -cr mh-6.7/uip/dist.c /achates/u1/mh-6.7/uip/dist.c *** mh-6.7/uip/dist.c Fri Dec 14 16:26:03 1990 --- /achates/u1/mh-6.7/uip/dist.c Tue Jun 11 22:19:48 1991 *************** *** 44,50 **** #define FILESW 13 "file file", -4, /* interface from msh */ ! NULL, NULL }; /* */ --- 44,50 ---- #define FILESW 13 "file file", -4, /* interface from msh */ ! NULL, 0 }; /* */ *************** *** 61,67 **** #define NEWSW 4 "new", 0, ! NULL, NULL }; --- 61,67 ---- #define NEWSW 4 "new", 0, ! NULL, 0 }; *************** *** 71,77 **** "list", 0, "refile +folder", 0, ! NULL, NULL }; /* */ --- 71,77 ---- "list", 0, "refile +folder", 0, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/dp.c /achates/u1/mh-6.7/uip/dp.c *** mh-6.7/uip/dp.c Fri Dec 14 16:26:04 1990 --- /achates/u1/mh-6.7/uip/dp.c Tue Jun 11 23:23:17 1991 *************** *** 30,36 **** #define HELPSW 3 "help", 4, ! NULL, NULL }; /* */ --- 30,36 ---- #define HELPSW 3 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/dropsbr.c /achates/u1/mh-6.7/uip/dropsbr.c *** mh-6.7/uip/dropsbr.c Fri Dec 14 16:26:04 1990 --- /achates/u1/mh-6.7/uip/dropsbr.c Tue Jun 11 22:24:38 1991 *************** *** 163,169 **** if (lseek (fd, (long) (-count), 2) == (long) NOTOK || read (fd, ldelim, count) != count) return NOTOK; ! ldelim[count] = NULL; if (strcmp (ldelim, mmdlm2) && write (fd, "\n", 1) != 1 --- 163,169 ---- if (lseek (fd, (long) (-count), 2) == (long) NOTOK || read (fd, ldelim, count) != count) return NOTOK; ! ldelim[count] = 0; if (strcmp (ldelim, mmdlm2) && write (fd, "\n", 1) != 1 diff -cr mh-6.7/uip/forw.c /achates/u1/mh-6.7/uip/forw.c *** mh-6.7/uip/forw.c Fri Dec 14 16:26:04 1990 --- /achates/u1/mh-6.7/uip/forw.c Tue Jun 11 22:20:43 1991 *************** *** 78,84 **** "build", -5, /* interface from mhe */ #endif MHE ! NULL, NULL }; /* */ --- 78,84 ---- "build", -5, /* interface from mhe */ #endif MHE ! NULL, 0 }; /* */ *************** *** 95,101 **** #define NEWSW 4 "new", 0, ! NULL, NULL }; --- 95,101 ---- #define NEWSW 4 "new", 0, ! NULL, 0 }; *************** *** 105,111 **** "list", 0, "refile +folder", 0, ! NULL, NULL }; /* */ --- 105,111 ---- "list", 0, "refile +folder", 0, ! NULL, 0 }; /* */ *************** *** 580,586 **** for (bp = buffer + i; i > 1; i--) *bp++ = '*'; *bp++ = '\n'; ! *bp = NULL; (void) write (out, buffer, strlen (buffer)); } } --- 580,586 ---- for (bp = buffer + i; i > 1; i--) *bp++ = '*'; *bp++ = '\n'; ! *bp = 0; (void) write (out, buffer, strlen (buffer)); } } diff -cr mh-6.7/uip/inc.c /achates/u1/mh-6.7/uip/inc.c *** mh-6.7/uip/inc.c Fri Dec 14 16:26:04 1990 --- /achates/u1/mh-6.7/uip/inc.c Thu Jun 13 05:45:22 1991 *************** *** 6,12 **** #include "../h/mh.h" #ifdef POP #include "../h/dropsbr.h" ! #endif POP #include "../h/formatsbr.h" #include "../h/scansbr.h" #include "../zotnet/tws.h" --- 6,18 ---- #include "../h/mh.h" #ifdef POP #include "../h/dropsbr.h" ! #endif ! #ifdef KPOP ! #include ! #endif ! #ifdef HESIOD ! #include ! #endif #include "../h/formatsbr.h" #include "../h/scansbr.h" #include "../zotnet/tws.h" *************** *** 102,108 **** #define HELPSW 22 "help", 4, ! NULL, NULL }; /* */ --- 108,114 ---- #define HELPSW 22 "help", 4, ! NULL, 0 }; /* */ *************** *** 160,166 **** *audfile = NULL, *from = NULL, *host = NULL, - *user = NULL, #ifdef POP *pass = NULL, #endif POP --- 166,171 ---- *************** *** 170,175 **** --- 175,181 ---- **argp, *nfs, *arguments[MAXARGS]; + char *user = getusr (); struct msgs *mp; struct stat st, s1; *************** *** 177,191 **** #ifdef MHE FILE *mhe = NULL; #endif MHE invo_name = r1bindex (argv[0], '/'); mts_init (invo_name); ! #ifdef POP ! if (pophost && *pophost) ! host = pophost; if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; ! #endif POP if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); --- 183,199 ---- #ifdef MHE FILE *mhe = NULL; #endif MHE + #ifdef HESIOD + struct hes_postoffice *po; + char *tmphost; + #endif invo_name = r1bindex (argv[0], '/'); mts_init (invo_name); ! if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; ! if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); *************** *** 321,331 **** /* */ #ifdef POP if (host && !*host) host = NULL; if (from || !host || !rpop) (void) setuid (getuid ()); ! #endif POP if (from) { newmail = from; #ifdef POP --- 329,359 ---- /* */ #ifdef POP + #ifdef HESIOD + /* + * Scheme is: + * use MAILHOST environment variable if present, + * else try Hesiod. + * If that fails, use the default (if any) + * provided by mtstailor in mts_init() + */ + if (pophost == NULL || pophost[0] == '\0') + { + if ((tmphost = getenv("MAILHOST")) != NULL) + pophost = tmphost; + else if ((po = hes_getmailhost(user)) != NULL && + strcmp(po->po_type, "POP") == 0) + pophost = po->po_host; + } + #endif /* HESIOD */ + if (pophost && *pophost) + host = pophost; + if (host && !*host) host = NULL; if (from || !host || !rpop) (void) setuid (getuid ()); ! #endif /* POP */ if (from) { newmail = from; #ifdef POP *************** *** 337,345 **** #ifdef POP else if (host) { if (rpop) { ! if (user == NULL) ! user = getusr (); ! pass = getusr (); } else ruserpass (host, &user, &pass); --- 365,371 ---- #ifdef POP else if (host) { if (rpop) { ! pass = user; } else ruserpass (host, &user, &pass); diff -cr mh-6.7/uip/install-mh.c /achates/u1/mh-6.7/uip/install-mh.c *** mh-6.7/uip/install-mh.c Fri Dec 14 16:26:05 1990 --- /achates/u1/mh-6.7/uip/install-mh.c Tue Jun 11 23:24:05 1991 *************** *** 78,89 **** else if ((pw = getpwuid (getuid ())) == NULL || pw -> pw_dir == NULL ! || *pw -> pw_dir == NULL) adios (NULLCP, "no HOME envariable"); else mypath = getcpy (pw -> pw_dir); if ((cp = mypath + strlen (mypath) - 1) > mypath && *cp == '/') ! *cp = NULL; } defpath = concat (mypath, "/", mh_profile, NULLCP); --- 78,89 ---- else if ((pw = getpwuid (getuid ())) == NULL || pw -> pw_dir == NULL ! || *pw -> pw_dir == 0) adios (NULLCP, "no HOME envariable"); else mypath = getcpy (pw -> pw_dir); if ((cp = mypath + strlen (mypath) - 1) > mypath && *cp == '/') ! *cp = 0; } defpath = concat (mypath, "/", mh_profile, NULLCP); *************** *** 189,194 **** if (fgets (line, sizeof line, stdin) == NULL) done (1); if (cp = index (line, '\n')) ! *cp = NULL; return line; } --- 189,194 ---- if (fgets (line, sizeof line, stdin) == NULL) done (1); if (cp = index (line, '\n')) ! *cp = 0; return line; } diff -cr mh-6.7/uip/mark.c /achates/u1/mh-6.7/uip/mark.c *** mh-6.7/uip/mark.c Fri Dec 14 16:26:05 1990 --- /achates/u1/mh-6.7/uip/mark.c Tue Jun 11 22:27:59 1991 *************** *** 32,38 **** #define DEBUGSW 9 "debug", -5, ! NULL, NULL }; /* */ --- 32,38 ---- #define DEBUGSW 9 "debug", -5, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/mhlsbr.c /achates/u1/mh-6.7/uip/mhlsbr.c *** mh-6.7/uip/mhlsbr.c Fri Dec 14 16:26:05 1990 --- /achates/u1/mh-6.7/uip/mhlsbr.c Tue Jun 11 23:02:00 1991 *************** *** 102,108 **** #define ISSUESW 20 "issue number", -5, ! NULL, NULL }; /* */ --- 102,108 ---- #define ISSUESW 20 "issue number", -5, ! NULL, 0 }; /* */ *************** *** 152,162 **** static struct mcomp *fmttl = NULL; static struct mcomp global = { ! NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, BELL, NULL }; static struct mcomp holder = { ! NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NOCOMPONENT, NULL }; --- 152,162 ---- static struct mcomp *fmttl = NULL; static struct mcomp global = { ! NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, BELL, 0 }; static struct mcomp holder = { ! NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NOCOMPONENT, 0 }; *************** *** 461,467 **** for (cp = buf + i; i > 1; i--) *cp++ = '*'; *cp++ = '\n'; ! *cp = NULL; printf ("%s", buf); } else --- 461,467 ---- for (cp = buf + i; i > 1; i--) *cp++ = '*'; *cp++ = '\n'; ! *cp = 0; printf ("%s", buf); } else *************** *** 532,538 **** continue; if (cp = index (bp, '\n')) ! *cp = NULL; if (*bp == ':') { c1 = add_queue (&fmthd, &fmttl, NULLCP, bp + 1, CLEARTEXT); --- 532,538 ---- continue; if (cp = index (bp, '\n')) ! *cp = 0; if (*bp == ':') { c1 = add_queue (&fmthd, &fmttl, NULLCP, bp + 1, CLEARTEXT); *************** *** 713,719 **** if (!*++parptr) parptr--; c = *parptr; ! *parptr = NULL; *s = getcpy (cp); if ((*parptr = c) == '"') parptr++; --- 713,719 ---- if (!*++parptr) parptr--; c = *parptr; ! *parptr = 0; *s = getcpy (cp); if ((*parptr = c) == '"') parptr++; *************** *** 737,743 **** *cp++ = c; else break; ! *cp = NULL; return result; } --- 737,743 ---- *cp++ = c; else break; ! *cp = 0; return result; } *************** *** 841,847 **** printf ("Press to list \"%s\"...", mname); } (void) fflush (stdout); ! buf[0] = NULL; (void) read (fileno (stdout), buf, sizeof buf); } if (index (buf, '\n')) { --- 841,847 ---- printf ("Press to list \"%s\"...", mname); } (void) fflush (stdout); ! buf[0] = 0; (void) read (fileno (stdout), buf, sizeof buf); } if (index (buf, '\n')) { *************** *** 977,983 **** if (uleq (ap -> p_name, name)) return (ap -> p_flags); ! return NULL; } --- 977,983 ---- if (uleq (ap -> p_name, name)) return (ap -> p_flags); ! return 0; } *************** *** 992,998 **** return add (s1, s2); if (s2 && *(dp = s2 + strlen (s2) - 1) == '\n') ! *dp = NULL; return add (s1, add (",\n", s2)); } --- 992,998 ---- return add (s1, s2); if (s2 && *(dp = s2 + strlen (s2) - 1) == '\n') ! *dp = 0; return add (s1, add (",\n", s2)); } *************** *** 1078,1084 **** if (c2 -> c_text) c2 -> c_text = add (",\n", c2 -> c_text); if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = NULL; c2 -> c_text = add (buffer, c2 -> c_text); } --- 1078,1084 ---- if (c2 -> c_text) c2 -> c_text = add (",\n", c2 -> c_text); if (*(cp = buffer + strlen (buffer) - 1) == '\n') ! *cp = 0; c2 -> c_text = add (buffer, c2 -> c_text); } *************** *** 1291,1297 **** if (onelp == NULL) onelp = stuff; ! if (*onelp == NULL) return (onelp = NULL); ret = onelp; --- 1291,1297 ---- if (onelp == NULL) onelp = stuff; ! if (*onelp == 0) return (onelp = NULL); ret = onelp; *************** *** 1301,1307 **** if (isspace (*onelp)) { if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) { term = '\n'; ! *onelp++ = NULL; break; } else --- 1301,1307 ---- if (isspace (*onelp)) { if (*onelp == '\n' && (!onelp[1] || (flags & ADDRFMT))) { term = '\n'; ! *onelp++ = 0; break; } else *************** *** 1315,1321 **** spc = 0; } ! *cp = NULL; } else { while (*onelp && *onelp != '\n') --- 1315,1321 ---- spc = 0; } ! *cp = 0; } else { while (*onelp && *onelp != '\n') *************** *** 1322,1328 **** onelp++; if (*onelp == '\n') { term = '\n'; ! *onelp++ = NULL; } if (flags & LEFTADJUST) while (*ret == ' ' || *ret == '\t') --- 1322,1328 ---- onelp++; if (*onelp == '\n') { term = '\n'; ! *onelp++ = 0; } if (flags & LEFTADJUST) while (*ret == ' ' || *ret == '\t') *************** *** 1373,1379 **** if (global.c_flags & BELL) (void) putchar ('\007'); (void) fflush (stdout); ! buf[0] = NULL; (void) read (fileno (stdout), buf, sizeof buf); if (index (buf, '\n')) { if (global.c_flags & CLEARSCR) --- 1373,1379 ---- if (global.c_flags & BELL) (void) putchar ('\007'); (void) fflush (stdout); ! buf[0] = 0; (void) read (fileno (stdout), buf, sizeof buf); if (index (buf, '\n')) { if (global.c_flags & CLEARSCR) diff -cr mh-6.7/uip/mhmail.c /achates/u1/mh-6.7/uip/mhmail.c *** mh-6.7/uip/mhmail.c Fri Dec 14 16:26:05 1990 --- /achates/u1/mh-6.7/uip/mhmail.c Tue Jun 11 22:28:43 1991 *************** *** 25,31 **** #define HELPSW 4 "help", 4, ! NULL, NULL }; /* */ --- 25,31 ---- #define HELPSW 4 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/mhpath.c /achates/u1/mh-6.7/uip/mhpath.c *** mh-6.7/uip/mhpath.c Fri Dec 14 16:26:05 1990 --- /achates/u1/mh-6.7/uip/mhpath.c Tue Jun 11 22:29:29 1991 *************** *** 9,15 **** #define HELPSW 0 "help", 4, ! NULL, NULL }; /* */ --- 9,15 ---- #define HELPSW 0 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/msgchk.c /achates/u1/mh-6.7/uip/msgchk.c *** mh-6.7/uip/msgchk.c Fri Dec 14 16:26:06 1990 --- /achates/u1/mh-6.7/uip/msgchk.c Thu Jun 13 05:39:53 1991 *************** *** 10,15 **** --- 10,18 ---- #include #include #include + #ifdef HESIOD + #include + #endif /* */ *************** *** 49,55 **** #define HELPSW 8 "help", 4, ! NULL, NULL }; /* */ --- 52,58 ---- #define HELPSW 8 "help", 4, ! NULL, 0 }; /* */ *************** *** 88,93 **** --- 91,97 ---- status = 0, snoop = 0, vecp = 0; + int uid = getuid (); char *cp, *host = NULL, buf[80], *************** *** 95,110 **** **argp, *arguments[MAXARGS], *vec[50]; struct passwd *pw; invo_name = r1bindex (argv[0], '/'); mts_init (invo_name); - #ifdef POP - if (pophost && *pophost) - host = pophost; if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; ! #endif POP if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); --- 99,116 ---- **argp, *arguments[MAXARGS], *vec[50]; + char *user = getusr (); struct passwd *pw; + #ifdef HESIOD + struct hes_postoffice *po; + char *tmphost; + #endif invo_name = r1bindex (argv[0], '/'); mts_init (invo_name); if ((cp = getenv ("MHPOPDEBUG")) && *cp) snoop++; ! if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); *************** *** 168,190 **** } /* */ - #ifdef POP if (!host || !*host) host = NULL; if (!host || !rpop) ! (void) setuid (getuid ()); ! #endif POP if (vecp == 0) { #ifdef POP if (host) ! status = remotemail (host, NULLCP, rpop, notifysw, 1, snoop); else ! #endif POP ! if ((pw = getpwuid (getuid ())) == NULL) ! adios (NULLCP, "you lose"); ! else ! status = checkmail (pw, datesw, notifysw, 1); } else { vec[vecp] = NULL; --- 174,222 ---- } /* */ #ifdef POP + #ifdef HESIOD + /* + * Scheme is: + * use MAILHOST environment variable if present, + * else try Hesiod. + * If that fails, use the default (if any) + * provided by mtstailor in mts_init() + */ + if (pophost == NULL || pophost[0] == '\0') + { + if ((tmphost = getenv("MAILHOST")) != NULL) + pophost = tmphost; + else if ((po = hes_getmailhost(vecp ? vec[0] : user)) != NULL && + strcmp(po->po_type, "POP") == 0) + pophost = po->po_host; + } + #endif /* HESIOD */ + if (pophost && *pophost) + host = pophost; if (!host || !*host) host = NULL; if (!host || !rpop) ! (void) setuid (uid); ! #endif /* POP */ if (vecp == 0) { #ifdef POP if (host) ! status = remotemail (host, user, rpop, notifysw, 1, snoop); else ! #endif ! { ! char *home = (uid = geteuid()) ? home = getenv ("HOME") : NULL; ! if (home == NULL) ! { ! pw = getpwnam (user); ! if (pw == NULL) ! adios (NULLCP, "unable to get information about user"); ! if (home == NULL) ! home = pw->pw_dir; ! } ! status = checkmail (user, home, datesw, notifysw, 1); ! } } else { vec[vecp] = NULL; *************** *** 194,202 **** if (host) status += remotemail (host, cp, rpop, notifysw, 0, snoop); else ! #endif POP if (pw = getpwnam (cp)) ! status += checkmail (pw, datesw, notifysw, 0); else advise (NULLCP, "no such user as %s", cp); } --- 226,234 ---- if (host) status += remotemail (host, cp, rpop, notifysw, 0, snoop); else ! #endif if (pw = getpwnam (cp)) ! status += checkmail (pw->pw_name, pw->pw_dir, datesw, notifysw, 0); else advise (NULLCP, "no such user as %s", cp); } *************** *** 214,220 **** #define NNMAISW 2 "nomail", 0, ! NULL, NULL }; --- 246,252 ---- #define NNMAISW 2 "nomail", 0, ! NULL, 0 }; *************** *** 244,251 **** /* ARGSUSED */ #endif MF ! static int checkmail (pw, datesw, notifysw, personal) ! register struct passwd *pw; int datesw, notifysw, personal; --- 276,283 ---- /* ARGSUSED */ #endif MF ! static int checkmail (user, home, datesw, notifysw, personal) ! register char *user, *home; int datesw, notifysw, personal; *************** *** 256,263 **** struct stat st; (void) sprintf (buffer, "%s/%s", ! mmdfldir[0] ? mmdfldir : pw -> pw_dir, ! mmdflfil[0] ? mmdflfil : pw -> pw_name); #ifndef MF if (datesw) { st.st_size = 0; --- 288,295 ---- struct stat st; (void) sprintf (buffer, "%s/%s", ! mmdfldir[0] ? mmdfldir : home, ! mmdflfil[0] ? mmdflfil : user); #ifndef MF if (datesw) { st.st_size = 0; *************** *** 270,277 **** #ifdef MF if (umincproc != NULL && *umincproc != NULL) { (void) sprintf (buffer, "%s/%s", ! uucpldir[0] ? uucpldir : pw -> pw_dir, ! uucplfil[0] ? uucplfil : pw -> pw_name); mf |= (stat (buffer, &st) == NOTOK || st.st_size == 0) ? NONEOK : st.st_atime <= st.st_mtime ? UUCPNEW : UUCPOLD; } --- 302,309 ---- #ifdef MF if (umincproc != NULL && *umincproc != NULL) { (void) sprintf (buffer, "%s/%s", ! uucpldir[0] ? uucpldir : home, ! uucplfil[0] ? uucplfil : user); mf |= (stat (buffer, &st) == NOTOK || st.st_size == 0) ? NONEOK : st.st_atime <= st.st_mtime ? UUCPNEW : UUCPOLD; } *************** *** 279,285 **** if ((mf & UUCPOK) || (mf & MMDFOK)) { if (notifysw & NT_MAIL) { ! printf (personal ? "You have " : "%s has ", pw -> pw_name); if (mf & UUCPOK) printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new"); if ((mf & UUCPOK) && (mf & MMDFOK)) --- 311,317 ---- if ((mf & UUCPOK) || (mf & MMDFOK)) { if (notifysw & NT_MAIL) { ! printf (personal ? "You have " : "%s has ", user); if (mf & UUCPOK) printf ("%s old-style bell", mf & UUCPOLD ? "old" : "new"); if ((mf & UUCPOK) && (mf & MMDFOK)) *************** *** 297,303 **** else { if (notifysw & NT_NMAI) printf (personal ? "You don't %s%s" : "%s doesn't %s", ! personal ? "" : pw -> pw_name, "have any mail waiting"); else notifysw = 0; --- 329,335 ---- else { if (notifysw & NT_NMAI) printf (personal ? "You don't %s%s" : "%s doesn't %s", ! personal ? "" : user, "have any mail waiting"); else notifysw = 0; *************** *** 338,344 **** if (rpop) { if (user == NULL) user = getusr (); ! pass = getusr (); } else ruserpass (host, &user, &pass); --- 370,376 ---- if (rpop) { if (user == NULL) user = getusr (); ! pass = user; } else ruserpass (host, &user, &pass); diff -cr mh-6.7/uip/msh.c /achates/u1/mh-6.7/uip/msh.c *** mh-6.7/uip/msh.c Fri Dec 14 16:26:06 1990 --- /achates/u1/mh-6.7/uip/msh.c Tue Jun 11 22:46:35 1991 *************** *** 73,79 **** #define HELPSW 13 "help", 4, ! NULL, NULL }; /* */ --- 73,79 ---- #define HELPSW 13 "help", 4, ! NULL, 0 }; /* */ *************** *** 436,442 **** #define WHOMCMD 26 "whom", 0, ! NULL, NULL }; /* */ --- 436,442 ---- #define WHOMCMD 26 "whom", 0, ! NULL, 0 }; /* */ *************** *** 728,734 **** mp -> curmsg = 0; mp -> foldpath = getcpy (myname ? myname : file); ! mp -> msgflags = NULL; #ifdef BPOP if (pmsh) mp -> msgflags |= READONLY; --- 728,734 ---- mp -> curmsg = 0; mp -> foldpath = getcpy (myname ? myname : file); ! mp -> msgflags = 0; #ifdef BPOP if (pmsh) mp -> msgflags |= READONLY; *************** *** 1451,1459 **** if (cp < &buffer[sizeof buffer - 2]) *cp++ = i; } ! *cp = NULL; ! if (buffer[0] == NULL) continue; if (buffer[0] == '?') { printf ("commands:\n"); --- 1451,1459 ---- if (cp < &buffer[sizeof buffer - 2]) *cp++ = i; } ! *cp = 0; ! if (buffer[0] == 0) continue; if (buffer[0] == '?') { printf ("commands:\n"); *************** *** 1532,1538 **** *cp, *pp; ! cmdp -> line[0] = NULL; pp = cmdp -> args[argp++] = cmdp -> line; cmdp -> redirect = NULL; cmdp -> direction = STDIO; --- 1532,1538 ---- *cp, *pp; ! cmdp -> line[0] = 0; pp = cmdp -> args[argp++] = cmdp -> line; cmdp -> redirect = NULL; cmdp -> direction = STDIO; *************** *** 1541,1547 **** for (cp = buffer; c = *cp; cp++) if (!isspace (c)) break; ! if (c == NULL) { if (vmh) (void) fmt2peer (RC_EOF, "null command"); return NOTOK; --- 1541,1547 ---- for (cp = buffer; c = *cp; cp++) if (!isspace (c)) break; ! if (c == 0) { if (vmh) (void) fmt2peer (RC_EOF, "null command"); return NOTOK; *************** *** 1551,1561 **** if (isspace (c)) { while (isspace (c)) c = *cp++; ! if (c == NULL) break; ! *pp++ = NULL; cmdp -> args[argp++] = pp; ! *pp = NULL; } switch (c) { --- 1551,1561 ---- if (isspace (c)) { while (isspace (c)) c = *cp++; ! if (c == 0) break; ! *pp++ = 0; cmdp -> args[argp++] = pp; ! *pp = 0; } switch (c) { *************** *** 1562,1574 **** case '"': for (;;) { switch (c = *cp++) { ! case NULL: padvise (NULLCP, "unmatched \""); return NOTOK; case '"': break; case QUOTE: ! if ((c = *cp++) == NULL) goto no_quoting; default: *pp++ = c; --- 1562,1574 ---- case '"': for (;;) { switch (c = *cp++) { ! case 0: padvise (NULLCP, "unmatched \""); return NOTOK; case '"': break; case QUOTE: ! if ((c = *cp++) == 0) goto no_quoting; default: *pp++ = c; *************** *** 1579,1585 **** continue; case QUOTE: ! if ((c = *cp++) == NULL) { no_quoting: ; padvise (NULLCP, "the newline character can not be quoted"); return NOTOK; --- 1579,1585 ---- continue; case QUOTE: ! if ((c = *cp++) == 0) { no_quoting: ; padvise (NULLCP, "the newline character can not be quoted"); return NOTOK; *************** *** 1595,1601 **** padvise (NULLCP, "invalid null command"); return NOTOK; } ! if (*cmdp -> args[argp - 1] == NULL) argp--; cmdp -> direction = c == '>' ? CRTIO : PIPIO; if (cmdp -> direction == CRTIO && (c = *cp) == '>') { --- 1595,1601 ---- padvise (NULLCP, "invalid null command"); return NOTOK; } ! if (*cmdp -> args[argp - 1] == 0) argp--; cmdp -> direction = c == '>' ? CRTIO : PIPIO; if (cmdp -> direction == CRTIO && (c = *cp) == '>') { *************** *** 1606,1612 **** for (; c = *cp; cp++) if (!isspace (c)) break; ! if (c == NULL) { padvise (NULLCP, cmdp -> direction != PIPIO ? "missing name for redirect" : "invalid null command"); --- 1606,1612 ---- for (; c = *cp; cp++) if (!isspace (c)) break; ! if (c == 0) { padvise (NULLCP, cmdp -> direction != PIPIO ? "missing name for redirect" : "invalid null command"); *************** *** 1627,1633 **** break; } ! *pp++ = NULL; cmdp -> args[argp] = NULL; return OK; --- 1627,1633 ---- break; } ! *pp++ = 0; cmdp -> args[argp] = NULL; return OK; *************** *** 1647,1654 **** return OK; if (cp = index (pp = redirect + 1, '/')) ! *cp++ = NULL; ! if (*pp == NULL) pp = mypath; else if (pw = getpwnam (pp)) --- 1647,1654 ---- return OK; if (cp = index (pp = redirect + 1, '/')) ! *cp++ = 0; ! if (*pp == 0) pp = mypath; else if (pw = getpwnam (pp)) diff -cr mh-6.7/uip/mshcmds.c /achates/u1/mh-6.7/uip/mshcmds.c *** mh-6.7/uip/mshcmds.c Fri Dec 14 16:26:06 1990 --- /achates/u1/mh-6.7/uip/mshcmds.c Thu Jun 13 08:38:27 1991 *************** *** 8,14 **** --- 8,17 ---- #include "../h/formatsbr.h" #include "../h/scansbr.h" #include "../zotnet/tws.h" + /* AIX 1.2.1 declares getws() */ + #define getws _getws #include + #undef getws #include "../zotnet/mts.h" #include #include *************** *** 116,122 **** #define DIHELP 12 "help", 4, ! NULL, NULL }; /* */ --- 119,125 ---- #define DIHELP 12 "help", 4, ! NULL, 0 }; /* */ *************** *** 222,228 **** #define EXHELP 6 "help", 4, ! NULL, NULL }; /* */ --- 225,231 ---- #define EXHELP 6 "help", 4, ! NULL, 0 }; /* */ *************** *** 357,363 **** (void) fseek (zp, pos, 0); smsgs[msgp].m_start = pos; ! for (c = NULL; fgets (buffer, sizeof buffer, zp) != NULL && pos < Msgs[msgnum].m_stop; c = buffer[0]) --- 360,366 ---- (void) fseek (zp, pos, 0); smsgs[msgp].m_start = pos; ! for (c = 0; fgets (buffer, sizeof buffer, zp) != NULL && pos < Msgs[msgnum].m_stop; c = buffer[0]) *************** *** 471,477 **** #define FIHELP 7 "help", 4, ! NULL, NULL }; /* */ --- 474,480 ---- #define FIHELP 7 "help", 4, ! NULL, 0 }; /* */ *************** *** 646,652 **** #define FLHELP 15 "help", 4, ! NULL, NULL }; /* */ --- 649,655 ---- #define FLHELP 15 "help", 4, ! NULL, 0 }; /* */ *************** *** 731,737 **** } if (folder) { ! if (*folder == NULL) { advise (NULLCP, "null folder names are not permitted"); return; } --- 734,740 ---- } if (folder) { ! if (*folder == 0) { advise (NULLCP, "null folder names are not permitted"); return; } *************** *** 867,873 **** #define FOHELP 15 "help", 4, ! NULL, NULL }; /* */ --- 870,876 ---- #define FOHELP 15 "help", 4, ! NULL, 0 }; /* */ *************** *** 953,959 **** /* foil search of .mh_profile */ (void) sprintf (buf, "%sXXXXXX", invo_name); ! vec[0] = mktemp (buf); vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msgp) --- 956,962 ---- /* foil search of .mh_profile */ (void) sprintf (buf, "%sXXXXXX", invo_name); ! vec[0] = (char *)mktemp (buf); vec[vecp++] = "-file"; vec[vecp] = NULL; if (!msgp) *************** *** 1145,1151 **** #define MDBUGSW 9 "debug", -5, ! NULL, NULL }; /* */ --- 1148,1154 ---- #define MDBUGSW 9 "debug", -5, ! NULL, 0 }; /* */ *************** *** 1341,1347 **** #define PAHELP 1 "help", 4, ! NULL, NULL }; /* */ --- 1344,1350 ---- #define PAHELP 1 "help", 4, ! NULL, 0 }; /* */ *************** *** 1531,1537 **** #define PIHELP 22 "help", 4, ! NULL, NULL }; /* */ --- 1534,1540 ---- #define PIHELP 22 "help", 4, ! NULL, 0 }; /* */ *************** *** 1738,1744 **** #define REHELP 21 "help", 4, ! NULL, NULL }; /* */ --- 1741,1747 ---- #define REHELP 21 "help", 4, ! NULL, 0 }; /* */ *************** *** 1841,1847 **** #define RMHELP 0 "help", 4, ! NULL, NULL }; /* */ --- 1844,1850 ---- #define RMHELP 0 "help", 4, ! NULL, 0 }; /* */ *************** *** 1971,1977 **** #define SCHELP 7 "help", 4, ! NULL, NULL }; /* */ --- 1974,1980 ---- #define SCHELP 7 "help", 4, ! NULL, 0 }; /* */ *************** *** 2138,2144 **** #define SHHELP 10 "help", 4, ! NULL, NULL }; /* */ --- 2141,2147 ---- #define SHHELP 10 "help", 4, ! NULL, 0 }; /* */ *************** *** 2355,2361 **** printf ("Press to list \"%d\"...", msgnum); } (void) fflush (stdout); ! buf[0] = NULL; #ifndef BSD42 (void) read (fileno (stdout), buf, sizeof buf); #else BSD42 --- 2358,2364 ---- printf ("Press to list \"%d\"...", msgnum); } (void) fflush (stdout); ! buf[0] = 0; #ifndef BSD42 (void) read (fileno (stdout), buf, sizeof buf); #else BSD42 *************** *** 2404,2410 **** #define SOHELP 7 "help", 4, ! NULL, NULL }; /* */ --- 2407,2413 ---- #define SOHELP 7 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/packf.c /achates/u1/mh-6.7/uip/packf.c *** mh-6.7/uip/packf.c Fri Dec 14 16:26:07 1990 --- /achates/u1/mh-6.7/uip/packf.c Tue Jun 11 23:04:47 1991 *************** *** 16,22 **** #define HELPSW 1 "help", 4, ! NULL, NULL }; /* */ --- 16,22 ---- #define HELPSW 1 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/pick.c /achates/u1/mh-6.7/uip/pick.c *** mh-6.7/uip/pick.c Fri Dec 14 16:26:07 1990 --- /achates/u1/mh-6.7/uip/pick.c Tue Jun 11 23:05:27 1991 *************** *** 58,64 **** #define HELPSW 22 "help", 4, ! NULL, NULL }; /* */ --- 58,64 ---- #define HELPSW 22 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/picksbr.c /achates/u1/mh-6.7/uip/picksbr.c *** mh-6.7/uip/picksbr.c Fri Dec 14 16:26:07 1990 --- /achates/u1/mh-6.7/uip/picksbr.c Tue Jun 11 22:56:26 1991 *************** *** 43,49 **** #define PRDATF 14 "datefield field", 5, ! NULL, NULL }; /* DEFINITIONS FOR PATTERN MATCHING */ --- 43,49 ---- #define PRDATF 14 "datefield field", 5, ! NULL, 0 }; /* DEFINITIONS FOR PATTERN MATCHING */ *************** *** 668,674 **** *p1++ = c; } ! *p1++ = NULL; cbp = p2; p1 = linebuf; p2 = n -> n_expbuf; --- 668,674 ---- *p1++ = c; } ! *p1++ = 0; cbp = p2; p1 = linebuf; p2 = n -> n_expbuf; diff -cr mh-6.7/uip/popsbr.c /achates/u1/mh-6.7/uip/popsbr.c *** mh-6.7/uip/popsbr.c Fri Dec 14 16:26:07 1990 --- /achates/u1/mh-6.7/uip/popsbr.c Wed Jun 12 01:49:17 1991 *************** *** 1,6 **** /* popsbr.c - POP client subroutines */ #ifndef lint ! static char ident[] = "@(#)$Id: popsbr.c,v 1.4 90/04/09 09:47:21 sources Exp $"; #endif lint /* LINTLIBRARY */ --- 1,6 ---- /* popsbr.c - POP client subroutines */ #ifndef lint ! static char ident[] = "@(#)$Id: popsbr.c,v 1.5 90/04/09 09:45:16 sources Exp Locker: sources $"; #endif lint /* LINTLIBRARY */ *************** *** 32,39 **** static FILE *input; static FILE *output; ! static int traverse(), command(), multiline(), getline(); ! static putline(); /* */ #ifndef RPOP --- 32,44 ---- static FILE *input; static FILE *output; ! #ifdef __STDC__ ! static int traverse (int (*)(), const char*, char *, char *, char *, char *); ! #else ! static int traverse(); ! #endif ! static int command(), multiline(), getline(); ! static putline(); /* */ #ifndef RPOP *************** *** 54,61 **** --- 59,71 ---- #endif RPOP char buffer[BUFSIZ]; + #ifdef KPOP + if ((fd1 = kclient (host, "tcp", POPSERVICE, rpop, response)) == NOTOK) + return NOTOK; + #else if ((fd1 = client (host, "tcp", POPSERVICE, rpop, response)) == NOTOK) return NOTOK; + #endif if ((fd2 = dup (fd1)) == NOTOK) { (void) sprintf (response, "unable to dup connection descriptor: %s", *************** *** 74,81 **** if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+' ! && command ("USER %s", user) != NOTOK ! && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), pass) != NOTOK) return OK; if (*response != '+') { --- 84,95 ---- if (poprint) fprintf (stderr, "<--- %s\n", response); if (*response == '+' ! && command ("USER %s", user) != NOTOK ! #ifndef KPOP ! && command ("%s %s", rpop ? "RPOP" : (pophack++, "PASS"), ! #else ! && command ("PASS %s", ! #endif pass) != NOTOK) return OK; if (*response != '+') { *************** *** 157,163 **** int i; #ifndef BPOP int *ids = NULL; ! #endif not BPOP if (msgno) { if (command ("LIST %d", msgno) == NOTOK) --- 171,177 ---- int i; #ifndef BPOP int *ids = NULL; ! #endif if (msgno) { if (command ("LIST %d", msgno) == NOTOK) *************** *** 211,217 **** int msgno, (*action) (); { ! return traverse (action, "RETR %d", msgno); } --- 225,231 ---- int msgno, (*action) (); { ! return traverse (action, "RETR %d", (char *)msgno, 0, 0, 0); } *************** *** 219,226 **** static int traverse (action, fmt, a, b, c, d) int (*action) (); ! char *fmt, ! *a, *b, *c, *d; --- 233,244 ---- static int traverse (action, fmt, a, b, c, d) int (*action) (); ! #ifdef __STDC__ ! const char *fmt; ! #else ! char *fmt; ! #endif ! char *a, *b, *c, *d; *************** *** 271,277 **** lines, (*action) (); { ! return traverse (action, "TOP %d %d", msgno, lines); } --- 289,295 ---- lines, (*action) (); { ! return traverse (action, "TOP %d %d", (char *)msgno, (char *)lines, 0, 0); } *************** *** 328,334 **** if (poprint) if (pophack) { if (cp = index (buffer, ' ')) ! *cp = NULL; fprintf (stderr, "---> %s ********\n", buffer); if (cp) *cp = ' '; --- 346,352 ---- if (poprint) if (pophack) { if (cp = index (buffer, ' ')) ! *cp = 0; fprintf (stderr, "---> %s ********\n", buffer); if (cp) *cp = ' '; *************** *** 361,367 **** if (getline (buffer, sizeof buffer, input) != OK) return NOTOK; if (strncmp (buffer, TRM, TRMLEN) == 0) { ! if (buffer[TRMLEN] == NULL) return DONE; else (void) strcpy (response, buffer + TRMLEN); --- 379,385 ---- if (getline (buffer, sizeof buffer, input) != OK) return NOTOK; if (strncmp (buffer, TRM, TRMLEN) == 0) { ! if (buffer[TRMLEN] == 0) return DONE; else (void) strcpy (response, buffer + TRMLEN); *************** *** 394,404 **** (void) strcpy (response, "connection closed by foreign host"); return DONE; } ! *p = NULL; if (*--p == '\n') ! *p = NULL; if (*--p == '\r') ! *p = NULL; return OK; } --- 412,422 ---- (void) strcpy (response, "connection closed by foreign host"); return DONE; } ! *p = 0; if (*--p == '\n') ! *p = 0; if (*--p == '\r') ! *p = 0; return OK; } diff -cr mh-6.7/uip/post.c /achates/u1/mh-6.7/uip/post.c *** mh-6.7/uip/post.c Fri Dec 14 16:26:08 1990 --- /achates/u1/mh-6.7/uip/post.c Thu Jun 13 02:02:07 1991 *************** *** 128,134 **** #define FILLSW 30 "fill-in file", -7, ! NULL, NULL }; /* */ --- 128,134 ---- #define FILLSW 30 "fill-in file", -7, ! NULL, 0 }; /* */ *************** *** 161,206 **** /* */ static struct headers NHeaders[] = { ! "Return-Path", HBAD, NULL, ! "Received", HBAD, NULL, ! "Reply-To", HADR | HNGR, NULL, "From", HADR | HNGR, MFRM, ! "Sender", HADR | HBAD, NULL, ! "Date", HBAD, NULL, ! "Subject", HSUB, NULL, "To", HADR | HTRY, MVIS, "cc", HADR | HTRY, MVIS, "Bcc", HADR | HTRY | HBCC | HNIL, MINV, "Dcc", HADR | HTRY | HDCC | HNIL, MVIS, /* sorta cc & bcc combined */ ! "Message-ID", HBAD, NULL, ! "Fcc", HFCC, NULL, NULL }; static struct headers RHeaders[] = { ! "Resent-Reply-To", HADR | HNGR, NULL, "Resent-From", HADR | HNGR, MRFM, ! "Resent-Sender", HADR | HBAD, NULL, ! "Resent-Date", HBAD, NULL, ! "Resent-Subject", HSUB, NULL, "Resent-To", HADR | HTRY, MVIS, "Resent-cc", HADR | HTRY, MVIS, "Resent-Bcc", HADR | HTRY | HBCC, MINV, ! "Resent-Message-ID", HBAD, NULL, ! "Resent-Fcc", HFCC, NULL, ! "Reply-To", HADR, NULL, "From", HADR | HNGR, MFRM, #ifdef MMDFI ! "Sender", HADR | HMNG | HNGR, NULL, #else not MMFDI ! "Sender", HADR | HNGR, NULL, #endif not MMDFI "Date", HNOP, MDAT, ! "To", HADR | HNIL, NULL, ! "cc", HADR | HNIL, NULL, ! "Bcc", HADR | HTRY | HBCC | HNIL, NULL, ! "Fcc", HIGN, NULL, NULL }; --- 161,206 ---- /* */ static struct headers NHeaders[] = { ! "Return-Path", HBAD, 0, ! "Received", HBAD, 0, ! "Reply-To", HADR | HNGR, 0, "From", HADR | HNGR, MFRM, ! "Sender", HADR | HBAD, 0, ! "Date", HBAD, 0, ! "Subject", HSUB, 0, "To", HADR | HTRY, MVIS, "cc", HADR | HTRY, MVIS, "Bcc", HADR | HTRY | HBCC | HNIL, MINV, "Dcc", HADR | HTRY | HDCC | HNIL, MVIS, /* sorta cc & bcc combined */ ! "Message-ID", HBAD, 0, ! "Fcc", HFCC, 0, NULL }; static struct headers RHeaders[] = { ! "Resent-Reply-To", HADR | HNGR, 0, "Resent-From", HADR | HNGR, MRFM, ! "Resent-Sender", HADR | HBAD, 0, ! "Resent-Date", HBAD, 0, ! "Resent-Subject", HSUB, 0, "Resent-To", HADR | HTRY, MVIS, "Resent-cc", HADR | HTRY, MVIS, "Resent-Bcc", HADR | HTRY | HBCC, MINV, ! "Resent-Message-ID", HBAD, 0, ! "Resent-Fcc", HFCC, 0, ! "Reply-To", HADR, 0, "From", HADR | HNGR, MFRM, #ifdef MMDFI ! "Sender", HADR | HMNG | HNGR, 0, #else not MMFDI ! "Sender", HADR | HNGR, 0, #endif not MMDFI "Date", HNOP, MDAT, ! "To", HADR | HNIL, 0, ! "cc", HADR | HNIL, 0, ! "Bcc", HADR | HTRY | HBCC | HNIL, 0, ! "Fcc", HIGN, 0, NULL }; *************** *** 234,240 **** #define RESENT 1 static int msgstate = NORMAL; ! static long clock = 0L; /* the time we started (more or less) */ static TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) (); --- 234,240 ---- #define RESENT 1 static int msgstate = NORMAL; ! static long start_time = 0L; /* the time we started (more or less) */ static TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) (); *************** *** 301,307 **** long lseek (), time (); static putfmt(), start_headers(), finish_headers(), putgrp(), pl(); ! static anno(), insert_foc(), make_bcc_file(), verify_all_addresses(); static chkadr(), do_addresses(), do_text(), do_an_address(), sigon(); static sigoff(), p_refile(), fcc(), die(), insert_fcc(); static int get_header(), putadr(), insert(), annoaux(); --- 301,307 ---- long lseek (), time (); static putfmt(), start_headers(), finish_headers(), putgrp(), pl(); ! static anno(), make_bcc_file(), verify_all_addresses(); static chkadr(), do_addresses(), do_text(), do_an_address(), sigon(); static sigoff(), p_refile(), fcc(), die(), insert_fcc(); static int get_header(), putadr(), insert(), annoaux(); *************** *** 758,766 **** } if (cp = rindex (str, '\n')) ! *cp = NULL; for (cp = pp = str; cp = index (pp, ','); pp = cp) { ! *cp++ = NULL; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); --- 758,766 ---- } if (cp = rindex (str, '\n')) ! *cp = 0; for (cp = pp = str; cp = index (pp, ','); pp = cp) { ! *cp++ = 0; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); *************** *** 874,880 **** myuid = getuid (); mygid = getgid (); ! (void) time (&clock); (void) strcpy (from, adrsprintf (NULLCP, NULLCP)); --- 874,880 ---- myuid = getuid (); mygid = getgid (); ! (void) time (&start_time); (void) strcpy (from, adrsprintf (NULLCP, NULLCP)); *************** *** 915,924 **** if (whomsw) break; ! fprintf (out, "Date: %s\n", dtime (&clock)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", ! getpid (), clock, LocalName ()); if (msgflags & MFRM) fprintf (out, "Sender: %s\n", from); else --- 915,924 ---- if (whomsw) break; ! fprintf (out, "Date: %s\n", dtime (&start_time)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", ! getpid (), start_time, LocalName ()); if (msgflags & MFRM) fprintf (out, "Sender: %s\n", from); else *************** *** 943,952 **** fprintf (out, "Sender: %s\n", from); #endif MMDFI ! fprintf (out, "Resent-Date: %s\n", dtime (&clock)); if (msgid) fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n", ! getpid (), clock, LocalName ()); if (msgflags & MRFM) fprintf (out, "Resent-Sender: %s\n", from); else --- 943,952 ---- fprintf (out, "Sender: %s\n", from); #endif MMDFI ! fprintf (out, "Resent-Date: %s\n", dtime (&start_time)); if (msgid) fprintf (out, "Resent-Message-ID: <%d.%ld@%s>\n", ! getpid (), start_time, LocalName ()); if (msgflags & MRFM) fprintf (out, "Resent-Sender: %s\n", from); else *************** *** 1167,1174 **** for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) ! *++pp = NULL; ! if (*cp == NULL) return; if (fccind >= FCCS) --- 1167,1174 ---- for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) ! *++pp = 0; ! if (*cp == 0) return; if (fccind >= FCCS) *************** *** 1190,1199 **** adios (bccfil, "unable to create"); (void) chmod (bccfil, 0600); ! fprintf (out, "Date: %s\n", dtime (&clock)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", ! getpid (), clock, LocalName ()); fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); --- 1190,1199 ---- adios (bccfil, "unable to create"); (void) chmod (bccfil, 0600); ! fprintf (out, "Date: %s\n", dtime (&start_time)); if (msgid) fprintf (out, "Message-ID: <%d.%ld@%s>\n", ! getpid (), start_time, LocalName ()); fprintf (out, "From: %s\n", signature); if (subject) fprintf (out, "Subject: %s", subject); *************** *** 2513,2519 **** pstat = signal (SIGPIPE, SIG_IGN); if (from) { /* no mail filtering, so... */ (void) sprintf (buffer, "From %s %.24s remote from %s\n", ! getusr (), ctime (&clock), SystemName ()); i = strlen (buffer); if (fwrite (buffer, sizeof *buffer, i, fp) != i) goto oops; --- 2513,2519 ---- pstat = signal (SIGPIPE, SIG_IGN); if (from) { /* no mail filtering, so... */ (void) sprintf (buffer, "From %s %.24s remote from %s\n", ! getusr (), ctime (&start_time), SystemName ()); i = strlen (buffer); if (fwrite (buffer, sizeof *buffer, i, fp) != i) goto oops; *************** *** 2599,2605 **** register struct mailname *lp; naddrs = 0; ! if (nm_init (getusr (), &clock) == NOTOK) { for (lp = netaddrs.m_next; lp; lp = lp -> m_next) if (lp -> m_bcc ? bccque : !bccque) fprintf (stderr, " %s at %s: unable to get queue file\n", --- 2599,2605 ---- register struct mailname *lp; naddrs = 0; ! if (nm_init (getusr (), &start_time) == NOTOK) { for (lp = netaddrs.m_next; lp; lp = lp -> m_next) if (lp -> m_bcc ? bccque : !bccque) fprintf (stderr, " %s at %s: unable to get queue file\n", diff -cr mh-6.7/uip/prompter.c /achates/u1/mh-6.7/uip/prompter.c *** mh-6.7/uip/prompter.c Fri Dec 14 16:26:08 1990 --- /achates/u1/mh-6.7/uip/prompter.c Tue Jun 11 23:07:12 1991 *************** *** 60,66 **** #define HELPSW 10 "help", 4, ! NULL, NULL }; /* */ --- 60,66 ---- #define HELPSW 10 "help", 4, ! NULL, 0 }; /* */ *************** *** 247,253 **** for (cp = field; *cp; cp++) if (*cp != ' ' && *cp != '\t') break; ! if (*cp++ != '\n' || *cp != NULL) { printf ("%s:%s", name, field); fprintf (out, "%s:%s", name, field); while (state == FLDPLUS) { --- 247,253 ---- for (cp = field; *cp; cp++) if (*cp != ' ' && *cp != '\t') break; ! if (*cp++ != '\n' || *cp != 0) { printf ("%s:%s", name, field); fprintf (out, "%s:%s", name, field); while (state == FLDPLUS) { *************** *** 272,278 **** (void) unlink (tmpfil); done (1); } ! if (i != 0 || (field[0] != '\n' && field[0] != NULL)) { fprintf (out, "%s:", name); do { if (field[0] != ' ' && field[0] != '\t') --- 272,278 ---- (void) unlink (tmpfil); done (1); } ! if (i != 0 || (field[0] != '\n' && field[0] != 0)) { fprintf (out, "%s:", name); do { if (field[0] != ' ' && field[0] != '\t') *************** *** 299,305 **** if (!body) break; fprintf (out, "--------\n"); ! if (field[0] == NULL || !prepend) printf ("--------\n"); if (field[0]) { if (prepend && body) { --- 299,305 ---- if (!body) break; fprintf (out, "--------\n"); ! if (field[0] == 0 || !prepend) printf ("--------\n"); if (field[0]) { if (prepend && body) { *************** *** 309,315 **** (void) getln (buffer, sizeof buffer); if (doteof && buffer[0] == '.' && buffer[1] == '\n') break; ! if (buffer[0] == NULL) break; fprintf (out, "%s", buffer); } --- 309,315 ---- (void) getln (buffer, sizeof buffer); if (doteof && buffer[0] == '.' && buffer[1] == '\n') break; ! if (buffer[0] == 0) break; fprintf (out, "%s", buffer); } *************** *** 332,338 **** (void) getln (field, sizeof field); if (doteof && field[0] == '.' && field[1] == '\n') break; ! if (field[0] == NULL) break; fprintf (out, "%s", field); } --- 332,338 ---- (void) getln (field, sizeof field); if (doteof && field[0] == '.' && field[1] == '\n') break; ! if (field[0] == 0) break; fprintf (out, "%s", field); } *************** *** 386,392 **** char *cp; cp = buffer; ! *cp = NULL; #ifndef BSD42 wtuser = 1; --- 386,392 ---- char *cp; cp = buffer; ! *cp = 0; #ifndef BSD42 wtuser = 1; *************** *** 424,430 **** return 1; } *cp++ = c; ! *cp = NULL; wtuser = 0; return 0; --- 424,430 ---- return 1; } *cp++ = c; ! *cp = 0; wtuser = 0; return 0; *************** *** 431,437 **** default: if (cp < buffer + n) *cp++ = c; ! *cp = NULL; } } --- 431,437 ---- default: if (cp < buffer + n) *cp++ = c; ! *cp = 0; } } diff -cr mh-6.7/uip/rcvdist.c /achates/u1/mh-6.7/uip/rcvdist.c *** mh-6.7/uip/rcvdist.c Fri Dec 14 16:26:08 1990 --- /achates/u1/mh-6.7/uip/rcvdist.c Tue Jun 11 23:43:20 1991 *************** *** 18,24 **** #define HELPSW 1 "help", 4, ! NULL, NULL }; /* */ --- 18,24 ---- #define HELPSW 1 "help", 4, ! NULL, 0 }; /* */ *************** *** 229,235 **** i = strlen (cp = cptr -> c_text) - 1; if (cp[i] == '\n') if (cptr -> c_type & CT_ADDR) { ! cp[i] = NULL; cp = add (",\n\t", cp); } else --- 229,235 ---- i = strlen (cp = cptr -> c_text) - 1; if (cp[i] == '\n') if (cptr -> c_type & CT_ADDR) { ! cp[i] = 0; cp = add (",\n\t", cp); } else diff -cr mh-6.7/uip/rcvpack.c /achates/u1/mh-6.7/uip/rcvpack.c *** mh-6.7/uip/rcvpack.c Fri Dec 14 16:26:08 1990 --- /achates/u1/mh-6.7/uip/rcvpack.c Tue Jun 11 23:45:17 1991 *************** *** 12,18 **** #define HELPSW 0 "help", 4, ! NULL, NULL }; /* */ --- 12,18 ---- #define HELPSW 0 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/rcvstore.c /achates/u1/mh-6.7/uip/rcvstore.c *** mh-6.7/uip/rcvstore.c Fri Dec 14 16:26:09 1990 --- /achates/u1/mh-6.7/uip/rcvstore.c Tue Jun 11 23:08:12 1991 *************** *** 35,41 **** #define HELPSW 7 "help", 4, ! NULL, NULL }; /* */ --- 35,41 ---- #define HELPSW 7 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/rcvtty.c /achates/u1/mh-6.7/uip/rcvtty.c *** mh-6.7/uip/rcvtty.c Fri Dec 14 16:26:09 1990 --- /achates/u1/mh-6.7/uip/rcvtty.c Tue Jun 11 23:46:26 1991 *************** *** 43,49 **** #define NBELSW 7 "nobell", 0, ! NULL, NULL }; /* */ --- 43,49 ---- #define NBELSW 7 "nobell", 0, ! NULL, 0 }; /* */ *************** *** 155,161 **** if ((uf = fopen ("/etc/utmp", "r")) == NULL) exit (RCV_MBX); while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) ! if (ut.ut_name[0] != NULL && strncmp (user, ut.ut_name, sizeof ut.ut_name) == 0) { (void) strncpy (tty, ut.ut_line, sizeof ut.ut_line); alert (tty, md); --- 155,161 ---- if ((uf = fopen ("/etc/utmp", "r")) == NULL) exit (RCV_MBX); while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) ! if (ut.ut_name[0] != 0 && strncmp (user, ut.ut_name, sizeof ut.ut_name) == 0) { (void) strncpy (tty, ut.ut_line, sizeof ut.ut_line); alert (tty, md); diff -cr mh-6.7/uip/refile.c /achates/u1/mh-6.7/uip/refile.c *** mh-6.7/uip/refile.c Fri Dec 14 16:26:09 1990 --- /achates/u1/mh-6.7/uip/refile.c Tue Jun 11 23:08:30 1991 *************** *** 34,40 **** #define HELPSW 7 "help", 4, ! NULL, NULL }; /* */ --- 34,40 ---- #define HELPSW 7 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/repl.c /achates/u1/mh-6.7/uip/repl.c *** mh-6.7/uip/repl.c Fri Dec 14 16:26:09 1990 --- /achates/u1/mh-6.7/uip/repl.c Tue Jun 11 23:09:38 1991 *************** *** 75,81 **** "build", -5, /* interface from mhe */ #endif MHE ! NULL, NULL }; --- 75,81 ---- "build", -5, /* interface from mhe */ #endif MHE ! NULL, 0 }; *************** *** 89,95 **** #define CALSW 3 "all", 0, ! NULL, NULL }; /* */ --- 89,95 ---- #define CALSW 3 "all", 0, ! NULL, 0 }; /* */ *************** *** 106,112 **** #define NEWSW 4 "new", 0, ! NULL, NULL }; --- 106,112 ---- #define NEWSW 4 "new", 0, ! NULL, 0 }; *************** *** 116,122 **** "list", 0, "refile +folder", 0, ! NULL, NULL }; /* */ --- 116,122 ---- "list", 0, "refile +folder", 0, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/rmm.c /achates/u1/mh-6.7/uip/rmm.c *** mh-6.7/uip/rmm.c Fri Dec 14 16:26:10 1990 --- /achates/u1/mh-6.7/uip/rmm.c Tue Jun 11 23:11:23 1991 *************** *** 9,15 **** #define HELPSW 0 "help", 4, ! NULL, NULL }; /* */ --- 9,15 ---- #define HELPSW 0 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/scan.c /achates/u1/mh-6.7/uip/scan.c *** mh-6.7/uip/scan.c Fri Dec 14 16:26:10 1990 --- /achates/u1/mh-6.7/uip/scan.c Tue Jun 11 23:12:06 1991 *************** *** 42,48 **** #define HELPSW 10 "help", 4, ! NULL, NULL }; /* */ --- 42,48 ---- #define HELPSW 10 "help", 4, ! NULL, 0 }; /* */ diff -cr mh-6.7/uip/scansbr.c /achates/u1/mh-6.7/uip/scansbr.c *** mh-6.7/uip/scansbr.c Fri Dec 14 16:26:10 1990 --- /achates/u1/mh-6.7/uip/scansbr.c Tue Jun 11 22:23:48 1991 *************** *** 175,181 **** for (cp = tmpbuf + strlen (tmpbuf) - 1; cp >= tmpbuf; cp--) if (isspace (*cp)) ! *cp = NULL; else break; *--savecomp = cptr; --- 175,181 ---- for (cp = tmpbuf + strlen (tmpbuf) - 1; cp >= tmpbuf; cp--) if (isspace (*cp)) ! *cp = 0; else break; *--savecomp = cptr; diff -cr mh-6.7/uip/send.c /achates/u1/mh-6.7/uip/send.c *** mh-6.7/uip/send.c Fri Dec 14 16:26:10 1990 --- /achates/u1/mh-6.7/uip/send.c Tue Jun 11 23:16:26 1991 *************** *** 102,108 **** #define SNOOPSW 32 "snoop", -5, ! NULL, NULL }; static struct swit anyl[] = { --- 102,108 ---- #define SNOOPSW 32 "snoop", -5, ! NULL, 0 }; static struct swit anyl[] = { *************** *** 113,119 **** #define LISTDSW 2 "list", 0, ! NULL, NULL }; /* */ --- 113,119 ---- #define LISTDSW 2 "list", 0, ! NULL, 0 }; /* */ *************** *** 345,359 **** /* */ #ifdef TMA ! if ((cp = getenv ("KDS")) == NULL || *cp == NULL) if ((cp = m_find ("kdsproc")) && *cp) (void) putenv ("KDS", cp); ! if ((cp = getenv ("TMADB")) == NULL || *cp == NULL) if ((cp = m_find ("tmadb")) && *cp) (void) putenv ("TMADB", m_maildir (cp)); #endif TMA ! if ((cp = getenv ("SIGNATURE")) == NULL || *cp == NULL) if ((cp = m_find ("signature")) && *cp) (void) putenv ("SIGNATURE", cp); #ifdef UCI --- 345,359 ---- /* */ #ifdef TMA ! if ((cp = getenv ("KDS")) == NULL || *cp == 0) if ((cp = m_find ("kdsproc")) && *cp) (void) putenv ("KDS", cp); ! if ((cp = getenv ("TMADB")) == NULL || *cp == 0) if ((cp = m_find ("tmadb")) && *cp) (void) putenv ("TMADB", m_maildir (cp)); #endif TMA ! if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = m_find ("signature")) && *cp) (void) putenv ("SIGNATURE", cp); #ifdef UCI *************** *** 363,369 **** && fgets (buf, sizeof buf, fp) != NULL) { (void) fclose (fp); if (cp = index (buf, '\n')) ! *cp = NULL; (void) putenv ("SIGNATURE", buf); } } --- 363,369 ---- && fgets (buf, sizeof buf, fp) != NULL) { (void) fclose (fp); if (cp = index (buf, '\n')) ! *cp = 0; (void) putenv ("SIGNATURE", buf); } } *************** *** 373,384 **** if (stat (msgs[msgnum], &st) == NOTOK) adios (msgs[msgnum], "unable to stat draft file"); ! if ((annotext = getenv ("mhannotate")) == NULL || *annotext == NULL) annotext = NULL; if (annotext ! && ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == NULL)) altmsg = NULL; ! if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != NULL)) inplace = atoi (cp); if ((cp = getenv ("mhdist")) --- 373,384 ---- if (stat (msgs[msgnum], &st) == NOTOK) adios (msgs[msgnum], "unable to stat draft file"); ! if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; if (annotext ! && ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == 0)) altmsg = NULL; ! if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != 0)) inplace = atoi (cp); if ((cp = getenv ("mhdist")) diff -cr mh-6.7/uip/sendsbr.c /achates/u1/mh-6.7/uip/sendsbr.c *** mh-6.7/uip/sendsbr.c Fri Dec 14 16:26:11 1990 --- /achates/u1/mh-6.7/uip/sendsbr.c Tue Jun 11 22:18:56 1991 *************** *** 290,296 **** FILE *fp; struct msgs *mp; ! if ((folder = getenv ("mhfolder")) == NULL || *folder == NULL) { if (debugsw) admonish (NULLCP, "$mhfolder not set"); return; --- 290,296 ---- FILE *fp; struct msgs *mp; ! if ((folder = getenv ("mhfolder")) == NULL || *folder == 0) { if (debugsw) admonish (NULLCP, "$mhfolder not set"); return; *************** *** 312,318 **** goto oops; } ! if ((cp = getenv ("mhmessages")) == NULL || *cp == NULL) { if (debugsw) admonish (NULLCP, "$mhmessages not set"); goto oops; --- 312,318 ---- goto oops; } ! if ((cp = getenv ("mhmessages")) == NULL || *cp == 0) { if (debugsw) admonish (NULLCP, "$mhmessages not set"); goto oops; diff -cr mh-6.7/uip/show.c /achates/u1/mh-6.7/uip/show.c *** mh-6.7/uip/show.c Fri Dec 14 16:26:11 1990 --- /achates/u1/mh-6.7/uip/show.c Tue Jun 11 23:03:50 1991 *************** *** 39,45 **** #define HELPSW 11 "help", 4, ! NULL, NULL }; --- 39,45 ---- #define HELPSW 11 "help", 4, ! NULL, 0 }; diff -cr mh-6.7/uip/slocal.c /achates/u1/mh-6.7/uip/slocal.c *** mh-6.7/uip/slocal.c Fri Dec 14 16:26:11 1990 --- /achates/u1/mh-6.7/uip/slocal.c Tue Jun 11 23:51:03 1991 *************** *** 71,77 **** #define HELPSW 10 "help", 4, ! NULL, NULL }; /* */ --- 71,77 ---- #define HELPSW 10 "help", 4, ! NULL, 0 }; /* */ *************** *** 305,311 **** else fd = fileno (stdin); ! from[0] = NULL; if (sender == NULL) copyinfo (fp, from); --- 305,311 ---- else fd = fileno (stdin); ! from[0] = 0; if (sender == NULL) copyinfo (fp, from); *************** *** 407,413 **** if (*buffer == '#') continue; if (cp = index (buffer, '\n')) ! *cp = NULL; if ((vecp = split (buffer, vec)) < 5) continue; if (debug) --- 407,413 ---- if (*buffer == '#') continue; if (cp = index (buffer, '\n')) ! *cp = 0; if ((vecp = split (buffer, vec)) < 5) continue; if (debug) *************** *** 542,553 **** for (i = 0, s = cp; i <= NVEC;) { vec[i] = NULL; while (isspace (*s) || *s == ',') ! *s++ = NULL; ! if (*s == NULL) break; if (*s == '"') { ! for (vec[i++] = ++s; *s != NULL && *s != '"'; s++) if (*s == QUOTE) { if (*++s == '"') (void) strcpy (s - 1, s); --- 542,553 ---- for (i = 0, s = cp; i <= NVEC;) { vec[i] = NULL; while (isspace (*s) || *s == ',') ! *s++ = 0; ! if (*s == 0) break; if (*s == '"') { ! for (vec[i++] = ++s; *s != 0 && *s != '"'; s++) if (*s == QUOTE) { if (*++s == '"') (void) strcpy (s - 1, s); *************** *** 554,560 **** s--; } if (*s == '"') ! *s++ = NULL; continue; } if (*s == QUOTE && *++s != '"') --- 554,560 ---- s--; } if (*s == '"') ! *s++ = 0; continue; } if (*s == QUOTE && *++s != '"') *************** *** 561,567 **** s--; vec[i++] = s++; ! while (*s != NULL && !isspace (*s) && *s != ',') s++; } vec[i] = NULL; --- 561,567 ---- s--; vec[i++] = s++; ! while (*s != 0 && !isspace (*s) && *s != ',') s++; } vec[i] = NULL; *************** *** 619,625 **** if (p -> p_flags & P_ADR) { dp = cp + strlen (cp) - 1; if (*dp == '\n') ! *dp = NULL; cp = add (",\n\t", cp); } else --- 619,625 ---- if (p -> p_flags & P_ADR) { dp = cp + strlen (cp) - 1; if (*dp == '\n') ! *dp = 0; cp = add (",\n\t", cp); } else *************** *** 703,709 **** s2 = --cp; continue; } ! *s2++ = NULL; if (p = lookup (vars, cp)) { if (!parsed && (p -> p_flags & P_CHK)) (void) parse (fd); --- 703,709 ---- s2 = --cp; continue; } ! *s2++ = 0; if (p = lookup (vars, cp)) { if (!parsed && (p -> p_flags & P_CHK)) (void) parse (fd); *************** *** 712,718 **** s1 += strlen (s1); } } ! *s1 = NULL; } /* */ --- 712,718 ---- s1 += strlen (s1); } } ! *s1 = 0; } /* */ *************** *** 773,779 **** return NOTOK; while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) ! if (ut.ut_name[0] != NULL && strncmp (user, ut.ut_name, sizeof ut.ut_name) == 0) { if (debug) continue; --- 773,779 ---- return NOTOK; while (fread ((char *) &ut, sizeof ut, 1, uf) == 1) ! if (ut.ut_name[0] != 0 && strncmp (user, ut.ut_name, sizeof ut.ut_name) == 0) { if (debug) continue; *************** *** 1042,1054 **** if (strncmp (from, "From ", i = strlen ("From "))) { rewind (fp); ! *from = NULL; return; } (void) strcpy (buffer, from + i); if (cp = index (buffer, '\n')) { ! *cp = NULL; cp -= 24; if (cp < buffer) cp = buffer; --- 1042,1054 ---- if (strncmp (from, "From ", i = strlen ("From "))) { rewind (fp); ! *from = 0; return; } (void) strcpy (buffer, from + i); if (cp = index (buffer, '\n')) { ! *cp = 0; cp -= 24; if (cp < buffer) cp = buffer; *************** *** 1055,1065 **** } else cp = buffer; ! *cp = NULL; for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (isspace (*cp)) ! *cp = NULL; else break; sender = buffer; --- 1055,1065 ---- } else cp = buffer; ! *cp = 0; for (cp = buffer + strlen (buffer) - 1; cp >= buffer; cp--) if (isspace (*cp)) ! *cp = 0; else break; sender = buffer; diff -cr mh-6.7/uip/sortm.c /achates/u1/mh-6.7/uip/sortm.c *** mh-6.7/uip/sortm.c Fri Dec 14 16:26:11 1990 --- /achates/u1/mh-6.7/uip/sortm.c Thu Jun 13 04:58:49 1991 *************** *** 6,12 **** --- 6,14 ---- #include "../h/mh.h" #include "../zotnet/tws.h" + #define getws _getws #include + #undef getws #include #include #include *************** *** 35,41 **** #define HELPSW 8 "help", 4, ! NULL, NULL }; struct smsg { --- 37,43 ---- #define HELPSW 8 "help", 4, ! NULL, 0 }; struct smsg { *************** *** 52,58 **** int submajor = 0; /* if true, sort on subject-major */ int verbose; ! static getws(); static int dsort(), read_hdrs (), subsort(), txtsort(); static void rename_chain(), rename_msgs(); --- 54,65 ---- int submajor = 0; /* if true, sort on subject-major */ int verbose; ! #ifdef __STDC__ ! static int getws (char *datesw, int msg, struct smsg *smsg); ! #else ! static int getws (); ! #endif ! static int dsort(), read_hdrs (), subsort(), txtsort(); static void rename_chain(), rename_msgs(); diff -cr mh-6.7/uip/spost.c /achates/u1/mh-6.7/uip/spost.c *** mh-6.7/uip/spost.c Fri Dec 14 16:26:12 1990 --- /achates/u1/mh-6.7/uip/spost.c Tue Jun 11 23:48:02 1991 *************** *** 97,103 **** #define ANNOSW 24 "idanno number", -6, ! NULL, NULL }; /* */ --- 97,103 ---- #define ANNOSW 24 "idanno number", -6, ! NULL, 0 }; /* */ *************** *** 130,164 **** /* */ static struct headers NHeaders[] = { ! "Return-Path", HBAD, NULL, ! "Received", HBAD, NULL, ! "Reply-To", HADR | HNGR, NULL, "From", HADR | HNGR, MFRM, ! "Sender", HADR | HBAD, NULL, "Date", HNOP, MDAT, ! "Subject", HSUB, NULL, "To", HADR | HTRY, MVIS, "cc", HADR | HTRY, MVIS, "Bcc", HADR | HTRY | HBCC | HNIL, MINV, ! "Message-Id", HBAD, NULL, ! "Fcc", HFCC, NULL, NULL }; static struct headers RHeaders[] = { ! "Resent-Reply-To", HADR | HNGR, NULL, "Resent-From", HADR | HNGR, MRFM, ! "Resent-Sender", HADR | HBAD, NULL, "Resent-Date", HNOP, MRDT, ! "Resent-Subject", HSUB, NULL, "Resent-To", HADR | HTRY, MVIS, "Resent-cc", HADR | HTRY, MVIS, "Resent-Bcc", HADR | HTRY | HBCC, MINV, ! "Resent-Message-Id", HBAD, NULL, ! "Resent-Fcc", HFCC, NULL, ! "Reply-To", HADR, NULL, ! "Fcc", HIGN, NULL, NULL }; --- 130,164 ---- /* */ static struct headers NHeaders[] = { ! "Return-Path", HBAD, 0, ! "Received", HBAD, 0, ! "Reply-To", HADR | HNGR, 0, "From", HADR | HNGR, MFRM, ! "Sender", HADR | HBAD, 0, "Date", HNOP, MDAT, ! "Subject", HSUB, 0, "To", HADR | HTRY, MVIS, "cc", HADR | HTRY, MVIS, "Bcc", HADR | HTRY | HBCC | HNIL, MINV, ! "Message-Id", HBAD, 0, ! "Fcc", HFCC, 0, NULL }; static struct headers RHeaders[] = { ! "Resent-Reply-To", HADR | HNGR, 0, "Resent-From", HADR | HNGR, MRFM, ! "Resent-Sender", HADR | HBAD, 0, "Resent-Date", HNOP, MRDT, ! "Resent-Subject", HSUB, 0, "Resent-To", HADR | HTRY, MVIS, "Resent-cc", HADR | HTRY, MVIS, "Resent-Bcc", HADR | HTRY | HBCC, MINV, ! "Resent-Message-Id", HBAD, 0, ! "Resent-Fcc", HFCC, 0, ! "Reply-To", HADR, 0, ! "Fcc", HIGN, 0, NULL }; *************** *** 501,509 **** if (hdr -> flags & HFCC) { if (cp = rindex (str, '\n')) ! *cp = NULL; for (cp = pp = str; cp = index (pp, ','); pp = cp) { ! *cp++ = NULL; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); --- 501,509 ---- if (hdr -> flags & HFCC) { if (cp = rindex (str, '\n')) ! *cp = 0; for (cp = pp = str; cp = index (pp, ','); pp = cp) { ! *cp++ = 0; insert_fcc (hdr, pp); } insert_fcc (hdr, pp); *************** *** 715,722 **** for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) ! *++pp = NULL; ! if (*cp == NULL) return; if (fccind >= FCCS) --- 715,722 ---- for (pp += strlen (pp) - 1; pp > cp && isspace (*pp); pp--) continue; if (pp >= cp) ! *++pp = 0; ! if (*cp == 0) return; if (fccind >= FCCS) diff -cr mh-6.7/uip/vmh.c /achates/u1/mh-6.7/uip/vmh.c *** mh-6.7/uip/vmh.c Fri Dec 14 16:26:13 1990 --- /achates/u1/mh-6.7/uip/vmh.c Tue Jun 11 23:19:08 1991 *************** *** 74,80 **** #define HELPSW 3 "help", 4, ! NULL, NULL }; /* */ --- 74,80 ---- #define HELPSW 3 "help", 4, ! NULL, 0 }; /* */ *************** *** 696,702 **** register char *bp; bp = buffer; ! *bp = NULL; for (;;) { switch (c = toascii (wgetch (w))) { --- 696,702 ---- register char *bp; bp = buffer; ! *bp = 0; for (;;) { switch (c = toascii (wgetch (w))) { *************** *** 709,715 **** case '\r': case '\n': ! *bp = NULL; if (bp > buffer) { leaveok (curscr, FALSE); wmove (w, 0, w -> _curx - (bp - buffer)); --- 709,715 ---- case '\r': case '\n': ! *bp = 0; if (bp > buffer) { leaveok (curscr, FALSE); wmove (w, 0, w -> _curx - (bp - buffer)); *************** *** 725,731 **** wprintw (w, "Interrupt"); wstandend (w); wrefresh (w); ! *buffer = NULL; return NOTOK; } if (c == EOFC) { --- 725,731 ---- wprintw (w, "Interrupt"); wstandend (w); wrefresh (w); ! *buffer = 0; return NOTOK; } if (c == EOFC) { *************** *** 1105,1111 **** lp -> l_buf = getcpy (w -> _y[w -> _cury]); for (cp = lp -> l_buf + strlen (lp -> l_buf) - 1; cp >= lp -> l_buf; cp--) if (isspace (*cp)) ! *cp = NULL; else break; --- 1105,1111 ---- lp -> l_buf = getcpy (w -> _y[w -> _cury]); for (cp = lp -> l_buf + strlen (lp -> l_buf) - 1; cp >= lp -> l_buf; cp--) if (isspace (*cp)) ! *cp = 0; else break; diff -cr mh-6.7/uip/vmhsbr.c /achates/u1/mh-6.7/uip/vmhsbr.c *** mh-6.7/uip/vmhsbr.c Fri Dec 14 16:26:13 1990 --- /achates/u1/mh-6.7/uip/vmhsbr.c Tue Jun 11 22:55:44 1991 *************** *** 42,53 **** PEERrfd = rfd; PEERwfd = wfd; ! if ((cp = getenv ("MHVDEBUG")) ! && *cp ! && (fp = fopen (sprintf (buffer, "%s.out", invo_name), "w"))) { ! (void) fseek (fp, 0L, 2); ! fprintf (fp, "%d: rcinit (%d, %d)\n", getpid (), rfd, wfd); ! (void) fflush (fp); } return OK; --- 42,54 ---- PEERrfd = rfd; PEERwfd = wfd; ! if ((cp = getenv ("MHVDEBUG")) && *cp) { ! sprintf (buffer, "%s.out", invo_name); ! if (fp = fopen (buffer, "w")) { ! (void) fseek (fp, 0L, 2); ! fprintf (fp, "%d: rcinit (%d, %d)\n", getpid (), rfd, wfd); ! (void) fflush (fp); ! } } return OK; *************** *** 105,111 **** return rclose (rc, "malloc of %d lost", rc -> rc_len); if (read (PEERrfd, rc -> rc_data, rc -> rc_len) != rc -> rc_len) return rclose (rc, "read from peer lost(2)"); ! rc -> rc_data[rc -> rc_len] = NULL; } else rc -> rc_data = NULL; --- 106,112 ---- return rclose (rc, "malloc of %d lost", rc -> rc_len); if (read (PEERrfd, rc -> rc_data, rc -> rc_len) != rc -> rc_len) return rclose (rc, "read from peer lost(2)"); ! rc -> rc_data[rc -> rc_len] = 0; } else rc -> rc_data = NULL; diff -cr mh-6.7/uip/whatnowsbr.c /achates/u1/mh-6.7/uip/whatnowsbr.c *** mh-6.7/uip/whatnowsbr.c Fri Dec 14 16:26:14 1990 --- /achates/u1/mh-6.7/uip/whatnowsbr.c Tue Jun 11 22:17:54 1991 *************** *** 31,37 **** #define HELPSW 6 "help", 4, ! NULL, NULL }; /* */ --- 31,37 ---- #define HELPSW 6 "help", 4, ! NULL, 0 }; /* */ *************** *** 54,60 **** #define WHOMSW 7 "whom []", 0, ! NULL, NULL }; /* */ --- 54,60 ---- #define WHOMSW 7 "whom []", 0, ! NULL, 0 }; /* */ *************** *** 151,160 **** /* */ ! if (drft == NULL && (drft = getenv ("mhdraft")) == NULL || *drft == NULL) drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULLCP; ! if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == NULL)) ed = NULL, nedit++; if ((cp = getenv ("mhuse")) && *cp) use = atoi (cp); --- 151,160 ---- /* */ ! if (drft == NULL && (drft = getenv ("mhdraft")) == NULL || *drft == 0) drft = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msgnam = (cp = getenv ("mhaltmsg")) && *cp ? getcpy (cp) : NULLCP; ! if (ed == NULL && ((ed = getenv ("mheditor")) == NULL || *ed == 0)) ed = NULL, nedit++; if ((cp = getenv ("mhuse")) && *cp) use = atoi (cp); *************** *** 564,570 **** #define SNDRFSW 31 "nodraftfolder", -3, ! NULL, NULL }; /* */ --- 564,570 ---- #define SNDRFSW 31 "nodraftfolder", -3, ! NULL, 0 }; /* */ *************** *** 717,723 **** (void) putenv ("TMADB", m_maildir (cp)); #endif TMA ! if ((cp = getenv ("SIGNATURE")) == NULL || *cp == NULL) if ((cp = m_find ("signature")) && *cp) (void) putenv ("SIGNATURE", cp); #ifdef UCI --- 717,723 ---- (void) putenv ("TMADB", m_maildir (cp)); #endif TMA ! if ((cp = getenv ("SIGNATURE")) == NULL || *cp == 0) if ((cp = m_find ("signature")) && *cp) (void) putenv ("SIGNATURE", cp); #ifdef UCI *************** *** 727,743 **** && fgets (buf, sizeof buf, fp) != NULL) { (void) fclose (fp); if (cp = index (buf, '\n')) ! *cp = NULL; (void) putenv ("SIGNATURE", buf); } } #endif UCI ! if ((annotext = getenv ("mhannotate")) == NULL || *annotext == NULL) annotext = NULL; ! if ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == NULL) altmsg = NULL; ! if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != NULL)) inplace = atoi (cp); if ((cp = getenv ("mhdist")) --- 727,743 ---- && fgets (buf, sizeof buf, fp) != NULL) { (void) fclose (fp); if (cp = index (buf, '\n')) ! *cp = 0; (void) putenv ("SIGNATURE", buf); } } #endif UCI ! if ((annotext = getenv ("mhannotate")) == NULL || *annotext == 0) annotext = NULL; ! if ((altmsg = getenv ("mhaltmsg")) == NULL || *altmsg == 0) altmsg = NULL; ! if (annotext && ((cp = getenv ("mhinplace")) != NULL && *cp != 0)) inplace = atoi (cp); if ((cp = getenv ("mhdist")) diff -cr mh-6.7/uip/whom.c /achates/u1/mh-6.7/uip/whom.c *** mh-6.7/uip/whom.c Fri Dec 14 16:26:14 1990 --- /achates/u1/mh-6.7/uip/whom.c Tue Jun 11 23:21:19 1991 *************** *** 41,47 **** #define FILLSW 11 "fill-in file", -7, ! NULL, NULL }; /* */ --- 41,47 ---- #define FILLSW 11 "fill-in file", -7, ! NULL, 0 }; /* */ *************** *** 152,158 **** if (msg == NULL) { #ifdef WHATNOW ! if ((cp = getenv ("mhdraft")) == NULL || *cp == NULL) #endif WHATNOW cp = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msg = vec[vecp++] = cp; --- 152,158 ---- if (msg == NULL) { #ifdef WHATNOW ! if ((cp = getenv ("mhdraft")) == NULL || *cp == 0) #endif WHATNOW cp = getcpy (m_draft (dfolder, dmsg, 1, &isdf)); msg = vec[vecp++] = cp; diff -cr mh-6.7/zotnet/bboards/getbbent.c /achates/u1/mh-6.7/zotnet/bboards/getbbent.c *** mh-6.7/zotnet/bboards/getbbent.c Fri Dec 14 16:26:15 1990 --- /achates/u1/mh-6.7/zotnet/bboards/getbbent.c Tue Jun 11 22:07:07 1991 *************** *** 243,249 **** if ((p = fgets (line, sizeof line, BBfile)) == NULL) return NULL; ! for (q = p, count = 0; *q != NULL && *q != NEWLINE; q++) if (*q == COLON) count++; --- 243,249 ---- if ((p = fgets (line, sizeof line, BBfile)) == NULL) return NULL; ! for (q = p, count = 0; *q != 0 && *q != NEWLINE; q++) if (*q == COLON) count++; *************** *** 250,256 **** if (count != NCOLON) { #ifdef MMDFONLY if (q = index (p, NEWLINE)) ! *q = NULL; ll_log (logptr, LLOGTMP, "bad entry in %s: %s", BBData, p); #endif MMDFONLY goto retry; --- 250,256 ---- if (count != NCOLON) { #ifdef MMDFONLY if (q = index (p, NEWLINE)) ! *q = 0; ll_log (logptr, LLOGTMP, "bad entry in %s: %s", BBData, p); #endif MMDFONLY goto retry; *************** *** 274,286 **** *s++ = q; q = bbskip (q, COMMA); } ! *s = NULL; s = bb -> bb_leader = BBLeaders; ! if (*r == NULL) { if (!(BBflags & SB_FAST)) { *s++ = BBName; ! *s = NULL; } } else { --- 274,286 ---- *s++ = q; q = bbskip (q, COMMA); } ! *s = 0; s = bb -> bb_leader = BBLeaders; ! if (*r == 0) { if (!(BBflags & SB_FAST)) { *s++ = BBName; ! *s = 0; } } else { *************** *** 288,294 **** *s++ = r; r = bbskip (r, COMMA); } ! *s = NULL; } s = bb -> bb_dist = BBDists; --- 288,294 ---- *s++ = r; r = bbskip (r, COMMA); } ! *s = 0; } s = bb -> bb_dist = BBDists; *************** *** 296,302 **** *s++ = d; d = bbskip (d, COMMA); } ! *s = NULL; if (*f) (void) sscanf (f, "%o", &bb -> bb_flags); --- 296,302 ---- *s++ = d; d = bbskip (d, COMMA); } ! *s = 0; if (*f) (void) sscanf (f, "%o", &bb -> bb_flags); *************** *** 401,407 **** p = index (bb -> bb_request, '@'); r = index (bb -> bb_addr, '@'); ! BBRequest[0] = NULL; if (*bb -> bb_request == '-') if (p == NULL && r && *r == '@') --- 401,407 ---- p = index (bb -> bb_request, '@'); r = index (bb -> bb_addr, '@'); ! BBRequest[0] = 0; if (*bb -> bb_request == '-') if (p == NULL && r && *r == '@') *************** *** 417,423 **** if (BBRequest[0]) bb -> bb_request = BBRequest; else ! if (*bb -> bb_request == NULL) bb -> bb_request = *bb -> bb_addr ? bb -> bb_addr : bb -> bb_leader[0]; --- 417,423 ---- if (BBRequest[0]) bb -> bb_request = BBRequest; else ! if (*bb -> bb_request == 0) bb -> bb_request = *bb -> bb_addr ? bb -> bb_addr : bb -> bb_leader[0]; *************** *** 426,435 **** bb -> bb_addr = BBAddr; } else ! if (*bb -> bb_addr == NULL) bb -> bb_addr = bb -> bb_name; ! if (*bb -> bb_file == NULL) return; if (*bb -> bb_file != '/') { (void) sprintf (BBFile, "%s/%s", BBDir, bb -> bb_file); --- 426,435 ---- bb -> bb_addr = BBAddr; } else ! if (*bb -> bb_addr == 0) bb -> bb_addr = bb -> bb_name; ! if (*bb -> bb_file == 0) return; if (*bb -> bb_file != '/') { (void) sprintf (BBFile, "%s/%s", BBDir, bb -> bb_file); *************** *** 436,442 **** bb -> bb_file = BBFile; } ! if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == NULL) (void) strcpy (prf, ""), cp = bb -> bb_file; else (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file); --- 436,442 ---- bb -> bb_file = BBFile; } ! if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == 0) (void) strcpy (prf, ""), cp = bb -> bb_file; else (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file); *************** *** 458,464 **** if (!feof (info) && fgets (line, sizeof line, info)) { (void) strcpy (BBDate, line); if (cp = index (BBDate, NEWLINE)) ! *cp = NULL; bb -> bb_date = BBDate; } --- 458,464 ---- if (!feof (info) && fgets (line, sizeof line, info)) { (void) strcpy (BBDate, line); if (cp = index (BBDate, NEWLINE)) ! *cp = 0; bb -> bb_date = BBDate; } *************** *** 484,490 **** if (BBuid == -1 && !setbbaux (BBOARDS, BBDB)) return 0; ! if (username[0] == NULL) { if ((pw = getpwuid (uid = getuid ())) == NULL) return 0; gid = getgid (); --- 484,490 ---- if (BBuid == -1 && !setbbaux (BBOARDS, BBDB)) return 0; ! if (username[0] == 0) { if ((pw = getpwuid (uid = getuid ())) == NULL) return 0; gid = getgid (); *************** *** 521,527 **** if (b == NULL) return 0; ! if (*b -> bb_passwd == NULL) return 1; if (strcmp (b -> bb_passwd, --- 521,527 ---- if (b == NULL) return 0; ! if (*b -> bb_passwd == 0) return 1; if (strcmp (b -> bb_passwd, *************** *** 608,614 **** register int result; register char **dp; ! BBErrors[0] = NULL; for (dp = bb -> bb_dist; *dp; dp++) if (result = getbbitem (bb, *dp, action)) return result; --- 608,614 ---- register int result; register char **dp; ! BBErrors[0] = 0; for (dp = bb -> bb_dist; *dp; dp++) if (result = getbbitem (bb, *dp, action)) return result; *************** *** 646,653 **** hp = item; break; ! case NULL: ! if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == NULL) (void) strcpy (prf, ""), cp = bb -> bb_file; else (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file); --- 646,653 ---- hp = item; break; ! case 0: ! if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == 0) (void) strcpy (prf, ""), cp = bb -> bb_file; else (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file); *************** *** 667,673 **** return bblose ("unable to read file %s", hp); while (fgets (buffer, sizeof buffer, fp)) { if (np = index (buffer, '\n')) ! *np = NULL; if (result = getbbitem (bb, buffer, action)) { (void) fclose (fp); (void) bblose ("error with file %s, item %s", hp, buffer); --- 667,673 ---- return bblose ("unable to read file %s", hp); while (fgets (buffer, sizeof buffer, fp)) { if (np = index (buffer, '\n')) ! *np = 0; if (result = getbbitem (bb, buffer, action)) { (void) fclose (fp); (void) bblose ("error with file %s, item %s", hp, buffer); *************** *** 679,685 **** default: if (hp = rindex (item, '@')) { ! *hp++ = NULL; (void) strcpy (mbox, item); (void) strcpy (host, hp); *--hp = '@'; --- 679,685 ---- default: if (hp = rindex (item, '@')) { ! *hp++ = 0; (void) strcpy (mbox, item); (void) strcpy (host, hp); *--hp = '@'; *************** *** 704,710 **** *b, *c; { ! if (BBErrors[0] == NULL) (void) sprintf (BBErrors, fmt, a, b, c); return NOTOK; --- 704,710 ---- *b, *c; { ! if (BBErrors[0] == 0) (void) sprintf (BBErrors, fmt, a, b, c); return NOTOK; *************** *** 721,727 **** for (; *s2; s2++) *s1++ = isupper (*s2) ? tolower (*s2) : *s2; ! *s1 = NULL; } /* */ --- 721,727 ---- for (; *s2; s2++) *s1++ = isupper (*s2) ? tolower (*s2) : *s2; ! *s1 = 0; } /* */ *************** *** 736,742 **** while (*p && *p != c) p++; if (*p) ! *p++ = NULL; return p; } --- 736,742 ---- while (*p && *p != c) p++; if (*p) ! *p++ = 0; return p; } diff -cr mh-6.7/zotnet/mf/mf.c /achates/u1/mh-6.7/zotnet/mf/mf.c *** mh-6.7/zotnet/mf/mf.c Fri Dec 14 16:26:16 1990 --- /achates/u1/mh-6.7/zotnet/mf/mf.c Tue Jun 11 22:13:06 1991 *************** *** 54,60 **** *b; { for (; *a; a++, b++) ! if (*b == NULL) return FALSE; else { char c1 = islower (*a) ? toupper (*a) : *a; --- 54,60 ---- *b; { for (; *a; a++, b++) ! if (*b == 0) return FALSE; else { char c1 = islower (*a) ? toupper (*a) : *a; *************** *** 63,69 **** return FALSE; } ! return (*b == NULL); } /* */ --- 63,69 ---- return FALSE; } ! return (*b == 0); } /* */ *************** *** 154,160 **** for (cp = tp; isspace (*cp); cp++) continue; ! if (*cp == NULL) { free (vp); vp = tp = NULL; return NULL; --- 154,160 ---- for (cp = tp; isspace (*cp); cp++) continue; ! if (*cp == 0) { free (vp); vp = tp = NULL; return NULL; *************** *** 167,191 **** xp = wp; while (isspace (*xp)) xp++; ! if (*xp != NULL && isat (--xp)) { yp = xp + 4; while (isspace (*yp)) yp++; ! if (*yp != NULL) if ((zp = index (yp, ' ')) != NULL) ! *zp = NULL, tp = ++zp; else tp = NULL; else ! *wp = NULL, tp = ++wp; } else ! *wp = NULL, tp = ++wp; } else tp = NULL; else ! *wp = NULL, tp = ++wp; if (adrxp -> text) free (adrxp -> text); --- 167,191 ---- xp = wp; while (isspace (*xp)) xp++; ! if (*xp != 0 && isat (--xp)) { yp = xp + 4; while (isspace (*yp)) yp++; ! if (*yp != 0) if ((zp = index (yp, ' ')) != NULL) ! *zp = 0, tp = ++zp; else tp = NULL; else ! *wp = 0, tp = ++wp; } else ! *wp = 0, tp = ++wp; } else tp = NULL; else ! *wp = 0, tp = ++wp; if (adrxp -> text) free (adrxp -> text); *************** *** 193,205 **** adrxp -> mbox = cp; adrxp -> host = adrxp -> path = NULL; if ((wp = rindex (cp, '@')) != NULL) { ! *wp++ = NULL; adrxp -> host = *wp ? wp : NULL; } else for (wp = cp + strlen (cp) - 4; wp >= cp; wp--) if (isat (wp)) { ! *wp++ = NULL; adrxp -> host = wp + 3; } --- 193,205 ---- adrxp -> mbox = cp; adrxp -> host = adrxp -> path = NULL; if ((wp = rindex (cp, '@')) != NULL) { ! *wp++ = 0; adrxp -> host = *wp ? wp : NULL; } else for (wp = cp + strlen (cp) - 4; wp >= cp; wp--) if (isat (wp)) { ! *wp++ = 0; adrxp -> host = wp + 3; } *************** *** 218,224 **** register char c, *cp; ! for (c = ' ', cp = tp; (*tp = *fp++) != NULL;) if (isspace (*tp)) { if (c != ' ') *tp++ = c = ' '; --- 218,224 ---- register char c, *cp; ! for (c = ' ', cp = tp; (*tp = *fp++) != 0;) if (isspace (*tp)) { if (c != ' ') *tp++ = c = ' '; *************** *** 227,233 **** c = *tp++; if (c == ' ' && cp < tp) ! *--tp = NULL; } --- 227,233 ---- c = *tp++; if (c == ' ' && cp < tp) ! *--tp = 0; } *************** *** 337,343 **** '"', LX_ERR, '[', LX_ERR, ']', LX_ERR, ! NULL, NULL }; /* */ --- 337,343 ---- '"', LX_ERR, '[', LX_ERR, ']', LX_ERR, ! 0, 0 }; /* */ *************** *** 392,398 **** if (note) free (note); pers = mbox = host = path = grp = note = NULL; ! err[0] = NULL; if (dp == NULL) { dp = cp = getcpy (addrs ? addrs : ""); --- 392,398 ---- if (note) free (note); pers = mbox = host = path = grp = note = NULL; ! err[0] = 0; if (dp == NULL) { dp = cp = getcpy (addrs ? addrs : ""); *************** *** 476,482 **** (void) strcpy (adr, ap); bp = adr + strlen (adr) - 1; if (*bp == ',' || *bp == ';' || *bp == '\n') ! *bp = NULL; /* */ --- 476,482 ---- (void) strcpy (adr, ap); bp = adr + strlen (adr) - 1; if (*bp == ',' || *bp == ';' || *bp == '\n') ! *bp = 0; /* */ *************** *** 834,840 **** *bp; bp = buffer; ! *bp = NULL; if (!cp) return (last_lex = LX_END); --- 834,840 ---- *bp; bp = buffer; ! *bp = 0; if (!cp) return (last_lex = LX_END); *************** *** 842,848 **** c = *cp++; while (isspace (c)) c = *cp++; ! if (c == NULL) { cp = NULL; return (last_lex = LX_END); } --- 842,848 ---- c = *cp++; while (isspace (c)) c = *cp++; ! if (c == 0) { cp = NULL; return (last_lex = LX_END); } *************** *** 852,858 **** for (cp++;;) switch (c = *cp++) { case '>': ! *bp = NULL; cp++; return (last_lex = LX_WP); --- 852,858 ---- for (cp++;;) switch (c = *cp++) { case '>': ! *bp = 0; cp++; return (last_lex = LX_WP); *************** *** 865,876 **** if (c == '(') for (*bp++ = c, i = 0;;) switch (c = *cp++) { ! case NULL: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == NULL) { cp = NULL; return (last_lex = LX_ERR); } --- 865,876 ---- if (c == '(') for (*bp++ = c, i = 0;;) switch (c = *cp++) { ! case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } *************** *** 884,890 **** case ')': *bp++ = c; if (--i < 0) { ! *bp = NULL; note = note ? add (buffer, add (" ", note)) : getcpy (buffer); return my_lex (buffer); --- 884,890 ---- case ')': *bp++ = c; if (--i < 0) { ! *bp = 0; note = note ? add (buffer, add (" ", note)) : getcpy (buffer); return my_lex (buffer); *************** *** 896,907 **** if (c == '"') for (*bp++ = c;;) switch (c = *cp++) { ! case NULL: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == NULL) { cp = NULL; return (last_lex = LX_ERR); } --- 896,907 ---- if (c == '"') for (*bp++ = c;;) switch (c = *cp++) { ! case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } *************** *** 910,916 **** continue; case '"': *bp++ = c; ! *bp = NULL; return (last_lex = LX_QSTR); } --- 910,916 ---- continue; case '"': *bp++ = c; ! *bp = 0; return (last_lex = LX_QSTR); } *************** *** 917,928 **** if (c == '[') for (*bp++ = c;;) switch (c = *cp++) { ! case NULL: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == NULL) { cp = NULL; return (last_lex = LX_ERR); } --- 917,928 ---- if (c == '[') for (*bp++ = c;;) switch (c = *cp++) { ! case 0: cp = NULL; return (last_lex = LX_ERR); case QUOTE: *bp++ = c; ! if ((c = *cp++) == 0) { cp = NULL; return (last_lex = LX_ERR); } *************** *** 931,937 **** continue; case ']': *bp++ = c; ! *bp = NULL; return (last_lex = LX_DLIT); } --- 931,937 ---- continue; case ']': *bp++ = c; ! *bp = 0; return (last_lex = LX_DLIT); } *************** *** 938,945 **** /* */ *bp++ = c; ! *bp = NULL; ! for (i = 0; special[i].lx_chr != NULL; i++) if (c == special[i].lx_chr) return (last_lex = special[i].lx_val); --- 938,945 ---- /* */ *bp++ = c; ! *bp = 0; ! for (i = 0; special[i].lx_chr != 0; i++) if (c == special[i].lx_chr) return (last_lex = special[i].lx_val); *************** *** 947,955 **** return (last_lex = LX_ERR); for (;;) { ! if ((c = *cp++) == NULL) break; ! for (i = 0; special[i].lx_chr != NULL; i++) if (c == special[i].lx_chr) goto got_atom; if (iscntrl (c) || isspace (c)) --- 947,955 ---- return (last_lex = LX_ERR); for (;;) { ! if ((c = *cp++) == 0) break; ! for (i = 0; special[i].lx_chr != 0; i++) if (c == special[i].lx_chr) goto got_atom; if (iscntrl (c) || isspace (c)) *************** *** 957,967 **** *bp++ = c; } got_atom: ; ! if (c == NULL) cp = NULL; else cp--; ! *bp = NULL; last_lex = !gotat || cp == NULL || index (cp, '<') != NULL ? LX_ATOM : LX_AT; return last_lex; --- 957,967 ---- *bp++ = c; } got_atom: ; ! if (c == 0) cp = NULL; else cp--; ! *bp = 0; last_lex = !gotat || cp == NULL || index (cp, '<') != NULL ? LX_ATOM : LX_AT; return last_lex; *************** *** 1010,1016 **** case EOF: eol: ; if (cp != pp) { ! *cp = NULL; *bp = pp; return OK; } --- 1010,1016 ---- case EOF: eol: ; if (cp != pp) { ! *cp = 0; *bp = pp; return OK; } *************** *** 1020,1026 **** pp = NULL; return DONE; ! case NULL: continue; case '\n': --- 1020,1026 ---- pp = NULL; return DONE; ! case 0: continue; case '\n': diff -cr mh-6.7/zotnet/mts/client.c /achates/u1/mh-6.7/zotnet/mts/client.c *** mh-6.7/zotnet/mts/client.c Fri Dec 14 16:26:24 1990 --- /achates/u1/mh-6.7/zotnet/mts/client.c Tue Jun 11 22:02:16 1991 *************** *** 88,97 **** } ap = arguments; ! if (args != NULL && *args != NULL) ap = copyip (brkstring (getcpy (args), " ", "\n"), ap); else ! if (servers != NULL && *servers != NULL) ap = copyip (brkstring (getcpy (servers), " ", "\n"), ap); if (ap == arguments) { *ap++ = getcpy ("localhost"); --- 88,97 ---- } ap = arguments; ! if (args != NULL && *args != 0) ap = copyip (brkstring (getcpy (args), " ", "\n"), ap); else ! if (servers != NULL && *servers != 0) ap = copyip (brkstring (getcpy (servers), " ", "\n"), ap); if (ap == arguments) { *ap++ = getcpy ("localhost"); *************** *** 123,129 **** break; } } ! #endif not BIND continue; } --- 123,129 ---- break; } } ! #endif continue; } diff -cr mh-6.7/zotnet/mts/lock.c /achates/u1/mh-6.7/zotnet/mts/lock.c *** mh-6.7/zotnet/mts/lock.c Fri Dec 14 16:26:24 1990 --- /achates/u1/mh-6.7/zotnet/mts/lock.c Thu Jun 13 01:06:41 1991 *************** *** 25,32 **** #ifdef LOCKF #include #endif LOCKF - #define NOTOK (-1) #define OK 0 --- 25,34 ---- #ifdef LOCKF #include #endif LOCKF + #ifdef _AIX + #include + #endif #define NOTOK (-1) #define OK 0 *************** *** 148,156 **** *cp; bp = curlock; ! if ((cp = rindex (file, '/')) == NULL || *++cp == NULL) cp = file; ! if (lockldir == NULL || *lockldir == NULL) { if (cp != file) { (void) sprintf (bp, "%.*s", cp - file, file); bp += strlen (bp); --- 150,158 ---- *cp; bp = curlock; ! if ((cp = rindex (file, '/')) == NULL || *++cp == 0) cp = file; ! if (lockldir == NULL || *lockldir == 0) { if (cp != file) { (void) sprintf (bp, "%.*s", cp - file, file); bp += strlen (bp); *************** *** 173,179 **** } if (tmplock) { ! if ((cp = rindex (curlock, '/')) == NULL || *++cp == NULL) (void) strcpy (tmplock, ",LCK.XXXXXX"); else (void) sprintf (tmplock, "%.*s,LCK.XXXXXX", --- 175,181 ---- } if (tmplock) { ! if ((cp = rindex (curlock, '/')) == NULL || *++cp == 0) (void) strcpy (tmplock, ",LCK.XXXXXX"); else (void) sprintf (tmplock, "%.*s,LCK.XXXXXX", *** /dev/null Fri Jul 26 16:29:23 1991 --- /achates/u1/mh-6.7/uip/kclient.c Thu Jun 13 06:26:24 1991 *************** *** 0 **** --- 1,402 ---- + /* + * $Source: /paris/source/4.3/new/mh.6.6/support/pop/RCS/kclient.c,v $ + * $Header: /paris/source/4.3/new/mh.6.6/support/pop/RCS/kclient.c,v 1.2 89/11/11 03:35:14 probe Exp $ + */ + + #ifndef lint + static char *rcsid_client_c = "$Header: /paris/source/4.3/new/mh.6.6/support/pop/RCS/kclient.c,v 1.2 89/11/11 03:35:14 probe Exp $"; + #endif lint + + /* kclient.c - connect to a server via knetd, kerberos authenticated */ + + #include "../h/strings.h" + #include + #ifdef KPOP + #include "../zotnet/mts/mts.h" + #else + #include "mts.h" + #endif + #include + #include + #include + #include + #include + #include + #ifdef KPOP + #include + #include + + static CREDENTIALS cred; + static MSG_DAT msg_data; + static KTEXT ticket = (KTEXT)NULL; + static Key_schedule schedule; + #endif + + #define NOTOK (-1) + #define OK 0 + #define DONE 1 + + #define TRUE 1 + #define FALSE 0 + + #define OOPS1 (-2) + #define OOPS2 (-3) + + #define MAXARGS 1000 + #define MAXNETS 5 + #define MAXHOSTS 25 + + /* */ + + extern int errno; + extern int sys_nerr; + extern char *sys_errlist[]; + + struct addrent { + int a_addrtype; /* assumes AF_INET for inet_netof () */ + + union { + int un_net; + char un_addr[14]; + } un; + #define a_net un.un_net + #define a_addr un.un_addr + }; + + static struct addrent *ne, *nz; + static struct addrent nets[MAXNETS]; + + static struct addrent *he, *hz; + static struct addrent hosts[MAXHOSTS]; + + #ifdef KPOP + + char realservice[] = "kpop"; + + char krb_realm[REALM_SZ]; + char *PrincipalHostname(); + + /* redefine routine names for kerberos to make the loader happy */ + #define client kclient + #define rcaux krcaux + + #ifdef __STDC__ + static int rcaux (struct servent *, struct hostent *, int, char *, char *); + static int getport (int, int, char *); + static int inet (struct hostent *, int); + #else + static int rcaux (), getport (), inet (); + #endif /* STDC */ + static int brkany (); + + #endif /* KPOP */ + + char *getcpy (), **brkstring (), **copyip (); + + /* */ + + int client (args, protocol, service, rproto, response) + char *args, + *protocol, + *service, + *response; + int rproto; + { + int sd; + register char **ap; + char *arguments[MAXARGS]; + register struct hostent *hp; + #ifndef BIND + register struct netent *np; + #endif + register struct servent *sp; + #ifndef KPOP + #define realservice service + #endif + + if ((sp = getservbyname (realservice, protocol)) == NULL) { + (void) sprintf (response, "%s/%s: unknown service", realservice, protocol); + return NOTOK; + } + + ap = arguments; + if (args != NULL && *args != 0) + ap = copyip (brkstring (getcpy (args), " ", "\n"), ap); + else + if (servers != NULL && *servers != 0) + ap = copyip (brkstring (getcpy (servers), " ", "\n"), ap); + if (ap == arguments) { + *ap++ = getcpy ("localhost"); + *ap = NULL; + } + + nz = (ne = nets) + sizeof nets / sizeof nets[0]; + hz = (he = hosts) + sizeof hosts / sizeof hosts[0]; + + for (ap = arguments; *ap; ap++) { + if (**ap == '\01') { + #ifndef BIND + if (np = getnetbyname (*ap + 1)) { + sethostent (1); + while (hp = gethostent ()) + if (np -> n_addrtype == hp -> h_addrtype + && inet (hp, np -> n_net)) { + switch (sd = rcaux (sp, hp, rproto, response, service)) { + case NOTOK: + continue; + case OOPS1: + break; + case OOPS2: + return NOTOK; + + default: + return sd; + } + break; + } + } + #endif + continue; + } + + if (hp = gethostbyname (*ap)) { + switch (sd = rcaux (sp, hp, rproto, response, service)) { + case NOTOK: + case OOPS1: + break; + case OOPS2: + return NOTOK; + + default: + return sd; + } + continue; + } + } + + (void) strcpy (response, "no servers available"); + return NOTOK; + } + + /* */ + + static int rcaux (sp, hp, rproto, response, service) + register struct servent *sp; + register struct hostent *hp; + int rproto; + register char *response; + char *service; /* what they really want to talk to */ + { + int sd; + struct in_addr in; + register struct addrent *ap; + struct sockaddr_in in_socket; + register struct sockaddr_in *isock = &in_socket; + #ifdef KPOP + int rem; + #endif + + for (ap = nets; ap < ne; ap++) + if (ap -> a_addrtype == hp -> h_addrtype && inet (hp, ap -> a_net)) + return NOTOK; + + for (ap = hosts; ap < he; ap++) + if (ap -> a_addrtype == hp -> h_addrtype + && bcmp (ap -> a_addr, hp -> h_addr, hp -> h_length) == 0) + return NOTOK; + + if ((sd = getport (rproto, hp -> h_addrtype, response)) == NOTOK) + return OOPS2; + + bzero ((char *) isock, sizeof *isock); + isock -> sin_family = hp -> h_addrtype; + isock -> sin_port = sp -> s_port; + bcopy (hp -> h_addr, (char *) &isock -> sin_addr, hp -> h_length); + + if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK) + switch (errno) { + case ENETDOWN: + case ENETUNREACH: + (void) close (sd); + if (ne < nz) { + ne -> a_addrtype = hp -> h_addrtype; + bcopy (hp -> h_addr, (char *) &in, sizeof in); + ne -> a_net = inet_netof (in); + ne++; + } + return OOPS1; + + case ETIMEDOUT: + case ECONNREFUSED: + default: + (void) close (sd); + if (he < hz) { + he -> a_addrtype = hp -> h_addrtype; + bcopy (hp -> h_addr, he -> a_addr, hp -> h_length); + he++; + } + return NOTOK; + } + + #ifdef KPOP + ticket = (KTEXT)malloc( sizeof(KTEXT_ST) ); + rem = krb_sendauth(0L, sd, ticket, service, hp->h_name, + (char *) krb_realmofhost(hp->h_name), + (unsigned long)0, &msg_data, &cred, schedule, + (struct sockaddr_in *)NULL, + (struct sockaddr_in *)NULL, + "KPOPV0.1"); + if (rem != KSUCCESS) { + close(sd); + (void) strcpy(response, "Post office refused connection: "); + (void) strcat(response, krb_err_txt[rem]); + return OOPS2; + } + #endif + + return sd; + } + + /* */ + + static int getport (rproto, addrtype, response) + int rproto, + addrtype; + register char *response; + { + int sd, + port; + struct sockaddr_in in_socket, + *isock = &in_socket; + + if (rproto && addrtype != AF_INET) { + (void) sprintf (response, "reserved ports not supported for af=%d", + addrtype); + errno = ENOPROTOOPT; + return NOTOK; + } + + if ((sd = socket (AF_INET, SOCK_STREAM, 0)) == NOTOK) { + (void) sprintf (response, "unable to create socket: %s", + errno > 0 && errno < sys_nerr ? sys_errlist[errno] + : "unknown error"); + return NOTOK; + } + #ifdef KPOP + return(sd); + #else + if (!rproto) + return sd; + + bzero ((char *) isock, sizeof *isock); + isock -> sin_family = addrtype; + for (port = IPPORT_RESERVED - 1;;) { + isock -> sin_port = htons ((u_short) port); + if (bind (sd, (struct sockaddr *) isock, sizeof *isock) != NOTOK) + return sd; + + switch (errno) { + case EADDRINUSE: + case EADDRNOTAVAIL: + if (--port <= IPPORT_RESERVED / 2) { + (void) strcpy (response, "ports available"); + return NOTOK; + } + break; + + default: + (void) sprintf (response, "unable to bind socket: %s", + errno > 0 && errno < sys_nerr ? sys_errlist[errno] + : "unknown error"); + return NOTOK; + } + } + #endif + } + + /* */ + + static int inet (hp, net) + register struct hostent *hp; + int net; + { + struct in_addr in; + + bcopy (hp -> h_addr, (char *) &in, sizeof in); + return (inet_netof (in) == net); + } + + /* */ + + /* static copies of three MH subroutines... (sigh) */ + + static char *broken[MAXARGS + 1]; + + + static char **brkstring (strg, brksep, brkterm) + register char *strg; + register char *brksep, + *brkterm; + { + register int bi; + register char c, + *sp; + + sp = strg; + + for (bi = 0; bi < MAXARGS; bi++) { + while (brkany (c = *sp, brksep)) + *sp++ = 0; + if (!c || brkany (c, brkterm)) { + *sp = 0; + broken[bi] = 0; + return broken; + } + + broken[bi] = sp; + while ((c = *++sp) && !brkany (c, brksep) && !brkany (c, brkterm)) + continue; + } + broken[MAXARGS] = 0; + + return broken; + } + + + static brkany (chr, strg) + register char chr, + *strg; + { + register char *sp; + + if (strg) + for (sp = strg; *sp; sp++) + if (chr == *sp) + return 1; + return 0; + } + + + static char **copyip (p, q) + register char **p, + **q; + { + while (*p) + *q++ = *p++; + *q = 0; + + return q; + } + + + static char *getcpy (str) + register char *str; + { + register char *cp; + + if ((cp = malloc ((unsigned) (strlen (str) + 1))) == NULL) + return NULL; + + (void) strcpy (cp, str); + return cp; + }