home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume7 / 2.11news / patch06 < prev    next >
Encoding:
Text File  |  1987-03-25  |  63.4 KB  |  2,580 lines

  1. /* Written  1:37 pm  Mar 24, 1987 by rick@seismo.UUCP in mirror:news.software.b */
  2. /* ---------- "Patch #6 for news 2.11 source" ---------- */
  3. Description:
  4.     This is patch #6 for news 2.11 source. It addresses the following
  5.     problems:
  6.  
  7.     Makefile.dst has had its dependencies corrected.
  8.     checkgroups now supports !newscategory to complain if those categories
  9.     are present.
  10.     newgroup control messages now use locking to keep from smashing the
  11.     active file.
  12.     Much greater control over the hostname used in the Path and From lines
  13.     is provided via the optional GENERICPATH and GENERICFROM defines.
  14.     (HIDDENNET automatically uses thse defines. More on how to use them
  15.     in a following article)
  16.     If you defined LOCKF, locking DID NOT WORK on most systems! (How come
  17.     nobody noticed this???). It works now.
  18.     Unknown newsgroups are no longer logged in errlog.
  19.     Problems with unbatching from pipes have been corrected.
  20.     locking to prevent multiple rnews -U processes running is provided.
  21.     postnews now supports an append option to append to a file instead
  22.     of overwriting it.
  23.     cancelling an article from vnews/readnews works better.
  24.     The vnews.help file has been updated.
  25.     Various minor portability cleanups.
  26.  
  27. Fix:
  28.     cd to the src directory and apply the following patch
  29.  
  30. Index: patchlevel.h
  31. Prereq: 5
  32. *** .d/patchlevel.h    Tue Mar 10 16:13:26 1987
  33. --- patchlevel.h    Tue Mar 24 10:59:32 1987
  34. ***************
  35. *** 1,3 ****
  36. ! #define    PATCHLEVEL    5
  37.   
  38. ! #define NEWS_VERSION   "B 2.11 3/10/87"
  39. --- 1,3 ----
  40. ! #define    PATCHLEVEL    6
  41.   
  42. ! #define NEWS_VERSION   "B 2.11 3/23/87"
  43.  
  44. Index: Makefile.dst
  45. Prereq: 1.21
  46. *** .d/Makefile.dst    Wed Dec 17 18:23:43 1986
  47. --- Makefile.dst    Tue Mar 24 11:00:54 1987
  48. ***************
  49. *** 1,3 ****
  50. ! # '@(#)Makefile.dst    1.21    12/16/86'
  51.   # Generic Makefile.
  52.   # This is converted to USG/v7/etc by localize.sh
  53. --- 1,3 ----
  54. ! # '@(#)Makefile.dst    1.23    3/23/87'
  55.   # Generic Makefile.
  56.   # This is converted to USG/v7/etc by localize.sh
  57. ***************
  58. *** 128,134 ****
  59. --- 128,138 ----
  60.   defs.h:    defs.dist localize.sh Makefile.dst Makefile
  61.       sh localize.sh
  62. +     @echo Localize has been run. Restart the make.
  63. +     @exit 1
  64.   
  65.   Makefile: localize.sh defs.dist Makefile.dst
  66.       sh localize.sh
  67. +     @echo Localize has been run. Restart the make.
  68. +     @exit 1
  69.   
  70.   update: install.sh makeactive.sh
  71. ***************
  72. *** 171,175 ****
  73.       $(CC) $(CFLAGS) -c funcs2.c
  74.   
  75. ! getdate.o:  getdate.y
  76.       @echo "expect 8 shift/reduce conflicts"
  77.       yacc getdate.y
  78. --- 175,179 ----
  79.       $(CC) $(CFLAGS) -c funcs2.c
  80.   
  81. ! getdate.o:  getdate.y defs.h
  82.       @echo "expect 8 shift/reduce conflicts"
  83.       yacc getdate.y
  84. ***************
  85. *** 228,232 ****
  86.       $(CC) $(CFLAGS) -c uname.c
  87.   
  88. ! ndir.o: ndir.c ndir.h
  89.       $(CC) $(CFLAGS) -c ndir.c
  90.   
  91. --- 232,236 ----
  92.       $(CC) $(CFLAGS) -c uname.c
  93.   
  94. ! ndir.o: ndir.c ndir.h defs.h
  95.       $(CC) $(CFLAGS) -c ndir.c
  96.   
  97. ***************
  98. *** 239,247 ****
  99.   #VMS     mv recnews.exe recnews
  100.   
  101. ! sendnews:  sendnews.o uname.o
  102. !     $(CC) $(LFLAGS) sendnews.o uname.o -o sendnews
  103.   #VMS     mv sendnews.exe sendnews
  104.   
  105. ! batch:  batch.c Makefile
  106.       $(CC) $(CFLAGS) $(LFLAGS) batch.c -o batch
  107.   #VMS     mv batch.exe batch
  108. --- 243,251 ----
  109.   #VMS     mv recnews.exe recnews
  110.   
  111. ! sendnews:  sendnews.o defs.h
  112. !     $(CC) $(LFLAGS) sendnews.o -o sendnews
  113.   #VMS     mv sendnews.exe sendnews
  114.   
  115. ! batch:  batch.c Makefile defs.h
  116.       $(CC) $(CFLAGS) $(LFLAGS) batch.c -o batch
  117.   #VMS     mv batch.exe batch
  118. Index: checkgroups.sh
  119. Prereq: 1.20
  120. *** .d/checkgroups.sh    Wed Dec 17 18:22:58 1986
  121. --- checkgroups.sh    Mon Mar 23 14:00:53 1987
  122. ***************
  123. *** 1,4 ****
  124.   : check active file for missing or extra newsgroups
  125. ! : '@(#)checkgroups    1.20    12/16/86'
  126.   
  127.   if  test  ! -s LIBDIR/newsgroups
  128. --- 1,4 ----
  129.   : check active file for missing or extra newsgroups
  130. ! : '@(#)checkgroups    1.22    3/20/87'
  131.   
  132.   if  test  ! -s LIBDIR/newsgroups
  133. ***************
  134. *** 28,32 ****
  135.       cat >> /tmp/$$msg
  136.       cp /dev/null /tmp/$$b
  137. !     cat /tmp/$$msg | sed -e "s;[     ].*;;" -e "s;\..*;;" | sort -u |
  138.           while read dist
  139.           do
  140. --- 28,32 ----
  141.       cat >> /tmp/$$msg
  142.       cp /dev/null /tmp/$$b
  143. !     sed -e "s;[     ].*;;" -e "s;\..*;;" -e "s;^!;;" /tmp/$$msg | sort -u |
  144.           while read dist
  145.           do
  146. ***************
  147. *** 38,42 ****
  148.       egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
  149.       cat /tmp/$$a > LIBDIR/newsgroups
  150. !     cat /tmp/$$msg >> LIBDIR/newsgroups
  151.       rm -f /tmp/$$b /tmp/$$msg
  152.       ;;
  153. --- 38,42 ----
  154.       egrep -v "${group}" LIBDIR/newsgroups > /tmp/$$a
  155.       cat /tmp/$$a > LIBDIR/newsgroups
  156. !     sed -e "/^!/d" /tmp/$$msg >> LIBDIR/newsgroups
  157.       rm -f /tmp/$$b /tmp/$$msg
  158.       ;;
  159. Index: control.c
  160. Prereq: 2.52
  161. *** .d/control.c    Tue Mar 10 16:13:31 1987
  162. --- control.c    Mon Mar 23 14:00:21 1987
  163. ***************
  164. *** 20,24 ****
  165.   
  166.   #ifdef SCCSID
  167. ! static char    *SccsId = "@(#)control.c    2.52    3/9/87";
  168.   #endif /* SCCSID */
  169.   
  170. --- 20,24 ----
  171.   
  172.   #ifdef SCCSID
  173. ! static char    *SccsId = "@(#)control.c    2.53    3/20/87";
  174.   #endif /* SCCSID */
  175.   
  176. ***************
  177. *** 25,29 ****
  178.   #include "iparams.h"
  179.   
  180. ! #define eq(msg) (strcmp(msg, cargv[0]) == 0)
  181.   
  182.   int cargc;
  183. --- 25,29 ----
  184.   #include "iparams.h"
  185.   
  186. ! #define eq(msg) (msg[0] == cargv[0][0] && strcmp(msg, cargv[0]) == 0)
  187.   
  188.   int cargc;
  189. ***************
  190. *** 33,36 ****
  191. --- 33,37 ----
  192.   FILE *popen(), *mhopen(), *mailhdr();
  193.   
  194. + #define NCARGS    30
  195.   char *senderof();
  196.   #ifdef u370
  197. ***************
  198. *** 120,124 ****
  199.   char *str;
  200.   {
  201. !     static char *cavpbuf[20];
  202.       static char cavbuf[256];
  203.       char *nextfree = cavbuf;
  204. --- 121,125 ----
  205.   char *str;
  206.   {
  207. !     static char *cavpbuf[NCARGS];
  208.       static char cavbuf[256];
  209.       char *nextfree = cavbuf;
  210. ***************
  211. *** 139,143 ****
  212.               *nextfree++ = 0;
  213.               cargv[cargc] = nextfree;
  214. !             cargc++;
  215.           } else
  216.               *nextfree++ = *str++;
  217. --- 140,146 ----
  218.               *nextfree++ = 0;
  219.               cargv[cargc] = nextfree;
  220. !             if (cargc++ >= NCARGS)
  221. !                 xerror("Too many arguments to control message %s",
  222. !                         header.ident);
  223.           } else
  224.               *nextfree++ = *str++;
  225. ***************
  226. *** 170,174 ****
  227.       if (argc < 2)
  228.           error("ihave: Too few arguments.");
  229. !     if (strncmp(FULLSYSNAME, argv[argc - 1], SNLN) == 0)
  230.           return 0;
  231.       list[0] = '\0';
  232. --- 173,177 ----
  233.       if (argc < 2)
  234.           error("ihave: Too few arguments.");
  235. !     if (strncmp(PATHSYSNAME, argv[argc - 1], SNLN) == 0)
  236.           return 0;
  237.       list[0] = '\0';
  238. ***************
  239. *** 213,220 ****
  240.       */
  241.       (void) sprintf(header.nbuf, "to.%s.ctl", argv[argc - 1]);
  242. !     (void) sprintf(header.title, "sendme%s %s", list, FULLSYSNAME);
  243.       (void) strcpy(header.ctlmsg, header.title);
  244.       getident(&header);
  245. !     (void) sprintf(header.from, "%s@%s%s", "usenet", FULLSYSNAME, mydomain());
  246.       (void) strcpy(header.path, NEWSUSR);
  247.       header.subdate[0] = header.expdate[0] = '\0';
  248. --- 216,223 ----
  249.       */
  250.       (void) sprintf(header.nbuf, "to.%s.ctl", argv[argc - 1]);
  251. !     (void) sprintf(header.title, "sendme%s %s", list, PATHSYSNAME);
  252.       (void) strcpy(header.ctlmsg, header.title);
  253.       getident(&header);
  254. !     (void) sprintf(header.from, "%s@%s", "usenet", FROMSYSNAME);
  255.       (void) strcpy(header.path, NEWSUSR);
  256.       header.subdate[0] = header.expdate[0] = '\0';
  257. ***************
  258. *** 255,259 ****
  259.       if (argc < 2)
  260.           error("sendme: Too few arguments.");
  261. !     if (strncmp(FULLSYSNAME, argv[argc - 1], SNLN) == 0)
  262.           return 0;
  263.       if (s_find(&srec, argv[argc - 1]) != TRUE)
  264. --- 258,262 ----
  265.       if (argc < 2)
  266.           error("sendme: Too few arguments.");
  267. !     if (strncmp(PATHSYSNAME, argv[argc - 1], SNLN) == 0)
  268.           return 0;
  269.       if (s_find(&srec, argv[argc - 1]) != TRUE)
  270. ***************
  271. *** 365,368 ****
  272. --- 368,372 ----
  273.       }
  274.   
  275. +     lock();
  276.       /* see if it already exists */
  277.       (void) rewind(actfp); clearerr(actfp);
  278. ***************
  279. *** 379,384 ****
  280.               p -= 3;
  281.               if (argc > 2 && strcmp(argv[2], "moderated") == 0) {
  282. !                 if (*p == 'm')
  283.                       return 0;
  284.   # ifdef NONEWGROUPS
  285.                   if(can_change) {
  286. --- 383,390 ----
  287.               p -= 3;
  288.               if (argc > 2 && strcmp(argv[2], "moderated") == 0) {
  289. !                 if (*p == 'm') {
  290. !                     unlock();
  291.                       return 0;
  292. +                 }
  293.   # ifdef NONEWGROUPS
  294.                   if(can_change) {
  295. ***************
  296. *** 443,448 ****
  297.                * No permission to change
  298.                */
  299. !             if(!can_change)
  300.                   return 0;
  301.   # endif /* NONEWGROUPS */
  302.               /* The active file was wrong about the state of the
  303. --- 449,456 ----
  304.                * No permission to change
  305.                */
  306. !             if(!can_change) {
  307. !                 unlock();
  308.                   return 0;
  309. +             }
  310.   # endif /* NONEWGROUPS */
  311.               /* The active file was wrong about the state of the
  312. ***************
  313. *** 458,461 ****
  314. --- 466,470 ----
  315.                   logerr("Newsgroup %s changed from unmoderated to moderated",
  316.                   argv[1]);
  317. +             unlock();
  318.               return 0;
  319.           }
  320. ***************
  321. *** 520,523 ****
  322. --- 529,533 ----
  323.       }
  324.   # endif /* NOTIFY */
  325. +     unlock();
  326.       return 0;
  327.   }
  328. ***************
  329. *** 580,590 ****
  330.   
  331.       if (shouldremove) {
  332. !         int rc;
  333.           /* We let the shell do all the work.
  334. !          * See the rmgrp shell script. */
  335. !         (void) setuid(geteuid()); /* otherwise it won't rmdir the dir */
  336. !         (void) sprintf(bfr, "exec %s/rmgroup %s", LIB, argv[1]);
  337. !         rc = system(bfr);
  338. !         log("system(%s) status %d", bfr, rc);
  339.       }
  340.       return 0;
  341. --- 590,609 ----
  342.   
  343.       if (shouldremove) {
  344. !         int pid, status;
  345.           /* We let the shell do all the work.
  346. !          * See the rmgrp shell script.
  347. !          */
  348. !         lock();
  349. !         (void) sprintf(bfr, "%s/rmgroup", LIB);
  350. !         if (pid = vfork()) {
  351. !             status = fwait(pid);
  352. !         } else {
  353. !             (void) setuid(duid);
  354. !             execvp(bfr, argv);
  355. !         }
  356. !         unlock();
  357. !         if (status)
  358. !             log("rmgroup status %d", status);
  359.       }
  360.       return 0;
  361. ***************
  362. *** 641,645 ****
  363.       } else
  364.           log("Cancelling %s", line);
  365. !     if ((uid == ROOTID||uid == 0) && strcmp(header.distribution, "local") == 0)
  366.           su = 1;
  367.       while (*p) {
  368. --- 660,668 ----
  369.       } else
  370.           log("Cancelling %s", line);
  371. !     if ((uid == ROOTID||uid == 0) && (
  372. ! #ifdef ORGDISTRIB
  373. !         strcmp(header.distribution, ORGDISTRIB) == 0 ||
  374. ! #endif /* ORGDISTRIB */
  375. !         strcmp(header.distribution, "local") == 0))
  376.           su = 1;
  377.       while (*p) {
  378. ***************
  379. *** 917,933 ****
  380.           fprintf(fp, "Date: %s\n", arpadate(&now));
  381.   #ifdef MMDF
  382. !         fprintf(fp, "From: The News System <usenet@%s%s>\n",
  383. !                 FULLSYSNAME, mydomain());
  384.   #endif /* MMDF */
  385.           fprintf(fp, "To: %s\n", to);
  386.           fprintf(fp, "Subject: %s\n", subject);
  387. ! #ifdef HIDDENNET
  388. !         if (strcmp(LOCALSYSNAME, FULLSYSNAME))
  389. !             fprintf(fp, "Responding-System: %s.%s%s\n\n",
  390. !                 LOCALSYSNAME, FULLSYSNAME, mydomain());
  391. !         else
  392. ! #endif /* !HIDDENNET */
  393. !             fprintf(fp, "Responding-System: %s%s\n\n",
  394. !                 FULLSYSNAME, mydomain());
  395.       }
  396.       return fp;
  397. --- 940,949 ----
  398.           fprintf(fp, "Date: %s\n", arpadate(&now));
  399.   #ifdef MMDF
  400. !         fprintf(fp, "From: The News System <usenet@%s>\n",
  401. !                 FROMSYSNAME);
  402.   #endif /* MMDF */
  403.           fprintf(fp, "To: %s\n", to);
  404.           fprintf(fp, "Subject: %s\n", subject);
  405. !         fprintf(fp, "Responding-System: %s\n\n", LOCALSYSNAME);
  406.       }
  407.       return fp;
  408. Index: defs.dist
  409. Prereq: 2.56
  410. *** .d/defs.dist    Fri Nov 21 16:05:07 1986
  411. --- defs.dist    Tue Mar 24 11:00:58 1987
  412. ***************
  413. *** 15,19 ****
  414.    */
  415.   
  416. ! /*    @(#)defs.dist    2.56    11/21/86    */
  417.   
  418.   /*
  419. --- 15,19 ----
  420.    */
  421.   
  422. ! /*    @(#)defs.dist    2.57    3/23/87    */
  423.   
  424.   /*
  425. ***************
  426. *** 79,82 ****
  427. --- 79,85 ----
  428.                   /* The mail address to look like it came */
  429.                   /* from one machine */
  430. + /* NOTE: The following two macros replace the use of HIDDENNET */
  431. + /* #define GENERICPATH "frooz"    /* If you are using a shared USENET/UUCP node */
  432. + /* #define GENERICFROM "Frobozz.COM"    /* If you want generic From:-addresses */
  433.   /* #define NICENESS    4    /* does a nice(NICENESS) in rnews */
  434.   /* #define FASCIST    "all,!all.all"    /* only permit posting to certain groups */
  435. Index: expire.c
  436. Prereq: 2.51
  437. *** .d/expire.c    Tue Mar 10 16:13:33 1987
  438. --- expire.c    Mon Mar 23 14:00:08 1987
  439. ***************
  440. *** 18,22 ****
  441.   
  442.   #ifdef SCCSID
  443. ! static char    *SccsId = "@(#)expire.c    2.51    3/9/87";
  444.   #endif /* SCCSID */
  445.   
  446. --- 18,22 ----
  447.   
  448.   #ifdef SCCSID
  449. ! static char    *SccsId = "@(#)expire.c    2.52    3/20/87";
  450.   #endif /* SCCSID */
  451.   
  452. ***************
  453. *** 315,319 ****
  454. --- 315,325 ----
  455.       monitor((int(*)())0,(int(*)())0,0,0,0);
  456.   #endif /* PROFILING */
  457. + #ifdef IHCC
  458. +     /*afline happens to be available - (we're getting out anyway)*/
  459. +     sprintf(afline, "%s/%s", logdir(HOME), RNEWS);
  460. +     execl(afline, "rnews", "-U", (char *)NULL);
  461. + #else /* ! IHCC */
  462.       execl(RNEWS, "rnews", "-U", (char *)NULL);
  463. + #endif /* ! IHCC */
  464.       perror(RNEWS);
  465.       xxit(1);
  466. ***************
  467. *** 792,799 ****
  468.       LockFd = open(ACTIVE, 2);
  469.   # ifdef    LOCKF
  470. !     (void) lockf(LockFd, F_LOCK, 0);
  471.   # else    /* BSD4_2 */
  472. !     (void) flock(LockFd, LOCK_EX);
  473. ! # endif    /* BSd4_2 */
  474.   #else    /* !BSD4_2 && !LOCKF */
  475.       int i = 0;
  476. --- 798,806 ----
  477.       LockFd = open(ACTIVE, 2);
  478.   # ifdef    LOCKF
  479. !     if (lockf(LockFd, F_LOCK, 0) < 0)
  480.   # else    /* BSD4_2 */
  481. !     if (flock(LockFd, LOCK_EX) < 0)
  482. ! # endif    /* BSD4_2 */
  483. !         xerror("Can't get lock for expire: %s", errmsg(errno));
  484.   #else    /* !BSD4_2 && !LOCKF */
  485.       int i = 0;
  486. ***************
  487. *** 804,808 ****
  488.           sleep(i*2);
  489.       }
  490.   #endif    /* !BSD4_2  && !LOCKF */
  491.   }
  492. --- 811,814 ----
  493. Index: funcs2.c
  494. Prereq: 1.19
  495. *** .d/funcs2.c    Tue Feb 24 17:55:49 1987
  496. --- funcs2.c    Mon Mar 23 13:59:43 1987
  497. ***************
  498. *** 18,22 ****
  499.   
  500.   #ifdef SCCSID
  501. ! static char    *SccsId = "@(#)funcs2.c    1.19    2/22/87";
  502.   #endif /* SCCSID */
  503.   
  504. --- 18,22 ----
  505.   
  506.   #ifdef SCCSID
  507. ! static char    *SccsId = "@(#)funcs2.c    1.20    3/20/87";
  508.   #endif /* SCCSID */
  509.   
  510. ***************
  511. *** 124,136 ****
  512.       if (*p++ == '\0')
  513.           xerror("Bad SUBFILE (%s) line %d.", SUBFILE, sfline);
  514. ! /*
  515. !  * A sys file line reading "ME" means the name of the local system.
  516. !  */
  517.       if (strcmp(sp->s_name, "ME") == 0)
  518. ! #ifdef HIDDENNET
  519. !         (void) strcpy(sp->s_name, LOCALSYSNAME);
  520. ! #else /* !HIDDENNET */
  521. !         (void) strcpy(sp->s_name, FULLSYSNAME);
  522. ! #endif /* !HIDDENNET */
  523.       e = index(sp->s_name, '/');
  524.       if (e) {
  525. --- 124,132 ----
  526.       if (*p++ == '\0')
  527.           xerror("Bad SUBFILE (%s) line %d.", SUBFILE, sfline);
  528. !     /*
  529. !      * A sys file line reading "ME" means the name of the local system.
  530. !      */
  531.       if (strcmp(sp->s_name, "ME") == 0)
  532. !         (void) strcpy(sp->s_name, LOCALPATHSYSNAME);
  533.       e = index(sp->s_name, '/');
  534.       if (e) {
  535. ***************
  536. *** 323,328 ****
  537.   
  538.       ptr = hptr->path;
  539. !     if (prefix(ptr, FULLSYSNAME) &&
  540. !         index(NETCHRS, ptr[strlen(FULLSYSNAME)]))
  541.           ptr = index(ptr, '!') + 1;
  542.   #ifdef INTERNET
  543. --- 319,324 ----
  544.   
  545.       ptr = hptr->path;
  546. !     if (prefix(ptr, PATHSYSNAME) &&
  547. !         index(NETCHRS, ptr[strlen(PATHSYSNAME)]))
  548.           ptr = index(ptr, '!') + 1;
  549.   #ifdef INTERNET
  550. ***************
  551. *** 602,608 ****
  552.       chr = findhfdigit(hline);
  553.       sprintf(subfile, "%s.d/%c", ARTFILE, chr);
  554. !     if (access(subfile, 04) < 0)
  555. !         return(ARTFILE);
  556. !     return(subfile);
  557.   }
  558.   
  559. --- 598,602 ----
  560.       chr = findhfdigit(hline);
  561.       sprintf(subfile, "%s.d/%c", ARTFILE, chr);
  562. !     return subfile;
  563.   }
  564.   
  565. ***************
  566. *** 662,663 ****
  567. --- 656,685 ----
  568.   }
  569.   #endif /* VMS */
  570. + /*
  571. +  * Generate the name of the person responsible for posting this article,
  572. +  * in order to check that two articles were posted by the same person.
  573. +  */
  574. + char *
  575. + senderof(hp)
  576. + struct hbuf *hp;
  577. + {
  578. +     register char *r, *q, *tp;
  579. +     char *tailpath();
  580. +     static char senderbuf[BUFLEN];
  581. +     if (hp->sender[0])
  582. +         tp = hp->sender;
  583. +     else if (hp->from[0])
  584. +         tp = hp->from;
  585. +     else
  586. +         tp = tailpath(hp);
  587. +     (void) strncpy(senderbuf, tp, BUFLEN);
  588. +     /* Remove full name */
  589. +     q = index(senderbuf, ' ');
  590. +     if (q)
  591. +         *q = '\0';
  592. +     return senderbuf;
  593. + }
  594. Index: header.c
  595. Prereq: 2.47
  596. *** .d/header.c    Tue Mar 10 16:13:35 1987
  597. --- header.c    Mon Mar 23 13:59:38 1987
  598. ***************
  599. *** 17,21 ****
  600.   
  601.   #ifdef SCCSID
  602. ! static char    *SccsId = "@(#)header.c    2.47    3/9/87";
  603.   #endif /* SCCSID */
  604.   
  605. --- 17,21 ----
  606.   
  607.   #ifdef SCCSID
  608. ! static char    *SccsId = "@(#)header.c    2.48    3/20/87";
  609.   #endif /* SCCSID */
  610.   
  611. ***************
  612. *** 39,45 ****
  613.   int wholething;
  614.   {
  615. ! #ifndef HIDDENNET
  616.       register int    len;
  617. ! #endif /* HIDDENNET */
  618.       register int    i;
  619.   #ifdef OLD
  620. --- 39,45 ----
  621.   int wholething;
  622.   {
  623. ! #ifndef GENERICPATH
  624.       register int    len;
  625. ! #endif /* GENERICPATH */
  626.       register int    i;
  627.   #ifdef OLD
  628. ***************
  629. *** 97,105 ****
  630.   
  631.   strip:    /* strip off sys! from front of path. */
  632. ! #ifndef HIDDENNET
  633. !     if (strncmp(FULLSYSNAME, hp->path, (len = strlen(FULLSYSNAME))) == 0
  634.           && index(NETCHRS, hp->path[len]))
  635.           (void) strcpy(hp->path, &(hp->path[len+1]));
  636. ! #endif /* HIDDENNET */
  637.       lcase(hp->nbuf);
  638.   
  639. --- 97,105 ----
  640.   
  641.   strip:    /* strip off sys! from front of path. */
  642. ! #ifndef GENERICPATH
  643. !     if (strncmp(PATHSYSNAME, hp->path, (len = strlen(PATHSYSNAME))) == 0
  644.           && index(NETCHRS, hp->path[len]))
  645.           (void) strcpy(hp->path, &(hp->path[len+1]));
  646. ! #endif /* GENERICPATH */
  647.       lcase(hp->nbuf);
  648.   
  649. ***************
  650. *** 309,313 ****
  651.           host = index(tp, '!') + 1;
  652.       else if (user == tp)
  653. !         host = FULLSYSNAME;
  654.       else
  655.           host = tp;
  656. --- 309,313 ----
  657.           host = index(tp, '!') + 1;
  658.       else if (user == tp)
  659. !         host = FROMSYSNAME;
  660.       else
  661.           host = tp;
  662. ***************
  663. *** 316,320 ****
  664.       if (tp != NULL)
  665.           *tp = 0;
  666. !     (void) sprintf(hp->from, "%s@%s%s", user, host, mydomain());
  667.   
  668.       skin(pathbuf, fullname, hp->path);    /* remove RFC822-style comments */
  669. --- 316,323 ----
  670.       if (tp != NULL)
  671.           *tp = 0;
  672. !     if (index(host, '.') != NULL)
  673. !         (void) sprintf(hp->from, "%s@%s%s", user, host, mydomain());
  674. !     else
  675. !         (void) sprintf(hp->from, "%s@%s", user, host);
  676.   
  677.       skin(pathbuf, fullname, hp->path);    /* remove RFC822-style comments */
  678. ***************
  679. *** 631,639 ****
  680.        * first one it sees, so will ignore the second.
  681.        */
  682. !     if (prefix(hp->path, FULLSYSNAME) &&
  683. !         index(NETCHRS, hp->path[strlen(FULLSYSNAME)]))
  684.           fprintf(fp, "Path: %s\n", hp->path);
  685.       else
  686. !         fprintf(fp, "Path: %s!%s\n", FULLSYSNAME, hp->path);
  687.       if (hp->from[0])
  688.           fprintf(fp, "From: %s\n", hp->from);
  689. --- 634,642 ----
  690.        * first one it sees, so will ignore the second.
  691.        */
  692. !     if (prefix(hp->path, PATHSYSNAME) &&
  693. !         index(NETCHRS, hp->path[strlen(PATHSYSNAME)]))
  694.           fprintf(fp, "Path: %s\n", hp->path);
  695.       else
  696. !         fprintf(fp, "Path: %s!%s\n", PATHSYSNAME, hp->path);
  697.       if (hp->from[0])
  698.           fprintf(fp, "From: %s\n", hp->from);
  699. Index: ifuncs.c
  700. Prereq: 2.61
  701. *** .d/ifuncs.c    Tue Mar 10 16:13:41 1987
  702. --- ifuncs.c    Tue Mar 24 11:01:13 1987
  703. ***************
  704. *** 17,21 ****
  705.   
  706.   #ifdef SCCSID
  707. ! static char    *SccsId = "@(#)ifuncs.c    2.61    3/9/87";
  708.   #endif /* SCCSID */
  709.   
  710. --- 17,21 ----
  711.   
  712.   #ifdef SCCSID
  713. ! static char    *SccsId = "@(#)ifuncs.c    2.63    3/23/87";
  714.   #endif /* SCCSID */
  715.   
  716. ***************
  717. *** 75,81 ****
  718.       int nsent = 0;
  719.       char *sentsys;
  720. ! #ifdef HIDDENNET
  721.       int len;
  722. ! #endif /* HIDDENNET */
  723.   
  724.       /* h is a local copy of the header we can scribble on */
  725. --- 75,81 ----
  726.       int nsent = 0;
  727.       char *sentsys;
  728. ! #ifdef GENERICPATH
  729.       int len;
  730. ! #endif /* GENERICPATH */
  731.   
  732.       /* h is a local copy of the header we can scribble on */
  733. ***************
  734. *** 95,104 ****
  735.       /* break path into list of systems. */
  736.       hptr = h.path;
  737. ! #ifdef HIDDENNET
  738.       if (!is_rnews && 
  739. !         strncmp(FULLSYSNAME, h.path, (len = strlen(FULLSYSNAME))) == 0
  740.           && index(NETCHRS, h.path[len]))
  741.           (void) strcpy(h.path, &(h.path[len+1]));
  742. ! #endif HIDDENNET
  743.       sptr = hptr = h.path;
  744.       while ((hptr=strpbrk(hptr, NETCHRS)) != NULL) {
  745. --- 95,104 ----
  746.       /* break path into list of systems. */
  747.       hptr = h.path;
  748. ! #ifdef GENERICPATH
  749.       if (!is_rnews && 
  750. !         strncmp(PATHSYSNAME, h.path, (len = strlen(PATHSYSNAME))) == 0
  751.           && index(NETCHRS, h.path[len]))
  752.           (void) strcpy(h.path, &(h.path[len+1]));
  753. ! #endif /* GENERICPATH */
  754.       sptr = hptr = h.path;
  755.       while ((hptr=strpbrk(hptr, NETCHRS)) != NULL) {
  756. ***************
  757. *** 116,126 ****
  758.       while (s_read(&srec)) {
  759.           char *dist = h.distribution;
  760. ! #ifdef HIDDENNET
  761. !         if (strncmp(srec.s_name, LOCALSYSNAME, SNLN) == 0)
  762.               continue;
  763. - #else /* !HIDDENNET */
  764. -         if (strncmp(srec.s_name, FULLSYSNAME, SNLN) == 0)
  765. -             continue;
  766. - #endif /* !HIDDENNET */
  767.           if (sptr = srec.s_nosend) {
  768.               while (*sptr) {
  769. --- 116,121 ----
  770.       while (s_read(&srec)) {
  771.           char *dist = h.distribution;
  772. !         if (strncmp(srec.s_name, LOCALPATHSYSNAME, SNLN) == 0)
  773.               continue;
  774.           if (sptr = srec.s_nosend) {
  775.               while (*sptr) {
  776. ***************
  777. *** 342,346 ****
  778.       if (notify) {
  779.           char oldid[50];
  780. !         (void) sprintf(hh.title, "ihave %s %s", hh.ident, FULLSYSNAME);
  781.           (void) strcpy(hh.ctlmsg, hh.title);
  782.           (void) strcpy(hh.numlines, "0");
  783. --- 337,341 ----
  784.       if (notify) {
  785.           char oldid[50];
  786. !         (void) sprintf(hh.title, "ihave %s %s", hh.ident, PATHSYSNAME);
  787.           (void) strcpy(hh.ctlmsg, hh.title);
  788.           (void) strcpy(hh.numlines, "0");
  789. ***************
  790. *** 410,414 ****
  791.           if (afmt) {
  792.   #ifdef OLD
  793. !             fprintf(ofp, "A%s\n%s\n%s!%s\n%s\n%s\n", oident(hh.ident), hh.nbuf, FULLSYSNAME,
  794.                   hh.path, hh.subdate, hh.title);
  795.   #else /* !OLD */
  796. --- 405,409 ----
  797.           if (afmt) {
  798.   #ifdef OLD
  799. !             fprintf(ofp, "A%s\n%s\n%s!%s\n%s\n%s\n", oident(hh.ident), hh.nbuf, PATHSYSNAME,
  800.                   hh.path, hh.subdate, hh.title);
  801.   #else /* !OLD */
  802. ***************
  803. *** 787,797 ****
  804.       (void) fclose(fp);
  805.       unlock();
  806. ! #ifdef HIDDENNET
  807. !     if (strcmp(LOCALSYSNAME, FULLSYSNAME))
  808. !         (void) sprintf(hp->ident, "<%ld@%s.%s%s>", seqn, LOCALSYSNAME, FULLSYSNAME,
  809. !         mydomain());
  810. !     else
  811. ! #endif /* !HIDDENNET */
  812. !     (void) sprintf(hp->ident, "<%ld@%s%s>", seqn, FULLSYSNAME, mydomain());
  813.   }
  814.   
  815. --- 782,786 ----
  816.       (void) fclose(fp);
  817.       unlock();
  818. !     (void) sprintf(hp->ident, "<%ld@%s>", seqn, LOCALSYSNAME);
  819.   }
  820.   
  821. ***************
  822. *** 901,908 ****
  823.                   continue;
  824.               if (isproc)
  825. !                 cp = "Unknown newsgroup %s not localized";
  826.               else
  827. !                 cp = "Unknown newsgroup %s";
  828. !             logerr(cp, ngs[i]);
  829.   #ifdef ALWAYSALIAS
  830.               ++okcount;    /* so we know to exit below */
  831. --- 890,897 ----
  832.                   continue;
  833.               if (isproc)
  834. !                 log("Unknown newsgroup %s not localized",
  835. !                     ngs[i]);
  836.               else
  837. !                 logerr("Unknown newsgroup %s", ngs[i]);
  838.   #ifdef ALWAYSALIAS
  839.               ++okcount;    /* so we know to exit below */
  840. ***************
  841. *** 1014,1018 ****
  842.   
  843.       (void) sprintf(hp->path, "%s", logname);
  844. !     (void) sprintf(hp->from, "%s@%s%s (%s)", logname, FULLSYSNAME, mydomain(), fn);
  845.   }
  846.   
  847. --- 1003,1007 ----
  848.   
  849.       (void) sprintf(hp->path, "%s", logname);
  850. !     (void) sprintf(hp->from, "%s@%s (%s)", logname, FROMSYSNAME, fn);
  851.   }
  852.   
  853. ***************
  854. *** 1064,1067 ****
  855. --- 1053,1057 ----
  856.       int c;
  857.   
  858. +     setbuf(infp, NULL);
  859.       while ((c = getc(infp)) == '#') {
  860.           /* some kind of batch, investigate further */
  861. ***************
  862. *** 1071,1078 ****
  863.           fgets(cmd + 1, BUFLEN, infp);
  864.           if (strncmp(cmd, "#! cunbatch", 11) == 0) {
  865. -             reset_infp();
  866. -             i = strlen(cmd);
  867. -             (void) lseek(0, (long) i, 0);    /* position STDIN for
  868. -                              * exec */
  869.               (void) sprintf(cmd, "%s/compress", LIB);
  870.               input_pipe(cmd, "compress", "-d", (char *) 0);
  871. --- 1061,1064 ----
  872. ***************
  873. *** 1079,1090 ****
  874.               continue;    /* look for the #! rnews */
  875.           } else if (strncmp(cmd, "#! c7unbatch", 12) == 0) {
  876. !             reset_infp();
  877. !             i = strlen(cmd);
  878. !             (void) lseek(0, (long) i, 0);    /* position STDIN for
  879. !                              * exec */
  880. !             (void) sprintf(cmd, "%s/decode | %s/compress -d", LIB, LIB);
  881.               input_pipe("/bin/sh", "news-unpack", "-c", cmd);
  882.               continue;    /* look for the #! rnews */
  883. !         } else if (strncmp(cmd, "#! rnews", 8) == 0) {
  884.               /* instead of execing unbatch do it ourselves */
  885.               register int fd, rc, wc;
  886. --- 1065,1074 ----
  887.               continue;    /* look for the #! rnews */
  888.           } else if (strncmp(cmd, "#! c7unbatch", 12) == 0) {
  889. !             (void) sprintf(cmd, "%s/decode | %s/compress -d",
  890. !                 LIB, LIB);
  891.               input_pipe("/bin/sh", "news-unpack", "-c", cmd);
  892.               continue;    /* look for the #! rnews */
  893. !         } else if (strncmp(cmd, "#! rnews ", 9) == 0 ||
  894. !             strncmp(cmd, "! rnews ", 8) == 0) {
  895.               /* instead of execing unbatch do it ourselves */
  896.               register int fd, rc, wc;
  897. ***************
  898. *** 1093,1098 ****
  899.               char *filename;
  900.               int pid, wpid, exstat;
  901. -             char *mktemp();
  902. -             long atol();
  903.   #define CPBFSZ 8192
  904.               char buf[CPBFSZ];
  905. --- 1077,1080 ----
  906. ***************
  907. *** 1162,1169 ****
  908.                        * instead of a temporary file. 
  909.                        */
  910. !                     if (pipe(piped) != 0) {
  911. !                         perror("checkbatch: pipe() failed");
  912. !                         exit(1);
  913. !                     }
  914.                   }
  915.                   while ((pid = fork()) == -1) {
  916. --- 1144,1149 ----
  917.                        * instead of a temporary file. 
  918.                        */
  919. !                     if (pipe(piped) != 0)
  920. !                         xerror("checkbatch: pipe() failed");
  921.                   }
  922.                   while ((pid = fork()) == -1) {
  923. ***************
  924. *** 1210,1216 ****
  925.   
  926.           } else {
  927. -             reset_infp();
  928. -             i = strlen(cmd);
  929. -             (void) lseek(0, (long)i, 0);
  930.               docmd(cmd);
  931.               xxit(0);
  932. --- 1190,1193 ----
  933. ***************
  934. *** 1238,1242 ****
  935.       }
  936.       fflush(stdout);
  937. !     while ((pid = fork()) == -1) {
  938.           perror("checkbatch: fork failed, waiting");
  939.           sleep(60);
  940. --- 1215,1219 ----
  941.       }
  942.       fflush(stdout);
  943. !     while ((pid = vfork()) == -1) {
  944.           perror("checkbatch: fork failed, waiting");
  945.           sleep(60);
  946. ***************
  947. *** 1326,1362 ****
  948.       xxit(2);
  949.   }
  950. - /*
  951. -  * We've already done a read on stdin, and we want to seek back to the
  952. -  * beginning.  We want the real file descriptor (beyond buffers) to
  953. -  * reflect the true beginning.  Do whatever is necessary.
  954. -  */
  955. - reset_infp()
  956. - {
  957. -     register FILE *ofd;
  958. -     register int c;
  959. -     char *ofdname;
  960. -     /* First try to seek back - if so, it's a cheap way back. */
  961. -     if (lseek(0, 0L, 0) == 0L)
  962. -         return;
  963. -     /* Can't seek, so have to copy input to a file and use that. */
  964. -     ofdname = "/tmp/inewsXXXXXX";
  965. -     (void) mktemp(ofdname);
  966. -     ofd = fopen(ofdname, "w");
  967. -     while ((c=getc(infp)) != EOF)
  968. -         putc(c, ofd);
  969. -     if (ferror(ofd))
  970. -         xerror("write failed on temp file %s", ofdname);
  971. -     (void) fclose(ofd);
  972. -     (void) fclose(infp);
  973. -     /* Now for a few lower level hacks to reopen stdin and make
  974. -      * absolutely sure that the right fd's are done for the exec.
  975. -      */
  976. -     (void) close(0);        /* make sure stdin is really closed. */
  977. -     (void) open(ofdname, 0);
  978. -     (void) unlink(ofdname);        /* to avoid cleaning it up later. */
  979. - }
  980.   #endif /* BATCH */
  981.   
  982. --- 1303,1306 ----
  983. ***************
  984. *** 1452,1463 ****
  985.   lock()
  986.   {
  987. !     LockFd = open(SUBFILE,0);
  988.       /* This will sleep until the other program releases the lock */
  989.       /* We may need to alarm out of this, but I don't think so */
  990.   #ifdef LOCKF
  991. !     (void) lockf(LockFd, F_LOCK, 0);
  992.   #else
  993. !     (void) flock(LockFd, LOCK_EX);
  994.   #endif
  995.   }
  996.   
  997. --- 1396,1410 ----
  998.   lock()
  999.   {
  1000. !     LockFd = open(SUBFILE, 2);
  1001. !     if (LockFd < 0)
  1002. !         logerr("Can't open(%s,2) to lock", SUBFILE);
  1003.       /* This will sleep until the other program releases the lock */
  1004.       /* We may need to alarm out of this, but I don't think so */
  1005.   #ifdef LOCKF
  1006. !     if (lockf(LockFd, F_LOCK, 0) < 0)
  1007.   #else
  1008. !      if (flock(LockFd, LOCK_EX) < 0)
  1009.   #endif
  1010. +         xerror("Can't get lock on %s: %s", SUBFILE, errmsg(errno));
  1011.   }
  1012.   
  1013. ***************
  1014. *** 1491,1523 ****
  1015.   #endif /* !BSD4_2 */
  1016.   #endif /* !VMS */
  1017. - /*
  1018. -  * Generate the name of the person responsible for posting this article,
  1019. -  * in order to check that two articles were posted by the same person.
  1020. -  */
  1021. - char *
  1022. - senderof(hp)
  1023. - struct hbuf *hp;
  1024. - {
  1025. -     register char *r, *q, *tp;
  1026. -     char *tailpath();
  1027. -     if (hp->sender[0])
  1028. -         tp = hp->sender;
  1029. -     else if (hp->from[0])
  1030. -         tp = hp->from;
  1031. -     else
  1032. -         tp = tailpath(hp);
  1033. -     /* Remove full name */
  1034. -     q = index(tp, ' ');
  1035. -     if (q)
  1036. -         *q = '\0';
  1037. -     r = AllocCpy(tp);
  1038. -     if (q != NULL)
  1039. -         *q = ' ';
  1040. -     return r;
  1041. - }
  1042.   
  1043.   /* VARARGS1 */
  1044. --- 1438,1441 ----
  1045.  
  1046. Index: inews.c
  1047. Prereq: 2.76
  1048. *** .d/inews.c    Tue Mar 10 16:13:29 1987
  1049. --- inews.c    Tue Mar 24 11:01:30 1987
  1050. ***************
  1051. *** 18,22 ****
  1052.   
  1053.   #ifdef SCCSID
  1054. ! static char    *SccsId = "@(#)inews.c    2.76    3/10/87";
  1055.   #endif /* SCCSID */
  1056.   
  1057. --- 18,22 ----
  1058.   
  1059.   #ifdef SCCSID
  1060. ! static char    *SccsId = "@(#)inews.c    2.78    3/23/87";
  1061.   #endif /* SCCSID */
  1062.   
  1063. ***************
  1064. *** 25,28 ****
  1065. --- 25,31 ----
  1066.   # ifdef LOCKF
  1067.   # include <unistd.h>
  1068. + # include <fcntl.h>
  1069. + struct flock news_lock;
  1070.   # endif /* LOCKF */
  1071.   
  1072. ***************
  1073. *** 32,36 ****
  1074.   #else    /* !BSD4_2 */
  1075.   # include "ndir.h"
  1076. ! # ifdef USG
  1077.   # include <fcntl.h>
  1078.   # endif /* USG */
  1079. --- 35,39 ----
  1080.   #else    /* !BSD4_2 */
  1081.   # include "ndir.h"
  1082. ! # if defined(USG) && !defined(LOCKF)
  1083.   # include <fcntl.h>
  1084.   # endif /* USG */
  1085. ***************
  1086. *** 81,84 ****
  1087. --- 84,88 ----
  1088.   'a',    '\0',        FALSE,    UNPROC, UNKNOWN,    header.approved,
  1089.   'U',    '\0',        FALSE,    PROC, PROC,        filename,
  1090. + #define Sflag    options[14].flag
  1091.   'S',    '\0',        FALSE,    UNKNOWN|PROC,     UNPROC,    filename,
  1092.   'x',    '\0',        FALSE,    UNPROC, UNKNOWN,    not_here,
  1093. ***************
  1094. *** 88,92 ****
  1095.   
  1096.   FILE *mailhdr();
  1097. - extern char *mydomain();
  1098.   extern int errno;
  1099.   
  1100. --- 92,95 ----
  1101. ***************
  1102. *** 130,145 ****
  1103.       actfp = xfopen(ACTIVE, "r+");
  1104.   #ifdef    LOCKF
  1105. !     if (lockf(fileno(actfp), F_TLOCK, 0) < 0 &&
  1106. !         (errno == EAGAIN || errno == EACCES))
  1107.   #else    /* !LOCKF */
  1108.   #ifdef BSD4_2
  1109. !     if (flock(fileno(actfp), LOCK_SH|LOCK_NB) < 0 && errno == EWOULDBLOCK)
  1110.   #else    /* !BSD4_2 */
  1111.       sprintf(bfr, "%s.lock", ACTIVE);
  1112. !     if (LINK(ACTIVE,bfr) < 0 && errno == EEXIST)
  1113.   #endif /* V7 */
  1114.   #endif    /* !BSD4_2 */
  1115.           spool_news = 2;
  1116. !     else {
  1117.   #ifdef SPOOLNEWS
  1118.           if (argc > 1 && !strcmp(*(argv+1), "-S")) {
  1119. --- 133,156 ----
  1120.       actfp = xfopen(ACTIVE, "r+");
  1121.   #ifdef    LOCKF
  1122. ! # ifdef    F_RDLCK
  1123. !     news_lock.l_type = F_RDLCK;
  1124. !     if (fcntl(fileno(actfp), F_SETLK, &news_lock) < 0) {
  1125. ! # else /* !F_RDLCK */
  1126. !     if (lockf(fileno(actfp), F_TLOCK, 0) < 0) {
  1127. ! # endif /* !F_RDLCK */
  1128. !         if (errno != EAGAIN && errno != EACCES)
  1129.   #else    /* !LOCKF */
  1130.   #ifdef BSD4_2
  1131. !     if (flock(fileno(actfp), LOCK_SH|LOCK_NB) < 0) {
  1132. !         if (errno != EWOULDBLOCK)
  1133.   #else    /* !BSD4_2 */
  1134.       sprintf(bfr, "%s.lock", ACTIVE);
  1135. !     if (LINK(ACTIVE, bfr) < 0) {
  1136. !         if (errno != EEXIST)
  1137.   #endif /* V7 */
  1138.   #endif    /* !BSD4_2 */
  1139. +             xerror("Can't lock %s: %s", ACTIVE, errmsg(errno));
  1140.           spool_news = 2;
  1141. !     } else {
  1142.   #ifdef SPOOLNEWS
  1143.           if (argc > 1 && !strcmp(*(argv+1), "-S")) {
  1144. ***************
  1145. *** 146,149 ****
  1146. --- 157,161 ----
  1147.               argc--;
  1148.               argv++;
  1149. +             Sflag = 1;
  1150.           } else
  1151.               spool_news = 1;
  1152. ***************
  1153. *** 154,163 ****
  1154.           /* only unlock if we locked */
  1155.   #ifdef    LOCKF
  1156. !         lockf(fileno(actfp), F_ULOCK, 0);
  1157.   #else    /* !LOCKF */
  1158.   #ifdef     BSD4_2
  1159. !         flock(fileno(actfp), LOCK_UN);
  1160.   #else    /* !BSD4_2 */
  1161. !         UNLINK(bfr);
  1162.   #endif     /* V7 */
  1163.   #endif    /* !BSD4_2 */
  1164. --- 166,175 ----
  1165.           /* only unlock if we locked */
  1166.   #ifdef    LOCKF
  1167. !         (void) lockf(fileno(actfp), F_ULOCK, 0);
  1168.   #else    /* !LOCKF */
  1169.   #ifdef     BSD4_2
  1170. !         (void) flock(fileno(actfp), LOCK_UN);
  1171.   #else    /* !BSD4_2 */
  1172. !         (void) UNLINK(bfr);
  1173.   #endif     /* V7 */
  1174.   #endif    /* !BSD4_2 */
  1175. ***************
  1176. *** 195,199 ****
  1177.   #else
  1178.       chkdir(ARTFILE);
  1179. ! #endif DBM
  1180.       chkfile(ACTIVE);
  1181.       SigTrap = FALSE;    /* true if a signal has been caught */
  1182. --- 207,211 ----
  1183.   #else
  1184.       chkdir(ARTFILE);
  1185. ! #endif /* DBM */
  1186.       chkfile(ACTIVE);
  1187.       SigTrap = FALSE;    /* true if a signal has been caught */
  1188. ***************
  1189. *** 224,232 ****
  1190.       }
  1191.   
  1192. - #ifndef IHCC
  1193.       /*
  1194. !      * We force the use of 'getuser()' to prevent forgery of articles
  1195.        * by just changing $LOGNAME
  1196.        */
  1197.       if (isatty(fileno(stderr))) {
  1198.           if ((user = getenv("USER")) == NULL)
  1199. --- 236,244 ----
  1200.       }
  1201.   
  1202.       /*
  1203. !      * IHCC forces the use of 'getuser()' to prevent forgery of articles
  1204.        * by just changing $LOGNAME
  1205.        */
  1206. + #ifndef IHCC 
  1207.       if (isatty(fileno(stderr))) {
  1208.           if ((user = getenv("USER")) == NULL)
  1209. ***************
  1210. *** 235,239 ****
  1211.               home = getenv("LOGDIR");
  1212.       }
  1213. ! #endif
  1214.       if (user == NULL || home == NULL)
  1215.           getuser();
  1216. --- 247,251 ----
  1217.               home = getenv("LOGDIR");
  1218.       }
  1219. ! #endif /* !IHCC */
  1220.       if (user == NULL || home == NULL)
  1221.           getuser();
  1222. ***************
  1223. *** 340,348 ****
  1224.               (void) hread(&header, infp, FALSE);
  1225.               /* there are certain fields we won't let him specify. */
  1226. !             if (header.from[0])
  1227. !                 (void) strcpy(forgedname, header.from);
  1228.               if (!header.approved[0])
  1229.                   Mflag = FALSE;
  1230. -             header.from[0] = '\0';
  1231.               header.sender[0] = '\0';
  1232.               if (header.subdate[0] && cgtdate(header.subdate) < 0)
  1233. --- 352,374 ----
  1234.               (void) hread(&header, infp, FALSE);
  1235.               /* there are certain fields we won't let him specify. */
  1236. !             if (header.from[0]) {
  1237. !                 if (Sflag) {
  1238. !                     register char *p;
  1239. !                     strcpy(bfr, header.from);
  1240. !                     p  = strpbrk(bfr, "@ !");
  1241. !                     if (p)
  1242. !                         *p = '\0';
  1243. !                     if ((pw = getpwnam(bfr)) != NULL) {
  1244. !                         uid = pw->pw_uid;
  1245. !                         gid = pw->pw_gid;
  1246. !                         username = AllocCpy(bfr);
  1247. !                     }
  1248. !                 } else {
  1249. !                     (void) strcpy(forgedname, header.from);
  1250. !                     header.from[0] = '\0';
  1251. !                 }
  1252. !             }
  1253.               if (!header.approved[0])
  1254.                   Mflag = FALSE;
  1255.               header.sender[0] = '\0';
  1256.               if (header.subdate[0] && cgtdate(header.subdate) < 0)
  1257. ***************
  1258. *** 357,361 ****
  1259.               if (Mflag)
  1260.                   sprintf(header.path, "%s!%s",
  1261. !                     FULLSYSNAME, username);
  1262.               else if (!header.path[0]) {
  1263.                   (void) strcpy(header.path, forgedname);
  1264. --- 383,387 ----
  1265.               if (Mflag)
  1266.                   sprintf(header.path, "%s!%s",
  1267. !                     PATHSYSNAME, username);
  1268.               else if (!header.path[0]) {
  1269.                   (void) strcpy(header.path, forgedname);
  1270. ***************
  1271. *** 365,375 ****
  1272.               }
  1273.               if (!Mflag && !strpbrk(forgedname, "@ (<"))
  1274. !                 (void) sprintf(header.from,"%s@%s%s",
  1275. !                     forgedname, FULLSYSNAME, mydomain());
  1276.               else
  1277.                   (void) strncpy(header.from, forgedname, BUFLEN);
  1278.   
  1279. !             (void) sprintf(header.sender, "%s@%s%s",
  1280. !                 username, FULLSYSNAME, mydomain());
  1281.           } else {
  1282.               gensender(&header, username);
  1283. --- 391,401 ----
  1284.               }
  1285.               if (!Mflag && !strpbrk(forgedname, "@ (<"))
  1286. !                 (void) sprintf(header.from,"%s@%s",
  1287. !                     forgedname, FROMSYSNAME);
  1288.               else
  1289.                   (void) strncpy(header.from, forgedname, BUFLEN);
  1290.   
  1291. !             (void) sprintf(header.sender, "%s@%s",
  1292. !                 username, FROMSYSNAME);
  1293.           } else {
  1294.               gensender(&header, username);
  1295. ***************
  1296. *** 476,497 ****
  1297.       char    cbuf[BUFLEN];    /* command buffer            */
  1298.   
  1299. !     if (!rwaccess(f)) {
  1300. !         mfd = mailhdr((struct hbuf *)NULL, exists(f) ? "Unwritable files!" : "Missing files!");
  1301. !         if (mfd != NULL) {
  1302. !             putc('\n', mfd);
  1303. ! #ifdef HIDDENNET
  1304. !             fprintf(mfd, "System: %s.%s\n\nThere was a problem with %s!!\n", LOCALSYSNAME, FULLSYSNAME, f);
  1305. ! #else /* !HIDDENNET */
  1306. !             fprintf(mfd, "System: %s\n\nThere was a problem with %s!!\n", FULLSYSNAME, f);
  1307. ! #endif /* !HIDDENNET */
  1308. !             (void) sprintf(cbuf, "touch %s;chmod 666 %s", f, f);
  1309. !             (void) system(cbuf);
  1310. !             if (rwaccess(f))
  1311. !                 fprintf(mfd, "The problem has been taken care of.\n");
  1312. !             else
  1313. !                 fprintf(mfd, "Corrective action failed - check suid bits.\n");
  1314. !             (void) mclose(mfd);
  1315. !         }
  1316. !     }
  1317.   }
  1318.   
  1319. --- 502,521 ----
  1320.       char    cbuf[BUFLEN];    /* command buffer            */
  1321.   
  1322. !     if (rwaccess(f))
  1323. !         return;    /* everything is ok */
  1324. !     mfd = mailhdr((struct hbuf *)NULL,
  1325. !         exists(f) ? "Unwritable files!" : "Missing files!");
  1326. !     if (mfd == NULL)
  1327. !         return;
  1328. !     putc('\n', mfd);
  1329. !     fprintf(mfd, "System: %s\n\nThere was a problem with %s!!\n",
  1330. !         LOCALSYSNAME, f);
  1331. !     (void) sprintf(cbuf, "touch %s;chmod 666 %s", f, f);
  1332. !     (void) system(cbuf);
  1333. !     if (rwaccess(f))
  1334. !         fprintf(mfd, "The problem has been taken care of.\n");
  1335. !     else
  1336. !         fprintf(mfd, "Corrective action failed - check suid bits.\n");
  1337. !     (void) mclose(mfd);
  1338.   }
  1339.   
  1340. ***************
  1341. *** 505,525 ****
  1342.   
  1343.       sprintf(dir, "%s.d", d);
  1344. !     if (eaccess(dir, 07) != 0) {
  1345. !         mfd = mailhdr((struct hbuf *)NULL, exists(dir) ? "Unwritable diretories!" : "Missing directories!");
  1346. !         if (mfd != NULL) {
  1347. !             putc('\n', mfd);
  1348. ! #ifdef HIDDENNET
  1349. !             fprintf(mfd, "System: %s.%s\n\nThere was a problem with %s!!\n", LOCALSYSNAME, FULLSYSNAME, dir);
  1350. ! #else /* !HIDDENNET */
  1351. !             fprintf(mfd, "System: %s\n\nThere was a problem with %s!!\n", FULLSYSNAME, dir);
  1352. ! #endif /* !HIDDENNET */
  1353. !             (void) mkdir(dir, 0775);
  1354. !             if (eaccess(dir, 07) == 0)
  1355. !                 fprintf(mfd, "The problem has been taken care of.\n");
  1356. !             else
  1357. !                 fprintf(mfd, "Corrective action failed - check suid bits.\n");
  1358. !             (void) mclose(mfd);
  1359. !         }
  1360. !     }
  1361.   }
  1362.   
  1363. --- 529,547 ----
  1364.   
  1365.       sprintf(dir, "%s.d", d);
  1366. !     if (eaccess(dir, 07) == 0)
  1367. !         return; /* everything is ok */
  1368. !     mfd = mailhdr((struct hbuf *)NULL,
  1369. !         exists(dir) ? "Unwritable directories" : "Missing directories");
  1370. !     if (mfs == NULL)
  1371. !         return;
  1372. !     putc('\n', mfd);
  1373. !     fprintf(mfd, "System: %s\n\nThere was a problem with %s!\n",
  1374. !         LOCALSYSNAME, dir);
  1375. !     (void) mkdir(dir, 0775);
  1376. !     if (eaccess(dir, 07) == 0)
  1377. !         fprintf(mfd, "The problem has been taken care of.\n");
  1378. !     else
  1379. !         fprintf(mfd, "Corrective action failed - check suid bits.\n");
  1380. !     (void) mclose(mfd);
  1381.   }
  1382.   
  1383. ***************
  1384. *** 527,531 ****
  1385.    * This version of access checks against effective uid and effective gid
  1386.    */
  1387.   eaccess(name, mode)
  1388.   register char *name;
  1389. --- 549,552 ----
  1390. ***************
  1391. *** 577,588 ****
  1392.       register struct tm *tp;
  1393.       time_t t;
  1394. !     char buf[BUFLEN], *mktemp();
  1395.       extern struct tm *gmtime();
  1396.   
  1397. !     sp = xfopen(mktemp(INFILE), "w");
  1398. !     if (batchcmd != NULL)
  1399. !         fprintf(sp, "%s\n", batchcmd);
  1400. !     else
  1401.           if (not_here[0] != '\0')
  1402.               fprintf(sp, "#! inews -x %s -p\n", not_here);
  1403.       if (dolhwrite)
  1404. --- 598,613 ----
  1405.       register struct tm *tp;
  1406.       time_t t;
  1407. !     char buf[BUFLEN], sfile[BUFLEN];
  1408.       extern struct tm *gmtime();
  1409.   
  1410. !     (void) sprintf(sfile, "%s/.spXXXXXX", SPOOL);
  1411. !     sp = xfopen(mktemp(sfile), "w");
  1412. !     if (batchcmd != NULL) {
  1413.           if (not_here[0] != '\0')
  1414. +             fprintf(sp, "%s -x %s\n", batchcmd, not_here);
  1415. +         else
  1416. +             fprintf(sp, "%s\n", batchcmd);
  1417. +     } else
  1418. +         if (not_here[0] != '\0')
  1419.               fprintf(sp, "#! inews -x %s -p\n", not_here);
  1420.       if (dolhwrite)
  1421. ***************
  1422. *** 608,612 ****
  1423.           tp->tm_year, tp->tm_mon+1, tp->tm_mday,
  1424.           tp->tm_hour, tp->tm_min, getpid());
  1425. !     if (LINK(INFILE, buf) < 0) {
  1426.           char dbuf[BUFLEN];
  1427.   #ifdef VMS
  1428. --- 633,637 ----
  1429.           tp->tm_year, tp->tm_mon+1, tp->tm_mday,
  1430.           tp->tm_hour, tp->tm_min, getpid());
  1431. !     if (LINK(sfile, buf) < 0) {
  1432.           char dbuf[BUFLEN];
  1433.   #ifdef VMS
  1434. ***************
  1435. *** 617,625 ****
  1436.           if (mkdir(dbuf, 0777&~N_UMASK) < 0)
  1437.               xerror("Cannot mkdir %s: %s", dbuf, errmsg(errno));
  1438. !         if (LINK(INFILE, buf) < 0) 
  1439. !             xerror("Cannot link(%s,%s): %s", INFILE, buf,
  1440.                   errmsg(errno));
  1441.       }
  1442. !     (void) UNLINK(INFILE);
  1443.       xxit(0);
  1444.       /* NOTREACHED */
  1445. --- 642,650 ----
  1446.           if (mkdir(dbuf, 0777&~N_UMASK) < 0)
  1447.               xerror("Cannot mkdir %s: %s", dbuf, errmsg(errno));
  1448. !         if (LINK(sfile, buf) < 0) 
  1449. !             xerror("Cannot link(%s,%s): %s", sfile, buf,
  1450.                   errmsg(errno));
  1451.       }
  1452. !     (void) UNLINK(sfile);
  1453.       xxit(0);
  1454.       /* NOTREACHED */
  1455. ***************
  1456. *** 652,657 ****
  1457.   
  1458.       if (header.approved[0] == '\0')
  1459. !         (void) sprintf(header.approved, "%s@%s%s",
  1460. !                 username, FULLSYSNAME, mydomain());
  1461.       (void) sprintf(bfr, "%s/inews -n %s.ctl -c newgroup %s -d %s -a \"%s\"",
  1462.           LIB, header.nbuf, header.ctlmsg, header.distribution,
  1463. --- 677,682 ----
  1464.   
  1465.       if (header.approved[0] == '\0')
  1466. !         (void) sprintf(header.approved, "%s@%s",
  1467. !                 username, FROMSYSNAME);
  1468.       (void) sprintf(bfr, "%s/inews -n %s.ctl -c newgroup %s -d %s -a \"%s\"",
  1469.           LIB, header.nbuf, header.ctlmsg, header.distribution,
  1470. ***************
  1471. *** 900,907 ****
  1472.       }
  1473.   
  1474. !     if (spool_news && mode != PROC) {
  1475. !         fprintf(stderr,"Your article has been spooled for later processing.\n");
  1476. !         dospool("#! inews -S -h", TRUE);
  1477. !         /* NOT REACHED */
  1478.       }
  1479.   
  1480. --- 925,937 ----
  1481.       }
  1482.   
  1483. !     if (mode != PROC && spool_news)  {
  1484. !         if (spool_news == 1 && ngmatch(header.nbuf, "to.all.ctl"))
  1485. !             spool_news = 0;
  1486. !         if (spool_news) {
  1487. !             fprintf(stderr,
  1488. !             "Your article has been spooled for later processing.\n");
  1489. !             dospool("#! inews -S -h", TRUE);
  1490. !             /* NOT REACHED */
  1491. !         }
  1492.       }
  1493.   
  1494. ***************
  1495. *** 911,924 ****
  1496.               savehist(histline);
  1497.       } else {
  1498. ! #ifdef HIDDENNET
  1499. !         if (s_find(&srec, LOCALSYSNAME) == FALSE) {
  1500. ! #else /* !HIDDENNET */
  1501. !         if (s_find(&srec, FULLSYSNAME) == FALSE) {
  1502. ! #endif /* !HIDDENNET */
  1503. !             logerr("Cannot find my name '%s' in %s", FULLSYSNAME, SUBFILE);
  1504.               srec = dummy_srec;
  1505.           }
  1506.   #ifdef DOXREFS
  1507. !         (void) strncpy(nextref, FULLSYSNAME, BUFLEN);
  1508.   #endif /* DOXREFS */
  1509.           for (ptr = nbuf; *ptr;) {
  1510. --- 941,950 ----
  1511.               savehist(histline);
  1512.       } else {
  1513. !         if (s_find(&srec, PATHSYSNAME) == FALSE) {
  1514. !             logerr("Cannot find my name '%s' in %s", PATHSYSNAME, SUBFILE);
  1515.               srec = dummy_srec;
  1516.           }
  1517.   #ifdef DOXREFS
  1518. !         (void) strncpy(nextref, PATHSYSNAME, BUFLEN);
  1519.   #endif /* DOXREFS */
  1520.           for (ptr = nbuf; *ptr;) {
  1521. ***************
  1522. *** 988,992 ****
  1523.           }
  1524.   #ifdef SIGTTOU
  1525. !         signal(SIGTTOU, SIG_IGN);
  1526.   #endif /* SIGTTOU */
  1527.           savehist(histline);
  1528. --- 1014,1018 ----
  1529.           }
  1530.   #ifdef SIGTTOU
  1531. !         (void) signal(SIGTTOU, SIG_IGN);
  1532.   #endif /* SIGTTOU */
  1533.           savehist(histline);
  1534. ***************
  1535. *** 1067,1071 ****
  1536.               username);
  1537.   
  1538. !     if (mode != PROC && !is_ctl && header.sender[0] == '\0') {
  1539.           int siglines = 0;
  1540.           char sbuf[BUFLEN];
  1541. --- 1093,1097 ----
  1542.               username);
  1543.   
  1544. !     if (mode != PROC && !is_ctl && header.sender[0] == '\0' && !Sflag) {
  1545.           int siglines = 0;
  1546.           char sbuf[BUFLEN];
  1547. ***************
  1548. *** 1214,1217 ****
  1549. --- 1240,1246 ----
  1550.       int pid, status, ret;
  1551.       char spbuf[BUFLEN];
  1552. + #ifdef LOCKF
  1553. +     FILE* LockFd;
  1554. + #endif /* LOCKF */
  1555.   #ifdef VMS
  1556.       sprintf(spbuf, "%s/+rnews", SPOOL);
  1557. ***************
  1558. *** 1227,1236 ****
  1559.           xerror("opendir can't open .:%s", errmsg(errno));
  1560.   #ifdef    LOCKF
  1561. !     if (lockf(dirp->dd_fd, F_TLOCK, 0) < 0 &&
  1562. !         (errno == EAGAIN || errno == EACCES)) {
  1563.   #else    /* !LOCKF */
  1564.   #ifdef BSD4_2
  1565. !     if (flock(dirp->dd_fd, LOCK_EX|LOCK_NB) < 0 &&
  1566. !         errno == EWOULDBLOCK) {
  1567.   #else    /* V7 */
  1568.       strcat(spbuf, ".lock");
  1569. --- 1256,1266 ----
  1570.           xerror("opendir can't open .:%s", errmsg(errno));
  1571.   #ifdef    LOCKF
  1572. !     LockFd = xfopen(SEQFILE, "r+w");
  1573. !     if (lockf(fileno(LockFd), F_TLOCK, 0) < 0) {
  1574. !         if (errno != EAGAIN && errno != EACCES)
  1575.   #else    /* !LOCKF */
  1576.   #ifdef BSD4_2
  1577. !     if (flock(dirp->dd_fd, LOCK_EX|LOCK_NB) < 0) {
  1578. !         if (errno != EWOULDBLOCK)
  1579.   #else    /* V7 */
  1580.       strcat(spbuf, ".lock");
  1581. ***************
  1582. *** 1240,1247 ****
  1583.           (void) UNLINK(bfr);
  1584.           if (errno != EEXIST)
  1585. -             xerror("Can't lock %s: %s", spbuf, errmsg(errno));
  1586. -         else
  1587.   #endif /* V7 */
  1588.   #endif    /* !LOCKF */
  1589.           xxit(3); /* another rnews -U is running */
  1590.       }
  1591. --- 1270,1276 ----
  1592.           (void) UNLINK(bfr);
  1593.           if (errno != EEXIST)
  1594.   #endif /* V7 */
  1595.   #endif    /* !LOCKF */
  1596. +             xerror("Can't lock %s: %s", spbuf, errmsg(errno));
  1597.           xxit(3); /* another rnews -U is running */
  1598.       }
  1599. ***************
  1600. *** 1256,1261 ****
  1601. --- 1285,1297 ----
  1602.                   xerror("Can't fork: %s", errmsg(errno));
  1603.               if (pid == 0) {
  1604. + #ifdef IHCC
  1605. +                 char bufr[BUFSIZ];
  1606. +                 sprintf(bufr, "%s/%s", logdir(HOME), RNEWS);
  1607. +                 execl(bufr, "rnews", "-S", "-p", dir->d_name,
  1608. +                     (char *) NULL);
  1609. + #else /* !IHCC */
  1610.                   execl(RNEWS, "rnews", "-S", "-p", dir->d_name,
  1611.                       (char *) NULL);
  1612. + #endif /* !IHCC */
  1613.                   _exit(1);
  1614.               }
  1615. ***************
  1616. *** 1280,1284 ****
  1617.           rewinddir(dirp);
  1618.       } while (foundsome); /* keep rereading the directory until it's empty */
  1619. -     closedir(dirp);
  1620.       (void) UNLINK(spbuf);
  1621.   
  1622. --- 1316,1319 ----
  1623. Index: ndir.c
  1624. Prereq: 1.10
  1625. *** .d/ndir.c    Tue Mar 10 16:13:37 1987
  1626. --- ndir.c    Mon Mar 23 13:59:15 1987
  1627. ***************
  1628. *** 5,9 ****
  1629.   
  1630.   #ifdef SCCSID
  1631. ! static char    *SccsId = "@(#)ndir.c    1.10    3/9/87";
  1632.   #endif /* SCCSID */
  1633.   
  1634. --- 5,9 ----
  1635.   
  1636.   #ifdef SCCSID
  1637. ! static char    *SccsId = "@(#)ndir.c    1.11    3/20/87";
  1638.   #endif /* SCCSID */
  1639.   
  1640. ***************
  1641. *** 113,117 ****
  1642.       long curloc, base, offset;
  1643.       struct direct *dp;
  1644. !     extern long lseek();
  1645.   
  1646.       curloc = telldir(dirp);
  1647. --- 113,117 ----
  1648.       long curloc, base, offset;
  1649.       struct direct *dp;
  1650. !     long lseek(), telldir();
  1651.   
  1652.       curloc = telldir(dirp);
  1653.  
  1654. Index: params.h
  1655. Prereq: 2.21
  1656. *** .d/params.h    Thu Oct 30 16:11:55 1986
  1657. --- params.h    Mon Mar 23 13:58:58 1987
  1658. ***************
  1659. *** 3,7 ****
  1660.    */
  1661.   
  1662. ! /*    @(#)params.h    2.21    10/23/86        */
  1663.   
  1664.   #include <stdio.h>
  1665. --- 3,7 ----
  1666.    */
  1667.   
  1668. ! /*    @(#)params.h    2.22    3/20/87    */
  1669.   
  1670.   #include <stdio.h>
  1671. ***************
  1672. *** 73,83 ****
  1673.   #endif /* NOTIFY */
  1674.   
  1675. ! #ifdef HIDDENNET
  1676. ! extern char    *LOCALSYSNAME;
  1677. ! #endif /* HIDDENNET */
  1678.   
  1679. - extern    char    *FULLSYSNAME;
  1680.   #ifndef SHELL
  1681. ! extern char    *SHELL;
  1682.   #endif /* !SHELL */
  1683.   
  1684. --- 73,80 ----
  1685.   #endif /* NOTIFY */
  1686.   
  1687. ! extern    char    *LOCALSYSNAME, *LOCALPATHSYSNAME, *FROMSYSNAME, *PATHSYSNAME;
  1688.   
  1689.   #ifndef SHELL
  1690. ! extern    char    *SHELL;
  1691.   #endif /* !SHELL */
  1692.   
  1693. ***************
  1694. *** 116,117 ****
  1695. --- 113,124 ----
  1696.   #define xart_open xfopen
  1697.   #endif /* !VMS */
  1698. + /* Check for old naming scheme using HIDDENNET */
  1699. + #ifdef HIDDENNET
  1700. + #  ifndef GENERICFROM        /* Ugly fix, only for use in pathinit.c */
  1701. + #    define GENERICFROM "%s%0.0s%s", HIDDENNET
  1702. + #  endif
  1703. + #  ifndef GENERICPATH
  1704. + #    define GENERICPATH HIDDENNET
  1705. + #  endif
  1706. + #endif
  1707. Index: pathinit.c
  1708. Prereq: 1.20
  1709. *** .d/pathinit.c    Tue Mar 10 16:13:36 1987
  1710. --- pathinit.c    Tue Mar 24 11:01:37 1987
  1711. ***************
  1712. *** 35,39 ****
  1713.   
  1714.   #ifdef SCCSID
  1715. ! static char    *SccsId = "@(#)pathinit.c    1.20    3/9/87";
  1716.   #endif /* SCCSID */
  1717.   
  1718. --- 35,39 ----
  1719.   
  1720.   #ifdef SCCSID
  1721. ! static char    *SccsId = "@(#)pathinit.c    1.22    3/23/87";
  1722.   #endif /* SCCSID */
  1723.   
  1724. ***************
  1725. *** 51,55 ****
  1726.   
  1727.   
  1728. ! char *FULLSYSNAME, *SPOOL, *LIB, *BIN, *ACTIVE, *SUBFILE, *ARTFILE,
  1729.       *username, *userhome;
  1730.   
  1731. --- 51,56 ----
  1732.   
  1733.   
  1734. ! char *FROMSYSNAME, *PATHSYSNAME, *LOCALSYSNAME, *LOCALPATHSYSNAME;
  1735. ! char *SPOOL, *LIB, *BIN, *ACTIVE, *SUBFILE, *ARTFILE,
  1736.       *username, *userhome;
  1737.   
  1738. ***************
  1739. *** 87,95 ****
  1740.   #endif /* READ */
  1741.   
  1742. - #ifdef HIDDENNET
  1743. - char *LOCALSYSNAME;
  1744. - #endif /* HIDDENNET */
  1745.   
  1746.   struct passwd *getpwnam();
  1747.   char *rindex();
  1748. --- 88,92 ----
  1749. ***************
  1750. *** 115,120 ****
  1751.   pathinit()
  1752.   {
  1753. - #if defined(INEW) && defined(NOTIFY)
  1754. - #endif /* INEW && NOTIFY */
  1755.   #ifndef ROOTID
  1756.       struct passwd    *pw;    /* struct for pw lookup    */
  1757. --- 112,115 ----
  1758. ***************
  1759. *** 123,138 ****
  1760.       char *p;
  1761.   #endif /* EXP */
  1762. ! #ifndef CHKN
  1763.       struct utsname ubuf;
  1764.   
  1765.       uname(&ubuf);
  1766. - #ifdef HIDDENNET
  1767. -     FULLSYSNAME = AllocCpy(HIDDENNET);
  1768. -     LOCALSYSNAME = AllocCpy(ubuf.nodename);
  1769. - #else /* !HIDDENNET */
  1770. -     FULLSYSNAME = AllocCpy(ubuf.nodename);
  1771. - #endif /* !HIDDENNET */
  1772. - #endif /* !CHKN */
  1773.   
  1774.   #ifdef HOME
  1775.       /* Relative to the home directory of user HOME */
  1776. --- 118,158 ----
  1777.       char *p;
  1778.   #endif /* EXP */
  1779. ! #if !defined(CHKN) && !defined(EXP)
  1780. ! #ifdef GENERICFROM
  1781. !     int len;
  1782. ! #endif /* GENERICFROM */
  1783.       struct utsname ubuf;
  1784. +     char buf[BUFLEN];
  1785. +     extern char *mydomain();
  1786.   
  1787.       uname(&ubuf);
  1788.   
  1789. + #ifdef GENERICFROM
  1790. +     (void) sprintf(buf, GENERICFROM, ubuf.nodename, mydomain());
  1791. +     FROMSYSNAME = AllocCpy(buf);
  1792. +     len = strlen(ubuf.nodename);
  1793. +     if (FROMSYSNAME[len] == '.' &&
  1794. +         strncmp(ubuf.nodename, FROMSYSNAME, len) == 0)
  1795. +         LOCALSYSNAME = FROMSYSNAME;
  1796. +     else {
  1797. +         (void) sprintf(buf, "%s.%s", ubuf.nodename, FROMSYSNAME);
  1798. +         LOCALSYSNAME = AllocCpy(buf);
  1799. +     }
  1800. + #else    /* !GENERICFROM */
  1801. +     (void) sprintf(buf, "%s%s", ubuf.nodename, mydomain());
  1802. +     LOCALSYSNAME = AllocCpy(buf);
  1803. +     FROMSYSNAME = LOCALSYSNAME;
  1804. + #endif    /* !GENERICFROM */
  1805. +     LOCALPATHSYSNAME = AllocCpy(ubuf.nodename);
  1806. + #ifdef GENERICPATH
  1807. +     (void) sprintf(buf, GENERICPATH, ubuf.nodename, mydomain());
  1808. +     PATHSYSNAME = AllocCpy(buf);
  1809. + #else    /* !GENERICPATH */
  1810. +     PATHSYSNAME = LOCALPATHSYSNAME;
  1811. + #endif    /* !GENERICPATH */
  1812. + #endif /* !CHKN  && ! EXP */
  1813.   #ifdef HOME
  1814.       /* Relative to the home directory of user HOME */
  1815. ***************
  1816. *** 334,335 ****
  1817. --- 354,414 ----
  1818.   #endif /* NOTIFY */
  1819.   #endif /* INEW */
  1820. + #ifndef CHKN
  1821. + /*
  1822. +  * At sites where the are many mail domains within the support area of a single
  1823. +  * news administrator, it is much nicer to be able to read the local domain of
  1824. +  * a machine from a file.  What we do here is:
  1825. +  * 1)    Check for the presence of a LIBDIR/localdomain file.  If it doesn't 
  1826. +  *     exist,assume that MYDOMAIN should be used instead.
  1827. +  * 2)    If it does exist, we make the following assumptions:
  1828. +  *    a)  If it is empty, has only comments, or only blank lines; we assume
  1829. +  *        the domain is desired to be a zero length string ( ie "").  (this
  1830. +  *        implies that the domain name is contained in the hostname.)
  1831. +  *    b)  If it is not empty, we assume the first line not beginning with a
  1832. +  *        '#', blank/tab, or newline is the desired domain name.
  1833. +  *        A like '.UUCP' or '.TEK.COM' should be used.  We could insure that
  1834. +  *        the line begin with a '.' to be a valid domain name, but I don't 
  1835. +  *        think it is necessary to put that restriction on it.
  1836. +  */
  1837. + char *
  1838. + mydomain()
  1839. + {
  1840. +     static char *md = NULL;
  1841. +     register char *cp;
  1842. +     FILE *fp = NULL;
  1843. +     char fbuf[BUFLEN];
  1844. +     extern char *malloc(), *strcpy(), *index();
  1845. +     if(md)    /* we've been here before, so just return what we found */
  1846. +         return(md);
  1847. +     (void) sprintf(fbuf,"%s/localdomain", LIBDIR);
  1848. +     if ( (fp = fopen(fbuf,"r")) == NULL) {
  1849. +         md = MYDOMAIN;    /* No localdomain file, use MYDOMAIN instead */
  1850. +     } else {
  1851. +         while(fgets(fbuf, sizeof(fbuf), fp) ) {
  1852. +             if( *fbuf == '\n' || *fbuf == '#' 
  1853. +                 || *fbuf == ' ' || *fbuf == '\t')
  1854. +                 continue;
  1855. +     
  1856. +             if( cp = index(fbuf, '\n') )
  1857. +                 *cp = '\0';
  1858. +     
  1859. +             if ( (md = malloc(strlen(fbuf) + 1)) == NULL)
  1860. +                 md = MYDOMAIN;    /* punt here */
  1861. +             else
  1862. +                 (void)strcpy(md, fbuf);
  1863. +             break;
  1864. +         }
  1865. +     }
  1866. +     if(fp)
  1867. +         (void)fclose(fp);
  1868. +     if( md == NULL)
  1869. +         md = "";
  1870. +     
  1871. +     return md;
  1872. + }
  1873. + #endif /* !CHKN */
  1874. Index: postnews.c
  1875. Prereq: 1.30
  1876. *** .d/postnews.c    Wed Dec 17 18:23:24 1986
  1877. --- postnews.c    Mon Mar 23 13:58:48 1987
  1878. ***************
  1879. *** 18,22 ****
  1880.    */
  1881.   #ifdef SCCSID
  1882. ! static char    *SccsId = "@(#)postnews.c    1.30    12/16/86";
  1883.   #endif /* SCCSID */
  1884.   
  1885. --- 18,22 ----
  1886.    */
  1887.   #ifdef SCCSID
  1888. ! static char    *SccsId = "@(#)postnews.c    1.31    3/21/87";
  1889.   #endif /* SCCSID */
  1890.   
  1891. ***************
  1892. *** 156,160 ****
  1893.           do {
  1894.               do {
  1895. !                 getpr("\nWhat now?  [send, edit, list, quit, write] ", buf);
  1896.                   c = buf[0];
  1897.               } while (c == '\0');
  1898. --- 156,160 ----
  1899.           do {
  1900.               do {
  1901. !                 getpr("\nWhat now?  [send, edit, list, quit, write, append] ", buf);
  1902.                   c = buf[0];
  1903.               } while (c == '\0');
  1904. ***************
  1905. *** 183,187 ****
  1906.                   (void)  system(buf);
  1907.               }
  1908. !             if (c == 'w') {
  1909.                   register int ifd, ofd, nbytes;
  1910.                   char iobuf[BUFSIZ];
  1911. --- 183,187 ----
  1912.                   (void)  system(buf);
  1913.               }
  1914. !             if (c == 'w' || c == 'a') {
  1915.                   register int ifd, ofd, nbytes;
  1916.                   char iobuf[BUFSIZ];
  1917. ***************
  1918. *** 190,197 ****
  1919.                   if (fname[0] == '\0')
  1920.                       continue;
  1921. !                 ofd = creat(fname, 0666);
  1922.                   if (ofd < 0)
  1923.                       perror(fname);
  1924.                   else {
  1925.                       ifd = open(tempfname, 0);
  1926.                       if (ifd < 0)
  1927. --- 190,200 ----
  1928.                   if (fname[0] == '\0')
  1929.                       continue;
  1930. !                 ofd = (c == 'w') ? creat(fname, 0666)
  1931. !                          : open(fname, 2);
  1932.                   if (ofd < 0)
  1933.                       perror(fname);
  1934.                   else {
  1935. +                     if (c == 'a')
  1936. +                         (void) lseek(ofd, 0L, 2);
  1937.                       ifd = open(tempfname, 0);
  1938.                       if (ifd < 0)
  1939. Index: readnews.c
  1940. Prereq: 2.31
  1941. *** .d/readnews.c    Thu Oct 30 16:16:46 1986
  1942. --- readnews.c    Mon Mar 23 13:58:38 1987
  1943. ***************
  1944. *** 4,8 ****
  1945.   
  1946.   #ifdef SCCSID
  1947. ! static char    *SccsId = "@(#)readnews.c    2.31    9/16/86";
  1948.   #endif /* SCCSID */
  1949.   
  1950. --- 4,8 ----
  1951.   
  1952.   #ifdef SCCSID
  1953. ! static char    *SccsId = "@(#)readnews.c    2.32    3/21/87";
  1954.   #endif /* SCCSID */
  1955.   
  1956. ***************
  1957. *** 37,41 ****
  1958.   {
  1959.       register char    *ptr;    /* pointer to rest of buffer        */
  1960. !     char    *user, *home;
  1961.       int    optflag = FALSE, space = FALSE;
  1962.       struct utsname ubuf;
  1963. --- 37,41 ----
  1964.   {
  1965.       register char    *ptr;    /* pointer to rest of buffer        */
  1966. !     char    *user = NULL, *home = NULL;
  1967.       int    optflag = FALSE, space = FALSE;
  1968.       struct utsname ubuf;
  1969. ***************
  1970. *** 48,52 ****
  1971.       coptbuf[0] = datebuf[0] = '\0';
  1972.       uname(&ubuf);
  1973. !     strcpy(FULLSYSNAME, ubuf.nodename);
  1974.   
  1975.       savmask = umask(N_UMASK);    /* set up mask */
  1976. --- 48,52 ----
  1977.       coptbuf[0] = datebuf[0] = '\0';
  1978.       uname(&ubuf);
  1979. !     strcpy(FROMSYSNAME, ubuf.nodename);
  1980.   
  1981.       savmask = umask(N_UMASK);    /* set up mask */
  1982. ***************
  1983. *** 57,60 ****
  1984. --- 57,70 ----
  1985.       (void) ftime(&Now);
  1986.   
  1987. +     /* give reasonable error message if SPOOL directory
  1988. +      * is unaccessable... usually means system administrator
  1989. +      * has "turned off" news reading...
  1990. +      */
  1991. +     if (access(SPOOL, 05))
  1992. +     {
  1993. +         fputs("News articles are not available at this time\n",stderr);
  1994. +         xxit(1);
  1995. +     }
  1996.   #ifndef SHELL
  1997.       if ((SHELL = getenv("SHELL")) == NULL)
  1998. ***************
  1999. *** 61,70 ****
  2000.           SHELL = "/bin/sh";
  2001.   #endif
  2002. - #ifndef IHCC
  2003.       /*
  2004. !      * IHCC does not allow use of $LOGNAME to prevent forgery.
  2005.        * Note that this shouldn't matter in readnews, since inews
  2006.        * does all the actual posting of news.
  2007.        */
  2008.       if ((user = getenv("USER")) == NULL)
  2009.           user = getenv("LOGNAME");
  2010. --- 71,81 ----
  2011.           SHELL = "/bin/sh";
  2012.   #endif
  2013.       /*
  2014. !      * IHCC forces the use of 'getuser()' to prevent forgery of articles
  2015. !      * by just changing $LOGNAME
  2016.        * Note that this shouldn't matter in readnews, since inews
  2017.        * does all the actual posting of news.
  2018.        */
  2019. + #ifndef IHCC
  2020.       if ((user = getenv("USER")) == NULL)
  2021.           user = getenv("LOGNAME");
  2022. ***************
  2023. *** 71,75 ****
  2024.       if ((home = getenv("HOME")) == NULL)
  2025.           home = getenv("LOGDIR");
  2026. ! #endif
  2027.       if (user == NULL || home == NULL)
  2028.           getuser();
  2029. --- 82,86 ----
  2030.       if ((home = getenv("HOME")) == NULL)
  2031.           home = getenv("LOGDIR");
  2032. ! #endif /* ! IHCC */
  2033.       if (user == NULL || home == NULL)
  2034.           getuser();
  2035. ***************
  2036. *** 270,286 ****
  2037.       }
  2038.   
  2039. !     cleanup();
  2040.       /*NOTREACHED*/
  2041.   }
  2042.   
  2043. ! cleanup()
  2044.   {
  2045.       (void) signal(SIGHUP, SIG_IGN);
  2046.       (void) fflush(stdout);
  2047. !     if (!news || xflag || lflag || tflag)
  2048. !         xxit(0);
  2049. !     if (*groupdir && mode != MAIL)
  2050. !         updaterc();
  2051. !     writeoutrc();
  2052.       xxit(0);
  2053.   }
  2054. --- 281,305 ----
  2055.       }
  2056.   
  2057. !     cleanup(0);
  2058.       /*NOTREACHED*/
  2059.   }
  2060.   
  2061. ! cleanup(signo)
  2062.   {
  2063. +     extern short ospeed;
  2064.       (void) signal(SIGHUP, SIG_IGN);
  2065.       (void) fflush(stdout);
  2066. !     if (news && !xflag && !lflag && !tflag) {
  2067. !         if (*groupdir && mode != MAIL)
  2068. !             updaterc();
  2069. !         writeoutrc();
  2070. !     }
  2071. !     /*
  2072. !      * stop vnews from clearing the screen if we're
  2073. !      * killed by a hangup
  2074. !      */
  2075. !     if (signo == SIGHUP)
  2076. !         ospeed = 0;
  2077.       xxit(0);
  2078.   }
  2079. Index: readr.c
  2080. Prereq: 2.60
  2081. *** .d/readr.c    Wed Dec 17 18:23:27 1986
  2082. --- readr.c    Mon Mar 23 13:58:33 1987
  2083. ***************
  2084. *** 17,21 ****
  2085.   
  2086.   #ifdef SCCSID
  2087. ! static char    *SccsId = "@(#)readr.c    2.60    12/16/86";
  2088.   #endif /* SCCSID */
  2089.   
  2090. --- 17,21 ----
  2091.   
  2092.   #ifdef SCCSID
  2093. ! static char    *SccsId = "@(#)readr.c    2.61    3/21/87";
  2094.   #endif /* SCCSID */
  2095.   
  2096. ***************
  2097. *** 77,80 ****
  2098. --- 77,83 ----
  2099.   static jmp_buf sigjmpbuf;        /* for signal processing */
  2100.   static int canlongjmp;            /* TRUE if setjmp on sigjmp valid */
  2101. + short ospeed;                /* terminal speed NOT STATIC */
  2102. +                     /* used in readnews.c, declared here */
  2103. +                     /* to match declaration in visual.c */
  2104.   
  2105.   int catchcont();
  2106. *** .d/rfuncs2.c    Mon Dec 29 18:34:12 1986
  2107. --- rfuncs2.c    Mon Mar 23 13:58:22 1987
  2108. ***************
  2109. *** 17,21 ****
  2110.   
  2111.   #ifdef SCCSID
  2112. ! static char    *SccsId = "@(#)rfuncs2.c    1.34    12/23/86";
  2113.   #endif /* SCCSID */
  2114.   
  2115. --- 17,21 ----
  2116.   
  2117.   #ifdef SCCSID
  2118. ! static char    *SccsId = "@(#)rfuncs2.c    1.35    3/21/87";
  2119.   #endif /* SCCSID */
  2120.   
  2121. ***************
  2122. *** 305,312 ****
  2123.   FILE *fp;
  2124.   {
  2125. !     /* Alas, stdio does not permit this */
  2126.   }
  2127.   
  2128.   /*
  2129.    * Count the number of remaining lines in file fp.
  2130. --- 305,321 ----
  2131.   FILE *fp;
  2132.   {
  2133. ! #ifdef fileno
  2134. !     int    fno, err;
  2135. !     fno = fileno(fp);
  2136. !     err = ferror(fp);
  2137. !     fileno(fp) = -1;
  2138. !     (void) fflush(fp);
  2139. !     fileno(fp) = fno;
  2140. !     if (!err)
  2141. !         (void) clearerr(fp);
  2142. ! #endif /* fileno */
  2143.   }
  2144.   
  2145.   /*
  2146.    * Count the number of remaining lines in file fp.
  2147. ***************
  2148. *** 360,364 ****
  2149.       else {
  2150.   #ifdef OLD
  2151. !             fprintf(ofp, "A%s\n%s\n%s!%s\n%s\n%s\n", oident(hh.ident), hh.nbuf, FULLSYSNAME,
  2152.                   hh.path, hh.subdate, hh.title);
  2153.   #else /* !OLD */
  2154. --- 369,373 ----
  2155.       else {
  2156.   #ifdef OLD
  2157. !             fprintf(ofp, "A%s\n%s\n%s!%s\n%s\n%s\n", oident(hh.ident), hh.nbuf, PATHSYSNAME,
  2158.                   hh.path, hh.subdate, hh.title);
  2159.   #else /* !OLD */
  2160. ***************
  2161. *** 410,415 ****
  2162.           return 0;
  2163.       if (notauthor)
  2164. !         (void) sprintf(bfr, "%s/%s -c 'cancel %s' -n %s -d local < /dev/null",
  2165. !             LIB, "inews", hp->ident, hp->nbuf);
  2166.       else {
  2167.           if (hp->distribution[0] == '\0')
  2168. --- 419,429 ----
  2169.           return 0;
  2170.       if (notauthor)
  2171. !         (void) sprintf(bfr, "%s/%s -c 'cancel %s' -n %s -d %s < /dev/null",
  2172. !             LIB, "inews", hp->ident, hp->nbuf,
  2173. ! #ifdef ORGDISTRIB
  2174. !             ORGDISTRIB);
  2175. ! #else /* !ORGDISTRIB */
  2176. !             "local");
  2177. ! #endif /* !ORGDISTRIB */
  2178.       else {
  2179.           if (hp->distribution[0] == '\0')
  2180. Index: sendnews.c
  2181. Prereq: 2.11
  2182. *** .d/sendnews.c    Thu Oct 30 16:12:03 1986
  2183. --- sendnews.c    Mon Mar 23 13:58:16 1987
  2184. ***************
  2185. *** 4,8 ****
  2186.   
  2187.   #ifdef SCCSID
  2188. ! static char    *SccsId = "@(#)sendnews.c    2.11    9/19/86";
  2189.   #endif /* SCCSID */
  2190.   
  2191. --- 4,8 ----
  2192.   
  2193.   #ifdef SCCSID
  2194. ! static char    *SccsId = "@(#)sendnews.c    2.12    3/21/87";
  2195.   #endif /* SCCSID */
  2196.   
  2197. ***************
  2198. *** 9,12 ****
  2199. --- 9,13 ----
  2200.   #include <stdio.h>
  2201.   #include <ctype.h>
  2202. + #include "defs.h"
  2203.   
  2204.   char buffer[BUFSIZ];
  2205. Index: uname.c
  2206. Prereq: 2.14
  2207. *** .d/uname.c    Tue Mar 10 16:13:37 1987
  2208. --- uname.c    Mon Mar 23 13:58:09 1987
  2209. ***************
  2210. *** 22,26 ****
  2211.   
  2212.   #ifdef SCCSID
  2213. ! static char    *SccsId = "@(#)uname.c    2.14    3/9/87";
  2214.   #endif /* SCCSID */
  2215.   
  2216. --- 22,26 ----
  2217.   
  2218.   #ifdef SCCSID
  2219. ! static char    *SccsId = "@(#)uname.c    2.15    3/21/87";
  2220.   #endif /* SCCSID */
  2221.   
  2222. ***************
  2223. *** 98,157 ****
  2224.   }
  2225.   #endif
  2226. - /*
  2227. -  * At sites where the are many mail domains within the support area of a single
  2228. -  * news administrator, it is much nicer to be able to read the local domain of
  2229. -  * a machine from a file.  What we do here is:
  2230. -  * 1)    Check for the presence of a LIBDIR/localdomain file.  If it doesn't 
  2231. -  *     exist,assume that MYDOMAIN should be used instead.
  2232. -  * 2)    If it does exist, we make the following assumptions:
  2233. -  *    a)  If it is empty, has only comments, or only blank lines; we assume
  2234. -  *        the domain is desired to be a zero length string ( ie "").  (this
  2235. -  *        implies that the domain name is contained in the hostname.)
  2236. -  *    b)  If it is not empty, we assume the first line not beginning with a
  2237. -  *        '#', blank/tab, or newline is the desired domain name.
  2238. -  *        A like '.UUCP' or '.TEK.COM' should be used.  We could insure that
  2239. -  *        the line begin with a '.' to be a valid domain name, but I don't 
  2240. -  *        think it is necessary to put that restriction on it.
  2241. -  */
  2242. - char *
  2243. - mydomain()
  2244. - {
  2245. -     static char *md = NULL;
  2246. -     register char *cp;
  2247. -     FILE *fp = NULL;
  2248. -     char fbuf[BUFLEN];
  2249. -     extern char *malloc(), *strcpy(), *index();
  2250. -     if(md)    /* we've been here before, so just return what we found */
  2251. -         return(md);
  2252. -     (void) sprintf(fbuf,"%s/localdomain", LIBDIR);
  2253. -     if ( (fp = fopen(fbuf,"r")) == NULL) {
  2254. -         md = MYDOMAIN;    /* No localdomain file, use MYDOMAIN instead */
  2255. -     } else {
  2256. -         while(fgets(fbuf, sizeof(fbuf), fp) ) {
  2257. -             if( *fbuf == '\n' || *fbuf == '#' 
  2258. -                 || *fbuf == ' ' || *fbuf == '\t')
  2259. -                 continue;
  2260. -     
  2261. -             if( cp = index(fbuf, '\n') )
  2262. -                 *cp = '\0';
  2263. -     
  2264. -             if ( (md = malloc(strlen(fbuf) + 1)) == NULL)
  2265. -                 md = MYDOMAIN;    /* punt here */
  2266. -             else
  2267. -                 (void)strcpy(md, fbuf);
  2268. -             break;
  2269. -         }
  2270. -     }
  2271. -     if(fp)
  2272. -         (void)fclose(fp);
  2273. -     if( md == NULL)
  2274. -         md = "";
  2275. -     
  2276. -     return(md);
  2277. - }
  2278. --- 98,99 ----
  2279. Index: unbatch.c
  2280. Prereq: 1.25
  2281. *** .d/unbatch.c    Mon Dec 29 18:34:13 1986
  2282. --- unbatch.c    Mon Mar 23 13:58:13 1987
  2283. ***************
  2284. *** 14,18 ****
  2285.   
  2286.   #ifdef SCCSID
  2287. ! static char    *SccsId = "@(#)unbatch.c    1.25    12/23/86";
  2288.   #endif /* SCCSID */
  2289.   
  2290. --- 14,18 ----
  2291.   
  2292.   #ifdef SCCSID
  2293. ! static char    *SccsId = "@(#)unbatch.c    1.26    3/21/87";
  2294.   #endif /* SCCSID */
  2295.   
  2296. ***************
  2297. *** 104,108 ****
  2298.               (void) open(filename, 0);
  2299.   #ifdef IHCC
  2300. !             (void) sprintf(buf, "%s/%s/rnews", logdir(HOME), LIBDIR);
  2301.   #else
  2302.               strcpy(buf, RNEWS);
  2303. --- 104,108 ----
  2304.               (void) open(filename, 0);
  2305.   #ifdef IHCC
  2306. !             (void) sprintf(buf, "%s/%s", logdir(HOME), RNEWS);
  2307.   #else
  2308.               strcpy(buf, RNEWS);
  2309. Index: uurec.c
  2310. Prereq: 2.10
  2311. *** .d/uurec.c    Fri Nov 21 16:04:54 1986
  2312. --- uurec.c    Mon Mar 23 13:58:05 1987
  2313. ***************
  2314. *** 4,8 ****
  2315.   
  2316.   #ifdef SCCSID
  2317. ! static char    *SccsId = "@(#)uurec.c    2.10    11/21/86";
  2318.   #endif /* SCCSID */
  2319.   
  2320. --- 4,8 ----
  2321.   
  2322.   #ifdef SCCSID
  2323. ! static char    *SccsId = "@(#)uurec.c    2.11    3/21/87";
  2324.   #endif /* SCCSID */
  2325.   
  2326. ***************
  2327. *** 94,99 ****
  2328.                   pathcnt = 0;
  2329.   #ifdef IHCC
  2330. !                 sprintf(pbfr, "%s/%s/%s", logdir(HOME),
  2331. !                         LIBDIR, "rnews");
  2332.   #else
  2333.                   pbfr = RNEWS;
  2334. --- 94,98 ----
  2335.                   pathcnt = 0;
  2336.   #ifdef IHCC
  2337. !                 sprintf(pbfr, "%s/%s", logdir(HOME), RNEWS);
  2338.   #else
  2339.                   pbfr = RNEWS;
  2340. Index: visual.c
  2341. Prereq: 1.35
  2342. *** .d/visual.c    Mon Dec 29 18:34:06 1986
  2343. --- visual.c    Mon Mar 23 13:57:49 1987
  2344. ***************
  2345. *** 5,9 ****
  2346.   
  2347.   #ifdef SCCSID
  2348. ! static char    *SccsId = "@(#)visual.c    1.35    12/23/86";
  2349.   #endif /* SCCSID */
  2350.   
  2351. --- 5,9 ----
  2352.   
  2353.   #ifdef SCCSID
  2354. ! static char    *SccsId = "@(#)visual.c    1.36    3/21/87";
  2355.   #endif /* SCCSID */
  2356.   
  2357. ***************
  2358. *** 227,230 ****
  2359. --- 227,232 ----
  2360.   
  2361.       if (!news) {
  2362. +         ttycooked();
  2363. +         ospeed = 0;    /* to convince xxit() not to clear screen */
  2364.           fprintf(stderr, "No news.\n");
  2365.       }
  2366. ***************
  2367. *** 515,519 ****
  2368.           int wflags;
  2369.   
  2370. !     case '|':
  2371.       case 's':
  2372.       case 'w':
  2373. --- 517,521 ----
  2374.           int wflags;
  2375.   
  2376. !     case PIPECHAR:
  2377.       case 's':
  2378.       case 'w':
  2379. ***************
  2380. *** 520,525 ****
  2381.           /* We loop back to here each time user types ^U to prompt */
  2382.           do {
  2383. !             /* No saved default.  Ask. */
  2384. !             msg( (c=='|')? "|": "file: ");
  2385.               curflag = CURP2;
  2386.               while ((wflags = vgetc()) == ' ');
  2387. --- 522,527 ----
  2388.           /* We loop back to here each time user types ^U to prompt */
  2389.           do {
  2390. !             /* Prompt based on command char */
  2391. !             msg( (c==PIPECHAR)? "|": "file: ");
  2392.               curflag = CURP2;
  2393.               while ((wflags = vgetc()) == ' ');
  2394. ***************
  2395. *** 529,536 ****
  2396.               }
  2397.               if (wflags != CAGAIN) {
  2398. !                 savebuf[0] = wflags;
  2399. !                 savebuf[1] = 0;
  2400.               }
  2401. !             wflags = prget( (savebuf[0] == '|') ? "": "file: ",
  2402.                       savebuf);
  2403.           } while (wflags == 2);
  2404. --- 531,556 ----
  2405.               }
  2406.               if (wflags != CAGAIN) {
  2407. !                 if ((wflags & 0x1F) == wflags) {    /* control char */
  2408. !                     pushback(wflags);
  2409. !                     savebuf[0] = 0;
  2410. !                 } else {
  2411. !                     if (c == PIPECHAR) {
  2412. !                         savebuf[0] = PIPECHAR;
  2413. !                         savebuf[1] = wflags;
  2414. !                         savebuf[2] = 0;
  2415. !                     } else {
  2416. !                         savebuf[0] = wflags;
  2417. !                         savebuf[1] = 0;
  2418. !                     }
  2419. !                 }
  2420. !             } else {
  2421. !                 /* don't let them pipe to a saved filename */
  2422. !                 if (c == PIPECHAR && savebuf[0] != PIPECHAR) {
  2423. !                     savebuf[0] = PIPECHAR;
  2424. !                     savebuf[1] = 0;
  2425. !                 }
  2426.               }
  2427. !                     
  2428. !             wflags = prget( (savebuf[0] == PIPECHAR) ? "" : "file: ",
  2429.                       savebuf);
  2430.           } while (wflags == 2);
  2431. ***************
  2432. *** 537,541 ****
  2433.           if (wflags) break;    /* Interrupted out */
  2434.           wflags = 0;
  2435. !         if (c == '|') c = 's';
  2436.           if (c == 's')
  2437.               wflags |= SVHEAD;
  2438. --- 557,561 ----
  2439.           if (wflags) break;    /* Interrupted out */
  2440.           wflags = 0;
  2441. !         if (c == PIPECHAR) c = 's';
  2442.           if (c == 's')
  2443.               wflags |= SVHEAD;
  2444. ***************
  2445. *** 578,581 ****
  2446. --- 598,618 ----
  2447.                   (void) strcat(bptr, "Articles");
  2448.           }
  2449. +         /* handle ~/ for pipes */
  2450. +         if (*bptr == PIPECHAR) {
  2451. +             char    fullname[BUFLEN];
  2452. +             bptr++;        /* skip PIPECHAR */
  2453. +             while( *bptr == ' ')
  2454. +                 bptr++;    /* strip leading spaces */
  2455. +             if (bptr[0] == '~' && bptr[1] == '/') {
  2456. +                 strcpy(fullname,userhome);
  2457. +                 strcat(fullname,bptr+2);
  2458. +             } else
  2459. +                 strcpy(fullname,bptr);
  2460. +             /* we know PIPECHAR is in *savebuf */
  2461. +             strcpy(savebuf+1,fullname);
  2462. +             bptr = savebuf;
  2463. +         }
  2464. +                 
  2465.           vsave(bptr, wflags);
  2466.           break;
  2467. ***************
  2468. *** 667,673 ****
  2469.               *p = '\0';
  2470.               flags = BKGRND;
  2471. !         } else if (*p == '|') {
  2472.               *p = '\0';
  2473. !             (void) sprintf(bfr, "(%s)|mail '%s'", linebuf, username);
  2474.               (void) strcpy(linebuf, bfr);
  2475.               flags |= BKGRND;
  2476. --- 704,710 ----
  2477.               *p = '\0';
  2478.               flags = BKGRND;
  2479. !         } else if (*p == PIPECHAR) {
  2480.               *p = '\0';
  2481. !             (void) sprintf(bfr, "(%s)%cmail '%s'", linebuf, PIPECHAR, username);
  2482.               (void) strcpy(linebuf, bfr);
  2483.               flags |= BKGRND;
  2484. ***************
  2485. *** 907,918 ****
  2486.   cancel_command()
  2487.   {
  2488.       int notauthor;
  2489.   
  2490.       tfilename = filename;
  2491. !     (void) strcpy(rcbuf, h->path);
  2492. !     ptr1 = index(rcbuf, ' ');
  2493. !     if (ptr1)
  2494. !         *ptr1 = 0;
  2495. !     notauthor = strcmp(username, rcbuf);
  2496.       if (uid != ROOTID && uid && notauthor) {
  2497.           msg("Can't cancel what you didn't write.");
  2498. --- 944,960 ----
  2499.   cancel_command()
  2500.   {
  2501. +     register char *poster, *r;
  2502.       int notauthor;
  2503. +     char *senderof();
  2504.   
  2505. +     poster = senderof(&h);
  2506. +     /* only compare up to '.' or ' ' */
  2507. +     r = index(poster,'.');
  2508. +     if (r == NULL)
  2509. +         r = index(poster,' ');
  2510. +     if (r != NULL)
  2511. +         *r = '\0';
  2512.       tfilename = filename;
  2513. !     notauthor = strcmp(username, poster);
  2514.       if (uid != ROOTID && uid && notauthor) {
  2515.           msg("Can't cancel what you didn't write.");
  2516. ***************
  2517. *** 1055,1058 ****
  2518. --- 1097,1101 ----
  2519.   next_ng_command()
  2520.   {
  2521. +     set(bit);
  2522.       obit = -1;
  2523.       linebuf[0] = 0;
  2524. ***************
  2525. *** 1825,1828 ****
  2526. --- 1868,1872 ----
  2527.   msg(s, a1, a2, a3, a4)
  2528.   char *s;
  2529. + long a1, a2, a3, a4;
  2530.   {
  2531.       (void) sprintf(secpr, s, a1, a2, a3, a4);
  2532. *** .d/vnews.help    Mon Dec 29 18:34:14 1986
  2533. --- vnews.help    Mon Mar 23 11:29:26 1987
  2534. ***************
  2535. *** 20,22 ****
  2536.   l   List unread articles in group       L   List all articles in group
  2537.   
  2538. ! [Press ^L to see article again]
  2539. --- 20,22 ----
  2540.   l   List unread articles in group       L   List all articles in group
  2541.   
  2542. ! [Press CR to see article, h to see header... (any command will work)]
  2543. /* End of text from mirror:news.software.b */
  2544.