home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / tin / patch02b < prev    next >
Encoding:
Text File  |  1992-04-03  |  50.5 KB  |  2,091 lines

  1. Newsgroups: comp.sources.misc
  2. From: iain%anl433.uucp@germany.eu.net (Iain Lea)
  3. Subject:  v29i051:  tin - threaded full screen newsreader v1.1 PL2, Patch02b/4
  4. Message-ID: <1992Apr3.225928.7772@sparky.imd.sterling.com>
  5. X-Md4-Signature: 7f47f4fe398e7a61998bd6df64ca5adb
  6. Date: Fri, 3 Apr 1992 22:59:28 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: iain%anl433.uucp@germany.eu.net (Iain Lea)
  10. Posting-number: Volume 29, Issue 51
  11. Archive-name: tin/patch02b
  12. Environment: BSD, SCO, ISC, SUNOS, SYSVR3, SYSVR4, ULTRIX, XENIX
  13. Patch-To: tin: Volume 29, Issue 19-30
  14.  
  15. #!/bin/sh
  16. # this is patch112.shar.02 (part 2 of tin)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file tin.patch112 continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 2; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test ! -f _shar_wnt_.tmp; then
  33.     echo 'x - still skipping tin.patch112'
  34. else
  35. echo 'x - continuing file tin.patch112'
  36. sed 's/^X//' << 'SHAR_EOF' >> 'tin.patch112' &&
  37. X   *  Module    : getline.c
  38. !  *  Author    : Chris Thewalt / Iain Lea 
  39. X   *  Created   : 09-11-91
  40. !  *  Updated   : 13-03-92
  41. X   *  Notes     : emacs style line editing input package.  
  42. X   *  Copyright : (c) Copyright 1991-92 by Chris Thewalt & Iain Lea
  43. X   *              Permission to use, copy, modify, and distribute this
  44. --- 1,9 ----
  45. X  /*
  46. X   *  Project   : tin - a threaded Netnews reader
  47. X   *  Module    : getline.c
  48. !  *  Author    : Chris Thewalt & Iain Lea 
  49. X   *  Created   : 09-11-91
  50. !  *  Updated   : 29-03-92
  51. X   *  Notes     : emacs style line editing input package.  
  52. X   *  Copyright : (c) Copyright 1991-92 by Chris Thewalt & Iain Lea
  53. X   *              Permission to use, copy, modify, and distribute this
  54. ***************
  55. *** 125,130 ****
  56. --- 125,131 ----
  57. X              gl_addchar (str[i]);
  58. X      }
  59. X      while ((c = ReadCh ()) != EOF) {
  60. +         c &= 0xff;    
  61. X          if (isprint (c)) {
  62. X              if (number_only) {
  63. X                  if (isdigit (c) && gl_cnt < 6) {    /* num < 100000 */
  64. Only in .: getline.o
  65. diff -rcs ../111/group.c ./group.c
  66. *** ../111/group.c    Fri Mar 27 14:00:39 1992
  67. --- ./group.c    Thu Mar 26 15:05:35 1992
  68. ***************
  69. *** 3,9 ****
  70. X   *  Module    : group.c
  71. X   *  Author    : I.Lea & R.Skrenta
  72. X   *  Created   : 01-04-91
  73. !  *  Updated   : 22-03-92
  74. X   *  Notes     :
  75. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  76. X   *              You may  freely  copy or  redistribute  this software,
  77. --- 3,9 ----
  78. X   *  Module    : group.c
  79. X   *  Author    : I.Lea & R.Skrenta
  80. X   *  Created   : 01-04-91
  81. !  *  Updated   : 25-03-92
  82. X   *  Notes     :
  83. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  84. X   *              You may  freely  copy or  redistribute  this software,
  85. ***************
  86. *** 153,162 ****
  87. X  
  88. X              case '|':    /* pipe article/thread/tagged arts to command */
  89. X                  if (index_point >= 0) {
  90. -                     set_real_uid_gid ();
  91. X                      feed_articles (FEED_PIPE, GROUP_LEVEL, "Pipe",
  92. X                          (int) base[index_point], group_path);
  93. -                     set_tin_uid_gid ();
  94. X                  }
  95. X                  break;
  96. X  
  97. --- 153,160 ----
  98. ***************
  99. *** 454,463 ****
  100. X  
  101. X              case 'm':    /* mail article to somebody */
  102. X                  if (index_point >= 0) {
  103. -                     set_real_uid_gid ();
  104. X                      feed_articles (FEED_MAIL, GROUP_LEVEL, "Mail",
  105. X                          (int) base[index_point], group_path);
  106. -                     set_tin_uid_gid ();
  107. X                  }
  108. X                  break;
  109. X  
  110. --- 452,459 ----
  111. ***************
  112. *** 511,520 ****
  113. X  
  114. X              case 'o':    /* output art/thread/tagged arts to printer */
  115. X                  if (index_point >= 0) {
  116. -                     set_real_uid_gid ();
  117. X                      feed_articles (FEED_PRINT, GROUP_LEVEL, "Print",
  118. X                          (int) base[index_point], group_path);
  119. -                     set_tin_uid_gid ();
  120. X                  }
  121. X                  break;
  122. X  
  123. --- 507,514 ----
  124. ***************
  125. *** 580,589 ****
  126. X  
  127. X              case 's':    /* save regex pattern to file/s */
  128. X                  if (index_point >= 0) {
  129. -                     set_real_uid_gid ();
  130. X                      feed_articles (FEED_SAVE, GROUP_LEVEL, "Save",
  131. X                          (int) base[index_point], group_path);
  132. -                     set_tin_uid_gid ();
  133. X                  }
  134. X                  break;
  135. X              
  136. --- 574,581 ----
  137. ***************
  138. *** 825,831 ****
  139. X          if (show_only_unread) {
  140. X              n = new_responses (i);
  141. X              if (n > 0) {
  142. !                 n = n - 1;
  143. X              }    
  144. X          } else {
  145. X              n = num_of_responses (i);
  146. --- 817,825 ----
  147. X          if (show_only_unread) {
  148. X              n = new_responses (i);
  149. X              if (n > 0) {
  150. !                 if (num_of_responses (i) == 0) {
  151. !                     n = n - 1;
  152. !                 }    
  153. X              }    
  154. X          } else {
  155. X              n = num_of_responses (i);
  156. Only in .: group.o
  157. Files ../111/hashstr.c and ./hashstr.c are identical
  158. Only in .: hashstr.o
  159. diff -rcs ../111/help.c ./help.c
  160. *** ../111/help.c    Fri Mar 27 14:00:39 1992
  161. --- ./help.c    Sun Mar 29 04:49:52 1992
  162. ***************
  163. *** 3,9 ****
  164. X   *  Module    : help.c
  165. X   *  Author    : I.Lea
  166. X   *  Created   : 01-04-91
  167. !  *  Updated   : 12-02-92
  168. X   *  Notes     :
  169. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  170. X   *              You may  freely  copy or  redistribute  this software,
  171. --- 3,9 ----
  172. X   *  Module    : help.c
  173. X   *  Author    : I.Lea
  174. X   *  Created   : 01-04-91
  175. !  *  Updated   : 28-03-92
  176. X   *  Notes     :
  177. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  178. X   *              You may  freely  copy or  redistribute  this software,
  179. ***************
  180. *** 21,26 ****
  181. --- 21,27 ----
  182. X      txt_help_ctrl_l,
  183. X      txt_help_g_ctrl_k,
  184. X      txt_help_g_ctrl_r,
  185. +     txt_help_ctrl_y,
  186. X      txt_help_g_cr,
  187. X      txt_help_g_tab,
  188. X      txt_help_b,
  189. Only in .: help.o
  190. diff -rcs ../111/inews.c ./inews.c
  191. *** ../111/inews.c    Fri Mar 27 14:00:40 1992
  192. --- ./inews.c    Sat Mar 28 10:29:39 1992
  193. ***************
  194. *** 3,9 ****
  195. X   *  Module    : inews.c
  196. X   *  Author    : I.Lea
  197. X   *  Created   : 17-03-92
  198. !  *  Updated   : 19-03-92
  199. X   *  Notes     : NNTP builtin version of inews
  200. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  201. X   *              You may  freely  copy or  redistribute  this software,
  202. --- 3,9 ----
  203. X   *  Module    : inews.c
  204. X   *  Author    : I.Lea
  205. X   *  Created   : 17-03-92
  206. !  *  Updated   : 28-03-92
  207. X   *  Notes     : NNTP builtin version of inews
  208. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  209. X   *              You may  freely  copy or  redistribute  this software,
  210. ***************
  211. *** 59,65 ****
  212. X          }
  213. X      }
  214. X  
  215. ! #if defined(BSD) || defined(sinix)
  216. X      gethostname (host_name, sizeof (host_name)); 
  217. X  #else    
  218. X      uname (host_name);
  219. --- 59,65 ----
  220. X          }
  221. X      }
  222. X  
  223. ! #if defined(BSD) || defined(sinix) || defined(RS6000)
  224. X      gethostname (host_name, sizeof (host_name)); 
  225. X  #else    
  226. X      uname (host_name);
  227. Only in .: inews.o
  228. diff -rcs ../111/init.c ./init.c
  229. *** ../111/init.c    Fri Mar 27 14:00:40 1992
  230. --- ./init.c    Fri Mar 27 12:28:44 1992
  231. ***************
  232. *** 3,9 ****
  233. X   *  Module    : init.c
  234. X   *  Author    : I.Lea
  235. X   *  Created   : 01-04-91
  236. !  *  Updated   : 21-03-92
  237. X   *  Notes     :
  238. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  239. X   *              You may  freely  copy or  redistribute  this software,
  240. --- 3,9 ----
  241. X   *  Module    : init.c
  242. X   *  Author    : I.Lea
  243. X   *  Created   : 01-04-91
  244. !  *  Updated   : 27-03-92
  245. X   *  Notes     :
  246. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  247. X   *              You may  freely  copy or  redistribute  this software,
  248. ***************
  249. *** 71,76 ****
  250. --- 71,77 ----
  251. X  int max_art;
  252. X  int real_uid;
  253. X  int real_gid;
  254. + int start_editor_offset;
  255. X  int tin_uid;
  256. X  int tin_gid;
  257. X  int top = 0;
  258. ***************
  259. *** 97,103 ****
  260. X  int save_archive_name;        /* save thread with name from Archive-name: field */
  261. X  int mail_news;                /* mail all arts to specified user */
  262. X  int save_news;                /* save all arts to savedir structure */
  263. - int save_separate;            /* save a each part of a thread to a separate file */
  264. X  int show_author;            /* show Subject & From or only Subject in group menu */
  265. X  int show_only_unread;        /* show only new/unread arts or all arts */
  266. X  int sort_art_type;            /* sort arts[] array by subject,from or date field */
  267. --- 98,103 ----
  268. ***************
  269. *** 165,172 ****
  270. X      post_proc_type = POST_PROC_NONE;
  271. X      pos_first_unread = TRUE;
  272. X      print_header = FALSE;
  273. -     save_separate = TRUE;
  274. X      save_archive_name = TRUE;
  275. X      default_show_author = SHOW_FROM_NAME;
  276. X      show_only_unread = FALSE;
  277. X      sort_art_type = SORT_BY_NOTHING;
  278. --- 165,172 ----
  279. X      post_proc_type = POST_PROC_NONE;
  280. X      pos_first_unread = TRUE;
  281. X      print_header = FALSE;
  282. X      save_archive_name = TRUE;
  283. +     start_editor_offset = TRUE;
  284. X      default_show_author = SHOW_FROM_NAME;
  285. X      show_only_unread = FALSE;
  286. X      sort_art_type = SORT_BY_NOTHING;
  287. ***************
  288. *** 214,221 ****
  289. X      strcpy (bug_addr, BUG_REPORT_ADDRESS);
  290. X      strcpy (redirect_output, "> /dev/null 2>&1");
  291. X  
  292. -     set_real_uid_gid ();
  293. -     
  294. X  #ifdef INDEX_DAEMON
  295. X      sprintf (indexdir, "%s/.index", SPOOLDIR);
  296. X      strcpy (newsrc, active_file);    /* so that all groups are indexed */
  297. --- 214,219 ----
  298. ***************
  299. *** 395,402 ****
  300. X  
  301. X  got_bug_addr:;
  302. X      sprintf (txt_help_bug_report, txt_help_bug, bug_addr);
  303. -     set_tin_uid_gid ();
  304. X  }
  305. X  
  306. X  
  307. --- 393,398 ----
  308. ***************
  309. *** 405,411 ****
  310. X      int created = FALSE;
  311. X      struct stat sb;
  312. X      
  313. -     set_real_uid_gid ();
  314. X      if (stat (maildir, &sb) == -1) {
  315. X          mkdir (maildir, 0755);
  316. X          created = TRUE;
  317. --- 401,406 ----
  318. ***************
  319. *** 414,420 ****
  320. X          mkdir (savedir, 0755);
  321. X          created = TRUE;
  322. X      }
  323. -     set_tin_uid_gid ();
  324. X      
  325. X      return (created);
  326. X  }
  327. --- 409,414 ----
  328. Only in .: init.o
  329. diff -rcs ../111/kill.c ./kill.c
  330. *** ../111/kill.c    Fri Mar 27 14:00:44 1992
  331. --- ./kill.c    Thu Mar 26 15:05:36 1992
  332. ***************
  333. *** 31,38 ****
  334. X  
  335. X      free_kill_array ();
  336. X      
  337. -     set_real_uid_gid ();
  338. X      if ((fp = fopen (killfile, "r")) != NULL) {
  339. X          kill_num=0;
  340. X          while (fgets (buf, sizeof buf, fp) != NULL) {
  341. --- 31,36 ----
  342. ***************
  343. *** 76,85 ****
  344. X              }
  345. X          }
  346. X          fclose (fp);
  347. -         set_tin_uid_gid ();
  348. X          return TRUE;        
  349. X      } else {
  350. -         set_tin_uid_gid ();
  351. X          return FALSE;
  352. X      }
  353. X  
  354. --- 74,81 ----
  355. ***************
  356. *** 87,93 ****
  357. X      fclose (fp);
  358. X      killf[kill_num].kill_type = 0;
  359. X      error_message ("corrupt kill file %s", killfile);
  360. -     set_tin_uid_gid ();
  361. X      return FALSE;
  362. X  }
  363. X  
  364. --- 83,88 ----
  365. ***************
  366. *** 100,107 ****
  367. X      FILE *fp;
  368. X      int i;
  369. X      
  370. -     set_real_uid_gid ();
  371. X      if (kill_num && (fp = fopen (killfile, "w")) != NULL) {
  372. X          wait_message (txt_saving);
  373. X          fprintf (fp, "# 1st line  1=(Subject: only)  2=(From: only)  3=(Subject: & From:)\n");
  374. --- 95,100 ----
  375. ***************
  376. *** 128,134 ****
  377. X          fclose (fp);
  378. X          chmod (killfile, 0600);
  379. X      }
  380. -     set_tin_uid_gid ();
  381. X  }
  382. X  
  383. X  /*
  384. --- 121,126 ----
  385. ***************
  386. *** 158,164 ****
  387. --- 150,160 ----
  388. X      if (do_sigtstp) {
  389. X  #ifdef POSIX_JOB_CONTROL
  390. X          sigemptyset (&kill_act.sa_mask);
  391. + #if defined(SA_RESTART)
  392. X          kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
  393. + #else
  394. +         kill_act.sa_flags = 0;
  395. + #endif
  396. X          kill_act.sa_handler = SIG_DFL;
  397. X          sigaction (SIGTSTP, &kill_act, &old_act);
  398. X          kill_act.sa_handler = SIG_IGN;
  399. ***************
  400. *** 345,351 ****
  401. --- 341,351 ----
  402. X                  if (do_sigtstp) {
  403. X  #ifdef POSIX_JOB_CONTROL
  404. X                      sigemptyset (&kill_act.sa_mask);
  405. + #if defined(SA_RESTART)
  406. X                      kill_act.sa_flags = SA_RESTART | SA_RESETHAND;
  407. + #else
  408. +                     kill_act.sa_flags = 0;
  409. + #endif
  410. X                      kill_act.sa_handler = SIG_IGN;
  411. X                      sigaction (SIGTSTP, &old_act, 0L);
  412. X  #else
  413. Only in .: kill.o
  414. diff -rcs ../111/lang.c ./lang.c
  415. *** ../111/lang.c    Fri Mar 27 14:00:45 1992
  416. --- ./lang.c    Sun Mar 29 04:49:14 1992
  417. ***************
  418. *** 3,9 ****
  419. X   *  Module    : lang.c
  420. X   *  Author    : I.Lea
  421. X   *  Created   : 01-04-91
  422. !  *  Updated   : 21-03-92
  423. X   *  Notes     :
  424. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  425. X   *              You may  freely  copy or  redistribute  this software,
  426. --- 3,9 ----
  427. X   *  Module    : lang.c
  428. X   *  Author    : I.Lea
  429. X   *  Created   : 01-04-91
  430. !  *  Updated   : 28-03-92
  431. X   *  Notes     :
  432. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  433. X   *              You may  freely  copy or  redistribute  this software,
  434. ***************
  435. *** 78,84 ****
  436. X  char txt_post_subject[] = "Post Subject [%s]> ";
  437. X  char txt_no_subject[] = "No subject";
  438. X  char txt_cannot_open[] = "can't open %s";
  439. ! char txt_posting[] = "Posting...";
  440. X  char txt_art_posted[] = "-- Article posted --";
  441. X  char txt_art_rejected[] = "-- Article rejected (saved to %s) --";
  442. X  char txt_abort_edit_post[] = "a)bort, e)dit, p)ost: ";
  443. --- 78,84 ----
  444. X  char txt_post_subject[] = "Post Subject [%s]> ";
  445. X  char txt_no_subject[] = "No subject";
  446. X  char txt_cannot_open[] = "can't open %s";
  447. ! char txt_posting[] = "Posting article...";
  448. X  char txt_art_posted[] = "-- Article posted --";
  449. X  char txt_art_rejected[] = "-- Article rejected (saved to %s) --";
  450. X  char txt_abort_edit_post[] = "a)bort, e)dit, p)ost: ";
  451. ***************
  452. *** 286,291 ****
  453. --- 286,292 ----
  454. X  char txt_mail_bug_report[] = "Mail bug report...";
  455. X  char txt_mail_bug_report_confirm[] = "Mail bug report to %s? (y/n): ";
  456. X  char txt_reply_to_author[] = "Reply to author...";
  457. + char txt_no_blank_line[] = "No blank line found after header information. a)bort, e)dit: ";
  458. X  
  459. X  /*
  460. X   *  prompt.c
  461. ***************
  462. *** 298,305 ****
  463. X   */
  464. X   
  465. X  char txt_opt_autosave[] = "1. Auto save       : ";
  466. ! char txt_opt_save_separate[] = "2. Save separate   : ";
  467. ! char txt_opt_mark_saved_read[] = "3. Mark saved read : ";
  468. X  char txt_opt_kill_articles[] = "4. Kill articles   : ";
  469. X  char txt_opt_draw_arrow[] = "5. Draw arrow      : ";
  470. X  char txt_opt_print_header[] = "6. Print header    : ";
  471. --- 299,306 ----
  472. X   */
  473. X   
  474. X  char txt_opt_autosave[] = "1. Auto save       : ";
  475. ! char txt_opt_start_editor_offset[] = "2. Editor Offset   : ";
  476. ! char txt_opt_mark_saved_read[] =     "3. Mark saved read : ";
  477. X  char txt_opt_kill_articles[] = "4. Kill articles   : ";
  478. X  char txt_opt_draw_arrow[] = "5. Draw arrow      : ";
  479. X  char txt_opt_print_header[] = "6. Print header    : ";
  480. ***************
  481. *** 332,338 ****
  482. X  char txt_sort_by_date_descend[] = "Date: field (descending)";
  483. X  char txt_sort_by_date_ascend[] = "Date: field (ascending)";
  484. X  char txt_help_autosave[] = "Auto save article/thread by Archive-name: header. <SPACE> toggles & <CR> sets.";
  485. ! char txt_help_save_separate[] = "Save articles/threads to separate files. <SPACE> toggles & <CR> sets.";
  486. X  char txt_help_print_header[] = "By printing print all/part of header. <SPACE> toggles & <CR> sets.";
  487. X  char txt_help_pos_first_unread[] = "Put cursor at first/last unread art in groups. <SPACE> toggles & <CR> sets.";
  488. X  char txt_help_show_author[] = "Show Subject & From (author) fields in group menu. <SPACE> toggles & <CR> sets.";
  489. --- 333,339 ----
  490. X  char txt_sort_by_date_descend[] = "Date: field (descending)";
  491. X  char txt_sort_by_date_ascend[] = "Date: field (ascending)";
  492. X  char txt_help_autosave[] = "Auto save article/thread by Archive-name: header. <SPACE> toggles & <CR> sets.";
  493. ! char txt_help_start_editor_offset[] = "Start editor with line offset. <SPACE> toggles & <CR> sets.";
  494. X  char txt_help_print_header[] = "By printing print all/part of header. <SPACE> toggles & <CR> sets.";
  495. X  char txt_help_pos_first_unread[] = "Put cursor at first/last unread art in groups. <SPACE> toggles & <CR> sets.";
  496. X  char txt_help_show_author[] = "Show Subject & From (author) fields in group menu. <SPACE> toggles & <CR> sets.";
  497. ***************
  498. *** 400,405 ****
  499. --- 401,407 ----
  500. X  char txt_select_group[] = "Select group> ";
  501. X  char txt_help_g_4[] = "4$       Select group 4 ($=select last group)\r\n";
  502. X  char txt_help_g_ctrl_r[] = "^R       Reset .newsrc\r\n";
  503. + char txt_help_ctrl_y[] = "^Y       Yank in active file to see any new news\r\n";
  504. X  char txt_help_g_ctrl_k[] = "^KZ      Delete (Z=undelete) group from .newsrc\r\n";
  505. X  char txt_help_g_cr[] = "<CR>     Read current group\r\n";
  506. X  char txt_help_g_c[] = "c        Mark group as all read\r\n";
  507. Only in .: lang.o
  508. diff -rcs ../111/main.c ./main.c
  509. *** ../111/main.c    Fri Mar 27 14:00:46 1992
  510. --- ./main.c    Sun Mar 29 12:32:49 1992
  511. ***************
  512. *** 3,9 ****
  513. X   *  Module    : main.c
  514. X   *  Author    : I.Lea & R.Skrenta
  515. X   *  Created   : 01-04-91
  516. !  *  Updated   : 22-03-92
  517. X   *  Notes     :
  518. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  519. X   *              You may  freely  copy or  redistribute  this software,
  520. --- 3,9 ----
  521. X   *  Module    : main.c
  522. X   *  Author    : I.Lea & R.Skrenta
  523. X   *  Created   : 01-04-91
  524. !  *  Updated   : 29-03-92
  525. X   *  Notes     :
  526. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  527. X   *              You may  freely  copy or  redistribute  this software,
  528. ***************
  529. *** 24,30 ****
  530. X  {
  531. X      int created;
  532. X      int start_groupnum = 0;
  533. !     
  534. X      cmd_line = TRUE;
  535. X      debug = 0;    /* debug OFF */
  536. X  
  537. --- 24,34 ----
  538. X  {
  539. X      int created;
  540. X      int start_groupnum = 0;
  541. ! #ifdef SVR4
  542. !     setlocale (LC_ALL, "");
  543. ! #endif
  544. !         
  545. X      cmd_line = TRUE;
  546. X      debug = 0;    /* debug OFF */
  547. X  
  548. ***************
  549. *** 54,63 ****
  550. X      real_gid = getgid ();
  551. X  
  552. X      /*
  553. !      * we're setuid, so index in /usr/spool/news unless user root
  554. X       */
  555. !     if (tin_uid != real_uid && real_uid != 0) {
  556. X          local_index = FALSE;
  557. X      } else {    /* index in users home directory ~/.tin/.index */
  558. X          local_index = TRUE;
  559. X      }
  560. --- 58,70 ----
  561. X      real_gid = getgid ();
  562. X  
  563. X      /*
  564. !      * we're setuid, so index in /usr/spool/news even if user root
  565. !      * This is quite essential if non local index files are 
  566. !      * to be updated during the night from crontab by root.
  567. X       */
  568. !     if (tin_uid != real_uid) {
  569. X          local_index = FALSE;
  570. +         set_real_uid_gid();
  571. X      } else {    /* index in users home directory ~/.tin/.index */
  572. X          local_index = TRUE;
  573. X      }
  574. ***************
  575. *** 276,287 ****
  576. X                  break;
  577. X  
  578. X              case 'V':
  579. ! #if defined(__DATE__) && defined(__TIME__)            
  580. !                 sprintf (msg, "Version: %s PL%d  %s  %s",
  581. X                      VERSION, PATCHLEVEL, __DATE__, __TIME__);
  582. ! #else
  583. X                  sprintf (msg, "Version: %s PL%d",
  584. X                      VERSION, PATCHLEVEL);
  585. X  #endif                    
  586. X                  error_message (msg, "");
  587. X                  exit (1);
  588. --- 283,299 ----
  589. X                  break;
  590. X  
  591. X              case 'V':
  592. ! #ifndef COMPILED
  593. ! #    if defined(__DATE__) && defined(__TIME__)            
  594. !                 sprintf (msg, "Version: %s PL%d  %s %s",
  595. X                      VERSION, PATCHLEVEL, __DATE__, __TIME__);
  596. ! #    else
  597. X                  sprintf (msg, "Version: %s PL%d",
  598. X                      VERSION, PATCHLEVEL);
  599. + #    endif                    
  600. + #else            
  601. +                 sprintf (msg, "Version: %s PL%d  %s",
  602. +                     VERSION, PATCHLEVEL, COMPILED);
  603. X  #endif                    
  604. X                  error_message (msg, "");
  605. X                  exit (1);
  606. ***************
  607. *** 416,422 ****
  608. X              verbose = FALSE;
  609. X              switch (fork ()) {            /* fork child to update indexes in background */
  610. X                  case -1:    /* error forking */    
  611. !                     error_message ("Failed to start background indexing process", "");
  612. X                      break;
  613. X                  case 0:        /* child process */    
  614. X                      process_id = getpid ();
  615. --- 428,434 ----
  616. X              verbose = FALSE;
  617. X              switch (fork ()) {            /* fork child to update indexes in background */
  618. X                  case -1:    /* error forking */    
  619. !                     perror_message ("Failed to start background indexing process", "");
  620. X                      break;
  621. X                  case 0:        /* child process */    
  622. X                      process_id = getpid ();
  623. Only in .: main.o
  624. diff -rcs ../111/memory.c ./memory.c
  625. *** ../111/memory.c    Fri Mar 27 14:00:47 1992
  626. --- ./memory.c    Wed Mar 25 10:21:59 1992
  627. ***************
  628. *** 3,9 ****
  629. X   *  Module    : memory.c
  630. X   *  Author    : I.Lea & R.Skrenta
  631. X   *  Created   : 01-04-91
  632. !  *  Updated   : 16-02-92
  633. X   *  Notes     :
  634. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  635. X   *              You may  freely  copy or  redistribute  this software,
  636. --- 3,9 ----
  637. X   *  Module    : memory.c
  638. X   *  Author    : I.Lea & R.Skrenta
  639. X   *  Created   : 01-04-91
  640. !  *  Updated   : 25-03-92
  641. X   *  Notes     :
  642. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  643. X   *              You may  freely  copy or  redistribute  this software,
  644. ***************
  645. *** 196,202 ****
  646. X      }
  647. X  
  648. X      if (active != (struct group_t *) 0) {    /* active[] */
  649. !         for (i=0 ; i < max_active ; i++) {
  650. X              if (active[i].name != (char *) 0) {
  651. X                  free ((char *) active[i].name);
  652. X                  active[i].name = (char *) 0;
  653. --- 196,202 ----
  654. X      }
  655. X  
  656. X      if (active != (struct group_t *) 0) {    /* active[] */
  657. !         for (i=0 ; i < num_active ; i++) {
  658. X              if (active[i].name != (char *) 0) {
  659. X                  free ((char *) active[i].name);
  660. X                  active[i].name = (char *) 0;
  661. Only in .: memory.o
  662. diff -rcs ../111/misc.c ./misc.c
  663. *** ../111/misc.c    Fri Mar 27 14:00:52 1992
  664. --- ./misc.c    Sun Mar 29 04:46:25 1992
  665. ***************
  666. *** 3,9 ****
  667. X   *  Module    : misc.c
  668. X   *  Author    : I.Lea & R.Skrenta
  669. X   *  Created   : 01-04-91
  670. !  *  Updated   : 21-03-92
  671. X   *  Notes     :
  672. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  673. X   *              You may  freely  copy or  redistribute  this software,
  674. --- 3,9 ----
  675. X   *  Module    : misc.c
  676. X   *  Author    : I.Lea & R.Skrenta
  677. X   *  Created   : 01-04-91
  678. !  *  Updated   : 28-03-92
  679. X   *  Notes     :
  680. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  681. X   *              You may  freely  copy or  redistribute  this software,
  682. ***************
  683. *** 60,66 ****
  684. X          while (fgets (buf, sizeof (buf), fp_ip) != NULL) {
  685. X              if (fprintf (fp_op, "%s", buf) == EOF) {
  686. X                  sprintf (msg, "Error: fprintf() failed in copy_fp(). errno=%d", errno);
  687. !                 error_message (msg, "");
  688. X              }
  689. X          }
  690. X      } else {
  691. --- 60,66 ----
  692. X          while (fgets (buf, sizeof (buf), fp_ip) != NULL) {
  693. X              if (fprintf (fp_op, "%s", buf) == EOF) {
  694. X                  sprintf (msg, "Error: fprintf() failed in copy_fp(). errno=%d", errno);
  695. !                 perror_message (msg, "");
  696. X              }
  697. X          }
  698. X      } else {
  699. ***************
  700. *** 67,73 ****
  701. X          while (fgets (buf, sizeof (buf), fp_ip) != NULL) {
  702. X              if (fprintf (fp_op, "%s%s", prefix, buf) == EOF) {
  703. X                  sprintf (msg, "Error: fprintf() failed in copy_fp(). errno=%d", errno);
  704. !                 error_message (msg, "");
  705. X              }
  706. X          }
  707. X      }
  708. --- 67,73 ----
  709. X          while (fgets (buf, sizeof (buf), fp_ip) != NULL) {
  710. X              if (fprintf (fp_op, "%s%s", prefix, buf) == EOF) {
  711. X                  sprintf (msg, "Error: fprintf() failed in copy_fp(). errno=%d", errno);
  712. !                 perror_message (msg, "");
  713. X              }
  714. X          }
  715. X      }
  716. ***************
  717. *** 102,112 ****
  718. X          first = FALSE;
  719. X      }
  720. X  
  721. ! #ifdef NO_START_LINE
  722. !     sprintf (buf, "%s %s", editor, nam);
  723. ! #else
  724. !     sprintf (buf, "%s +%d %s", editor, start_line_offset, nam);
  725. ! #endif
  726. X  
  727. X      printf ("%s", buf);
  728. X      return invoke_cmd (buf);
  729. --- 102,112 ----
  730. X          first = FALSE;
  731. X      }
  732. X  
  733. !     if (start_editor_offset) {
  734. !         sprintf (buf, "%s +%d %s", editor, start_line_offset, nam);
  735. !     } else {
  736. !         sprintf (buf, "%s %s", editor, nam);
  737. !     }
  738. X  
  739. X      printf ("%s", buf);
  740. X      return invoke_cmd (buf);
  741. ***************
  742. *** 149,156 ****
  743. X      EndWin ();
  744. X      Raw (FALSE);
  745. X  
  746. -     set_real_uid_gid ();
  747. X  #ifdef SIGTSTP
  748. X      if (do_sigtstp)
  749. X          susp = signal (SIGTSTP, SIG_DFL);
  750. --- 149,154 ----
  751. ***************
  752. *** 163,170 ****
  753. X          signal (SIGTSTP, susp);
  754. X  #endif
  755. X  
  756. -     set_tin_uid_gid ();
  757. X      Raw (TRUE);
  758. X      InitWin ();
  759. X  
  760. --- 161,166 ----
  761. ***************
  762. *** 221,234 ****
  763. X      EndWin ();
  764. X      Raw (FALSE);
  765. X  
  766. - if (debug == 2) {
  767. -     {
  768. -     extern int test_reread;
  769. -     printf ("resync ran %d times with max_active of %d\n", test_reread, max_active);
  770. -     fflush (stdout);
  771. -     }
  772. - }
  773. X      exit (ret);
  774. X  }
  775. X  
  776. --- 217,222 ----
  777. ***************
  778. *** 246,256 ****
  779. X  
  780. X  #ifndef INDEX_DAEMON
  781. X  
  782. -     set_real_uid_gid ();
  783. -     
  784. X      if ((fp = fopen (unthreadfile, "r")) == NULL) {
  785. !         error_message (txt_cannot_open, unthreadfile);
  786. !         set_tin_uid_gid ();
  787. X          return;
  788. X      }
  789. X  
  790. --- 234,241 ----
  791. X  
  792. X  #ifndef INDEX_DAEMON
  793. X  
  794. X      if ((fp = fopen (unthreadfile, "r")) == NULL) {
  795. !         perror_message (txt_cannot_open, unthreadfile);
  796. X          return;
  797. X      }
  798. X  
  799. ***************
  800. *** 269,276 ****
  801. X          }
  802. X      }
  803. X      fclose (fp);
  804. -     set_tin_uid_gid ();
  805. X  #endif /* INDEX_DAEMON */
  806. X  }
  807. X  
  808. --- 254,259 ----
  809. ***************
  810. *** 323,329 ****
  811. X      }
  812. X      if (unlink (old_filename) == -1) {
  813. X          sprintf (buf, txt_rename_error, old_filename, new_filename);
  814. !         error_message (buf, "THREE");
  815. X          return;
  816. X      }
  817. X  }
  818. --- 306,312 ----
  819. X      }
  820. X      if (unlink (old_filename) == -1) {
  821. X          sprintf (buf, txt_rename_error, old_filename, new_filename);
  822. !         perror_message (buf, "THREE");
  823. X          return;
  824. X      }
  825. X  }
  826. ***************
  827. *** 353,364 ****
  828. X  #ifdef SIGTSTP
  829. X      SIGTYPE (*susp)();
  830. X  #endif
  831. X      time_remaining = alarm (0);    /* save time remaining on alarm clock */
  832. X  
  833. X      EndWin ();
  834. X      Raw (FALSE);
  835. -     set_real_uid_gid ();
  836. X  
  837. X  #ifdef SIGTSTP
  838. X      if (do_sigtstp)
  839. --- 336,347 ----
  840. X  #ifdef SIGTSTP
  841. X      SIGTYPE (*susp)();
  842. X  #endif
  843. ! #ifndef NO_RESYNC_ACTIVE_FILE
  844. X      time_remaining = alarm (0);    /* save time remaining on alarm clock */
  845. + #endif
  846. X  
  847. X      EndWin ();
  848. X      Raw (FALSE);
  849. X  
  850. X  #ifdef SIGTSTP
  851. X      if (do_sigtstp)
  852. ***************
  853. *** 372,383 ****
  854. X          signal (SIGTSTP, susp);
  855. X  #endif
  856. X  
  857. -     set_tin_uid_gid ();
  858. X      Raw (TRUE);
  859. X      InitWin ();
  860. X  
  861. X      alarm (time_remaining);    /* restart resync alarm clock */
  862. X      
  863. X      return ret == 0;
  864. X  }
  865. --- 355,366 ----
  866. X          signal (SIGTSTP, susp);
  867. X  #endif
  868. X  
  869. X      Raw (TRUE);
  870. X      InitWin ();
  871. X  
  872. + #ifndef NO_RESYNC_ACTIVE_FILE
  873. X      alarm (time_remaining);    /* restart resync alarm clock */
  874. + #endif
  875. X      
  876. X      return ret == 0;
  877. X  }
  878. ***************
  879. *** 407,437 ****
  880. X      EndInverse ();
  881. X  }
  882. X  
  883. X  void set_real_uid_gid ()
  884. X  {
  885. X  #if defined(BSD) && ! defined(sinix)
  886. X  #ifdef sun
  887. X      if (seteuid (real_uid) == -1) {
  888. !         error_message ("Error setreuid(real) failed", "");
  889. X      }
  890. !     if (setrgid (real_gid) == -1) {
  891. !         error_message ("Error setregid(real) failed", "");
  892. X      }
  893. X  #else
  894. X      if (setreuid (tin_uid, real_uid) == -1) {
  895. !         error_message ("Error setreuid(real) failed", "");
  896. X      }
  897. X      if (setregid (tin_gid, real_gid) == -1) {
  898. !         error_message ("Error setregid(real) failed", "");
  899. X      }
  900. X  #endif    /* sun */    
  901. X  #else
  902. X      if (setuid (real_uid) == -1) {
  903. !         error_message ("Error setuid(real) failed", "");
  904. X      }
  905. X      if (setgid (real_gid) == -1) {
  906. !         error_message ("Error setgid(real) failed", "");
  907. X      }
  908. X  #endif
  909. X  }
  910. --- 390,421 ----
  911. X      EndInverse ();
  912. X  }
  913. X  
  914. X  void set_real_uid_gid ()
  915. X  {
  916. +     if (local_index)
  917. +         return;
  918. X  #if defined(BSD) && ! defined(sinix)
  919. X  #ifdef sun
  920. X      if (seteuid (real_uid) == -1) {
  921. !         perror_message ("Error setreuid(real) failed", "");
  922. X      }
  923. !     if (setegid (real_gid) == -1) {
  924. !         perror_message ("Error setregid(real) failed", "");
  925. X      }
  926. X  #else
  927. X      if (setreuid (tin_uid, real_uid) == -1) {
  928. !         perror_message ("Error setreuid(real) failed", "");
  929. X      }
  930. X      if (setregid (tin_gid, real_gid) == -1) {
  931. !         perror_message ("Error setregid(real) failed", "");
  932. X      }
  933. X  #endif    /* sun */    
  934. X  #else
  935. X      if (setuid (real_uid) == -1) {
  936. !         perror_message ("Error setuid(real) failed", "");
  937. X      }
  938. X      if (setgid (real_gid) == -1) {
  939. !         perror_message ("Error setgid(real) failed", "");
  940. X      }
  941. X  #endif
  942. X  }
  943. ***************
  944. *** 439,466 ****
  945. X  
  946. X  void set_tin_uid_gid ()
  947. X  {
  948. X  #if defined(BSD) && ! defined(sinix)
  949. X  #ifdef sun
  950. X      if (seteuid (tin_uid) == -1) {
  951. !         error_message ("Error setreuid(real) failed", "");
  952. X      }
  953. !     if (setrgid (tin_gid) == -1) {
  954. !         error_message ("Error setregid(real) failed", "");
  955. X      }
  956. X  #else
  957. X      if (setreuid (real_uid, tin_uid) == -1) {
  958. !         error_message ("Error setreuid(tin) failed", "");
  959. X      }
  960. X      if (setregid (real_gid, tin_gid) == -1) {
  961. !         error_message ("Error setregid(tin) failed", "");
  962. X      }
  963. X  #endif    /* sun */    
  964. X  #else
  965. X      if (setuid (tin_uid) == -1) {
  966. !         error_message ("Error setuid(tin) failed", "");
  967. X      }
  968. X      if (setgid (tin_gid) == -1) {
  969. !         error_message ("Error setgid(tin) failed", "");
  970. X      }
  971. X  #endif
  972. X  }
  973. --- 423,452 ----
  974. X  
  975. X  void set_tin_uid_gid ()
  976. X  {
  977. +     if (local_index)
  978. +         return;
  979. X  #if defined(BSD) && ! defined(sinix)
  980. X  #ifdef sun
  981. X      if (seteuid (tin_uid) == -1) {
  982. !         perror_message ("Error setreuid(real) failed", "");
  983. X      }
  984. !     if (setegid (tin_gid) == -1) {
  985. !         perror_message ("Error setregid(real) failed", "");
  986. X      }
  987. X  #else
  988. X      if (setreuid (real_uid, tin_uid) == -1) {
  989. !         perror_message ("Error setreuid(tin) failed", "");
  990. X      }
  991. X      if (setregid (real_gid, tin_gid) == -1) {
  992. !         perror_message ("Error setregid(tin) failed", "");
  993. X      }
  994. X  #endif    /* sun */    
  995. X  #else
  996. X      if (setuid (tin_uid) == -1) {
  997. !         perror_message ("Error setuid(tin) failed", "");
  998. X      }
  999. X      if (setgid (tin_gid) == -1) {
  1000. !         perror_message ("Error setgid(tin) failed", "");
  1001. X      }
  1002. X  #endif
  1003. X  }
  1004. ***************
  1005. *** 624,629 ****
  1006. --- 610,634 ----
  1007. X      }
  1008. X  
  1009. X      return ret;
  1010. + }
  1011. + /*
  1012. +  *  strcmp that ignores case
  1013. +  */
  1014. + #define FOLD_TO_UPPER(a)    (islower ((int) (a)) ? toupper ((int) (a)) : (a))
  1015. + int my_stricmp (p, q)
  1016. +     char *p;
  1017. +     char *q;
  1018. + {
  1019. +     for (; FOLD_TO_UPPER (*p) == FOLD_TO_UPPER (*q); ++p, ++q) {
  1020. +         if (*p == '\0') {
  1021. +             return (0);
  1022. +         }
  1023. +     }        
  1024. +     return (FOLD_TO_UPPER (*p) - FOLD_TO_UPPER (*q));
  1025. X  }
  1026. X  
  1027. X  /*
  1028. Only in .: misc.o
  1029. diff -rcs ../111/newsrc.c ./newsrc.c
  1030. *** ../111/newsrc.c    Fri Mar 27 14:00:53 1992
  1031. --- ./newsrc.c    Sat Mar 28 12:59:51 1992
  1032. ***************
  1033. *** 3,9 ****
  1034. X   *  Module    : newsrc.c
  1035. X   *  Author    : I.Lea & R.Skrenta
  1036. X   *  Created   : 01-04-91
  1037. !  *  Updated   : 19-03-92
  1038. X   *  Notes     :
  1039. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1040. X   *              You may  freely  copy or  redistribute  this software,
  1041. --- 3,9 ----
  1042. X   *  Module    : newsrc.c
  1043. X   *  Author    : I.Lea & R.Skrenta
  1044. X   *  Created   : 01-04-91
  1045. !  *  Updated   : 28-03-92
  1046. X   *  Notes     :
  1047. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea & Rich Skrenta
  1048. X   *              You may  freely  copy or  redistribute  this software,
  1049. ***************
  1050. *** 29,36 ****
  1051. X      int len;
  1052. X      int ret_code = FALSE;
  1053. X      
  1054. -     set_real_uid_gid ();
  1055. X      if ((fp_subs = open_subscription_fp ()) != NULL) {
  1056. X          if ((fp_newsrc = fopen (newsrc, "w")) != NULL) {
  1057. X              while (fgets (buf, sizeof (buf), fp_subs) != NULL) {
  1058. --- 29,34 ----
  1059. ***************
  1060. *** 46,53 ****
  1061. X          fclose (fp_subs);
  1062. X      }
  1063. X  
  1064. -     set_tin_uid_gid ();
  1065. -     
  1066. X      return (ret_code);
  1067. X  }
  1068. X  
  1069. --- 44,49 ----
  1070. ***************
  1071. *** 60,67 ****
  1072. X      char buf[8192];
  1073. X      FILE *fp_newsrc, *fp_backup;
  1074. X      
  1075. -     set_real_uid_gid ();
  1076. X      if ((fp_newsrc = fopen (newsrc, "r")) != NULL) {
  1077. X          sprintf (buf, "%s/.oldnewsrc", homedir);
  1078. X          unlink (buf);    /* because rn makes a link of .newsrc -> .oldnewsrc */
  1079. --- 56,61 ----
  1080. ***************
  1081. *** 73,80 ****
  1082. X          }
  1083. X          fclose (fp_newsrc);
  1084. X      }
  1085. -     set_tin_uid_gid ();
  1086. X  }
  1087. X  
  1088. X  /*
  1089. --- 67,72 ----
  1090. ***************
  1091. *** 96,103 ****
  1092. X  
  1093. X  reread_newsrc:
  1094. X  
  1095. -     set_real_uid_gid ();
  1096. -     
  1097. X      if ((fp = fopen (newsrc, "r")) == NULL) {    /* attempt to make a .newsrc */
  1098. X          if (auto_subscribe_groups ()) {        /* attempt to auto create newsrc */
  1099. X              goto reread_newsrc;
  1100. --- 88,93 ----
  1101. ***************
  1102. *** 130,136 ****
  1103. X          if ((i = add_group (buf, FALSE)) < 0) {
  1104. X              if (! remove_old_groups) {
  1105. X                  if ((fp_old = fopen (old_groups, "w")) == NULL) {
  1106. !                     error_message (txt_cannot_open, old_groups);
  1107. X                      continue;
  1108. X                  }
  1109. X                  remove_old_groups = TRUE;
  1110. --- 120,126 ----
  1111. X          if ((i = add_group (buf, FALSE)) < 0) {
  1112. X              if (! remove_old_groups) {
  1113. X                  if ((fp_old = fopen (old_groups, "w")) == NULL) {
  1114. !                     perror_message (txt_cannot_open, old_groups);
  1115. X                      continue;
  1116. X                  }
  1117. X                  remove_old_groups = TRUE;
  1118. ***************
  1119. *** 153,160 ****
  1120. X          fclose (fp_old);
  1121. X          rewrite_newsrc ();
  1122. X      }
  1123. -     set_tin_uid_gid ();
  1124. X  }
  1125. X  
  1126. X  /*
  1127. --- 143,148 ----
  1128. ***************
  1129. *** 169,178 ****
  1130. X      FILE *fp;
  1131. X      int i;
  1132. X  
  1133. -     set_real_uid_gid ();
  1134. X      if ((fp = fopen (newsrc, "w")) == NULL) {
  1135. -         set_tin_uid_gid ();
  1136. X          return;
  1137. X      }
  1138. X  
  1139. --- 157,163 ----
  1140. ***************
  1141. *** 183,190 ****
  1142. X      }
  1143. X  
  1144. X      fclose (fp);
  1145. -     set_tin_uid_gid ();
  1146. X  }
  1147. X  
  1148. X  /*
  1149. --- 168,173 ----
  1150. ***************
  1151. *** 198,205 ****
  1152. X      FILE *fp, *fp_old, *fp_new;
  1153. X      int found_old_group, len;    
  1154. X  
  1155. -     set_real_uid_gid ();
  1156. X      sprintf (old_groups, "%s/.newsrc.%d", homedir, process_id);
  1157. X  
  1158. X      if ((fp = fopen (newsrc, "r")) == NULL)
  1159. --- 181,186 ----
  1160. ***************
  1161. *** 240,246 ****
  1162. X  
  1163. X  removed_old_groups_done:
  1164. X      unlink (old_groups);
  1165. -     set_tin_uid_gid ();
  1166. X  }
  1167. X  
  1168. X  /*
  1169. --- 221,226 ----
  1170. ***************
  1171. *** 287,296 ****
  1172. X      char *p;
  1173. X      char c;
  1174. X  
  1175. !     set_real_uid_gid ();
  1176. !     if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1177. X          goto update_done;
  1178. X  
  1179. X      if ((fp = fopen (newsrc, "r")) != NULL) {
  1180. X          while (fgets (buf, sizeof buf, fp) != NULL) {
  1181. --- 267,275 ----
  1182. X      char *p;
  1183. X      char c;
  1184. X  
  1185. !     if ((newfp = fopen (newnewsrc, "w")) == NULL) {
  1186. X          goto update_done;
  1187. +     }
  1188. X  
  1189. X      if ((fp = fopen (newsrc, "r")) != NULL) {
  1190. X          while (fgets (buf, sizeof buf, fp) != NULL) {
  1191. ***************
  1192. *** 328,334 ****
  1193. X      rename_file (newnewsrc, newsrc);
  1194. X  
  1195. X  update_done:
  1196. !     set_tin_uid_gid ();
  1197. X  }
  1198. X  
  1199. X  /*
  1200. --- 307,313 ----
  1201. X      rename_file (newnewsrc, newsrc);
  1202. X  
  1203. X  update_done:
  1204. !     ;
  1205. X  }
  1206. X  
  1207. X  /*
  1208. ***************
  1209. *** 355,362 ****
  1210. X      else
  1211. X          active[num].flag |= SUBSCRIBED;
  1212. X  
  1213. -     set_real_uid_gid ();
  1214. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1215. X          goto subscribe_done;
  1216. X  
  1217. --- 334,339 ----
  1218. ***************
  1219. *** 406,412 ****
  1220. X      rename_file (newnewsrc, newsrc);
  1221. X  
  1222. X  subscribe_done:
  1223. !     set_tin_uid_gid ();
  1224. X  }
  1225. X  
  1226. X  
  1227. --- 383,389 ----
  1228. X      rename_file (newnewsrc, newsrc);
  1229. X  
  1230. X  subscribe_done:
  1231. !     ;
  1232. X  }
  1233. X  
  1234. X  
  1235. ***************
  1236. *** 419,426 ****
  1237. X      char c;
  1238. X      int i;
  1239. X  
  1240. -     set_real_uid_gid ();
  1241. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1242. X          goto update_done;
  1243. X  
  1244. --- 396,401 ----
  1245. ***************
  1246. *** 449,456 ****
  1247. X      rename_file (newnewsrc, newsrc);
  1248. X  
  1249. X  update_done:
  1250. -     set_tin_uid_gid ();
  1251. X      for (i = 0; i < group_top; i++)
  1252. X          unread[i] = -1;
  1253. X  }
  1254. --- 424,429 ----
  1255. ***************
  1256. *** 467,474 ****
  1257. X      int gotit = FALSE;
  1258. X      FILE *del;
  1259. X  
  1260. -     set_real_uid_gid ();
  1261. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1262. X          goto del_done;
  1263. X  
  1264. --- 440,445 ----
  1265. ***************
  1266. *** 509,515 ****
  1267. X      rename_file (newnewsrc, newsrc);
  1268. X  
  1269. X  del_done:
  1270. !     set_tin_uid_gid ();
  1271. X  }
  1272. X  
  1273. X  
  1274. --- 480,486 ----
  1275. X      rename_file (newnewsrc, newsrc);
  1276. X  
  1277. X  del_done:
  1278. !     ;
  1279. X  }
  1280. X  
  1281. X  
  1282. ***************
  1283. *** 526,535 ****
  1284. X      int i, j;
  1285. X      char c;
  1286. X  
  1287. -     set_real_uid_gid ();
  1288. X      if ((del = fopen(delgroups, "r")) == NULL) {
  1289. -         set_tin_uid_gid ();
  1290. X          return FALSE;
  1291. X      }
  1292. X  
  1293. --- 497,503 ----
  1294. ***************
  1295. *** 536,542 ****
  1296. X      unlink(delgroups);
  1297. X      
  1298. X      if ((newfp = fopen(delgroups, "w")) == NULL) {
  1299. -         set_tin_uid_gid ();
  1300. X          return FALSE;
  1301. X      }
  1302. X  
  1303. --- 504,509 ----
  1304. ***************
  1305. *** 554,560 ****
  1306. X      which = !which;
  1307. X  
  1308. X      if (!*buf[which]) {
  1309. -         set_tin_uid_gid ();
  1310. X          return FALSE;
  1311. X      }
  1312. X  
  1313. --- 521,526 ----
  1314. ***************
  1315. *** 578,584 ****
  1316. X          if (strcmp(buf[which], active[i].name) == 0) {
  1317. X              for (j = 0; j < group_top; j++)
  1318. X                  if (my_group[j] == i) {
  1319. -                     set_tin_uid_gid ();
  1320. X                      return j;
  1321. X                  }
  1322. X  
  1323. --- 544,549 ----
  1324. ***************
  1325. *** 597,608 ****
  1326. X              unread[cur_groupnum] = parse_unread(p, i);
  1327. X  
  1328. X              if ((fp = fopen(newsrc, "r")) == NULL) {
  1329. -                 set_tin_uid_gid ();
  1330. X                  return FALSE;
  1331. X              }
  1332. X              if ((newfp = fopen(newnewsrc, "w")) == NULL) {
  1333. X                  fclose(fp);
  1334. -                 set_tin_uid_gid ();
  1335. X                  return FALSE;
  1336. X              }
  1337. X              i = 0;
  1338. --- 562,571 ----
  1339. ***************
  1340. *** 642,653 ****
  1341. X              fclose (newfp);
  1342. X              fclose (fp);
  1343. X              rename_file (newnewsrc, newsrc);
  1344. -             set_tin_uid_gid ();
  1345. X              return TRUE;
  1346. X          }
  1347. X      }
  1348. -     set_tin_uid_gid ();
  1349. X      return FALSE;
  1350. X  }
  1351. X  
  1352. --- 605,613 ----
  1353. ***************
  1354. *** 665,672 ****
  1355. X      if (active[groupnum].max < 2)
  1356. X          return;
  1357. X  
  1358. -     set_real_uid_gid ();
  1359. X      if ((newfp = fopen (newnewsrc, "w")) == NULL)
  1360. X          goto mark_group_read_done;
  1361. X  
  1362. --- 625,630 ----
  1363. ***************
  1364. *** 700,706 ****
  1365. X      rename_file (newnewsrc, newsrc);
  1366. X  
  1367. X  mark_group_read_done:
  1368. !     set_tin_uid_gid ();
  1369. X  }
  1370. X  
  1371. X  
  1372. --- 658,664 ----
  1373. X      rename_file (newnewsrc, newsrc);
  1374. X  
  1375. X  mark_group_read_done:
  1376. !     ;
  1377. X  }
  1378. X  
  1379. X  
  1380. ***************
  1381. *** 733,738 ****
  1382. --- 691,701 ----
  1383. X      }
  1384. X  }
  1385. X  
  1386. + /*
  1387. +  *  Read the first range from the .newsrc sequencer information.
  1388. +  *  If the top of the first range is higher than what the active
  1389. +  *  file claims is the bottom, use it as the new bottom instead.
  1390. +  */
  1391. X  
  1392. X  int parse_unread (s, groupnum)
  1393. X      char *s;
  1394. ***************
  1395. *** 744,759 ****
  1396. X      int gotone = FALSE;
  1397. X      int n;
  1398. X  
  1399. - /*
  1400. -  *  Read the first range from the .newsrc sequencer information.  If the
  1401. -  *  top of the first range is higher than what the active file claims is
  1402. -  *  the bottom, use it as the new bottom instead
  1403. -  */
  1404. X      high = 0;
  1405. X      if (*s) {
  1406. !         while (*s && (*s < '0' || *s > '9'))
  1407. X              s++;
  1408. X  
  1409. X          if (*s && *s >= '0' && *s <= '9') {
  1410. X              low = (long) atol (s);
  1411. --- 707,718 ----
  1412. X      int gotone = FALSE;
  1413. X      int n;
  1414. X  
  1415. X      high = 0;
  1416. X      if (*s) {
  1417. !         while (*s && (*s < '0' || *s > '9')) {
  1418. X              s++;
  1419. +         }    
  1420. X  
  1421. X          if (*s && *s >= '0' && *s <= '9') {
  1422. X              low = (long) atol (s);
  1423. ***************
  1424. *** 943,950 ****
  1425. X      int option_line = FALSE;
  1426. X      int ret_code = FALSE;
  1427. X  
  1428. -     set_real_uid_gid ();
  1429. -     
  1430. X      if ((fp_in = fopen (newsrc, "r")) == NULL) {
  1431. X          goto rewrite_group_done;
  1432. X      }
  1433. --- 902,907 ----
  1434. ***************
  1435. *** 1040,1046 ****
  1436. X      }
  1437. X  
  1438. X  rewrite_group_done:
  1439. -     set_tin_uid_gid ();
  1440. X      return ret_code;
  1441. X  }
  1442. X  
  1443. --- 997,1002 ----
  1444. Only in .: newsrc.o
  1445. Files ../111/nntp.h and ./nntp.h are identical
  1446. diff -rcs ../111/open.c ./open.c
  1447. *** ../111/open.c    Fri Mar 27 14:00:58 1992
  1448. --- ./open.c    Thu Mar 26 15:05:38 1992
  1449. ***************
  1450. *** 200,207 ****
  1451. X      char line[NNTP_STRLEN];
  1452. X  #endif
  1453. X      extern char index_file[];
  1454. X      
  1455. !     find_index_file (group_name);
  1456. X      
  1457. X  #ifdef NNTP_XINDEX
  1458. X      if (read_news_via_nntp) {
  1459. --- 200,215 ----
  1460. X      char line[NNTP_STRLEN];
  1461. X  #endif
  1462. X      extern char index_file[];
  1463. +         char group_path[LEN];
  1464. +         char *p;
  1465. +         strcpy (group_path, group_name);                     /* turn comp.unix.amiga
  1466. + into */
  1467. +         for (p = group_path; *p; p++)           /* comp/unix/amiga */
  1468. +                 if (*p == '.')
  1469. +                         *p = '/';
  1470. X      
  1471. !     find_index_file (group_name, group_path);
  1472. X      
  1473. X  #ifdef NNTP_XINDEX
  1474. X      if (read_news_via_nntp) {
  1475. ***************
  1476. *** 426,432 ****
  1477. X      mktemp (fnam);
  1478. X  
  1479. X      if ((fp = fopen (fnam, "w")) == NULL) {
  1480. !         error_message (txt_stuff_nntp_cannot_open, fnam);
  1481. X          return FALSE;
  1482. X      }
  1483. X  
  1484. --- 434,440 ----
  1485. X      mktemp (fnam);
  1486. X  
  1487. X      if ((fp = fopen (fnam, "w")) == NULL) {
  1488. !         perror_message (txt_stuff_nntp_cannot_open, fnam);
  1489. X          return FALSE;
  1490. X      }
  1491. X  
  1492. ***************
  1493. *** 472,478 ****
  1494. X      }
  1495. X  
  1496. X      if ((fp = fopen (fnam, "r")) == NULL) {
  1497. !         error_message (txt_nntp_to_fp_cannot_reopen, fnam);
  1498. X          return NULL;
  1499. X      }
  1500. X      
  1501. --- 480,486 ----
  1502. X      }
  1503. X  
  1504. X      if ((fp = fopen (fnam, "r")) == NULL) {
  1505. !         perror_message (txt_nntp_to_fp_cannot_reopen, fnam);
  1506. X          return NULL;
  1507. X      }
  1508. X      
  1509. ***************
  1510. *** 501,507 ****
  1511. X      }
  1512. X  
  1513. X      if ((fd = open (fnam, 0)) == -1) {
  1514. !         error_message (txt_nntp_to_fd_cannot_reopen, fnam);
  1515. X          return -1;
  1516. X      }
  1517. X      
  1518. --- 509,515 ----
  1519. X      }
  1520. X  
  1521. X      if ((fd = open (fnam, 0)) == -1) {
  1522. !         perror_message (txt_nntp_to_fd_cannot_reopen, fnam);
  1523. X          return -1;
  1524. X      }
  1525. X      
  1526. Only in .: open.o
  1527. diff -rcs ../111/page.c ./page.c
  1528. *** ../111/page.c    Fri Mar 27 14:00:58 1992
  1529. --- ./page.c    Thu Mar 26 15:05:39 1992
  1530. ***************
  1531. *** 138,146 ****
  1532. X                  goto restart;
  1533. X  
  1534. X              case '|':    /* pipe article/thread/tagged arts to command */
  1535. -                 set_real_uid_gid ();
  1536. X                  feed_articles (FEED_PIPE, PAGE_LEVEL, "Pipe", respnum, group_path);
  1537. -                 set_tin_uid_gid ();
  1538. X                  break;
  1539. X  
  1540. X              case '/':    /* search forwards in article */
  1541. --- 138,144 ----
  1542. ***************
  1543. *** 427,435 ****
  1544. X                  /* NOTREACHED */
  1545. X  
  1546. X              case 'm':    /* mail article/thread/tagged articles to somebody */
  1547. -                 set_real_uid_gid ();
  1548. X                  feed_articles (FEED_MAIL, PAGE_LEVEL, "Mail", respnum, group_path);
  1549. -                 set_tin_uid_gid ();
  1550. X                  break;
  1551. X  
  1552. X              case 'M':    /* options menu */
  1553. --- 425,431 ----
  1554. ***************
  1555. *** 460,468 ****
  1556. X                  break;
  1557. X  
  1558. X              case 'o':    /* output art/thread/tagged arts to printer */
  1559. -                 set_real_uid_gid ();
  1560. X                  feed_articles (FEED_PRINT, PAGE_LEVEL, "Print", respnum, group_path);
  1561. -                 set_tin_uid_gid ();
  1562. X                  break;
  1563. X  
  1564. X              case 'p':    /* previous article */
  1565. --- 456,462 ----
  1566. ***************
  1567. *** 498,506 ****
  1568. X                  break;
  1569. X  
  1570. X              case 's':    /* save article/thread/tagged articles */
  1571. -                 set_real_uid_gid ();
  1572. X                  feed_articles (FEED_SAVE, PAGE_LEVEL, "Save", respnum, group_path);
  1573. -                 set_tin_uid_gid ();
  1574. X                  break;
  1575. X  
  1576. X              case 't':    /* return to group selection page */
  1577. --- 492,498 ----
  1578. Only in .: page.o
  1579. Only in .: patch112.shar.01
  1580. Only in .: patch112.shar.02
  1581. Only in .: patch112.shar.03
  1582. Only in .: patch112.shar.04
  1583. diff -rcs ../111/patchlev.h ./patchlev.h
  1584. *** ../111/patchlev.h    Fri Mar 27 14:01:22 1992
  1585. --- ./patchlev.h    Sun Mar 29 16:46:56 1992
  1586. ***************
  1587. *** 3,9 ****
  1588. X   *  Module    : patchlev.h
  1589. X   *  Author    : I.Lea
  1590. X   *  Created   : 01-04-91
  1591. !  *  Updated   : 22-03-92
  1592. X   *  Notes     :
  1593. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1594. X   *              You may  freely  copy or  redistribute  this software,
  1595. --- 3,9 ----
  1596. X   *  Module    : patchlev.h
  1597. X   *  Author    : I.Lea
  1598. X   *  Created   : 01-04-91
  1599. !  *  Updated   : 29-03-92
  1600. X   *  Notes     :
  1601. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1602. X   *              You may  freely  copy or  redistribute  this software,
  1603. ***************
  1604. *** 12,16 ****
  1605. X   *              right notice, and it must be included in any copy made
  1606. X   */
  1607. X  
  1608. ! #define VERSION        "1.1"    /* Beta versions are "1.n Beta" */
  1609. ! #define PATCHLEVEL    1
  1610. --- 12,17 ----
  1611. X   *              right notice, and it must be included in any copy made
  1612. X   */
  1613. X  
  1614. ! #define VERSION        "1.1"        /* Beta versions are "1.n Beta" */
  1615. ! #define PATCHLEVEL    2
  1616. ! #define COMPILED "Sun Mar 29 15:47:11 CET 1992"
  1617. Only in .: patchlev.h.old
  1618. diff -rcs ../111/post.c ./post.c
  1619. *** ../111/post.c    Fri Mar 27 14:00:59 1992
  1620. --- ./post.c    Sat Mar 28 13:05:32 1992
  1621. ***************
  1622. *** 3,9 ****
  1623. X   *  Module    : post.c
  1624. X   *  Author    : I.Lea
  1625. X   *  Created   : 01-04-91
  1626. !  *  Updated   : 22-03-92
  1627. X   *  Notes     : mailing/posting/replying/followup & cancel article routines
  1628. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1629. X   *              You may  freely  copy or  redistribute  this software,
  1630. --- 3,9 ----
  1631. X   *  Module    : post.c
  1632. X   *  Author    : I.Lea
  1633. X   *  Created   : 01-04-91
  1634. !  *  Updated   : 28-03-92
  1635. X   *  Notes     : mailing/posting/replying/followup & cancel article routines
  1636. X   *  Copyright : (c) Copyright 1991-92 by Iain Lea
  1637. X   *              You may  freely  copy or  redistribute  this software,
  1638. ***************
  1639. *** 35,45 ****
  1640. X      int i, j, k;
  1641. X      int no_of_lines = 0;
  1642. X  
  1643. -     set_real_uid_gid ();
  1644. -         
  1645. X      if ((fp = fopen (postfile, "r")) == NULL) {
  1646. X          clear_message ();
  1647. -         set_tin_uid_gid ();
  1648. X          return FALSE;
  1649. X      } else {
  1650. X          while (fgets (buf, sizeof (buf), fp) != NULL) {
  1651. --- 35,42 ----
  1652. ***************
  1653. *** 84,90 ****
  1654. X              posted[i].subj[k++] = '\0';
  1655. X          }
  1656. X          fclose (fp);
  1657. -         set_tin_uid_gid ();
  1658. X  
  1659. X          show_info_page (POST_INFO, (char **) 0, txt_post_history_menu);
  1660. X          if (posted != (struct posted_t *) 0) {
  1661. --- 81,86 ----
  1662. ***************
  1663. *** 108,115 ****
  1664. X  
  1665. X      sprintf (tmp_post, "%s.%d", postfile, process_id);
  1666. X  
  1667. -     set_real_uid_gid ();
  1668. X      if ((tmp_fp = fopen (tmp_post, "w")) != NULL) {
  1669. X          time (&epoch);
  1670. X          tm = localtime (&epoch);
  1671. --- 104,109 ----
  1672. ***************
  1673. *** 128,137 ****
  1674. X          }
  1675. X          fclose (tmp_fp);
  1676. X      }
  1677. -     set_tin_uid_gid ();
  1678. X  }
  1679. X  
  1680. X  /*
  1681. X   *  Post an original article (not a followup)
  1682. X   */
  1683. X  
  1684. --- 122,191 ----
  1685. X          }
  1686. X          fclose (tmp_fp);
  1687. X      }
  1688. X  }
  1689. X  
  1690. X  /*
  1691. +  * Check the article file so that it is not missing the blank line
  1692. +  * between the header information and the text.
  1693. +  */
  1694. + int post_header_ok (article)
  1695. +     char* article;
  1696. + {
  1697. +     FILE *fp;
  1698. +     char line[LEN];
  1699. +     int cnt= 0;
  1700. +     int len, ind;
  1701. +     char prev_ch;
  1702. +     int header;
  1703. +     if ((fp = fopen (article, "r")) == NULL) {
  1704. +         perror_message (txt_cannot_open, article);
  1705. +         return FALSE;
  1706. +     }
  1707. +     while (fgets (line, LEN, fp) != NULL) {
  1708. +         cnt++;
  1709. +         len= strlen (line);
  1710. +         if (len > 0)
  1711. +             if (line[len - 1] == '\n') 
  1712. +                 line[--len]= 0;
  1713. +                 
  1714. +         if ((len == 0) && (cnt >= 2)) {
  1715. +             fclose(fp);
  1716. +             return TRUE;
  1717. +         }
  1718. +         prev_ch= ' ';
  1719. +         header= FALSE;
  1720. +         for (ind= 0; ind < len; ind++) /* Skip white space */
  1721. +             if ((line[ind] != ' ') && (line[ind] != '\t'))
  1722. +                 break;
  1723. +         for (; ind < len; ind++) {   
  1724. +             /* Header as long as the first token ends with ':' */
  1725. +             if (((ind == len - 1) &&
  1726. +                  (line[ind] == ':')) ||
  1727. +                 (((line[ind] == ' ') ||
  1728. +                   (line[ind] == '\t')) &&
  1729. +                  (prev_ch == ':'))) {
  1730. +                 header= TRUE;
  1731. +                 break;
  1732. +             }
  1733. +             if ((line[ind] == ' ') ||
  1734. +                 (line[ind] == '\t'))
  1735. +                 break;
  1736. +             prev_ch= line[ind];
  1737. +         }
  1738. +         if (! header) {
  1739. +             fclose (fp);
  1740. +             return FALSE;
  1741. +         }
  1742. +     }
  1743. +     fclose (fp);
  1744. +     return FALSE;
  1745. + }
  1746. + /*
  1747. X   *  Post an original article (not a followup)
  1748. X   */
  1749. X  
  1750. ***************
  1751. *** 147,153 ****
  1752. X      int redraw_screen = FALSE;
  1753. X  
  1754. X      *posted = FALSE;
  1755. !     start_line_offset = 4;
  1756. X  
  1757. X      if (active[my_group[cur_groupnum]].moderated == 'm') {
  1758. X          sprintf (msg, "Group %s is moderated. Continue? (y/n): ", group);
  1759. --- 201,207 ----
  1760. X      int redraw_screen = FALSE;
  1761. X  
  1762. X      *posted = FALSE;
  1763. !     start_line_offset = 5;
  1764. X  
  1765. X      if (active[my_group[cur_groupnum]].moderated == 'm') {
  1766. X          sprintf (msg, "Group %s is moderated. Continue? (y/n): ", group);
  1767. ***************
  1768. *** 177,187 ****
  1769. X      
  1770. X      wait_message (txt_post_an_article);
  1771. X  
  1772. -     set_real_uid_gid ();
  1773. X      if ((fp = fopen (article, "w")) == NULL) {
  1774. !         error_message (txt_cannot_open, article);
  1775. !         set_tin_uid_gid ();
  1776. X          return (redraw_screen);
  1777. X      }
  1778. X      chmod (article, 0600);
  1779. --- 231,238 ----
  1780. X      
  1781. X      wait_message (txt_post_an_article);
  1782. X  
  1783. X      if ((fp = fopen (article, "w")) == NULL) {
  1784. !         perror_message (txt_cannot_open, article);
  1785. X          return (redraw_screen);
  1786. X      }
  1787. X      chmod (article, 0600);
  1788. ***************
  1789. *** 188,194 ****
  1790. X  
  1791. X      fprintf (fp, "Subject: %s\n", subj);
  1792. X      fprintf (fp, "Newsgroups: %s\n", group);
  1793. -     fprintf (fp, "Distribution: \n");
  1794. X      if (*my_org) {
  1795. X          fprintf (fp, "Organization: %s\n", my_org);
  1796. X          start_line_offset++;
  1797. --- 239,244 ----
  1798. ***************
  1799. *** 197,202 ****
  1800. --- 247,253 ----
  1801. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1802. X          start_line_offset++;
  1803. X      }
  1804. +     fprintf (fp, "Distribution: \n\n");
  1805. X      fprintf (fp, "\n");
  1806. X  
  1807. X      add_signature (fp, FALSE);
  1808. ***************
  1809. *** 207,222 ****
  1810. X          switch (ch) {
  1811. X          case 'e':
  1812. X              invoke_editor (article);
  1813. !              set_real_uid_gid ();
  1814. X              redraw_screen = TRUE;
  1815. !             break;
  1816. X          case 'a':
  1817. X          case ESC:
  1818. X              if (unlink_article)
  1819. X                  unlink (article);
  1820. X              clear_message ();
  1821. -             set_tin_uid_gid ();
  1822. X              return (redraw_screen);
  1823. X  
  1824. X          case 'p':
  1825. --- 258,285 ----
  1826. X          switch (ch) {
  1827. X          case 'e':
  1828. X              invoke_editor (article);
  1829. !             while (! post_header_ok(article)) {
  1830. !                 do {
  1831. !                     sprintf (msg, "%s%c", txt_no_blank_line, 'e');
  1832. !                     wait_message (msg);
  1833. !                     MoveCursor (LINES, (int) strlen (txt_no_blank_line));
  1834. !                     if ((ch = (char) ReadCh ()) == CR)
  1835. !                         ch = 'e';
  1836. !                 } while (ch != ESC && ch != 'a' && ch != 'e');
  1837. !                 if (ch == 'e')
  1838. !                     invoke_editor (article);
  1839. !                 else
  1840. !                     break;
  1841. !             }
  1842. X              redraw_screen = TRUE;
  1843. !             if (ch == 'e') {
  1844. !                 break;
  1845. !             }
  1846. X          case 'a':
  1847. X          case ESC:
  1848. X              if (unlink_article)
  1849. X                  unlink (article);
  1850. X              clear_message ();
  1851. X              return (redraw_screen);
  1852. X  
  1853. X          case 'p':
  1854. ***************
  1855. *** 230,236 ****
  1856. X                  sprintf (buf, txt_art_rejected, dead_article);
  1857. X                  info_message (buf);
  1858. X                  sleep (3);
  1859. -                 set_tin_uid_gid ();
  1860. X                  return (redraw_screen);
  1861. X              }
  1862. X          }
  1863. --- 293,298 ----
  1864. ***************
  1865. *** 248,254 ****
  1866. X      find_mail_header (HEADER_SUBJECT, article, subj);
  1867. X      if (unlink_article)
  1868. X          unlink (article);
  1869. -     set_tin_uid_gid ();
  1870. X      update_art_posted_file (group, subj);
  1871. X      return (redraw_screen);
  1872. X  }
  1873. --- 310,315 ----
  1874. ***************
  1875. *** 298,308 ****
  1876. X          }
  1877. X      }
  1878. X  
  1879. -     set_real_uid_gid ();
  1880. X      if ((fp = fopen (article, "w")) == NULL) {
  1881. !         error_message (txt_cannot_open, article);
  1882. !         set_tin_uid_gid ();
  1883. X          return (ret_code);
  1884. X      }
  1885. X      chmod (article, 0600);
  1886. --- 359,366 ----
  1887. X          }
  1888. X      }
  1889. X  
  1890. X      if ((fp = fopen (article, "w")) == NULL) {
  1891. !         perror_message (txt_cannot_open, article);
  1892. X          return (ret_code);
  1893. X      }
  1894. X      chmod (article, 0600);
  1895. ***************
  1896. *** 314,323 ****
  1897. X      } else {
  1898. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1899. X      }
  1900. !     if (note_h_distrib != '\0') {
  1901. !         fprintf (fp, "Distribution: %s\n", note_h_distrib);
  1902. !         start_line_offset++;
  1903. !     }
  1904. X      fprintf (fp, "References: %s\n", note_h_messageid);
  1905. X  
  1906. X      if (*my_org) {
  1907. --- 372,378 ----
  1908. X      } else {
  1909. X          fprintf (fp, "Newsgroups: %s\n", note_h_newsgroups);
  1910. X      }
  1911. X      fprintf (fp, "References: %s\n", note_h_messageid);
  1912. X  
  1913. X      if (*my_org) {
  1914. ***************
  1915. *** 328,333 ****
  1916. --- 383,392 ----
  1917. X          fprintf (fp, "Reply-To: %s\n", reply_to);
  1918. X          start_line_offset++;
  1919. X      }
  1920. +     if (note_h_distrib != '\0') {
  1921. +         fprintf (fp, "Distribution: %s\n", note_h_distrib);
  1922. +         start_line_offset++;
  1923. +     }
  1924. X      fprintf (fp, "\n");
  1925. X  
  1926. X      if (copy_text) {    /* if "copy_text" */
  1927. ***************
  1928. *** 350,356 ****
  1929. X          switch (ch) {
  1930. X          case 'e':
  1931. X              invoke_editor (article);
  1932. -              set_real_uid_gid ();
  1933. X              ret_code = POSTED_REDRAW;
  1934. X              break;
  1935. X  
  1936. --- 409,414 ----
  1937. ***************
  1938. *** 359,365 ****
  1939. X              if (unlink_article)
  1940. X                  unlink (article);
  1941. X              clear_message ();
  1942. -             set_tin_uid_gid ();
  1943. X              return (ret_code);
  1944. X  
  1945. X          case 'p':
  1946. --- 417,422 ----
  1947. ***************
  1948. *** 373,379 ****
  1949. X                  sprintf (buf, txt_art_rejected, dead_article);
  1950. X                  info_message (buf);
  1951. X                  sleep (3);
  1952. -                 set_tin_uid_gid ();
  1953. X                  return (ret_code);
  1954. X              }
  1955. X          }
  1956. --- 430,435 ----
  1957. ***************
  1958. *** 397,405 ****
  1959. X      }
  1960. X  
  1961. X      if (unlink_article) {
  1962. -         set_real_uid_gid ();
  1963. X          unlink (article);
  1964. -         set_tin_uid_gid ();
  1965. X      }
  1966. X      
  1967. X      return (ret_code);
  1968. --- 453,459 ----
  1969. ***************
  1970. *** 423,434 ****
  1971. X      strcpy (mail_to, address);
  1972. X      clear_message ();
  1973. X      
  1974. -     set_real_uid_gid ();
  1975. X      sprintf (nam, "%s/.letter", homedir);
  1976. X      if ((fp = fopen (nam, "w")) == NULL) {
  1977. !         error_message (txt_cannot_open, nam);
  1978. !         set_tin_uid_gid ();
  1979. X          return (redraw_screen);
  1980. X      }
  1981. X      chmod (nam, 0600);
  1982. --- 477,485 ----
  1983. X      strcpy (mail_to, address);
  1984. X      clear_message ();
  1985. X      
  1986. X      sprintf (nam, "%s/.letter", homedir);
  1987. X      if ((fp = fopen (nam, "w")) == NULL) {
  1988. !         perror_message (txt_cannot_open, nam);
  1989. X          return (redraw_screen);
  1990. X      }
  1991. X      chmod (nam, 0600);
  1992. ***************
  1993. *** 470,476 ****
  1994. X          switch (ch) {
  1995. X          case 'e':
  1996. X              invoke_editor (nam);
  1997. -             set_real_uid_gid ();
  1998. X              redraw_screen = TRUE;
  1999. X              break;
  2000. X  
  2001. --- 521,526 ----
  2002. ***************
  2003. *** 478,484 ****
  2004. X          case ESC:
  2005. X              unlink (nam);
  2006. X              clear_message ();
  2007. -             set_tin_uid_gid ();
  2008. X              return (redraw_screen);
  2009. X  
  2010. X          case 's':
  2011. --- 528,533 ----
  2012. ***************
  2013. *** 501,509 ****
  2014. X      }
  2015. X  
  2016. X  mail_to_someone_done:
  2017. -     set_real_uid_gid ();
  2018. X      unlink (nam);
  2019. -     set_tin_uid_gid ();
  2020. X  
  2021. X      return (redraw_screen);
  2022. X  }
  2023. --- 550,556 ----
  2024. ***************
  2025. *** 529,540 ****
  2026. X      
  2027. X      wait_message (txt_mail_bug_report);
  2028. X      
  2029. -     set_real_uid_gid ();
  2030. X      sprintf (nam, "%s/.bugreport", homedir);
  2031. X      if ((fp = fopen (nam, "w")) == NULL) {
  2032. !         error_message (txt_cannot_open, nam);
  2033. SHAR_EOF
  2034. true || echo 'restore of tin.patch112 failed'
  2035. fi
  2036. echo 'End of tin part 2'
  2037. echo 'File tin.patch112 is continued in part 3'
  2038. echo 3 > _shar_seq_.tmp
  2039. exit 0
  2040. -- 
  2041.  Dr. med. dipl.-math Dieter Becker           Tel.: (0 / +49) 6841 - 16 3046
  2042.  Medizinische Universitaets- und Poliklinik  Fax.: (0 / +49) 6841 - 16 3369
  2043.  Innere Medizin III                         
  2044.  D - 6650 Homburg / Saar                     Email: becker@med-in.uni-sb.de
  2045. exit 0 # Just in case...
  2046.