]> jfr.im git - irc.git/blame - software/ircd/www.irc.org/ftp/irc/org/Old/irc2.7/irc2.7.2g-h.patch
init
[irc.git] / software / ircd / www.irc.org / ftp / irc / org / Old / irc2.7 / irc2.7.2g-h.patch
CommitLineData
3bd189cb
JR
1To apply this patchfile, cd to the irc2.7.2g top directory and enter
2% patch -p1 < 272g_to_272h
3
4Common subdirectories: irc2.7.2g/common and irc2.7.2h/common
5Common subdirectories: irc2.7.2g/doc and irc2.7.2h/doc
6Common subdirectories: irc2.7.2g/include and irc2.7.2h/include
7Common subdirectories: irc2.7.2g/irc and irc2.7.2h/irc
8Common subdirectories: irc2.7.2g/ircd and irc2.7.2h/ircd
9Only in irc2.7.2h: res
10diff -cr irc2.7.2g/common/send.c irc2.7.2h/common/send.c
11*** irc2.7.2g/common/send.c Tue Jun 16 12:36:42 1992
12--- irc2.7.2h/common/send.c Tue Mar 2 13:11:44 1993
13***************
14*** 522,527 ****
15--- 522,529 ----
16 {
17 if (!SendWallops(cptr))
18 continue;
19+ if (MyClient(cptr) && !(IsServer(from) || IsMe(from)))
20+ continue;
21 i = cptr->from->fd; /* find connection oper is on */
22 if (sentalong[i]) /* sent message along it already ? */
23 continue;
24diff -cr irc2.7.2g/common/send.c irc2.7.2h/common/send.circ2.7.2g/common/support.c irc2.7.2h/common/support.c
25*** irc2.7.2g/common/support.c Tue Jun 16 12:32:56 1992
26--- irc2.7.2h/common/support.c Tue Mar 2 13:10:25 1993
27***************
28*** 347,349 ****
29--- 347,418 ----
30 };
31
32 #endif
33+
34+
35+ /*
36+ ** read a string terminated by \r or \n in from a fd
37+ **
38+ ** Created: Sat Dec 12 06:29:58 EST 1992 by avalon
39+ */
40+ int dgets(fd, buf, num)
41+ int fd, num;
42+ char *buf;
43+ {
44+ static char dgbuf[8192];
45+ static char *head = dgbuf, *tail = dgbuf;
46+ static int eof = 0;
47+ register char *s, *t;
48+ register int n, nr;
49+
50+ /*
51+ ** Sanity checks.
52+ */
53+ if (!num)
54+ return 0;
55+ if (num > sizeof(dgbuf) - 1)
56+ num = sizeof(dgbuf) - 1;
57+ dgetsagain:
58+ /*
59+ ** check input buffer for EOL and if present return string.
60+ */
61+ if (head < tail &&
62+ ((s = index(head, '\n')) || (s= index(head, '\r'))) && s < tail)
63+ {
64+ n = MIN(s - head + 1, num); /* at least 1 byte */
65+ dgetsreturnbuf:
66+ bcopy(head, buf, n);
67+ head += n;
68+ if (head == tail)
69+ head = tail = dgbuf;
70+ return n;
71+ }
72+
73+ if (tail - head >= num) /* dgets buf is big enough */
74+ {
75+ n = num;
76+ goto dgetsreturnbuf;
77+ }
78+
79+ if (head != dgbuf)
80+ {
81+ for (nr = head - dgbuf, s = head, t = dgbuf; nr > 0; nr--)
82+ *t++ = *s++;
83+ tail = --t;
84+ }
85+ n = sizeof(dgbuf) - (tail - dgbuf) - 1;
86+ nr = read(fd, tail, n);
87+ if (nr == -1)
88+ return -1;
89+ if (!nr)
90+ {
91+ if (head < tail)
92+ {
93+ n = MIN(head - tail, num);
94+ goto dgetsreturnbuf;
95+ }
96+ return 0;
97+ }
98+ tail += nr;
99+ *(tail + 1) = '\0';
100+ goto dgetsagain;
101+ }
102Common subdirectories: irc2.7.2g/doc/Europe and irc2.7.2h/doc/Europe
103Common subdirectories: irc2.7.2g/doc/US-Admin and irc2.7.2h/doc/US-Admin
104Common subdirectories: irc2.7.2g/doc/history and irc2.7.2h/doc/history
105diff -cr irc2.7.2g/include/hash.h irc2.7.2h/include/hash.h
106*** irc2.7.2g/include/hash.h Tue Jun 16 12:32:54 1992
107--- irc2.7.2h/include/hash.h Tue Mar 23 01:52:31 1993
108***************
109*** 23,34 ****
110 void *list;
111 } aHashEntry;
112
113! #define HASHSIZE 809 /* prime number */
114 /*
115 * choose hashsize from these:
116 *
117 * 293, 313, 337, 359, 379, 401, 421, 443, 463, 487, 509, 541,
118! * 563, 587, 607, 631, 653, 673, 701, 721, 739, 761, 787, 809
119 */
120
121! #define CHANNELHASHSIZE 293 /* prime number */
122--- 23,42 ----
123 void *list;
124 } aHashEntry;
125
126! #define HASHSIZE 2003 /* prime number */
127 /*
128 * choose hashsize from these:
129 *
130 * 293, 313, 337, 359, 379, 401, 421, 443, 463, 487, 509, 541,
131! * 563, 587, 607, 631, 653, 673, 701, 721, 739, 761, 787, 809,
132! * 907, 941, 983,1019,1051,1117,1163,1213,1249,1297,1319,1361,
133! *1381,1427,1459,1493,1511,1567,1597,1607,1657,1669,1721,1759,
134! *1801,1867,1889,1933,1987,2003,2011,2017,2027,2029,2039,2053,
135! *2063,2069,2081,2083,2087,2089,2099,2111,2113,2129,2131,2137,
136! *2141,2143,2153,2161,2179,2203,2207,2213,2221,2237,2239,2243,
137! *2251,2267,2269,2273,2281,2287,2293,2297,2309,2311,2333,2339,
138! *2341,2347,2351,2357,2371,2377,2381,2383,2389,2393,2399,2411,
139! *2417,2423,2437,2441,2447,2459,2467,2473,2477,2503,2521
140 */
141
142! #define CHANNELHASHSIZE 607 /* prime number */
143diff -cr irc2.7.2g/include/hash.h irc2.7.2h/include/hash.hirc2.7.2g/include/patchlevel.h irc2.7.2h/include/patchlevel.h
144*** irc2.7.2g/include/patchlevel.h Wed Aug 12 04:49:11 1992
145--- irc2.7.2h/include/patchlevel.h Tue Mar 2 13:14:41 1993
146***************
147*** 19,25 ****
148 #include "config.h"
149
150 #ifdef IDENT
151! #define PATCHLEVEL "2.7.2g.ID"
152 #else
153! #define PATCHLEVEL "2.7.2g"
154 #endif
155--- 19,25 ----
156 #include "config.h"
157
158 #ifdef IDENT
159! #define PATCHLEVEL "2.7.2h.ID"
160 #else
161! #define PATCHLEVEL "2.7.2h"
162 #endif
163diff -cr irc2.7.2g/ircd/authuser.c irc2.7.2h/ircd/authuser.c
164*** irc2.7.2g/ircd/authuser.c Tue Jun 16 12:33:05 1992
165--- irc2.7.2h/ircd/authuser.c Tue Mar 2 13:15:55 1993
166***************
167*** 203,209 ****
168 FD_SET(s,&wfds);
169 r = select(s + 1,(fd_set *) 0,&wfds,(fd_set *) 0,&tv);
170 /* XXX: how to handle EINTR? */
171! if (r == -1)
172 CLORETS(0)
173 if (!FD_ISSET(s,&wfds))
174 {
175--- 203,209 ----
176 FD_SET(s,&wfds);
177 r = select(s + 1,(fd_set *) 0,&wfds,(fd_set *) 0,&tv);
178 /* XXX: how to handle EINTR? */
179! if (r <= 0)
180 CLORETS(0)
181 if (!FD_ISSET(s,&wfds))
182 {
183***************
184*** 211,223 ****
185 errno = ETIMEDOUT;
186 return 0;
187 }
188! return auth_sockuser(s,local,remote);
189 }
190
191! char *auth_sockuser(s,local,remote)
192 register int s;
193 register unsigned short local;
194! register unsigned short remote;
195 {
196 register int buflen;
197 register int w;
198--- 211,223 ----
199 errno = ETIMEDOUT;
200 return 0;
201 }
202! return auth_sockuser(s,local,remote,timeout);
203 }
204
205! char *auth_sockuser(s,local,remote,timeout)
206 register int s;
207 register unsigned short local;
208! register unsigned short remote,timeout;
209 {
210 register int buflen;
211 register int w;
212***************
213*** 226,232 ****
214 unsigned short rlocal;
215 unsigned short rremote;
216 register int fl;
217! fd_set wfds;
218 void *old_sig;
219
220 old_sig = signal(SIGPIPE, SIG_IGN);
221--- 226,233 ----
222 unsigned short rlocal;
223 unsigned short rremote;
224 register int fl;
225! struct timeval tv;
226! fd_set wfds,rfds;
227 void *old_sig;
228
229 old_sig = signal(SIGPIPE, SIG_IGN);
230***************
231*** 261,266 ****
232--- 262,274 ----
233 buflen -= w;
234 }
235 buf = realbuf;
236+ FD_ZERO(&rfds);
237+ FD_SET(s,&rfds);
238+ tv.tv_sec = timeout;
239+ tv.tv_usec = 0;
240+ w = select(s + 1,&rfds,(fd_set *) 0,(fd_set *) 0,&tv);
241+ if (w <= 0 || !FD_ISSET(s,&wfds))
242+ CLORETS(0)
243 while ((w = read(s,&ch,1)) == 1)
244 {
245 *buf = ch;
246diff -cr irc2.7.2g/ircd/authuser.c irc2.7.2h/ircd/authuser.circ2.7.2g/ircd/channel.c irc2.7.2h/ircd/channel.c
247*** irc2.7.2g/ircd/channel.c Fri Aug 21 16:23:34 1992
248--- irc2.7.2h/ircd/channel.c Mon Mar 22 22:29:46 1993
249***************
250*** 483,489 ****
251 }
252 if ((IsServer(cptr) && !IsServer(sptr) && !chanop) ||
253 mcount == -1)
254! sendto_ops("Hack: %s MODE %s %s %s",
255 parv[0], parv[1], modebuf, parabuf);
256 if (MyConnect(sptr) && (!chanop || mcount == -1))
257 sendto_one(sptr, "Hack: %s MODE %s %s %s",
258--- 483,489 ----
259 }
260 if ((IsServer(cptr) && !IsServer(sptr) && !chanop) ||
261 mcount == -1)
262! sendto_ops("Fake: %s MODE %s %s %s",
263 parv[0], parv[1], modebuf, parabuf);
264 if (MyConnect(sptr) && (!chanop || mcount == -1))
265 sendto_one(sptr, "Hack: %s MODE %s %s %s",
266Common subdirectories: irc2.7.2g/ircd/crypt and irc2.7.2h/ircd/crypt
267diff -cr irc2.7.2g/ircd/channel.c irc2.7.2h/ircd/channel.circ2.7.2g/ircd/hash.c irc2.7.2h/ircd/hash.c
268*** irc2.7.2g/ircd/hash.c Wed Aug 12 04:51:21 1992
269--- irc2.7.2h/ircd/hash.c Wed Mar 24 13:27:17 1993
270***************
271*** 320,326 ****
272 return (tmp);
273 }
274
275- #ifdef DEBUGMODE
276
277 /*
278 * NOTE: this command is not supposed to be an offical part of the ircd
279--- 320,325 ----
280***************
281*** 335,340 ****
282--- 334,340 ----
283 int parc;
284 char *parv[];
285 {
286+ #ifdef DEBUGMODE
287 register int l, i;
288 register aHashEntry *tab;
289 int deepest = 0, deeplink = 0, showlist = 0, tothits = 0;
290***************
291*** 343,350 ****
292 char ch;
293 aHashEntry *table;
294
295- if (!IsRegisteredUser(sptr) || !MyConnect(sptr))
296- return 0;
297 if (parc > 1) {
298 ch = *parv[1];
299 if (islower(ch))
300--- 343,348 ----
301***************
302*** 477,489 ****
303 return (0);
304 }
305 case 'S' :
306! sendto_one(sptr, "NOTICE %s :s_bsd.c SBSDC ircd.c IRCDC",
307! parv[0]);
308! sendto_one(sptr, "NOTICE %s :channel.c CHANC s_misc.c SMISC",
309! parv[0]);
310! sendto_one(sptr, "NOTICE %s :hash.c HASHC version.c.SH VERSH",
311! parv[0]);
312 return 0;
313 default :
314 break;
315 }
316--- 475,486 ----
317 return (0);
318 }
319 case 'S' :
320! #else
321! if (parc>1 && !strncmp("fubar",parv[1],5)) {
322! #endif
323! sendto_one(sptr, "NOTICE %s :SBSDC IRCDC", parv[0]);
324! sendto_one(sptr, "NOTICE %s :CHANC SMISC", parv[0]);
325! sendto_one(sptr, "NOTICE %s :HASHC VERSH", parv[0]);
326 return 0;
327+ #ifdef DEBUGMODE
328 }
329***************
330*** 504,508 ****
331 sendto_one(sptr,"NOTICE %s :Entry Most Hit: %d Hits: %d",
332 parv[0], mosthit, mosthits);
333 return 0;
334- }
335 #endif
336--- 501,505 ----
337 sendto_one(sptr,"NOTICE %s :Entry Most Hit: %d Hits: %d",
338 parv[0], mosthit, mosthits);
339 return 0;
340 #endif
341+ }
342diff -cr irc2.7.2g/ircd/hash.c irc2.7.2h/ircd/hash.circ2.7.2g/ircd/ircd.c irc2.7.2h/ircd/ircd.c
343*** irc2.7.2g/ircd/ircd.c Wed Aug 12 04:47:48 1992
344--- irc2.7.2h/ircd/ircd.c Tue Mar 2 13:10:00 1993
345***************
346*** 427,433 ****
347 if (portnum < 0)
348 portnum = PORTNUM;
349 me.port = portnum;
350- get_my_name(me.name, me.sockhost,sizeof(me.sockhost)-1);
351 if (debugtty == -2)
352 {
353 me.fd = 0;
354--- 427,432 ----
355***************
356*** 446,451 ****
357--- 445,451 ----
358 printf("Couldn't open configuration file %s\n", configfile);
359 exit(-1);
360 }
361+ get_my_name(me.name, me.sockhost,sizeof(me.sockhost)-1);
362 if (debugtty != -2)
363 {
364 aConfItem *aconf;
365diff -cr irc2.7.2g/ircd/ircd.c irc2.7.2h/ircd/ircd.circ2.7.2g/ircd/s_bsd.c irc2.7.2h/ircd/s_bsd.c
366*** irc2.7.2g/ircd/s_bsd.c Wed Aug 12 04:47:48 1992
367--- irc2.7.2h/ircd/s_bsd.c Tue Mar 23 01:41:39 1993
368***************
369*** 103,108 ****
370--- 103,109 ----
371 struct sockaddr *connect_unix_server PROTO((aConfItem *, aClient *, int *));
372 struct sockaddr *connect_inet_server PROTO((aConfItem *, aClient *, int *));
373 static int completed_connection PROTO((aClient *));
374+ static struct in_addr myip;
375 #ifdef UNIXPORT
376 static char unixpath[256];
377 #endif
378***************
379*** 544,554 ****
380--- 545,559 ----
381 struct hostent hps;
382 int stop = 0;
383
384+ alarm(10);
385 hp = gethostbyaddr(sp, len, fam);
386+ alarm(0);
387 if (!hp)
388 return NULL;
389
390+ alarm(10);
391 hp2 = gethostbyname(hp->h_name);
392+ alarm(0);
393 if (!hp2)
394 return NULL;
395
396***************
397*** 590,598 ****
398--- 595,608 ----
399 return -2;
400
401 if (!IsUnixSocket(cptr))
402+ {
403+ alarm(10);
404 hp = gethostbyaddr(&(sk.sin_addr), sizeof(struct in_addr),
405 sk.sin_family);
406+ alarm(0);
407+ }
408
409+
410 /* attach I-lines using hostname first, then check ip#'s. */
411 if (hp)
412 for (name = hp->h_name; name ; name = hp->h_aliases[i++])
413***************
414*** 706,713 ****
415--- 716,725 ----
416 ** real name, then check with it as the host. Use gethostbyname()
417 ** to check for servername as hostname.
418 */
419+ alarm(10);
420 if ((!c_conf || !n_conf) && (hp = gethostbyname(name)))
421 {
422+ alarm(0);
423 for (i = 0; hp->h_addr_list[i]; i++)
424 if (!bcmp(hp->h_addr_list[i], (char *)(&sk.sin_addr),
425 sizeof(struct in_addr)))
426***************
427*** 723,732 ****
428--- 735,749 ----
429 }
430 hp = (struct hostent *)NULL;
431 }
432+ alarm(0);
433
434 if (!c_conf || !n_conf)
435+ {
436+ alarm(10);
437 hp = gethostbyaddr(&(sk.sin_addr), sizeof(struct in_addr),
438 sk.sin_family);
439+ alarm(0);
440+ }
441 if (hp)
442 /*
443 * if we are missing a C or N line from above, search for
444***************
445*** 992,998 ****
446--- 1009,1017 ----
447 local[fd] = acptr;
448 acptr->acpt = cptr;
449 SetUnixSock(acptr);
450+ alarm(10);
451 hp = gethostbyname(me.sockhost);
452+ alarm(0);
453 if (hp)
454 bcopy(hp->h_addr_list[0], &acptr->ip, sizeof(struct in_addr));
455 else
456***************
457*** 1041,1047 ****
458 if (cptr = local[i])
459 {
460 if (IsMe(cptr) && AcceptNewConnections &&
461! (cptr->flags & FLAGS_LISTEN) && (now > cptr->lasttime + 1))
462 {
463 FD_SET(i, &read_set);
464 }
465--- 1060,1066 ----
466 if (cptr = local[i])
467 {
468 if (IsMe(cptr) && AcceptNewConnections &&
469! (cptr->flags & FLAGS_LISTEN) && (now > cptr->lasttime + 2))
470 {
471 FD_SET(i, &read_set);
472 }
473***************
474*** 1287,1293 ****
475 aClient *cptr;
476 int *lenp;
477 {
478! static struct sockaddr_in server;
479 struct hostent *hp;
480
481 /*
482--- 1306,1312 ----
483 aClient *cptr;
484 int *lenp;
485 {
486! static struct sockaddr_in server, local;
487 struct hostent *hp;
488
489 /*
490***************
491*** 1297,1303 ****
492--- 1316,1327 ----
493
494 cptr->fd = socket(AF_INET, SOCK_STREAM, 0);
495 strncpyzt(cptr->sockhost, aconf->host, sizeof(cptr->sockhost));
496+ bzero((char *)&server, sizeof(server));
497+ bzero((char *)&local, sizeof(local));
498+ local.sin_family = AF_INET;
499 server.sin_family = AF_INET;
500+ bcopy((char *)&myip, (char *)&local.sin_addr,
501+ sizeof(struct in_addr));
502
503 if (cptr->fd < 0)
504 {
505***************
506*** 1305,1310 ****
507--- 1329,1341 ----
508 free(cptr);
509 return (struct sockaddr *)NULL;
510 }
511+ if (bind(cptr->fd, (struct sockaddr *)&local, sizeof(local))==-1)
512+ {
513+ report_error("error binding to local port for %s:%s", cptr);
514+ close(cptr->fd);
515+ free(cptr);
516+ return NULL;
517+ }
518
519 /* MY FIX -- jtrim@duorion.cair.du.edu (2/10/89) */
520
521***************
522*** 1311,1317 ****
523--- 1342,1350 ----
524 if (isdigit(*(aconf->host)) && (aconf->ipnum.s_addr == -1)) {
525 aconf->ipnum.s_addr = inet_addr(aconf->host);
526 } else if (aconf->ipnum.s_addr == -1) {
527+ alarm(10);
528 hp = gethostbyname(aconf->host);
529+ alarm(0);
530 if (hp == (struct hostent *)NULL)
531 {
532 close(cptr->fd);
533***************
534*** 1488,1494 ****
535 char *conf_name, *name;
536 int len;
537 {
538! struct hostent *hp;
539
540 if (gethostname(name,len) < 0)
541 return -1;
542--- 1521,1528 ----
543 char *conf_name, *name;
544 int len;
545 {
546! static char tmp[HOSTLEN];
547! struct hostent *hp;
548
549 if (gethostname(name,len) < 0)
550 return -1;
551***************
552*** 1502,1528 ****
553 * a CNAME record for conf_name pointing to hostname. If so accept
554 * conf_name as our name. meLazy
555 */
556! if (!BadPtr(conf_name) && mycmp(conf_name, name))
557 {
558! if (hp = gethostbyname(conf_name))
559! {
560! char tmp[HOSTLEN];
561! char *hname;
562! int i=0;
563
564! for (hname = hp->h_name; hname;
565! hname = hp->h_aliases[i++])
566! {
567! strncpy(tmp, hname, sizeof(tmp));
568! add_local_domain(tmp,sizeof(tmp)-strlen(tmp));
569! if (!mycmp(tmp, conf_name))
570! {
571! strncpy(name, conf_name, len);
572! break;
573! }
574! }
575! }
576 }
577!
578! return (0);
579 }
580--- 1536,1564 ----
581 * a CNAME record for conf_name pointing to hostname. If so accept
582 * conf_name as our name. meLazy
583 */
584! if (BadPtr(conf_name))
585! return -1;
586!
587! alarm(10);
588! if ((hp = gethostbyname(conf_name)) || (hp = gethostbyname(name)))
589 {
590! char *hname;
591! int i=0;
592
593! alarm(0);
594! for (hname = hp->h_name; hname; hname = hp->h_aliases[i++])
595! {
596! strncpy(tmp, hname, sizeof(tmp));
597! add_local_domain(tmp,sizeof(tmp)-strlen(tmp));
598! if (!mycmp(tmp, conf_name))
599! {
600! bcopy(hp->h_addr, (char *)&myip,
601! sizeof(struct in_addr));
602! strncpy(name, conf_name, len);
603! return 0;
604! }
605! }
606 }
607! alarm(0);
608! return -1;
609 }
610diff -cr irc2.7.2g/ircd/s_bsd.c irc2.7.2h/ircd/s_bsd.circ2.7.2g/ircd/s_conf.c irc2.7.2h/ircd/s_conf.c
611*** irc2.7.2g/ircd/s_conf.c Wed Aug 12 04:47:49 1992
612--- irc2.7.2h/ircd/s_conf.c Tue Mar 2 13:10:12 1993
613***************
614*** 57,62 ****
615--- 57,63 ----
616 #include <stdio.h>
617 #include "netdb.h"
618 #include <sys/socket.h>
619+ #include <fcntl.h>
620 #ifdef __hpux
621 #include "inet.h"
622 #endif
623***************
624*** 482,488 ****
625 int initconf(rehashing)
626 int rehashing;
627 {
628! FILE *fd;
629 char line[512], *tmp, c[80];
630 int ccount = 0, ncount = 0;
631 aConfItem *aconf;
632--- 483,489 ----
633 int initconf(rehashing)
634 int rehashing;
635 {
636! int fd;
637 char line[512], *tmp, c[80];
638 int ccount = 0, ncount = 0;
639 aConfItem *aconf;
640***************
641*** 489,497 ****
642 struct hostent *hp;
643
644 debug(DEBUG_DEBUG, "initconf(%d)", rehashing);
645! if (!(fd = fopen(configfile,"r")))
646 return(-1);
647! while (fgets(line,sizeof(line)-1,fd))
648 {
649 if (line[0] == '#' || line[0] == '\n' ||
650 line[0] == ' ' || line[0] == '\t')
651--- 490,498 ----
652 struct hostent *hp;
653
654 debug(DEBUG_DEBUG, "initconf(%d)", rehashing);
655! if ((fd = open(configfile, O_RDONLY)) == -1)
656 return(-1);
657! while (dgets(fd,line,sizeof(line)-1)>0)
658 {
659 if (line[0] == '#' || line[0] == '\n' ||
660 line[0] == ' ' || line[0] == '\t')
661***************
662*** 500,506 ****
663
664 if (tmp = (char *)index(line, '\n'))
665 *tmp = 0;
666! else while(fgets(c, sizeof(c), fd))
667 {
668 if (tmp = (char *)index(c, '\n'))
669 *tmp= 0;
670--- 501,507 ----
671
672 if (tmp = (char *)index(line, '\n'))
673 *tmp = 0;
674! else while(dgets(fd, c, sizeof(c))>0)
675 {
676 if (tmp = (char *)index(c, '\n'))
677 *tmp= 0;
678***************
679*** 694,700 ****
680 aconf->status, aconf->host, aconf->passwd,
681 aconf->name, aconf->port, Class(aconf));
682 }
683! fclose(fd);
684 check_class();
685 nextping = nextconnect = time(NULL);
686 return (0);
687--- 695,701 ----
688 aconf->status, aconf->host, aconf->passwd,
689 aconf->name, aconf->port, Class(aconf));
690 }
691! close(fd);
692 check_class();
693 nextping = nextconnect = time(NULL);
694 return (0);
695diff -cr irc2.7.2g/ircd/s_conf.c irc2.7.2h/ircd/s_conf.circ2.7.2g/ircd/s_misc.c irc2.7.2h/ircd/s_misc.c
696*** irc2.7.2g/ircd/s_misc.c Wed Aug 12 04:47:50 1992
697--- irc2.7.2h/ircd/s_misc.c Tue Mar 2 13:10:13 1993
698***************
699*** 31,36 ****
700--- 31,37 ----
701 #include "sys.h"
702 #include "numeric.h"
703 #include <sys/stat.h>
704+ #include <fcntl.h>
705 #ifdef HPUX
706 # include <sys/syscall.h>
707 # define getrusage(a,b) syscall(SYS_GETRUSAGE, a, b)
708***************
709*** 297,304 ****
710 sptr->user->username, sptr->user->host);
711 # else
712 {
713! FILE *userlogfile;
714! struct stat stbuf;
715
716 /*
717 * This conditional makes the logfile active only after
718--- 298,305 ----
719 sptr->user->username, sptr->user->host);
720 # else
721 {
722! int userlogfile;
723! char linebuf[160];
724
725 /*
726 * This conditional makes the logfile active only after
727***************
728*** 310,325 ****
729 * file in 3 seconds. -avalon (curtesy of wumpus)
730 */
731 alarm(3);
732! if (IsPerson(sptr) && !stat(FNAME_USERLOG, &stbuf) &&
733! (userlogfile = fopen(FNAME_USERLOG, "a")))
734 {
735 alarm(0);
736! fprintf(userlogfile, "%s (%3d:%02d:%02d): %s@%s\n",
737 myctime(sptr->firsttime),
738 on_for / 3600, (on_for % 3600)/60,
739 on_for % 60,
740 sptr->user->username, sptr->user->host);
741! fclose(userlogfile);
742 }
743 alarm(0);
744 /* Modification by stealth@caen.engin.umich.edu */
745--- 311,327 ----
746 * file in 3 seconds. -avalon (curtesy of wumpus)
747 */
748 alarm(3);
749! if (IsPerson(sptr) &&
750! (userlogfile = open(FNAME_USERLOG, O_WRONLY|O_APPEND)))
751 {
752 alarm(0);
753! sprintf(linebuf, "%s (%3d:%02d:%02d): %s@%s\n",
754 myctime(sptr->firsttime),
755 on_for / 3600, (on_for % 3600)/60,
756 on_for % 60,
757 sptr->user->username, sptr->user->host);
758! write(userlogfile, linebuf, strlen(linebuf));
759! close(userlogfile);
760 }
761 alarm(0);
762 /* Modification by stealth@caen.engin.umich.edu */
763diff -cr irc2.7.2g/ircd/s_misc.c irc2.7.2h/ircd/s_misc.circ2.7.2g/ircd/s_msg.c irc2.7.2h/ircd/s_msg.c
764*** irc2.7.2g/ircd/s_msg.c Wed Aug 12 04:47:51 1992
765--- irc2.7.2h/ircd/s_msg.c Wed Mar 24 13:29:04 1993
766***************
767*** 35,40 ****
768--- 35,41 ----
769 #include "msg.h"
770 #include "channel.h"
771 #include <sys/stat.h>
772+ #include <fcntl.h>
773 #include <stdio.h>
774 #include <utmp.h>
775 #ifdef IDENT
776***************
777*** 605,611 ****
778 sendto_ops("Nick change collision from %s to %s(%s <- %s)",
779 sptr->name, acptr->name, acptr->from->name,
780 get_client_name(cptr, FALSE));
781! sendto_serv_butone(cptr, /* KILL old from outgoing servers */
782 ":%s KILL %s :%s (%s(%s) <- %s)",
783 me.name, sptr->name,
784 me.name,
785--- 606,612 ----
786 sendto_ops("Nick change collision from %s to %s(%s <- %s)",
787 sptr->name, acptr->name, acptr->from->name,
788 get_client_name(cptr, FALSE));
789! sendto_serv_butone(NULL, /* KILL old from outgoing servers */
790 ":%s KILL %s :%s (%s(%s) <- %s)",
791 me.name, sptr->name,
792 me.name,
793***************
794*** 612,618 ****
795 acptr->from->name,
796 acptr->name,
797 get_client_name(cptr, FALSE));
798! sendto_one(cptr, /* Kill new from incoming link */
799 ":%s KILL %s :%s (%s <- %s(%s))",
800 me.name, acptr->name,
801 me.name,
802--- 613,619 ----
803 acptr->from->name,
804 acptr->name,
805 get_client_name(cptr, FALSE));
806! sendto_serv_butone(NULL, /* Kill new from incoming link */
807 ":%s KILL %s :%s (%s <- %s(%s))",
808 me.name, acptr->name,
809 me.name,
810***************
811*** 3203,3209 ****
812 int parc;
813 char *parv[];
814 {
815! FILE *fptr;
816 char line[80], *tmp;
817
818 if (check_registered(sptr))
819--- 3204,3210 ----
820 int parc;
821 char *parv[];
822 {
823! int fd;
824 char line[80], *tmp;
825
826 if (check_registered(sptr))
827***************
828*** 3221,3227 ****
829 * 3 seconds. -avalon (curtesy of wumpus)
830 */
831 alarm(3);
832! if (!(fptr = fopen(MOTD, "r")))
833 {
834 alarm(0);
835 sendto_one(sptr,
836--- 3222,3228 ----
837 * 3 seconds. -avalon (curtesy of wumpus)
838 */
839 alarm(3);
840! if (!(fd = open(MOTD, O_RDONLY)))
841 {
842 alarm(0);
843 sendto_one(sptr,
844***************
845*** 3232,3238 ****
846 alarm(0);
847 sendto_one(sptr, ":%s NOTICE %s :MOTD - %s Message of the Day - ",
848 me.name, parv[0], me.name);
849! while (fgets(line, 80, fptr))
850 {
851 if (tmp = (char *)index(line,'\n'))
852 *tmp = '\0';
853--- 3233,3239 ----
854 alarm(0);
855 sendto_one(sptr, ":%s NOTICE %s :MOTD - %s Message of the Day - ",
856 me.name, parv[0], me.name);
857! while (dgets(fd, line, sizeof(line) - 1))
858 {
859 if (tmp = (char *)index(line,'\n'))
860 *tmp = '\0';
861***************
862*** 3243,3249 ****
863 }
864 sendto_one(sptr, ":%s NOTICE %s :* End of /MOTD command.",
865 me.name, parv[0]);
866! fclose(fptr);
867 #endif
868 return 0;
869 }
870--- 3244,3250 ----
871 }
872 sendto_one(sptr, ":%s NOTICE %s :* End of /MOTD command.",
873 me.name, parv[0]);
874! close(fd);
875 #endif
876 return 0;
877 }
878diff -cr irc2.7.2g/Makefile irc2.7.2h/Makefile
879*** irc2.7.2g/Makefile Wed Aug 12 04:47:51 1992
880--- irc2.7.2h/Makefile Wed Mar 24 13:29:04 1993
881***************
882*** 88,94 ****
883 cd common;\
884 ${MAKE} build;\
885 cd ../ircd;\
886! ${MAKE} bindircd;\
887
888 authbind:
889 echo "Building common";\
890--- 88,94 ----
891 cd common;\
892 ${MAKE} build;\
893 cd ../ircd;\
894! ${MAKE} bindircd;
895
896 authbind:
897 echo "Building common";\
898***************
899*** 95,101 ****
900 cd common;\
901 ${MAKE} build;\
902 cd ../ircd;\
903! ${MAKE} authbind;\
904
905 clean:
906 ${RM} -f *~ #* core
907--- 95,101 ----
908 cd common;\
909 ${MAKE} build;\
910 cd ../ircd;\
911! ${MAKE} authbind;
912
913 clean:
914 ${RM} -f *~ #* core