/[cvs]/eggdrop1.9/src/userrec.c
ViewVC logotype

Contents of /eggdrop1.9/src/userrec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.48 - (show annotations) (download) (as text)
Sun May 5 16:40:39 2002 UTC (17 years, 8 months ago) by tothwolf
Branch: MAIN
Changes since 1.47: +8 -5 lines
File MIME type: text/x-chdr
Grafted GPL header onto newer files.
Storing rcsid in binary files now.

1 /*
2 * userrec.c --
3 *
4 * add_q() del_q() str2flags() flags2str() str2chflags() chflags2str()
5 * a bunch of functions to find and change user records
6 * change and check user (and channel-specific) flags
7 */
8 /*
9 * Copyright (C) 1997 Robey Pointer
10 * Copyright (C) 1999, 2000, 2001, 2002 Eggheads Development Team
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27 #ifndef lint
28 static const char rcsid[] = "$Id$";
29 #endif
30
31 #include <sys/stat.h>
32 #include "main.h"
33 #include "users.h"
34 #include "chan.h"
35 #include "modules.h"
36 #include "tandem.h"
37 #include "logfile.h"
38 #include "modules.h" /* encrypt_pass */
39 #include "cmdt.h" /* cmd_t */
40 #include "chanprog.h" /* clear_chanlist, set_chanlist */
41 #include "dccutil.h" /* shareout, chanout_but */
42 #include "irccmp.h" /* irccmp */
43 #include "tclhash.h" /* check_tcl_nkch */
44 #include "match.h" /* wild_match */
45 #include "userrec.h" /* prototypes */
46
47 extern struct dcc_t *dcc;
48 extern struct chanset_t *chanset;
49 extern int default_flags, default_uflags, quiet_save,
50 dcc_total, share_greet;
51 extern char userfile[], ver[], botnetnick[];
52 extern time_t now;
53
54 #ifndef MAKING_MODS
55 extern struct dcc_table DCC_CHAT, DCC_BOT;
56 #endif /* MAKING_MODS */
57
58 int noshare = 1; /* don't send out to sharebots */
59 int sort_users = 0; /* sort the userlist when saving */
60 struct userrec *userlist = NULL; /* user records are stored here */
61 struct userrec *lastuser = NULL; /* last accessed user record */
62 maskrec *global_bans = NULL,
63 *global_exempts = NULL,
64 *global_invites = NULL;
65 struct igrec *global_ign = NULL;
66 int cache_hit = 0,
67 cache_miss = 0; /* temporary cache accounting */
68 int strict_host = 0;
69 int userfile_perm = 0600; /* Userfile permissions,
70 default rw------- */
71
72 int count_users(struct userrec *bu)
73 {
74 int tot = 0;
75 struct userrec *u ;
76
77 for (u = bu; u; u = u->next)
78 tot++;
79 return tot;
80 }
81
82 /* Convert "nick!~user@host", "nick!+user@host" and "nick!-user@host"
83 * to "nick!user@host" if necessary. (drummer)
84 */
85 char *fixfrom(char *s)
86 {
87 char *p;
88 static char buf[512];
89
90 if (s == NULL)
91 return NULL;
92 strlcpy(buf, s, sizeof buf);
93 if (strict_host)
94 return buf;
95 if ((p = strchr(buf, '!')))
96 p++;
97 else
98 p = s; /* Sometimes we get passed just a
99 * user@host here... */
100 /* These are ludicrous. */
101 if (strchr("~+-^=", *p) && (p[1] != '@')) /* added check for @ - drummer */
102 strcpy(p, p + 1);
103 /* Bug was: n!~@host -> n!@host now: n!~@host */
104 return buf;
105 }
106
107 struct userrec *check_dcclist_hand(char *handle)
108 {
109 int i;
110
111 for (i = 0; i < dcc_total; i++)
112 if (dcc[i].type && !strcasecmp(dcc[i].nick, handle))
113 return dcc[i].user;
114 return NULL;
115 }
116
117 struct userrec *get_user_by_handle(struct userrec *bu, char *handle)
118 {
119 struct userrec *u, *ret;
120
121 if (!handle)
122 return NULL;
123 /* FIXME: This should be done outside of this function. */
124 /* handle might and should be const */
125 rmspace(handle);
126 if (!handle[0] || (handle[0] == '*'))
127 return NULL;
128 if (bu == userlist) {
129 if (lastuser && !strcasecmp(lastuser->handle, handle)) {
130 cache_hit++;
131 return lastuser;
132 }
133 ret = check_dcclist_hand(handle);
134 if (ret) {
135 cache_hit++;
136 return ret;
137 }
138 ret = check_chanlist_hand(handle);
139 if (ret) {
140 cache_hit++;
141 return ret;
142 }
143 cache_miss++;
144 }
145 for (u = bu; u; u = u->next)
146 if (!strcasecmp(u->handle, handle)) {
147 if (bu == userlist)
148 lastuser = u;
149 return u;
150 }
151 return NULL;
152 }
153
154 /* Fix capitalization, etc
155 */
156 void correct_handle(char *handle)
157 {
158 struct userrec *u;
159
160 u = get_user_by_handle(userlist, handle);
161 if (u == NULL)
162 return;
163 strcpy(handle, u->handle);
164 }
165
166 /* This will be usefull in a lot of places, much more code re-use so we
167 * endup with a smaller executable bot. <cybah>
168 */
169 void clear_masks(maskrec *m)
170 {
171 maskrec *temp = NULL;
172
173 for (; m; m = temp) {
174 temp = m->next;
175 if (m->mask)
176 free(m->mask);
177 if (m->user)
178 free(m->user);
179 if (m->desc)
180 free(m->desc);
181 free(m);
182 }
183 }
184
185 void clear_userlist(struct userrec *bu)
186 {
187 struct userrec *u, *v;
188 int i;
189
190 for (u = bu; u; u = v) {
191 v = u->next;
192 freeuser(u);
193 }
194 if (userlist == bu) {
195 struct chanset_t *cst;
196
197 for (i = 0; i < dcc_total; i++)
198 dcc[i].user = NULL;
199 clear_chanlist();
200 lastuser = NULL;
201
202 while (global_ign)
203 delignore(global_ign->igmask);
204
205 clear_masks(global_bans);
206 clear_masks(global_exempts);
207 clear_masks(global_invites);
208 global_exempts = global_invites = global_bans = NULL;
209
210 for (cst = chanset; cst; cst = cst->next) {
211 clear_masks(cst->bans);
212 clear_masks(cst->exempts);
213 clear_masks(cst->invites);
214
215 cst->bans = cst->exempts = cst->invites = NULL;
216 }
217 }
218 /* Remember to set your userlist to NULL after calling this */
219 }
220
221 /* Find CLOSEST host match
222 * (if "*!*@*" and "*!*@*clemson.edu" both match, use the latter!)
223 *
224 * Checks the chanlist first, to possibly avoid needless search.
225 */
226 struct userrec *get_user_by_host(char *host)
227 {
228 struct userrec *u, *ret;
229 struct list_type *q;
230 int cnt, i;
231 char host2[UHOSTLEN];
232
233 if (host == NULL)
234 return NULL;
235 rmspace(host);
236 if (!host[0])
237 return NULL;
238 ret = check_chanlist(host);
239 cnt = 0;
240 if (ret != NULL) {
241 cache_hit++;
242 return ret;
243 }
244 cache_miss++;
245 strlcpy(host2, host, sizeof host2);
246 host = fixfrom(host);
247 for (u = userlist; u; u = u->next) {
248 q = get_user(&USERENTRY_HOSTS, u);
249 for (; q; q = q->next) {
250 i = wild_match(q->extra, host);
251 if (i > cnt) {
252 ret = u;
253 cnt = i;
254 }
255 }
256 }
257 if (ret != NULL) {
258 lastuser = ret;
259 set_chanlist(host2, ret);
260 }
261 return ret;
262 }
263
264 /* use fixfrom() or dont? (drummer)
265 */
266 struct userrec *get_user_by_equal_host(char *host)
267 {
268 struct userrec *u;
269 struct list_type *q;
270
271 for (u = userlist; u; u = u->next)
272 for (q = get_user(&USERENTRY_HOSTS, u); q; q = q->next)
273 if (!irccmp(q->extra, host))
274 return u;
275 return NULL;
276 }
277
278 /* Try: pass_match_by_host("-",host)
279 * will return 1 if no password is set for that host
280 */
281 int u_pass_match(struct userrec *u, char *pass)
282 {
283 char *cmp, new[32];
284
285 if (!u)
286 return 0;
287 cmp = get_user(&USERENTRY_PASS, u);
288 if (!cmp && (!pass[0] || (pass[0] == '-')))
289 return 1;
290 if (!cmp || !pass || !pass[0] || (pass[0] == '-'))
291 return 0;
292 if (u->flags & USER_BOT) {
293 if (!strcmp(cmp, pass))
294 return 1;
295 } else {
296 if (strlen(pass) > 15)
297 pass[15] = 0;
298 encrypt_pass(pass, new);
299 if (!strcmp(cmp, new))
300 return 1;
301 }
302 return 0;
303 }
304
305 int write_user(struct userrec *u, FILE * f, int idx)
306 {
307 char s[181];
308 struct chanuserrec *ch;
309 struct chanset_t *cst;
310 struct user_entry *ue;
311 struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
312
313 fr.global = u->flags;
314 fr.udef_global = u->flags_udef;
315 build_flags(s, &fr, NULL);
316 if (fprintf(f, "%-10s - %-24s\n", u->handle, s) == EOF)
317 return 0;
318 for (ch = u->chanrec; ch; ch = ch->next) {
319 cst = findchan_by_dname(ch->channel);
320 if (cst && ((idx < 0) || channel_shared(cst))) {
321 if (idx >= 0) {
322 fr.match = (FR_CHAN | FR_BOT);
323 get_user_flagrec(dcc[idx].user, &fr, ch->channel);
324 } else
325 fr.chan = BOT_SHARE;
326 if ((fr.chan & BOT_SHARE) || (fr.bot & BOT_GLOBAL)) {
327 fr.match = FR_CHAN;
328 fr.chan = ch->flags;
329 fr.udef_chan = ch->flags_udef;
330 build_flags(s, &fr, NULL);
331 if (fprintf(f, "! %-20s %lu %-10s %s\n", ch->channel, ch->laston, s,
332 (((idx < 0) || share_greet) && ch->info) ? ch->info
333 : "") == EOF)
334 return 0;
335 }
336 }
337 }
338 for (ue = u->entries; ue; ue = ue->next) {
339 if (ue->name) {
340 struct list_type *lt;
341
342 for (lt = ue->u.list; lt; lt = lt->next)
343 if (fprintf(f, "--%s %s\n", ue->name, lt->extra) == EOF)
344 return 0;
345 } else {
346 if (!ue->type->write_userfile(f, u, ue))
347 return 0;
348 }
349 }
350 return 1;
351 }
352
353 int sort_compare(struct userrec *a, struct userrec *b)
354 {
355 /* Order by flags, then alphabetically
356 * first bots: +h / +a / +l / other bots
357 * then users: +n / +m / +o / other users
358 * return true if (a > b)
359 */
360 if (a->flags & b->flags & USER_BOT) {
361 if (~bot_flags(a) & bot_flags(b) & BOT_HUB)
362 return 1;
363 if (bot_flags(a) & ~bot_flags(b) & BOT_HUB)
364 return 0;
365 if (~bot_flags(a) & bot_flags(b) & BOT_ALT)
366 return 1;
367 if (bot_flags(a) & ~bot_flags(b) & BOT_ALT)
368 return 0;
369 if (~bot_flags(a) & bot_flags(b) & BOT_LEAF)
370 return 1;
371 if (bot_flags(a) & ~bot_flags(b) & BOT_LEAF)
372 return 0;
373 } else {
374 if (~a->flags & b->flags & USER_BOT)
375 return 1;
376 if (a->flags & ~b->flags & USER_BOT)
377 return 0;
378 if (~a->flags & b->flags & USER_OWNER)
379 return 1;
380 if (a->flags & ~b->flags & USER_OWNER)
381 return 0;
382 if (~a->flags & b->flags & USER_MASTER)
383 return 1;
384 if (a->flags & ~b->flags & USER_MASTER)
385 return 0;
386 if (~a->flags & b->flags & USER_OP)
387 return 1;
388 if (a->flags & ~b->flags & USER_OP)
389 return 0;
390 }
391 return (strcasecmp(a->handle, b->handle) > 0);
392 }
393
394 void sort_userlist()
395 {
396 int again;
397 struct userrec *last, *p, *c, *n;
398
399 again = 1;
400 last = NULL;
401 while ((userlist != last) && (again)) {
402 p = NULL;
403 c = userlist;
404 n = c->next;
405 again = 0;
406 while (n != last) {
407 if (sort_compare(c, n)) {
408 again = 1;
409 c->next = n->next;
410 n->next = c;
411 if (p == NULL)
412 userlist = n;
413 else
414 p->next = n;
415 }
416 p = c;
417 c = n;
418 n = n->next;
419 }
420 last = c;
421 }
422 }
423
424 /* Rewrite the entire user file. Call USERFILE hook as well, probably
425 * causing the channel file to be rewritten as well.
426 */
427 void write_userfile(int idx)
428 {
429 FILE *f;
430 char *new_userfile;
431 char s1[81];
432 time_t tt;
433 struct userrec *u;
434 int ok;
435
436 if (userlist == NULL)
437 return; /* No point in saving userfile */
438
439 new_userfile = malloc(strlen(userfile) + 5);
440 sprintf(new_userfile, "%s~new", userfile);
441
442 f = fopen(new_userfile, "w");
443 chmod(new_userfile, userfile_perm);
444 if (f == NULL) {
445 putlog(LOG_MISC, "*", _("ERROR writing user file."));
446 free(new_userfile);
447 return;
448 }
449 if (!quiet_save)
450 putlog(LOG_MISC, "*", _("Writing user file..."));
451 if (sort_users)
452 sort_userlist();
453 tt = now;
454 strcpy(s1, ctime(&tt));
455 fprintf(f, "#4v: %s -- %s -- written %s", ver, botnetnick, s1);
456 ok = 1;
457 for (u = userlist; u && ok; u = u->next)
458 ok = write_user(u, f, idx);
459 if (!ok || fflush(f)) {
460 putlog(LOG_MISC, "*", "%s (%s)", _("ERROR writing user file."), strerror(ferror(f)));
461 fclose(f);
462 free(new_userfile);
463 return;
464 }
465 fclose(f);
466 call_hook(HOOK_USERFILE);
467 movefile(new_userfile, userfile);
468 free(new_userfile);
469 }
470
471 int change_handle(struct userrec *u, char *newh)
472 {
473 int i;
474 char s[HANDLEN + 1];
475
476 if (!u)
477 return 0;
478 /* Nothing that will confuse the userfile */
479 if (!newh[1] && strchr(BADHANDCHARS, newh[0]))
480 return 0;
481 check_tcl_nkch(u->handle, newh);
482 /* Yes, even send bot nick changes now: */
483 if (!noshare && !(u->flags & USER_UNSHARED))
484 shareout(NULL, "h %s %s\n", u->handle, newh);
485 strlcpy(s, u->handle, sizeof s);
486 strlcpy(u->handle, newh, sizeof u->handle);
487 for (i = 0; i < dcc_total; i++)
488 if (dcc[i].type && dcc[i].type != &DCC_BOT && !strcasecmp(dcc[i].nick, s)) {
489 strlcpy(dcc[i].nick, newh, sizeof dcc[i].nick);
490 if (dcc[i].type == &DCC_CHAT && dcc[i].u.chat->channel >= 0) {
491 chanout_but(-1, dcc[i].u.chat->channel,
492 "*** Handle change: %s -> %s\n", s, newh);
493 if (dcc[i].u.chat->channel < 100000)
494 botnet_send_nkch(i, s);
495 }
496 }
497 return 1;
498 }
499
500 extern int noxtra;
501
502 struct userrec *adduser(struct userrec *bu, char *handle, char *host,
503 char *pass, int flags)
504 {
505 struct userrec *u, *x;
506 struct xtra_key *xk;
507 int oldshare = noshare;
508
509 noshare = 1;
510 u = (struct userrec *) malloc(sizeof(struct userrec));
511
512 /* u->next=bu; bu=u; */
513 strlcpy(u->handle, handle, sizeof u->handle);
514 u->next = NULL;
515 u->chanrec = NULL;
516 u->entries = NULL;
517 if (flags != USER_DEFAULT) { /* drummer */
518 u->flags = flags;
519 u->flags_udef = 0;
520 } else {
521 u->flags = default_flags;
522 u->flags_udef = default_uflags;
523 }
524 set_user(&USERENTRY_PASS, u, pass);
525 if (!noxtra) {
526 char *now2;
527 xk = malloc(sizeof(struct xtra_key));
528 xk->key = strdup("created");
529 now2 = malloc(15);
530 sprintf(now2, "%lu", now);
531 xk->data = malloc(strlen(now2) +1);
532 sprintf(xk->data, "%lu", now);
533 set_user(&USERENTRY_XTRA, u, xk);
534 free(now2);
535 }
536 /* Strip out commas -- they're illegal */
537 if (host && host[0]) {
538 char *p;
539
540 /* About this fixfrom():
541 * We should use this fixfrom before every call of adduser()
542 * but its much easier to use here... (drummer)
543 * Only use it if we have a host :) (dw)
544 */
545 host = fixfrom(host);
546 p = strchr(host, ',');
547
548 while (p != NULL) {
549 *p = '?';
550 p = strchr(host, ',');
551 }
552 set_user(&USERENTRY_HOSTS, u, host);
553 } else
554 set_user(&USERENTRY_HOSTS, u, "none");
555 if (bu == userlist)
556 clear_chanlist();
557 noshare = oldshare;
558 if ((!noshare) && (handle[0] != '*') && (!(flags & USER_UNSHARED)) &&
559 (bu == userlist)) {
560 struct flag_record fr = {FR_GLOBAL, 0, 0, 0, 0, 0};
561 char x[100];
562
563 fr.global = u->flags;
564 fr.udef_global = u->flags_udef;
565 build_flags(x, &fr, 0);
566 shareout(NULL, "n %s %s %s %s\n", handle, host && host[0] ? host : "none",
567 pass, x);
568 }
569 if (bu == NULL)
570 bu = u;
571 else {
572 if ((bu == userlist) && (lastuser != NULL))
573 x = lastuser;
574 else
575 x = bu;
576 while (x->next != NULL)
577 x = x->next;
578 x->next = u;
579 if (bu == userlist)
580 lastuser = u;
581 }
582 return bu;
583 }
584
585 void freeuser(struct userrec *u)
586 {
587 struct user_entry *ue, *ut;
588 struct chanuserrec *ch, *z;
589
590 if (u == NULL)
591 return;
592 ch = u->chanrec;
593 while (ch) {
594 z = ch;
595 ch = ch->next;
596 if (z->info != NULL)
597 free(z->info);
598 free(z);
599 }
600 u->chanrec = NULL;
601 for (ue = u->entries; ue; ue = ut) {
602 ut = ue->next;
603 if (ue->name) {
604 struct list_type *lt, *ltt;
605
606 for (lt = ue->u.list; lt; lt = ltt) {
607 ltt = lt->next;
608 free(lt->extra);
609 free(lt);
610 }
611 free(ue->name);
612 free(ue);
613 } else {
614 ue->type->kill(ue);
615 }
616 }
617 free(u);
618 }
619
620 int deluser(char *handle)
621 {
622 struct userrec *u = userlist, *prev = NULL;
623 int fnd = 0;
624
625 while ((u != NULL) && (!fnd)) {
626 if (!strcasecmp(u->handle, handle))
627 fnd = 1;
628 else {
629 prev = u;
630 u = u->next;
631 }
632 }
633 if (!fnd)
634 return 0;
635 if (prev == NULL)
636 userlist = u->next;
637 else
638 prev->next = u->next;
639 if (!noshare && (handle[0] != '*') && !(u->flags & USER_UNSHARED))
640 shareout(NULL, "k %s\n", handle);
641 for (fnd = 0; fnd < dcc_total; fnd++)
642 if (dcc[fnd].type && dcc[fnd].user == u)
643 dcc[fnd].user = 0; /* Clear any dcc users for this entry,
644 * null is safe-ish */
645 clear_chanlist();
646 freeuser(u);
647 lastuser = NULL;
648 return 1;
649 }
650
651 int delhost_by_handle(char *handle, char *host)
652 {
653 struct userrec *u;
654 struct list_type *q, *qnext, *qprev;
655 struct user_entry *e = NULL;
656 int i = 0;
657
658 u = get_user_by_handle(userlist, handle);
659 if (!u)
660 return 0;
661 q = get_user(&USERENTRY_HOSTS, u);
662 qprev = q;
663 if (q) {
664 if (!irccmp(q->extra, host)) {
665 e = find_user_entry(&USERENTRY_HOSTS, u);
666 e->u.extra = q->next;
667 free(q->extra);
668 free(q);
669 i++;
670 qprev = NULL;
671 q = e->u.extra;
672 } else
673 q = q->next;
674 while (q) {
675 qnext = q->next;
676 if (!irccmp(q->extra, host)) {
677 if (qprev)
678 qprev->next = q->next;
679 else if (e) {
680 e->u.extra = q->next;
681 qprev = NULL;
682 }
683 free(q->extra);
684 free(q);
685 i++;
686 } else
687 qprev = q;
688 q = qnext;
689 }
690 }
691 if (!qprev)
692 set_user(&USERENTRY_HOSTS, u, "none");
693 if (!noshare && i && !(u->flags & USER_UNSHARED))
694 shareout(NULL, "-h %s %s\n", handle, host);
695 clear_chanlist();
696 return i;
697 }
698
699 void addhost_by_handle(char *handle, char *host)
700 {
701 struct userrec *u = get_user_by_handle(userlist, handle);
702
703 set_user(&USERENTRY_HOSTS, u, host);
704 /* u will be cached, so really no overhead, even tho this looks dumb: */
705 if ((!noshare) && !(u->flags & USER_UNSHARED)) {
706 if (u->flags & USER_BOT)
707 shareout(NULL, "+bh %s %s\n", handle, host);
708 else
709 shareout(NULL, "+h %s %s\n", handle, host);
710 }
711 clear_chanlist();
712 }
713
714 void touch_laston(struct userrec *u, char *where, time_t timeval)
715 {
716 if (!u)
717 return;
718 if (timeval > 1) {
719 struct laston_info *li =
720 (struct laston_info *) get_user(&USERENTRY_LASTON, u);
721
722 if (!li)
723 li = malloc(sizeof(struct laston_info));
724
725 else if (li->lastonplace)
726 free(li->lastonplace);
727 li->laston = timeval;
728 if (where)
729 li->lastonplace = strdup(where);
730 else
731 li->lastonplace = NULL;
732 set_user(&USERENTRY_LASTON, u, li);
733 } else if (timeval == 1) {
734 set_user(&USERENTRY_LASTON, u, 0);
735 }
736 }
737
738 /* Go through all channel records and try to find a matching
739 * nick. Will return the user's user record if that is known
740 * to the bot. (Fabian)
741 *
742 * Warning: This is unreliable by concept!
743 */
744 struct userrec *get_user_by_nick(char *nick)
745 {
746 struct chanset_t *chan;
747 memberlist *m;
748
749 for (chan = chanset; chan; chan = chan->next) {
750 for (m = chan->channel.member; m && m->nick[0] ;m = m->next) {
751 if (!irccmp(nick, m->nick)) {
752 char word[512];
753
754 snprintf(word, sizeof word, "%s!%s", m->nick, m->userhost);
755 /* No need to check the return value ourself */
756 return get_user_by_host(word);;
757 }
758 }
759 }
760 /* Sorry, no matches */
761 return NULL;
762 }
763
764 void user_del_chan(char *dname)
765 {
766 struct chanuserrec *ch, *och;
767 struct userrec *u;
768
769 for (u = userlist; u; u = u->next) {
770 ch = u->chanrec;
771 och = NULL;
772 while (ch) {
773 if (!irccmp(dname, ch->channel)) {
774 if (och)
775 och->next = ch->next;
776 else
777 u->chanrec = ch->next;
778
779 if (ch->info)
780 free(ch->info);
781 free(ch);
782 break;
783 }
784 och = ch;
785 ch = ch->next;
786 }
787 }
788 }

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23