uucp-1.06.1.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. --- uucp-1.06.1.orig/contrib/uurate.c
  2. +++ uucp-1.06.1/contrib/uurate.c
  3. @@ -82,6 +82,11 @@
  4. * and one for the errors encountered
  5. * - reapplied patch by Scott Boyd <scott@futures.com> that I did not
  6. * get knowledge of
  7. + *
  8. + * Ed Doolittle <dolittle@math.toronto.edu> - Sun Aug 8 1999
  9. + * - shrunk compact summary to fit in 78 characters (time strings only
  10. + * require 8 characters, not 9)
  11. + *
  12. */
  13. /* $Log: uurate.c,v $
  14. * Revision 1.15 1994/04/07 21:47:11 kdburg
  15. @@ -302,6 +307,7 @@
  16. int sent, called = IN;
  17. int report = 0; /* if <= 0 give msg that no report was avail. */
  18. int junk;
  19. + extern int getopt();
  20. /* --------------------------------------------------------------------
  21. * P r o l o g
  22. @@ -980,7 +986,7 @@
  23. if (cur->next == NULL) /* totals line reached ? */
  24. hdrprt('s',1); /* print the separator line */
  25. - printf("%-8s %4d %4d %9s %9s %9s %9s %9s %5.0f %5.0f\n",
  26. + printf("%-8s %4ld %4ld %9s %9s %9s %8s %8s %5.0f %5.0f\n",
  27. cur->Hostname, rf, sf,
  28. t1, t2, t3, t4, t5,
  29. ir, or);
  30. @@ -1028,7 +1034,7 @@
  31. hdrprt('p',0); /* print the header line(s) */
  32. hdr_done = TRUE;
  33. }
  34. - printf("%-8s %3s %4d %4d %5d %4d %10d %7d %10d\n",
  35. + printf("%-8s %3s %4ld %4ld %5ld %4ld %10ld %7ld %10ld\n",
  36. type == NULL ? " ":cur->Hostname,
  37. prot->type,
  38. prot->pr_psizemin,
  39. @@ -1072,7 +1078,7 @@
  40. hdrprt('p',1); /* print the header line(s) */
  41. hdr_done = TRUE;
  42. }
  43. - printf("%-8s %3s %11d %11d %11d %11d\n",
  44. + printf("%-8s %3s %11ld %11ld %11ld %11ld\n",
  45. type == NULL ? " ":cur->Hostname,
  46. prot->type,
  47. prot->pr_eheader,
  48. @@ -1747,13 +1753,13 @@
  49. puts("\nCompact summary:");
  50. puts("----------------");
  51. puts("\
  52. -Name of + Files + +------- Bytes/1000 --------+ +------ Time -----+ + Avg CPS +\n\
  53. -site in out inbound outbound total inbound outbound in out\n\
  54. --------- ---- ---- --------- --------- --------- --------- --------- ----- -----");
  55. +Name of + Files + +------- Bytes/1000 --------+ +----- Time ----+ + Avg CPS +\n\
  56. +site in out inbound outbound total inbound outbound in out\n\
  57. +-------- ---- ---- --------- --------- --------- -------- -------- ----- -----");
  58. }
  59. else
  60. puts("\
  61. ---------------------------------------------------------------------------------");
  62. +------------------------------------------------------------------------------");
  63. break;
  64. --- uucp-1.06.1.orig/system.h
  65. +++ uucp-1.06.1/system.h
  66. @@ -303,7 +303,8 @@
  67. will allow all grades from 'A' to 'Z' and 'a' to 'd'). This
  68. function should return FALSE on error. */
  69. extern boolean fsysdep_get_work_init P((const struct uuconf_system *qsys,
  70. - int bgrade));
  71. + int bgrade,
  72. + boolean unlimited));
  73. /* Get the next command to be executed for a remote system. The
  74. bgrade argument will be the same as for fsysdep_get_work_init;
  75. --- uucp-1.06.1.orig/trans.c
  76. +++ uucp-1.06.1/trans.c
  77. @@ -511,7 +511,7 @@
  78. if (bgrade == '\0')
  79. return TRUE;
  80. - if (! fsysdep_get_work_init (qsys, bgrade))
  81. + if (! fsysdep_get_work_init (qsys, bgrade, FALSE))
  82. return FALSE;
  83. while (TRUE)
  84. @@ -670,7 +670,8 @@
  85. fhangup = FALSE;
  86. if (qdaemon->fhangup_requested
  87. - && qTsend == NULL)
  88. + && qTsend == NULL
  89. + && (qTreceive == NULL || qdaemon->cchans > 1))
  90. {
  91. /* The remote system has requested that we transfer
  92. control by sending CYM after receiving a file. */
  93. --- uucp-1.06.1.orig/uucico.c
  94. +++ uucp-1.06.1/uucico.c
  95. @@ -126,6 +126,9 @@
  96. struct sconnection *qconn;
  97. };
  98. +/* min. grade set on commandline */
  99. +static char cmdlgrade = '\0';
  100. +
  101. /* Local functions. */
  102. static void uusage P((void));
  103. @@ -176,6 +179,7 @@
  104. { "nodetach", no_argument, NULL, 'D' },
  105. { "loop", no_argument, NULL, 'e' },
  106. { "force", no_argument, NULL, 'f'},
  107. + { "grade", required_argument, NULL, 'g'},
  108. { "stdin", required_argument, NULL, 'i' },
  109. { "prompt", no_argument, NULL, 'l' },
  110. { "port", required_argument, NULL, 'p' },
  111. @@ -250,9 +254,9 @@
  112. ++zProgram;
  113. #if COHERENT_C_OPTION
  114. - zopts = "c:CDefi:I:lp:qr:s:S:u:x:X:vwz";
  115. + zopts = "c:CDefg:i:I:lp:qr:s:S:u:x:X:vwz";
  116. #else
  117. - zopts = "cCDefi:I:lp:qr:s:S:u:x:X:vwz";
  118. + zopts = "cCDefg:i:I:lp:qr:s:S:u:x:X:vwz";
  119. #endif
  120. while ((iopt = getopt_long (argc, argv, zopts,
  121. @@ -293,6 +297,14 @@
  122. failed call. */
  123. fforce = TRUE;
  124. break;
  125. +
  126. + case 'g':
  127. + /* Force a grade */
  128. + if (isalpha(optarg[0]))
  129. + cmdlgrade = optarg[0];
  130. + else
  131. + fprintf (stderr, "%s: invalid grade \n", zProgram);
  132. + break;
  133. case 'i':
  134. /* Type of port to use for standard input. Only TLI is
  135. @@ -794,6 +806,7 @@
  136. printf ("Usage: %s [options]\n", zProgram);
  137. printf (" -s,-S,--system system: Call system (-S implies -f)\n");
  138. printf (" -f,--force: Force call despite system status\n");
  139. + printf (" -g,--grade: limit outgoing call to a given grade\n");
  140. printf (" -r state: 1 for master, 0 for slave (default)\n");
  141. printf (" --master: Act as master\n");
  142. printf (" --slave: Act as slave (default)\n");
  143. @@ -940,6 +953,9 @@
  144. if (! qsys->uuconf_fcall || qsys->uuconf_qtimegrade == NULL)
  145. continue;
  146. + if (qport && strcmp (qsys->uuconf_zport,qport->uuconf_zname))
  147. + continue;
  148. +
  149. fnevertime = FALSE;
  150. /* Make sure this is a legal time to call. */
  151. @@ -1331,12 +1347,18 @@
  152. boolean fret;
  153. /* Determine the grade we should request of the other system. A
  154. - '\0' means that no restrictions have been made. */
  155. - if (! ftimespan_match (qsys->uuconf_qcalltimegrade, &ival,
  156. - (int *) NULL))
  157. - bgrade = '\0';
  158. + '\0' means that no restrictions have been made.
  159. + If a grade is set on the command line, the calltimegrade-value
  160. + is overwritten. */
  161. +
  162. + if (cmdlgrade != '\0')
  163. + bgrade = cmdlgrade;
  164. else
  165. - bgrade = (char) ival;
  166. + if (! ftimespan_match (qsys->uuconf_qcalltimegrade, &ival,
  167. + (int *) NULL))
  168. + bgrade = '\0';
  169. + else
  170. + bgrade = (char) ival;
  171. /* Determine the name we will call ourselves. */
  172. if (qsys->uuconf_zlocalname != NULL)
  173. --- uucp-1.06.1.orig/uustat.c
  174. +++ uucp-1.06.1/uustat.c
  175. @@ -933,7 +933,7 @@
  176. {
  177. boolean fret;
  178. - if (! fsysdep_get_work_init (qsys, UUCONF_GRADE_LOW))
  179. + if (! fsysdep_get_work_init (qsys, UUCONF_GRADE_LOW, TRUE))
  180. return FALSE;
  181. while (TRUE)
  182. @@ -2166,7 +2166,7 @@
  183. char *zid;
  184. boolean fret;
  185. - if (! fsysdep_get_work_init (qsys, UUCONF_GRADE_LOW))
  186. + if (! fsysdep_get_work_init (qsys, UUCONF_GRADE_LOW, TRUE))
  187. return FALSE;
  188. cwork = 0;
  189. --- uucp-1.06.1.orig/uuxqt.c
  190. +++ uucp-1.06.1/uuxqt.c
  191. @@ -928,6 +928,44 @@
  192. don't permit multiple arguments. */
  193. for (i = 1; azQargs[i] != NULL; i++)
  194. {
  195. + if (azQargs[i][0] == '-' && azQargs[i][1] == '-')
  196. + {
  197. + char *zopts = azQargs[i] + 2;
  198. +
  199. + /* The -g, -n, and -s options take an argument. */
  200. + if (!strncmp(zopts, "grade", 5) && zopts[5] != '=')
  201. + {
  202. + if (azQargs[i+1] != NULL)
  203. + ++i;
  204. + }
  205. + if (!(strncmp(zopts, "notify", 6)
  206. + && strncmp(zopts, "status", 6)) && zopts[6] != '=')
  207. + {
  208. + if (azQargs[i+1] != NULL)
  209. + ++i;
  210. + }
  211. +
  212. + /* The -I, -u and -x options are not permitted. */
  213. + if (!strncmp(zopts, "config", 6))
  214. + {
  215. + if (zopts[6] != '=' && azQargs[i+1] != NULL)
  216. + ++i;
  217. + azQargs[i] = zbufcpy ("--nouucico");
  218. + }
  219. + if (!strncmp(zopts, "user", 4))
  220. + {
  221. + if (zopts[4] != '=' && azQargs[i+1] != NULL)
  222. + ++i;
  223. + azQargs[i] = zbufcpy ("--nouucico");
  224. + }
  225. + if (!strncmp(zopts, "debug", 5))
  226. + {
  227. + if (zopts[5] != '=' && azQargs[i+1] != NULL)
  228. + ++i;
  229. + azQargs[i] = zbufcpy ("--nouucico");
  230. + }
  231. + }
  232. + else
  233. if (azQargs[i][0] == '-')
  234. {
  235. char *zopts;
  236. --- uucp-1.06.1.orig/unix/lock.c
  237. +++ uucp-1.06.1/unix/lock.c
  238. @@ -425,7 +425,9 @@
  239. {
  240. (void) close (o);
  241. o = -1;
  242. - (void) remove (zpath);
  243. + if (remove (zpath) < 0 && errno == EPERM)
  244. + break;
  245. + sleep(1);
  246. fret = TRUE;
  247. continue;
  248. }
  249. --- uucp-1.06.1.orig/unix/serial.c
  250. +++ uucp-1.06.1/unix/serial.c
  251. @@ -920,6 +920,12 @@
  252. #ifdef B115200
  253. { B115200, 115200 },
  254. #endif
  255. +#ifdef B230400
  256. + { B230400, 230400 },
  257. +#endif
  258. +#ifdef B460800
  259. + { B460800, 460800 },
  260. +#endif
  261. { B0, 0 }
  262. };
  263. @@ -2371,8 +2377,17 @@
  264. else
  265. csleepchars = MAX_INPUT - 10;
  266. +#ifndef BUG
  267. + if (q->ibaud) {
  268. + isleep = (int) (((long) csleepchars * 10000L) / q->ibaud);
  269. + isleep -= 10;
  270. + } else {
  271. + isleep = 1000; /* I hope, a second is right... */
  272. + }
  273. +#else
  274. isleep = (int) (((long) csleepchars * 10000L) / q->ibaud);
  275. isleep -= 10;
  276. +#endif
  277. if (isleep > 10)
  278. {
  279. @@ -2773,9 +2788,20 @@
  280. / baud bits/sec)
  281. * 10 bits/byte)
  282. */
  283. +#ifndef BUG
  284. + if (q->ibaud) {
  285. + stime.tv_sec = (long) 10240 / q->ibaud;
  286. + stime.tv_usec = ((((long) 1024000000 / q->ibaud) * (long) 10)
  287. + % (long) 1000000);
  288. + } else {
  289. + stime.tv_sec = 1;
  290. + stime.tv_usec = 0;
  291. + }
  292. +#else
  293. stime.tv_sec = (long) 10240 / q->ibaud;
  294. stime.tv_usec = ((((long) 1024000000 / q->ibaud) * (long) 10)
  295. % (long) 1000000);
  296. +#endif
  297. imask = 1 << q->o;
  298. if (imask == 0)
  299. @@ -2846,7 +2872,14 @@
  300. we don't need to use the catch stuff, since we know
  301. that HAVE_RESTARTABLE_SYSCALLS is 0. */
  302. usset_signal (SIGALRM, usalarm, TRUE, (boolean *) NULL);
  303. +#ifndef BUG
  304. + if (q->ibaud)
  305. + alarm ((int) ((long) 10240 / q->ibaud) + 1);
  306. + else
  307. + alarm (1);
  308. +#else
  309. alarm ((int) ((long) 10240 / q->ibaud) + 1);
  310. +#endif
  311. /* There is a race condition here: on a severely loaded
  312. system, we could get the alarm before we start the
  313. --- uucp-1.06.1.orig/unix/work.c
  314. +++ uucp-1.06.1/unix/work.c
  315. @@ -282,9 +282,10 @@
  316. #define CWORKFILES (10)
  317. boolean
  318. -fsysdep_get_work_init (qsys, bgrade)
  319. +fsysdep_get_work_init (qsys, bgrade, unlimited)
  320. const struct uuconf_system *qsys;
  321. int bgrade;
  322. + boolean unlimited;
  323. {
  324. char *zdir;
  325. DIR *qdir;
  326. @@ -398,7 +399,7 @@
  327. asSwork_files[cSwork_files].zfile = zname;
  328. asSwork_files[cSwork_files].bgrade = bfilegrade;
  329. ++cSwork_files;
  330. - if (cSwork_files - chad > COMMANDS_PER_SCAN)
  331. + if (!unlimited && (cSwork_files - chad > COMMANDS_PER_SCAN))
  332. break;
  333. }
  334. }