home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / rkive / patch01b < prev    next >
Encoding:
Internet Message Format  |  1991-05-09  |  50.3 KB

  1. From: kent@sparky.imd.sterling.com (Kent Landfield)
  2. Newsgroups: comp.sources.misc
  3. Subject: v19i020:  rkive - Usenet sources archiver, Patch01b/3
  4. Message-ID: <1991May9.175644.19503@sparky.IMD.Sterling.COM>
  5. Date: 9 May 91 17:56:44 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7.  
  8. Submitted-by: Kent Landfield <kent@sparky.imd.sterling.com>
  9. Posting-number: Volume 19, Issue 20
  10. Archive-name: rkive/patch01b
  11. Patch-To: rkive: Volume 17, Issue 17-22
  12.  
  13. #!/bin/sh
  14. # do not concatenate these parts, unpack them in order with /bin/sh
  15. # file patch2.1 continued
  16. #
  17. if test ! -r _shar_seq_.tmp; then
  18.     echo 'Please unpack part 1 first!'
  19.     exit 1
  20. fi
  21. (read Scheck
  22.  if test "$Scheck" != 2; then
  23.     echo Please unpack part "$Scheck" next!
  24.     exit 1
  25.  else
  26.     exit 0
  27.  fi
  28. ) < _shar_seq_.tmp || exit 1
  29. if test ! -f _shar_wnt_.tmp; then
  30.     echo 'x - still skipping patch2.1'
  31. else
  32. echo 'x - continuing file patch2.1'
  33. sed 's/^X//' << 'SHAR_EOF' >> 'patch2.1' &&
  34. X  
  35. ! 9.  Use the posted date for chronological archiving instead of the 
  36. !     archived date.
  37. X  
  38. ! 10. Mail on error only.
  39. X  
  40. ! 11. Add a selection control-character which gives the local system article 
  41. X      number to put in 'log' and 'index'.  Would help if one runs into trouble. 
  42. + 12. Have a post capability in which the output from rkive would be posted
  43. +     to a local newsgroup instead of mailing it to a list of users or maybe
  44. +     as well as.
  45. X  
  46. X  Well that's the direction I am heading... If you have *any* additional
  47. X  ideas that are constructive, positive or negative (flames to /nev/dull)
  48. Only in .: INSTALL
  49. diff -cr ../usenet/MANIFEST ./MANIFEST
  50. *** ../usenet/MANIFEST    Wed May  8 21:31:59 1991
  51. --- ./MANIFEST    Thu May  9 01:23:25 1991
  52. ***************
  53. *** 1,9 ****
  54. !    File Name        Archive #    Description
  55. ! -----------------------------------------------------------
  56. X   Changes                    1   General description of changes in each version.
  57. X   IDEAS                      1    Contains future improvement ideas.
  58. X   MANIFEST                   1    This shipping list
  59. !  Makefile                   2    rkive make file for generating the software.
  60. X   README                     1    Information posting that should be read first.
  61. X   article.1                  2    Manual page for article command.
  62. X   article.c                  2    Source containing article main routines.
  63. --- 1,10 ----
  64. ! #   File Name        Archive #    Description
  65. ! #-----------------------------------------------------------
  66. X   Changes                    1   General description of changes in each version.
  67. X   IDEAS                      1    Contains future improvement ideas.
  68. +  INSTALL                    1    Instructions on installing rkive.
  69. X   MANIFEST                   1    This shipping list
  70. !  Makefile.dst               2    rkive distribution Makefile.
  71. X   README                     1    Information posting that should be read first.
  72. X   article.1                  2    Manual page for article command.
  73. X   article.c                  2    Source containing article main routines.
  74. ***************
  75. *** 16,21 ****
  76. --- 17,23 ----
  77. X   efopen.c                   1    Fopen a file with error checking.
  78. X   format.c                   2    Formatting output for indexes, logs, articles.
  79. X   header.c                   3    News article header reading routines.
  80. +  localize.smpl              3    Local configuration script example.
  81. X   makedir.c                  1    Make directory routines.
  82. X   match.y                    1   Matching routines for globbing support.
  83. X   news_arc.c                 4    News archiving gut functions.
  84. ***************
  85. *** 30,40 ****
  86. X   rkive.5                    2    Manual page for the rkive configuration file.
  87. X   rkive.c                    4    Source containing rkive main routines.
  88. X   rkive.cf                   3    Template configuration file.
  89. !  rkive.h                    2    Include file for rkive software.
  90. X   setup.c                    3    Routines to read the rkive configuration file.
  91. X   str.c                      1    String manipulation routines.
  92. X   suffix.c                   1    Compression suffix addition/removal routines.
  93. X   suffix.h                   1    Include for suffix structure and table.
  94. X   t.cf                       1    Test archive config file. Not the template.
  95. X   update_netdocs             1    Script to archive Usenet periodic articles.
  96. X   version.c                  1    Print the current version and patchlevel.
  97. --- 32,43 ----
  98. X   rkive.5                    2    Manual page for the rkive configuration file.
  99. X   rkive.c                    4    Source containing rkive main routines.
  100. X   rkive.cf                   3    Template configuration file.
  101. !  rkive.h.dst                2    Distribution include file for rkive software.
  102. X   setup.c                    3    Routines to read the rkive configuration file.
  103. X   str.c                      1    String manipulation routines.
  104. X   suffix.c                   1    Compression suffix addition/removal routines.
  105. X   suffix.h                   1    Include for suffix structure and table.
  106. +  sys.cf                     1    Test archive config file. Could be a template.
  107. X   t.cf                       1    Test archive config file. Not the template.
  108. X   update_netdocs             1    Script to archive Usenet periodic articles.
  109. X   version.c                  1    Print the current version and patchlevel.
  110. Only in ../usenet: Makefile
  111. Only in .: Makefile.dst
  112. diff -cr ../usenet/README ./README
  113. *** ../usenet/README    Wed May  8 21:31:50 1991
  114. --- ./README    Thu May  9 01:33:33 1991
  115. ***************
  116. *** 1,7 ****
  117. X  
  118. X                   USENET Sources Archiver             
  119. X  
  120. !                  @(#)README    2.2 2/23/91
  121. X  
  122. X               Copyright (c) 1989, 1990, 1991 by Kent Landfield.
  123. X  
  124. --- 1,7 ----
  125. X  
  126. X                   USENET Sources Archiver             
  127. X  
  128. !                  @(#)README    2.3 5/9/91 
  129. X  
  130. X               Copyright (c) 1989, 1990, 1991 by Kent Landfield.
  131. X  
  132. ***************
  133. *** 68,108 ****
  134. X  to a specified list of users or aliases. The indexes and log file formats
  135. X  are specifiable by the person configuring the rkive configuration file.
  136. X  
  137. ! -------------------------------------------------------------------
  138. ! The following defines are possible. Please note that the Directory
  139. ! Creation defines are specified in Makefile while the rest are specified
  140. ! in rkive.h.
  141. ! ***************************
  142. ! rkive.h - General Defines
  143. ! ***************************
  144. ! -D REDUCE_HEADERS   :   Archived article header reduction code.
  145. !     Disk space is saved by removing header lines that have no 
  146. !     further use after the article is stored in the archive.
  147. !     As currently defined, all headers *except* for From:, Newsgroups:, 
  148. !     Subject:, Message-ID:, Approved:, and Date: are removed if this 
  149. !         is defined.
  150. !     The list of headers to be saved can be added to or reduced by
  151. !     modifying the table "hdrs" in news_arc.c.
  152. ! -D SUBJECT_LINE     :   Specify that the local mailer has -s option
  153. !         such as /usr/bin/mailx or /usr/ucb/Mail.
  154. ! *************************************
  155. ! Makefile - Directory Creation Defines
  156. ! *************************************
  157. ! -D HAVE_MKDIR       : use the mkdir() function in the system library. 
  158. !     (AT&T 5.2 or earlier systems are probably out of luck..)
  159. ! -D USE_SYSMKDIR     : have rkive system off /bin/mkdir.
  160. !     (not recommended for *real* use...)
  161. ! If you do not define either, the function makedir() will create the 
  162. ! directory itself. I suggest that if you do not have mkdir() in your
  163. ! system libraries, use the builtin if you can. *Please* verify you can
  164. ! use it *first*.
  165. X  
  166. X  ---------------------------
  167. X  Archive Member Compression:
  168. --- 68,76 ----
  169. X  to a specified list of users or aliases. The indexes and log file formats
  170. X  are specifiable by the person configuring the rkive configuration file.
  171. X  
  172. ! Please read the file INSTALL for specifics on installation of rkive and
  173. ! is associated applications.  What follows is a little background information
  174. ! that might be helpful to read prior to reading INSTALL.
  175. X  
  176. X  ---------------------------
  177. X  Archive Member Compression:
  178. diff -cr ../usenet/article.1 ./article.1
  179. *** ../usenet/article.1    Wed May  8 21:31:56 1991
  180. --- ./article.1    Thu May  9 01:36:32 1991
  181. ***************
  182. *** 1,4 ****
  183. ! 'br "@(#)article.1    2.2 2/23/91"
  184. X  .op 1i
  185. X  .TH ARTICLE 1
  186. X  .SH NAME
  187. --- 1,4 ----
  188. ! 'br "@(#)article.1    2.3 5/9/91"
  189. X  .op 1i
  190. X  .TH ARTICLE 1
  191. X  .SH NAME
  192. ***************
  193. *** 81,89 ****
  194. X          D - Print the Date line.
  195. X          E - Print the Reposted-by line.
  196. X          F - Print the From line.
  197. !         H - Print the Original-posting-by line.
  198. !         I - Print the Original-subject line.
  199. !         J - Print the Archive-directory.
  200. X          K - Print the Keywords line.
  201. X          L - Print the Lines line.
  202. X          M - Print the Message-ID line.
  203. --- 81,89 ----
  204. X          D - Print the Date line.
  205. X          E - Print the Reposted-by line.
  206. X          F - Print the From line.
  207. !         H - Print the Comp.archives Original-posting-by line.
  208. !         I - Print the Comp.archives Original-subject line.
  209. !         J - Print the Comp.archives Archive-directory line.
  210. X          K - Print the Keywords line.
  211. X          L - Print the Lines line.
  212. X          M - Print the Message-ID line.
  213. ***************
  214. *** 92,99 ****
  215. X          Q - Print the Expires line.
  216. X          R - Print the References line.
  217. X          S - Print the Subject line.
  218. -         T - Print the Subject Topic.
  219. -         V - Print the Volume-Issue article filename.
  220. X          W - Print the Architecture line.
  221. X          X - Print the Version-number.
  222. X          a - Print the Archive-name line.
  223. --- 92,97 ----
  224. ***************
  225. *** 102,108 ****
  226. X          d - Print the Distribution line.
  227. X          e - Print the Environment line.
  228. X          f - Print the Followup-to line.
  229. !         h - Print the X-Checksum-Snefru line.
  230. X          o - Print the Organization line.
  231. X          p - Print the Posting-number line.
  232. X          r - Print the Reply-to line.
  233. --- 100,107 ----
  234. X          d - Print the Distribution line.
  235. X          e - Print the Environment line.
  236. X          f - Print the Followup-to line.
  237. !         h - Print the X-Md4-Signature line or
  238. !             Print the X-Checksum-Snefru line.
  239. X          o - Print the Organization line.
  240. X          p - Print the Posting-number line.
  241. X          r - Print the Reply-to line.
  242. ***************
  243. *** 118,123 ****
  244. --- 117,124 ----
  245. X          B - Print the base file name.
  246. X          G - Print the newsGroup name.
  247. X          O - Print the Full path of the specified file.
  248. +         Z - Print the Relative path of the file within the 
  249. +             newsgroup archive directory.
  250. X          i - Print the issue (if archive) line.
  251. X          l - Print the Author's logon address line.
  252. X          n - Print the Author's name.
  253. ***************
  254. *** 126,133 ****
  255. X          Additional Specification Characters 
  256. X  
  257. X          T - Print the Subject line's topic information.
  258. X          % - Print a %, no argument is converted.
  259. ! ..nr
  260. X  .PP
  261. X  In addition to the conversion characters, the following 
  262. X  characters have meaning during the formatting of the output.
  263. --- 127,135 ----
  264. X          Additional Specification Characters 
  265. X  
  266. X          T - Print the Subject line's topic information.
  267. +         V - Print the Volume-Issue article filename.
  268. X          % - Print a %, no argument is converted.
  269. ! .nf
  270. X  .PP
  271. X  In addition to the conversion characters, the following 
  272. X  characters have meaning during the formatting of the output.
  273. diff -cr ../usenet/article.h ./article.h
  274. *** ../usenet/article.h    Wed May  8 21:31:57 1991
  275. --- ./article.h    Thu May  9 01:36:32 1991
  276. ***************
  277. *** 1,5 ****
  278. X  /*
  279. ! **     @(#)article.h    2.2 2/23/91
  280. X  **
  281. X  */
  282. X  
  283. --- 1,5 ----
  284. X  /*
  285. ! **     @(#)article.h    2.3 5/9/91
  286. X  **
  287. X  */
  288. X  
  289. ***************
  290. *** 57,63 ****
  291. X  #define ARCH_NAME              23
  292. X  #define ARTICLEID              24
  293. X  #define PATCH_TO               25
  294. ! #define X_CHECKSUM_SNEFRU    26
  295. X  #define ORIGINAL_POSTING_BY    27
  296. X  #define ORIGINAL_SUBJECT    28
  297. X  #define ARCHIVE_SITE        29
  298. --- 57,63 ----
  299. X  #define ARCH_NAME              23
  300. X  #define ARTICLEID              24
  301. X  #define PATCH_TO               25
  302. ! #define X_CHECKSUM            26
  303. X  #define ORIGINAL_POSTING_BY    27
  304. X  #define ORIGINAL_SUBJECT    28
  305. X  #define ARCHIVE_SITE        29
  306. ***************
  307. *** 103,109 ****
  308. X      char    posting_num[BUFLEN];      /* Posting-number:       */
  309. X      char    archive_name[BUFLEN];     /* Archive-name:         */
  310. X      char    patch_to[BUFLEN];         /* Patch-To:             */
  311. !     char    x_checksum_snefru[BUFLEN];    /* X-Checksum-Snefru:     */
  312. X      char    orig_poster[BUFLEN];    /* Original-posting-by:  */
  313. X      char    orig_subject[BUFLEN];    /* Original-subject:     */
  314. X      char    archive_site[BUFLEN];    /* Archive-site:         */
  315. --- 103,110 ----
  316. X      char    posting_num[BUFLEN];      /* Posting-number:       */
  317. X      char    archive_name[BUFLEN];     /* Archive-name:         */
  318. X      char    patch_to[BUFLEN];         /* Patch-To:             */
  319. !     char    x_checksum[BUFLEN];        /* X-Checksum-Snefru: or */
  320. !                                        /* X-Md4-Signature:       */
  321. X      char    orig_poster[BUFLEN];    /* Original-posting-by:  */
  322. X      char    orig_subject[BUFLEN];    /* Original-subject:     */
  323. X      char    archive_site[BUFLEN];    /* Archive-site:         */
  324. diff -cr ../usenet/ckconfig.c ./ckconfig.c
  325. *** ../usenet/ckconfig.c    Wed May  8 21:31:57 1991
  326. --- ./ckconfig.c    Thu May  9 01:39:07 1991
  327. ***************
  328. *** 24,30 ****
  329. X  **  all ideas to me. This software is going to be maintained and 
  330. X  **  enhanced as deemed necessary by the community.
  331. X  */
  332. ! char sccsid[] = "@(#)ckconfig.c    2.2 2/23/91";
  333. X  
  334. X  #include <sys/types.h>
  335. X  #include <stdio.h>
  336. --- 24,30 ----
  337. X  **  all ideas to me. This software is going to be maintained and 
  338. X  **  enhanced as deemed necessary by the community.
  339. X  */
  340. ! char sccsid[] = "@(#)ckconfig.c    2.3 5/9/91";
  341. X  
  342. X  #include <sys/types.h>
  343. X  #include <stdio.h>
  344. ***************
  345. *** 125,135 ****
  346. X                      default_type == ONLY_ARCHIVE_NAME ? "Only-Archive-Name":
  347. X                      default_type == EXTERNAL_COMMAND ? "External-Command":
  348. X                                                          "Article-Number"); 
  349. !     if (default_type == EXTERNAL_COMMAND) {
  350. !        /* Must have an ARCHIVE_CMD line... */
  351. !        (void) fprintf(logfp,"Archive Command:         %s\n",
  352. !                   *arch_command ? arch_command : "ERROR - NOT SPECIFIED");
  353. !     }
  354. X  
  355. X      (void) fprintf(logfp,"Patches Type:            %s\n",
  356. X                    default_patch_type == PACKAGE ? "Package" : "Historical");
  357. --- 125,132 ----
  358. X                      default_type == ONLY_ARCHIVE_NAME ? "Only-Archive-Name":
  359. X                      default_type == EXTERNAL_COMMAND ? "External-Command":
  360. X                                                          "Article-Number"); 
  361. !    (void) fprintf(logfp,"Archive Command:         %s\n",
  362. !                     *arch_command ? arch_command : "NOT SPECIFIED");
  363. X  
  364. X      (void) fprintf(logfp,"Patches Type:            %s\n",
  365. X                    default_patch_type == PACKAGE ? "Package" : "Historical");
  366. diff -cr ../usenet/disp_grp.c ./disp_grp.c
  367. *** ../usenet/disp_grp.c    Wed May  8 21:32:00 1991
  368. --- ./disp_grp.c    Thu May  9 01:41:16 1991
  369. ***************
  370. *** 8,14 ****
  371. X  **
  372. X  */
  373. X  #ifndef lint
  374. ! static char SID[] = "@(#)disp_grp.c    2.2 2/23/91";
  375. X  #endif
  376. X  
  377. X  #include <sys/types.h>
  378. --- 8,14 ----
  379. X  **
  380. X  */
  381. X  #ifndef lint
  382. ! static char SID[] = "@(#)disp_grp.c    2.3 5/9/91";
  383. X  #endif
  384. X  
  385. X  #include <sys/types.h>
  386. ***************
  387. *** 26,31 ****
  388. --- 26,32 ----
  389. X  extern char mail[];
  390. X  extern char compress[];
  391. X  extern char checkhash[];
  392. + extern char arch_command[];
  393. X  
  394. X  struct passwd *pw;
  395. X  struct passwd *getpwuid();
  396. ***************
  397. *** 88,95 ****
  398. X                                               "Article-Number"); 
  399. X      if (ng->type == EXTERNAL_COMMAND) {
  400. X         /* Must have an ARCHIVE_CMD line... */
  401. !        (void) fprintf(logfp,"\tArchive Command:     %s\n",
  402. !                   *(ng->arch_command) ? ng->arch_command : "ERROR - NOT SPECIFIED");
  403. X      }
  404. X  
  405. X      (void) fprintf(logfp,"\tPatches Type:        %s\n", 
  406. --- 89,98 ----
  407. X                                               "Article-Number"); 
  408. X      if (ng->type == EXTERNAL_COMMAND) {
  409. X         /* Must have an ARCHIVE_CMD line... */
  410. !        (void)fprintf(logfp,"\tArchive Command:     %-15s\n",
  411. !                   *ng->arch_command != '\0' ? ng->arch_command : 
  412. !                   !*arch_command ? "ERROR - (*NO* DEFAULT)" :
  413. !                   fill_in_defaults ? arch_command : "NOT SPECIFIED (DEFAULT)");
  414. X      }
  415. X  
  416. X      (void) fprintf(logfp,"\tPatches Type:        %s\n", 
  417. diff -cr ../usenet/format.c ./format.c
  418. *** ../usenet/format.c    Wed May  8 21:31:53 1991
  419. --- ./format.c    Thu May  9 01:44:09 1991
  420. ***************
  421. *** 8,14 ****
  422. X  **
  423. X  */
  424. X  #if !defined(lint) && !defined(SABER)
  425. ! static char SID[] = "@(#)format.c    2.2 2/23/91";
  426. X  #endif
  427. X  
  428. X  #include <stdio.h>
  429. --- 8,14 ----
  430. X  **
  431. X  */
  432. X  #if !defined(lint) && !defined(SABER)
  433. ! static char SID[] = "@(#)format.c    2.3 5/9/91";
  434. X  #endif
  435. X  
  436. X  #include <stdio.h>
  437. ***************
  438. *** 40,45 ****
  439. --- 40,46 ----
  440. X    extern int default_modes;
  441. X  # ifdef NNTP
  442. X      extern char nntp[];
  443. +     extern char nntp_tmp_path[];
  444. X  # endif /*NNTP*/
  445. X  #endif /* RKIVE */
  446. X  
  447. ***************
  448. *** 243,248 ****
  449. --- 244,254 ----
  450. X                 case 'X':     /* Version-number */
  451. X                     cp = add_string(cp, header.version_number);
  452. X                     continue;
  453. + #ifdef RKIVE
  454. +                case 'Z':   /*  Relative pathname of archived file */
  455. +                    cp = add_string(cp,substr(filename,newsgrp->location)?filename+strlen(newsgrp->location)+1:filename);
  456. +                    continue;
  457. + #endif
  458. X                 case 'a':     /* Archive-name */
  459. X                     cp = add_string(cp, header.archive_name);
  460. X                     continue;
  461. ***************
  462. *** 261,268 ****
  463. X                 case 'f':     /* Followup-to  */
  464. X                     cp = add_string(cp, header.followup_to);
  465. X                     continue;
  466. !                case 'h':     /* X-Checksum-Snefru  */
  467. !                    cp = add_string(cp, header.x_checksum_snefru);
  468. X                     continue;
  469. X                 case 'i':     /* issue (if archive) */
  470. X                     cp = add_string(cp,itoa(article.issue));
  471. --- 267,274 ----
  472. X                 case 'f':     /* Followup-to  */
  473. X                     cp = add_string(cp, header.followup_to);
  474. X                     continue;
  475. !                case 'h':     /* X-Checksum-Snefru or X-Md4-Signature */
  476. !                    cp = add_string(cp, header.x_checksum);
  477. X                     continue;
  478. X                 case 'i':     /* issue (if archive) */
  479. X                     cp = add_string(cp,itoa(article.issue));
  480. ***************
  481. *** 419,424 ****
  482. --- 425,433 ----
  483. X                     cp = add_string(cp,newsgrp->mail_list);
  484. X                     continue;
  485. X  #ifdef NNTP
  486. +                case 'F':     /* NNTP Temporary transfer file */
  487. +                    cp = add_string(cp,nntp_tmp_path);
  488. +                    continue;
  489. X                 case 'N':     /* NNTP */
  490. X                     /* print out according to precedence. */
  491. X                     if (*newsgrp->nntp)
  492. diff -cr ../usenet/header.c ./header.c
  493. *** ../usenet/header.c    Wed May  8 21:31:51 1991
  494. --- ./header.c    Thu May  9 01:45:11 1991
  495. ***************
  496. *** 9,15 ****
  497. X  */
  498. X  
  499. X  #if !defined(lint) && !defined(SABER)
  500. ! static char SID[] = "@(#)header.c    2.2 2/23/91";
  501. X  #endif
  502. X  
  503. X  #include <stdio.h>
  504. --- 9,15 ----
  505. X  */
  506. X  
  507. X  #if !defined(lint) && !defined(SABER)
  508. ! static char SID[] = "@(#)header.c    2.3 5/9/91";
  509. X  #endif
  510. X  
  511. X  #include <stdio.h>
  512. ***************
  513. *** 78,93 ****
  514. X      if (its("Patch-to: "))
  515. X          return PATCH_TO;
  516. X  
  517. !     /* The X-Checksum-Snefru archive is being used by  */
  518. !     /* comp.sources.unix and comp.sources.misc to      */
  519. !     /* verify articles.                                */
  520. X  
  521. X      if (its("X-Checksum-Snefru: "))
  522. !         return X_CHECKSUM_SNEFRU;
  523. X  
  524. X      /* The following lines are used by comp.sources.games  */
  525. X      /* currently to indicate the environmental keywords    */
  526. X      /* indicating what is required by the software to run. */
  527. X  
  528. X      if (its("Environment: "))
  529. X          return ENVIRONMENT;
  530. --- 78,99 ----
  531. X      if (its("Patch-to: "))
  532. X          return PATCH_TO;
  533. X  
  534. !     /* The X-Checksum-Snefru archive was being used by     */
  535. !     /* comp.sources.unix and comp.sources.misc to  verify  */
  536. !     /* articles.  Once snefru was broken, the moderators   */
  537. !     /* of c.s.u and c.s.m switched to use X-Md4-Signature: */
  538. !     /* which is based on MD4 (RFC1186).                    */
  539. X  
  540. X      if (its("X-Checksum-Snefru: "))
  541. !         return X_CHECKSUM;
  542. !     if (its("X-Md4-Signature: "))
  543. !         return X_CHECKSUM;
  544. X  
  545. X      /* The following lines are used by comp.sources.games  */
  546. X      /* currently to indicate the environmental keywords    */
  547. X      /* indicating what is required by the software to run. */
  548. +     /* Supersedes: is also used by comp.sources.misc to    */
  549. +     /* indicate when a posting totally replaces another.   */
  550. X  
  551. X      if (its("Environment: "))
  552. X          return ENVIRONMENT;
  553. ***************
  554. *** 288,294 ****
  555. X      header.posting_num[0] = '\0';      /* Posting-number:       */
  556. X      header.archive_name[0] = '\0';     /* Archive-name:         */
  557. X      header.patch_to[0] = '\0';         /* Patch-To:             */
  558. !     header.x_checksum_snefru[0] = '\0';    /* X-Checksum-Snefru:      */
  559. X      header.orig_poster[0] = '\0';    /* Original-posting-by:  */
  560. X      header.orig_subject[0] = '\0';    /* Original-subject:     */
  561. X      header.archive_site[0] = '\0';    /* Archive-site:         */
  562. --- 294,301 ----
  563. X      header.posting_num[0] = '\0';      /* Posting-number:       */
  564. X      header.archive_name[0] = '\0';     /* Archive-name:         */
  565. X      header.patch_to[0] = '\0';         /* Patch-To:             */
  566. !     header.x_checksum[0] = '\0';    /* X-Checksum-Snefru: or */
  567. !                                      /* X-Md4-Signature       */
  568. X      header.orig_poster[0] = '\0';    /* Original-posting-by:  */
  569. X      header.orig_subject[0] = '\0';    /* Original-subject:     */
  570. X      header.archive_site[0] = '\0';    /* Archive-site:         */
  571. ***************
  572. *** 736,743 ****
  573. X          *sp = '\0';
  574. X          break;
  575. X  
  576. !     case X_CHECKSUM_SNEFRU:
  577. !         data(header.x_checksum_snefru,sizeof(header.x_checksum_snefru),"X_CHECKSUM_SNEFRU:", X_CHECKSUM_SNEFRU);
  578. X          break;
  579. X  
  580. X      case ORIGINAL_POSTING_BY:
  581. --- 743,750 ----
  582. X          *sp = '\0';
  583. X          break;
  584. X  
  585. !     case X_CHECKSUM:
  586. !         data(header.x_checksum,sizeof(header.x_checksum),"X_CHECKSUM:", X_CHECKSUM);
  587. X          break;
  588. X  
  589. X      case ORIGINAL_POSTING_BY:
  590. Only in .: localize.smpl
  591. diff -cr ../usenet/makedir.c ./makedir.c
  592. *** ../usenet/makedir.c    Wed May  8 21:32:01 1991
  593. --- ./makedir.c    Thu May  9 01:48:11 1991
  594. ***************
  595. *** 9,15 ****
  596. X  */
  597. X  
  598. X  #if !defined(lint) && !defined(SABER)
  599. ! static char SID[] = "@(#)makedir.c    2.1 2/21/91";
  600. X  #endif
  601. X  
  602. X  #include <sys/types.h>
  603. --- 9,15 ----
  604. X  */
  605. X  
  606. X  #if !defined(lint) && !defined(SABER)
  607. ! static char SID[] = "@(#)makedir.c    2.2 5/9/91";
  608. X  #endif
  609. X  
  610. X  #include <sys/types.h>
  611. ***************
  612. *** 34,40 ****
  613. X      int strlen();
  614. X      int chown();
  615. X  
  616. ! #ifndef HAVE_MKDIR
  617. X  # ifndef USE_SYSMKDIR
  618. X  
  619. X      char *strcat();
  620. --- 34,40 ----
  621. X      int strlen();
  622. X      int chown();
  623. X  
  624. ! #ifndef MKDIR
  625. X  # ifndef USE_SYSMKDIR
  626. X  
  627. X      char *strcat();
  628. ***************
  629. *** 58,69 ****
  630. X  
  631. X      char crnt_dir[MAXNAMLEN];
  632. X  
  633. ! #else /* HAVE_MKDIR */
  634. X  
  635. X      int mkdir();
  636. X      int svmask;          /* Old umask value */
  637. X  
  638. ! #endif /* HAVE_MKDIR */
  639. X      
  640. X      if ((strlen(dirpath) == 0) || (dirpath[0] == '\0')) {
  641. X          (void) fprintf(errfp,"%s: cannot make %s\n", progname,dirpath);
  642. --- 58,69 ----
  643. X  
  644. X      char crnt_dir[MAXNAMLEN];
  645. X  
  646. ! #else /* MKDIR */
  647. X  
  648. X      int mkdir();
  649. X      int svmask;          /* Old umask value */
  650. X  
  651. ! #endif /* MKDIR */
  652. X      
  653. X      if ((strlen(dirpath) == 0) || (dirpath[0] == '\0')) {
  654. X          (void) fprintf(errfp,"%s: cannot make %s\n", progname,dirpath);
  655. ***************
  656. *** 76,82 ****
  657. X              return(0);
  658. X      }
  659. X  
  660. ! #ifdef HAVE_MKDIR
  661. X  
  662. X      /*
  663. X      ** mkdir function supplied in system library.
  664. --- 76,82 ----
  665. X              return(0);
  666. X      }
  667. X  
  668. ! #ifdef MKDIR
  669. X  
  670. X      /*
  671. X      ** mkdir function supplied in system library.
  672. ***************
  673. *** 176,181 ****
  674. X          return(-1);
  675. X      }
  676. X  #endif /* USE_SYSMKDIR */
  677. ! #endif /* HAVE_MKDIR */
  678. X      return(0); 
  679. X  }
  680. --- 176,181 ----
  681. X          return(-1);
  682. X      }
  683. X  #endif /* USE_SYSMKDIR */
  684. ! #endif /* MKDIR */
  685. X      return(0); 
  686. X  }
  687. diff -cr ../usenet/news_arc.c ./news_arc.c
  688. *** ../usenet/news_arc.c    Wed May  8 21:31:46 1991
  689. --- ./news_arc.c    Thu May  9 01:49:47 1991
  690. ***************
  691. *** 9,15 ****
  692. X  */
  693. X  
  694. X  #if !defined(lint) && !defined(SABER)
  695. ! static char SID[] = "@(#)news_arc.c    2.2 2/23/91";
  696. X  #endif
  697. X  
  698. X  #include <sys/types.h>
  699. --- 9,15 ----
  700. X  */
  701. X  
  702. X  #if !defined(lint) && !defined(SABER)
  703. ! static char SID[] = "@(#)news_arc.c    2.3 5/9/91";
  704. X  #endif
  705. X  
  706. X  #include <sys/types.h>
  707. ***************
  708. *** 58,63 ****
  709. --- 58,64 ----
  710. X  void store_line();
  711. X  void dump_article();
  712. X  void record_problem();
  713. + void write_patch_log();
  714. X  
  715. X  void get_header(filename)
  716. X      char *filename;
  717. ***************
  718. *** 120,125 ****
  719. --- 121,127 ----
  720. X  {    "Date:",        (sizeof "Date:")        },
  721. X  {    "Approved:",        (sizeof "Approved:")        },
  722. X  {    "X-Checksum-Snefru:",    (sizeof "X-Checksum-Snefru:")    },
  723. + {    "X-Md4-Signature:",    (sizeof "X-Md4-Signature:")    },
  724. X  {    NULL,            0                },
  725. X  };
  726. X  
  727. ***************
  728. *** 252,258 ****
  729. X  char *path;
  730. X  {
  731. X      void write_archived();
  732. -     void write_patch_log();
  733. X  
  734. X      if (copy(filename,path) != 0) {  
  735. X          (void) fprintf(errfp,"copy failed for %s to %s\n",filename,path);
  736. --- 254,259 ----
  737. ***************
  738. *** 308,316 ****
  739. X      */
  740. X  
  741. X      /*
  742. !     ** If the Snefru header exists, check the article checksum for validity.
  743. X      */
  744. !     if (header.x_checksum_snefru[0]) {
  745. X      if (*(ng->checkhash)) {
  746. X          if (do_checkhash(ng->checkhash, filename) != 0)
  747. X          return(do_problem(CHECKHASH_PROB,ng,filename,path));
  748. --- 309,318 ----
  749. X      */
  750. X  
  751. X      /*
  752. !     ** If the MD4 or Snefru headers exists, check the article's
  753. !     ** checksum for validity.
  754. X      */
  755. !     if (header.x_checksum[0]) {
  756. X      if (*(ng->checkhash)) {
  757. X          if (do_checkhash(ng->checkhash, filename) != 0)
  758. X          return(do_problem(CHECKHASH_PROB,ng,filename,path));
  759. ***************
  760. *** 421,431 ****
  761. X              ** issue number to be used is available. 
  762. X              ** There should be no duplicates here ever... :-)
  763. X              ** [ just don't blow away your .archived file... :-( ]
  764. X              */
  765. X              do {
  766. !                 ++inum;
  767. !         chronpath(ng->location, path, inum);
  768. !             } while (stat(path ,&sb) == 0); 
  769. X              break;
  770. X      case ONLY_ARCHIVE_NAME:
  771. X              /*
  772. --- 423,442 ----
  773. X              ** issue number to be used is available. 
  774. X              ** There should be no duplicates here ever... :-)
  775. X              ** [ just don't blow away your .archived file... :-( ]
  776. +             ** Need to assure that the compression suffix in not attached
  777. +             ** as well since the prior run that day may use compression.
  778. X              */
  779. X              do {
  780. !                 do {
  781. !                     ++inum;
  782. !             chronpath(ng->location, path, inum);
  783. !                 } while (stat(path ,&sb) == 0); 
  784. !                 /* 
  785. !                 ** expand the path to the file to include the 
  786. !                 ** compression suffix if necessary.
  787. !                 */
  788. !                 final_path = expand_name(path, ng);
  789. !             } while (stat(final_path ,&sb) == 0); 
  790. X              break;
  791. X      case ONLY_ARCHIVE_NAME:
  792. X              /*
  793. ***************
  794. *** 517,523 ****
  795. X              if (*ng->arch_command) 
  796. X                  (void) strcpy(command, ng->arch_command);
  797. X              else if (*arch_command) 
  798. !                 (void) strcpy(command, ng->arch_command);
  799. X              else
  800. X                  return(do_problem(EXTERNAL_PROB,ng,filename,path));
  801. X              
  802. --- 528,534 ----
  803. X              if (*ng->arch_command) 
  804. X                  (void) strcpy(command, ng->arch_command);
  805. X              else if (*arch_command) 
  806. !                 (void) strcpy(command, arch_command);
  807. X              else
  808. X                  return(do_problem(EXTERNAL_PROB,ng,filename,path));
  809. X              
  810. ***************
  811. *** 643,648 ****
  812. --- 654,660 ----
  813. X  #endif /*MV_ORIGINAL */
  814. X  
  815. X      char pmess[BUFSIZ];
  816. +     char *final_path;
  817. X      int nm;
  818. X      struct stat sb;
  819. X  
  820. ***************
  821. *** 670,679 ****
  822. X            (void) strcat(pmess,"has an invalid archive TYPE specified.\n");
  823. X            break;
  824. X         case CHECKHASH_PROB:
  825. !           (void) strcat(pmess,"failed Snefru checkhash test.\n");
  826. X            break;
  827. X         case MSNG_HASH_PROB:
  828. !           (void) strcat(pmess,"is missing expected Snefru header.\n");
  829. X            break;
  830. X         case DUP_PROB:
  831. X            if (article.repost != TRUE) 
  832. --- 682,691 ----
  833. X            (void) strcat(pmess,"has an invalid archive TYPE specified.\n");
  834. X            break;
  835. X         case CHECKHASH_PROB:
  836. !           (void) strcat(pmess,"failed article checksum verification test.\n");
  837. X            break;
  838. X         case MSNG_HASH_PROB:
  839. !           (void) strcat(pmess,"is missing expected article checksum verifications header.\n");
  840. X            break;
  841. X         case DUP_PROB:
  842. X            if (article.repost != TRUE) 
  843. ***************
  844. *** 780,789 ****
  845. X  
  846. X      nm = 1;
  847. X  
  848. !     while (stat(path, &sb) == 0) {
  849. !          (void) sprintf(path,"%s/%s/%s.%d",problems_dir,ng->ng_path,file,nm);
  850. !          ++nm;
  851. !     }
  852. X  
  853. X      /* Display and record the actions */ 
  854. X      (void) sprintf(pmess,"\tStoring Article %s at %s\n", file, path);
  855. --- 792,812 ----
  856. X  
  857. X      nm = 1;
  858. X  
  859. !     do {
  860. !         final_path = expand_name(path, ng);
  861. !         /*
  862. !         ** Let's assure that neither the uncompressed or
  863. !         ** the compressed version of the article number
  864. !         ** exists where we want to put this problem.
  865. !         ** Don't need to create a different problem...
  866. !         */
  867. !         if ((stat(path, &sb) == 0) || (stat(final_path, &sb) == 0)) {
  868. !             (void) sprintf(path,"%s/%s/%s.%d",problems_dir,ng->ng_path,file,nm);
  869. !             ++nm;
  870. !         }
  871. !         else
  872. !             nm = 0;
  873. !     } while (nm != 0);
  874. X  
  875. X      /* Display and record the actions */ 
  876. X      (void) sprintf(pmess,"\tStoring Article %s at %s\n", file, path);
  877. ***************
  878. *** 849,854 ****
  879. --- 872,878 ----
  880. X                       VOLUME, now.tm_year, month[now.tm_mon],
  881. X                       now.tm_year,now.tm_mon+1,now.tm_mday,seqnum);
  882. X  #endif /* NO_MONTH_DIR */
  883. +     article.volume = now.tm_year;
  884. X  }
  885. X  
  886. X  void write_patch_log(ng, path)
  887. ***************
  888. *** 954,957 ****
  889. X      else
  890. X         return(0);
  891. X  }
  892. --- 978,980 ----
  893. diff -cr ../usenet/nntpart.c ./nntpart.c
  894. *** ../usenet/nntpart.c    Wed May  8 21:31:54 1991
  895. --- ./nntpart.c    Thu May  9 01:52:17 1991
  896. ***************
  897. *** 9,15 ****
  898. X  */
  899. X  
  900. X  #if !defined(lint) && !defined(SABER)
  901. ! static char *SID = "@(#)nntpart.c    2.1 2/21/91";
  902. X  #endif
  903. X  
  904. X  /*LINTLIBRARY*/
  905. --- 9,15 ----
  906. X  */
  907. X  
  908. X  #if !defined(lint) && !defined(SABER)
  909. ! static char *SID = "@(#)nntpart.c    2.2 5/9/91";
  910. X  #endif
  911. X  
  912. X  /*LINTLIBRARY*/
  913. ***************
  914. *** 155,161 ****
  915. --- 155,169 ----
  916. X          return;
  917. X  }
  918. X  
  919. + /*
  920. + ** nntp_tmp_path[]
  921. + **
  922. + ** Holds the full pathname of the nntp transfer file.
  923. + ** For use with external command archiving...
  924. + */
  925. X  
  926. + char nntp_tmp_path[MAXNAMLEN];   
  927. X  int nntp_retrieve_article(filename,which_time)
  928. X  char *filename;
  929. X  int which_time;
  930. ***************
  931. *** 249,254 ****
  932. --- 257,263 ----
  933. X          ** the Article-Number form of archiving.
  934. X          */
  935. X          (void) sprintf(filename,"%d",f);
  936. +         (void) sprintf(nntp_tmp_path,"%s/%d",TMPDIR,f);
  937. X  
  938. X          /* 
  939. X          ** Build the nntp command string 
  940. diff -cr ../usenet/patchlevel.h ./patchlevel.h
  941. *** ../usenet/patchlevel.h    Wed May  8 21:32:02 1991
  942. --- ./patchlevel.h    Thu May  9 01:53:31 1991
  943. ***************
  944. *** 1,5 ****
  945. X  /*
  946. ! **    @(#)patchlevel.h    2.2 2/23/91
  947. X  */
  948. X  #define RELEASE 2
  949. ! #define PATCHLEVEL 0
  950. --- 1,5 ----
  951. X  /*
  952. ! **    @(#)patchlevel.h    2.3 5/9/91
  953. X  */
  954. X  #define RELEASE 2
  955. ! #define PATCHLEVEL 1
  956. Common subdirectories: ../usenet/port and ./port
  957. diff -cr ../usenet/record_arc.c ./record_arc.c
  958. *** ../usenet/record_arc.c    Wed May  8 21:32:03 1991
  959. --- ./record_arc.c    Thu May  9 01:55:39 1991
  960. ***************
  961. *** 9,15 ****
  962. X  */
  963. X  
  964. X  #if !defined(lint) && !defined(SABER)
  965. ! static char SID[] = "@(#)record_arc.c    2.1 2/21/91";
  966. X  #endif
  967. X  
  968. X  #include <sys/types.h>
  969. --- 9,15 ----
  970. X  */
  971. X  
  972. X  #if !defined(lint) && !defined(SABER)
  973. ! static char SID[] = "@(#)record_arc.c    2.2 5/9/91";
  974. X  #endif
  975. X  
  976. X  #include <sys/types.h>
  977. ***************
  978. *** 130,137 ****
  979. X      if (test)
  980. X          return;
  981. X  
  982. !     if ((stat(path ,&sb) != 0)) 
  983. !         if (mkparents(path) == -1)
  984. X              return;          /* unable to build parent directories */
  985. X  
  986. X      /*
  987. --- 130,137 ----
  988. X      if (test)
  989. X          return;
  990. X  
  991. !     if ((stat(newsgrp->arc_done ,&sb) != 0)) 
  992. !         if (mkparents(newsgrp->arc_done) == -1)
  993. X              return;          /* unable to build parent directories */
  994. X  
  995. X      /*
  996. diff -cr ../usenet/retrieve.c ./retrieve.c
  997. *** ../usenet/retrieve.c    Wed May  8 21:31:58 1991
  998. --- ./retrieve.c    Thu May  9 01:57:18 1991
  999. ***************
  1000. *** 9,15 ****
  1001. X  */
  1002. X  
  1003. X  #if !defined(lint) && !defined(SABER)
  1004. ! static char SID[] = "@(#)retrieve.c    2.1 2/21/91";
  1005. X  #endif
  1006. X  
  1007. X  #include <sys/types.h>
  1008. --- 9,15 ----
  1009. X  */
  1010. X  
  1011. X  #if !defined(lint) && !defined(SABER)
  1012. ! static char SID[] = "@(#)retrieve.c    2.2 5/9/91";
  1013. X  #endif
  1014. X  
  1015. X  #include <sys/types.h>
  1016. ***************
  1017. *** 17,22 ****
  1018. --- 17,24 ----
  1019. X  #include <stdio.h>
  1020. X  #include "rkive.h"
  1021. X  
  1022. + #define TMPDIR "/tmp"
  1023. X  char newsgroup_directory[MAXNAMLEN];
  1024. X  
  1025. X  extern FILE *inputfp;              
  1026. ***************
  1027. *** 70,77 ****
  1028. X  ** to retrieve an article:
  1029. X  **    1. Retrieve an article from a remote site via NNTP,
  1030. X  **    2. Search the newsgroup directory for newsarticles,
  1031. ! **    3. Receive a newsarticle filename on standard input,
  1032. ! **    4. Receive newsarticle filenames from a batch file.
  1033. X  */
  1034. X  
  1035. X  int retrieve_article(filename,which_time)
  1036. --- 72,80 ----
  1037. X  ** to retrieve an article:
  1038. X  **    1. Retrieve an article from a remote site via NNTP,
  1039. X  **    2. Search the newsgroup directory for newsarticles,
  1040. ! **    3. Read an article from standard input, 
  1041. ! **    4. Receive a newsarticle filename on standard input,
  1042. ! **    5. Receive newsarticle filenames from a batch file.
  1043. X  */
  1044. X  
  1045. X  int retrieve_article(filename,which_time)
  1046. ***************
  1047. *** 83,88 ****
  1048. --- 86,92 ----
  1049. X      int strlen();
  1050. X      int unlink();
  1051. X      int fclose();
  1052. +     int creat();
  1053. X      char *strcpy();
  1054. X  
  1055. X      FILE *efopen();
  1056. ***************
  1057. *** 95,105 ****
  1058. X      static DIR *dfd;
  1059. X      static char *dir = ".";
  1060. X      char ibuf[BUFSIZ];
  1061. X  
  1062. - #ifdef NNTP
  1063. -     if (retrieve == FROM_NNTP) 
  1064. -          return(nntp_retrieve_article(filename,which_time));
  1065. - #endif /*NNTP*/
  1066. X  
  1067. X      if (which_time == 1) {
  1068. X         (void) strcpy(newsgrp->ng_path, newsgrp->ng_name);
  1069. --- 99,107 ----
  1070. X      static DIR *dfd;
  1071. X      static char *dir = ".";
  1072. X      char ibuf[BUFSIZ];
  1073. +     int len;
  1074. +     int tmpfp;
  1075. X  
  1076. X  
  1077. X      if (which_time == 1) {
  1078. X         (void) strcpy(newsgrp->ng_path, newsgrp->ng_name);
  1079. ***************
  1080. *** 115,121 ****
  1081. X                  *rp = '/';        /* to create   */
  1082. X              rp++;                 /* the disk    */
  1083. X          }                         /* location    */
  1084. !     
  1085. X          (void) sprintf(newsgroup_directory,"%s/%s", spooldir,newsgrp->ng_path);
  1086. X      
  1087. X          if (chdir(newsgroup_directory) != 0) {
  1088. --- 117,130 ----
  1089. X                  *rp = '/';        /* to create   */
  1090. X              rp++;                 /* the disk    */
  1091. X          }                         /* location    */
  1092. !     }
  1093. ! #ifdef NNTP
  1094. !     if (retrieve == FROM_NNTP) 
  1095. !          return(nntp_retrieve_article(filename,which_time));
  1096. ! #endif /*NNTP*/
  1097. !     if (which_time == 1) {
  1098. X          (void) sprintf(newsgroup_directory,"%s/%s", spooldir,newsgrp->ng_path);
  1099. X      
  1100. X          if (chdir(newsgroup_directory) != 0) {
  1101. ***************
  1102. *** 164,174 ****
  1103. X      }
  1104. X  
  1105. X      /*
  1106. X      ** The following code is for retrieval types FROM_NAME and FROM_BATCHFILE
  1107. X      ** only. Any other type is an unknown software error ...
  1108. X      */
  1109. X      if (retrieve != FROM_NAME && retrieve != FROM_BATCHFILE) {
  1110. !         (void) fprintf(errfp, "Invalid retrieval type encountered - %d\n",retrieve);
  1111. X          return(ERROR_ENCOUNTERED);
  1112. X      }
  1113. X  
  1114. --- 173,242 ----
  1115. X      }
  1116. X  
  1117. X      /*
  1118. +     ** FROM_STDIN archiving.
  1119. +     **
  1120. +     ** First create a temp file name and write the information into
  1121. +     ** the temp file. Write the data passed on stdin into the temp file.
  1122. +     ** Then pass the temp file name back to rkive to use from then on.
  1123. +     */
  1124. +     if (retrieve == FROM_STDIN) {
  1125. +         if ((rp = tempnam(TMPDIR, "rkiveXXXXXX")) == NULL) {
  1126. +             (void) fprintf(errfp, "Can't create tmpfile name\n");
  1127. +             return(ERROR_ENCOUNTERED);
  1128. +         }
  1129. +         if ((tmpfp = creat(rp, 0644)) == NULL) {
  1130. +             (void) fprintf(errfp, "Can't create tmpfile\n");
  1131. +             return(ERROR_ENCOUNTERED);
  1132. +         }
  1133. +         len = -1;
  1134. +         while (fgets(ibuf, BUFSIZ, inputfp) != NULL) {
  1135. +              len = strlen(ibuf);
  1136. +              if (write(tmpfp, ibuf, len) != len) 
  1137. +                  perror("write");
  1138. +         }
  1139. +         (void) close(tmpfp);
  1140. +         /*
  1141. +         ** If len was never assigned then stdin was closed.
  1142. +         ** and no reason at all to go any further, we are
  1143. +         ** done. Return so...
  1144. +         */
  1145. +         if (len == -1) {
  1146. +             /* 
  1147. +             ** no more filenames on inputfp...
  1148. +             */
  1149. +             (void) unlink(rp);
  1150. +             return(DONE);
  1151. +         }
  1152. +         /*
  1153. +         ** Check to assure the file is available and contains
  1154. +         ** some data...
  1155. +         */
  1156. +         if (!valid_disk_article(rp,rp)) {
  1157. +             return(ERROR_ENCOUNTERED);
  1158. +         }
  1159. +         /*
  1160. +         ** We have real data here...
  1161. +         */
  1162. +         (void) strcpy(filename,rp);
  1163. +         free(rp);
  1164. +         return(RETRIEVED);
  1165. +     }
  1166. +     /*
  1167. X      ** The following code is for retrieval types FROM_NAME and FROM_BATCHFILE
  1168. X      ** only. Any other type is an unknown software error ...
  1169. X      */
  1170. X      if (retrieve != FROM_NAME && retrieve != FROM_BATCHFILE) {
  1171. !         (void) fprintf(errfp, "Invalid retrieval type encountered - %d\n",
  1172. !                        retrieve);
  1173. X          return(ERROR_ENCOUNTERED);
  1174. X      }
  1175. X  
  1176. diff -cr ../usenet/rkive.5 ./rkive.5
  1177. *** ../usenet/rkive.5    Wed May  8 21:31:54 1991
  1178. --- ./rkive.5    Thu May  9 01:58:47 1991
  1179. ***************
  1180. *** 1,4 ****
  1181. ! 'br "@(#)rkive.5    2.3 2/24/91"
  1182. X  .TH RKIVE 5
  1183. X  .SH NAME
  1184. X  rkive.cf \- USENET Source Archiver Configuration File.
  1185. --- 1,4 ----
  1186. ! 'br "@(#)rkive.5    2.4 5/9/91"
  1187. X  .TH RKIVE 5
  1188. X  .SH NAME
  1189. X  rkive.cf \- USENET Source Archiver Configuration File.
  1190. ***************
  1191. *** 117,125 ****
  1192. X  .IP "CHECKHASH =" 
  1193. X  The location of the checkhash utility if the files are to be tested for
  1194. X  transit damage.  Currently, only comp.sources.unix and comp.sources.misc
  1195. ! supports this test with the X-Checksum-Snerfu: header.  If this variable 
  1196. ! is specified, it must contain the full path to the command used to perform 
  1197. ! the test.
  1198. X  .IP "NNTP =" 
  1199. X  The location of the NNTP server where the articles are to be archived from. 
  1200. X  This can be specified globally if all or most newsgroups are archived
  1201. --- 117,126 ----
  1202. X  .IP "CHECKHASH =" 
  1203. X  The location of the checkhash utility if the files are to be tested for
  1204. X  transit damage.  Currently, only comp.sources.unix and comp.sources.misc
  1205. ! supports this type of testing. The X-Checksum-Snerfu: header has been used
  1206. ! in the past. This header is being phased out in favor of the X-Md4-Signature: 
  1207. ! header. If this variable is specified, it must contain the full path to the 
  1208. ! command used to perform the verification testing on the articles. 
  1209. X  .IP "NNTP =" 
  1210. X  The location of the NNTP server where the articles are to be archived from. 
  1211. X  This can be specified globally if all or most newsgroups are archived
  1212. ***************
  1213. *** 263,271 ****
  1214. X  used to perform the compression.
  1215. X  .IP "CHECKHASH :" 
  1216. X  The location of the checkhash utility if the files are to be tested for
  1217. ! transit damage.  Currently, only comp.sources.unix supports this test with
  1218. ! the X-Checksum-Snerfu: header.  If this variable is specified, it must contain
  1219. ! the full path to the command used to perform the test.
  1220. X  .IP "NNTP :" 
  1221. X  The location of the NNTP server where the articles are to be archived from. 
  1222. X  This can be specified globally if all or most newsgroups are archived
  1223. --- 264,272 ----
  1224. X  used to perform the compression.
  1225. X  .IP "CHECKHASH :" 
  1226. X  The location of the checkhash utility if the files are to be tested for
  1227. ! transit damage.  Currently, only comp.sources.unix supports this type of 
  1228. ! testing.  If this variable is specified, it must contain the full path to 
  1229. ! the command used to perform the test.
  1230. X  .IP "NNTP :" 
  1231. X  The location of the NNTP server where the articles are to be archived from. 
  1232. X  This can be specified globally if all or most newsgroups are archived
  1233. ***************
  1234. *** 331,337 ****
  1235. X  .br
  1236. X  g - GROUP - Group id specified.
  1237. X  .br
  1238. ! h - CHECKHASH - Path to the checkhash utility.
  1239. X  .br
  1240. X  i - INDEX - Location of the newsgroup index.
  1241. X  .br
  1242. --- 332,338 ----
  1243. X  .br
  1244. X  g - GROUP - Group id specified.
  1245. X  .br
  1246. ! h - CHECKHASH - Path to checkhash or checkmd4 utility.
  1247. X  .br
  1248. X  i - INDEX - Location of the newsgroup index.
  1249. X  .br
  1250. ***************
  1251. *** 358,363 ****
  1252. --- 359,366 ----
  1253. X  b - Newsgroup's spool directory path.
  1254. X  .br
  1255. X  n - Newsgroup name.
  1256. + .br
  1257. + N - Disk path to the NNTP temporary transfer file.
  1258. X  .br
  1259. X  P - Actual disk path to the file to be archived.
  1260. X  .br
  1261. diff -cr ../usenet/rkive.c ./rkive.c
  1262. *** ../usenet/rkive.c    Wed May  8 21:31:49 1991
  1263. --- ./rkive.c    Thu May  9 02:00:19 1991
  1264. ***************
  1265. *** 37,45 ****
  1266. X  #include "cfg.h"
  1267. X  
  1268. X  #ifdef NNTP
  1269. ! char sccsid[] = "@(#)rkive.c    2.2 2/23/91 - NNTP Version";
  1270. X  #else
  1271. ! char sccsid[] = "@(#)rkive.c    2.2 2/23/91";
  1272. X  #endif /*!NNTP*/
  1273. X  
  1274. X  /* 
  1275. --- 37,45 ----
  1276. X  #include "cfg.h"
  1277. X  
  1278. X  #ifdef NNTP
  1279. ! char sccsid[] = "@(#)rkive.c    2.3 5/9/91 - NNTP Version";
  1280. X  #else
  1281. ! char sccsid[] = "@(#)rkive.c    2.3 5/9/91";
  1282. X  #endif /*!NNTP*/
  1283. X  
  1284. X  /* 
  1285. ***************
  1286. *** 46,63 ****
  1287. X  ** This is necessary since the builtin makedir call uses
  1288. X  ** mknod which is a superuser only call for directories.
  1289. X  */
  1290. ! #if (!HAVE_MKDIR && !USE_SYSMKDIR)
  1291. ! #define ROOT_ONLY
  1292. X  #endif
  1293. X  
  1294. - /* 
  1295. - ** The following define is use for compilation
  1296. - ** so that format_output can use the extended
  1297. - ** fomating characters that are not available
  1298. - ** in article.
  1299. - */
  1300. - #define RKIVE
  1301. X  char tmp_mailfile[] = "/tmp/rkive.mail";
  1302. X  char global_mailfile[] = "/tmp/gbl.mail";
  1303. X  
  1304. --- 46,57 ----
  1305. X  ** This is necessary since the builtin makedir call uses
  1306. X  ** mknod which is a superuser only call for directories.
  1307. X  */
  1308. ! #ifndef MKDIR 
  1309. ! # ifndef USE_SYSMKDIR
  1310. ! #   define ROOT_ONLY
  1311. ! # endif
  1312. X  #endif
  1313. X  
  1314. X  char tmp_mailfile[] = "/tmp/rkive.mail";
  1315. X  char global_mailfile[] = "/tmp/gbl.mail";
  1316. X  
  1317. ***************
  1318. *** 131,136 ****
  1319. --- 125,132 ----
  1320. X      (void)fprintf(stderr,"       Specify alternate configuration file to be used.\n");
  1321. X      (void)fprintf(stderr,"  -n newsgroup\n");
  1322. X      (void)fprintf(stderr,"       Specify newsgroup to archive or display status for.\n");
  1323. +     (void)fprintf(stderr,"  -A newsgroup\n");
  1324. +     (void)fprintf(stderr,"       Take an article to archive from stdin.\n");
  1325. X      (void)fprintf(stderr,"  -B batchfile\n");
  1326. X      (void)fprintf(stderr,"       Read names of articles to archive from batchfile.\n");
  1327. X      (void)fprintf(stderr,"       Note: Use of the -B option requires a newsgroup\n");
  1328. ***************
  1329. *** 171,178 ****
  1330. X     config_file = LOCATION;
  1331. X  
  1332. X     if (argc > 1) {
  1333. !       while ((c = getopt(argc, argv, "?dgstuvVn:f:B:S:y")) != EOF) {
  1334. X           switch (c) {
  1335. X               case 'B':   /* take filenames from batch file  */
  1336. X                   retrieve = FROM_BATCHFILE;
  1337. X                   batch_file = optarg;
  1338. --- 167,178 ----
  1339. X     config_file = LOCATION;
  1340. X  
  1341. X     if (argc > 1) {
  1342. !       while ((c = getopt(argc, argv, "?dgstuvVn:f:A:B:S:y")) != EOF) {
  1343. X           switch (c) {
  1344. +              case 'A':   /* stdin article archiving         */
  1345. +                  retrieve = FROM_STDIN;
  1346. +                  nwsg = optarg;
  1347. +                  break;
  1348. X               case 'B':   /* take filenames from batch file  */
  1349. X                   retrieve = FROM_BATCHFILE;
  1350. X                   batch_file = optarg;
  1351. ***************
  1352. *** 237,242 ****
  1353. --- 237,262 ----
  1354. X             return(1);
  1355. X         }
  1356. X     }
  1357. +    /*
  1358. +    ** If the user has specified that the article is to be read from stdin,
  1359. +    ** the user must specify a a newsgroup as well.  A request for status
  1360. +    ** on an article from stdin makes little sense to me... If I am wrong
  1361. +    ** let me know...
  1362. +    */
  1363. +    else if (retrieve == FROM_STDIN) {
  1364. +        if (nwsg == NULL) {
  1365. +            (void) fprintf(errfp, "%s: Must specify a newsgroup\n",progname);
  1366. +            (void) fprintf(errfp,"Sample command line...\n");
  1367. +            (void) fprintf(errfp,"\t%s -A newsgroup-here\n",progname);
  1368. +            return(1);
  1369. +        }
  1370. +        if (status_only != 0) {
  1371. +            (void) fprintf(errfp,"%s: can't get status for an article on stdin\n", progname);
  1372. +            (void) fprintf(errfp,"Sample command line...\n");
  1373. +            (void) fprintf(errfp,"\t%s -A newsgroup-here\n",progname);
  1374. +            return(1);
  1375. +        }
  1376. +    }
  1377. X  
  1378. X     setup_defaults();
  1379. X  
  1380. ***************
  1381. *** 387,392 ****
  1382. --- 407,413 ----
  1383. X         /* 
  1384. X         ** If the user has specified that a quick status 
  1385. X         ** listing should be produced then hop to it....
  1386. +        ** FROM_STDIN is not allowed to have status requests.
  1387. X         */
  1388. X  
  1389. X         if (status_only) {
  1390. ***************
  1391. *** 485,490 ****
  1392. --- 506,516 ----
  1393. X             if (retrieve == FROM_NNTP)
  1394. X                 (void) unlink(article_name);
  1395. X  #endif /*NNTP*/
  1396. +            /*
  1397. +            ** Remove the tmpfile if the article came from stdin.
  1398. +            */
  1399. +            if (retrieve == FROM_STDIN)
  1400. +                (void) unlink(article_name);
  1401. X             continue;
  1402. X         }
  1403. X            
  1404. ***************
  1405. *** 502,507 ****
  1406. --- 528,538 ----
  1407. X                 if (retrieve == FROM_NNTP)
  1408. X                     (void) unlink(article_name);
  1409. X  #endif /*NNTP*/
  1410. +                /*
  1411. +                ** Remove the tmpfile if the article came from stdin.
  1412. +                */
  1413. +                if (retrieve == FROM_STDIN)
  1414. +                    (void) unlink(article_name);
  1415. X                 continue;
  1416. X             }
  1417. X  
  1418. ***************
  1419. *** 519,524 ****
  1420. --- 550,560 ----
  1421. X                 if (retrieve == FROM_NNTP)
  1422. X                     (void) unlink(article_name);
  1423. X  #endif /*NNTP*/
  1424. +                /*
  1425. +                ** Remove the tmpfile if the article came from stdin.
  1426. +                */
  1427. +                if (retrieve == FROM_STDIN)
  1428. +                    (void) unlink(article_name);
  1429. X                 continue;
  1430. X             }
  1431. X         }
  1432. ***************
  1433. *** 548,554 ****
  1434. X  
  1435. X             if (!problem_article) {
  1436. X                 log_activities(archived_file,newsgrp);
  1437. !                build_index(new_member,newsgrp);
  1438. X                 notify_users(archived_file,newsgrp,cct++);
  1439. X             }
  1440. X         }
  1441. --- 584,590 ----
  1442. X  
  1443. X             if (!problem_article) {
  1444. X                 log_activities(archived_file,newsgrp);
  1445. !                build_index(archived_file,newsgrp);
  1446. X                 notify_users(archived_file,newsgrp,cct++);
  1447. X             }
  1448. X         }
  1449. ***************
  1450. *** 566,571 ****
  1451. --- 602,612 ----
  1452. X         if (retrieve == FROM_NNTP)
  1453. X             (void) unlink(article_name);
  1454. X  #endif /*NNTP*/
  1455. +        /*
  1456. +        ** Remove the tmpfile if the article came from stdin.
  1457. +        */
  1458. +        if (retrieve == FROM_STDIN)
  1459. +            (void) unlink(article_name);
  1460. X      }
  1461. X  
  1462. X      if (!status_only) {
  1463. ***************
  1464. *** 833,839 ****
  1465. X  char *filename;
  1466. X  {
  1467. X      char *comp_cmd;
  1468. -     char *kp;
  1469. X      char cmd[BUFSIZ];
  1470. X  
  1471. X      (void) sprintf(cmd,"%s %s", packit, filename);
  1472. --- 874,879 ----
  1473. ***************
  1474. *** 849,865 ****
  1475. X      if (!test) 
  1476. X         (void) system(cmd);
  1477. X  
  1478. !     /* 
  1479. !     ** Need to remove any compression command 
  1480. !     ** options if they exist. (compress -f)
  1481. !     */
  1482. !     (void) sprintf(cmd,"%s", comp_cmd);
  1483. !     if ((kp = strchr(cmd,' ')) != NULL) {
  1484. !          *kp = '\0';
  1485. !     }
  1486. !     return(suffix(cmd));
  1487. X  }
  1488. X  
  1489. X  
  1490. --- 889,895 ----
  1491. X      if (!test) 
  1492. X         (void) system(cmd);
  1493. X  
  1494. !     return(suffix(comp_cmd));
  1495. X  }
  1496. X  
  1497. X  
  1498. ***************
  1499. *** 877,883 ****
  1500. X      /* 
  1501. X      ** This function is used in the event that a problem
  1502. X      ** has occurred during archiving. It mails a message
  1503. !     ** to the newsgroup speecified list and it mails a 
  1504. X      ** message to the globally specified users.
  1505. X      ** 
  1506. X      ** It then logs the fact into both the newsgroup 
  1507. --- 907,913 ----
  1508. X      /* 
  1509. X      ** This function is used in the event that a problem
  1510. X      ** has occurred during archiving. It mails a message
  1511. !     ** to the newsgroup specified list and it mails a 
  1512. X      ** message to the globally specified users.
  1513. X      ** 
  1514. X      ** It then logs the fact into both the newsgroup 
  1515. ***************
  1516. *** 890,895 ****
  1517. --- 920,932 ----
  1518. X      if ( *mail ) 
  1519. X          logit(global_mailfile, msg_fmt,filename);
  1520. X      
  1521. +     /*
  1522. +     ** Assure that the file you are logging information to
  1523. +     ** has a directory to exist in.. If it fails, oh well..
  1524. +     */
  1525. +     (void)mkparents(ng->logfile);
  1526. X      logit(ng->logfile, msg_fmt, filename);
  1527. +     (void)mkparents(log);
  1528. X      logit(log, msg_fmt, filename);
  1529. X  }
  1530. diff -cr ../usenet/rkive.cf ./rkive.cf
  1531. *** ../usenet/rkive.cf    Wed May  8 21:31:48 1991
  1532. --- ./rkive.cf    Thu May  9 02:50:40 1991
  1533. ***************
  1534. *** 1,5 ****
  1535. X  #
  1536. ! #        @(#)rkive.cf    2.2 2/23/91
  1537. X  #
  1538. X  #        An rkive.cf template.
  1539. X  #        Copy and edit this to reflect the local archive conditions.
  1540. --- 1,5 ----
  1541. X  #
  1542. ! #        @(#)rkive.cf    2.3 5/9/91
  1543. X  #
  1544. X  #        An rkive.cf template.
  1545. X  #        Copy and edit this to reflect the local archive conditions.
  1546. ***************
  1547. *** 82,94 ****
  1548. X  #                          the available selection format capabilities.
  1549. X  #               COMPRESS - The location of the compression utility if the 
  1550. X  #                          files are to be reduced.
  1551. ! #              CHECKHASH - The location of the checkhash utility if  the
  1552. SHAR_EOF
  1553. true || echo 'restore of patch2.1 failed'
  1554. fi
  1555. echo 'End of  part 2'
  1556. echo 'File patch2.1 is continued in part 3'
  1557. echo 3 > _shar_seq_.tmp
  1558. exit 0
  1559. exit 0 # Just in case...
  1560. -- 
  1561. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1562. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1563. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1564. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1565.