]> jfr.im git - irc.git/blame - software/RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2001/000039.html
rename -> *.git
[irc.git] / software / RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2001 / 000039.html
CommitLineData
3bd189cb
JR
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2<HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding] svcs5
5 </TITLE>
6 <LINK REL="Index" HREF="index.html" >
7 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20svcs5&In-Reply-To=">
8 <META NAME="robots" CONTENT="index,nofollow">
9 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
10 <LINK REL="Previous" HREF="000032.html">
11 <LINK REL="Next" HREF="000041.html">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>[IRCServices Coding] svcs5</H1>
15 <B>v13 at priest.com</B>
16 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20svcs5&In-Reply-To="
17 TITLE="[IRCServices Coding] svcs5">v13 at priest.com
18 </A><BR>
19 <I>Sun Dec 16 17:09:35 PST 2001</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="000032.html">[IRCServices Coding] svcs5
22</A></li>
23 <LI>Next message: <A HREF="000041.html">[IRCServices Coding] Services 5 having problems to shut down
24</A></li>
25 <LI> <B>Messages sorted by:</B>
26 <a href="date.html#39">[ date ]</a>
27 <a href="thread.html#39">[ thread ]</a>
28 <a href="subject.html#39">[ subject ]</a>
29 <a href="author.html#39">[ author ]</a>
30 </LI>
31 </UL>
32 <HR>
33<!--beginarticle-->
34<PRE>I don't understand this completely, but i get coredumps when
35doing /msg chanserv levels #chan set ignore 6
36
37it seems that there is something wrong...
38
39in chanserv/util.c:
40
41ChannelInfo *makechan(const char *chan)
42{
43 ChannelInfo *ci;
44
45 ci = scalloc(sizeof(ChannelInfo), 1);
46 strscpy(ci-&gt;name, chan, CHANMAX);
47 ci-&gt;time_registered = time(NULL);
48&gt;&gt;&gt;&gt;&gt;<i> reset_levels(ci, 0); &lt;&lt;&lt;&lt;&lt;&lt;
49</I> return add_channelinfo(ci);
50}
51
52i bellieve this should be:
53reset_levels(ci,1);
54
55
56also in chanserv/access.c:
57
58EXPORT_FUNC(reset_levels)
59void reset_levels(ChannelInfo *ci, int set)
60{
61 int i;
62
63&gt;&gt;&gt;&gt;&gt;<i> free(ci-&gt;levels); &lt;&lt;&lt;&lt;&lt;
64</I> if (set) {
65 ci-&gt;levels = scalloc(CA_SIZE, sizeof(*ci-&gt;levels));
66 for (i = 0; i &lt; CA_SIZE; i++)
67 ci-&gt;levels[i] = def_levels[i];
68 } else {
69 ci-&gt;levels = NULL;
70 }
71}
72
73this may try to free something that is not malloced (if i get this right)
74when it is called from makechan() (free(NULL) works under glibc, but i don't
75know how portable/standard it is)
76
77
78finaly in chanserv/access-levels.c, in do_levels():
79
80 for (i = 0; levelinfo[i].what &gt;= 0; i++) {
81 if (stricmp(levelinfo[i].name, what) == 0) {
82 if (ci-&gt;levels)
83 reset_levels(ci, 1);
84&gt;&gt;&gt;&gt;&gt;<i> ci-&gt;levels[levelinfo[i].what] = level; &lt;&lt;&lt;&lt;&lt;&lt;
85</I> notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
86 levelinfo[i].name, chan, level);
87 put_channelinfo(ci);
88 return;
89 }
90 }
91
92the marked line is where i get the coredump...
93it doesn't make any sense..
94if ci-&gt;levels is NULL, then reset_levels is not called...
95so it remains NULL and then ci-&gt;levels[] is used
96
97(from gdb) (not wrapped)
98
99(gdb) bt
100#0 do_levels (u=0x814cf0c) at access-levels.c:324
101#1 0x0804df4c in run_cmd (service=0x8144bd4 &quot;ChanServ&quot;, u=0x814cf0c, id=0x81449c4, cmd=0xbffff5f2 &quot;levels&quot;) at commands.c:158
102#2 0x401a0070 in chanserv (source=0xbffff820 &quot;V13&quot;, target=0xbffff5e8 &quot;chanserv&quot;, buf=0xbffff5f2 &quot;levels&quot;) at main.c:226
103#3 0x08054cba in call_callback_5 (module=0x0, id=25, arg1=0xbffff820, arg2=0xbffff5e8, arg3=0xbffff5f2, arg4=0x0, arg5=0x0) at modules.c:605
104#4 0x08052f3f in m_privmsg (source=0xbffff820 &quot;V13&quot;, ac=2, av=0x814cd8c) at messages.c:169
105#5 0x08055260 in process () at process.c:131
106#6 0x08056395 in check_sockets () at sockets.c:362
107#7 0x080526cc in main (ac=3, av=0xbffffa54, envp=0xbffffa64) at main.c:377
108#8 0x4004d823 in __libc_start_main () from /lib/libc.so.6
109(gdb) l access-levels.c:324
110319 }
111320 for (i = 0; levelinfo[i].what &gt;= 0; i++) {
112321 if (stricmp(levelinfo[i].name, what) == 0) {
113322 if (ci-&gt;levels)
114323 reset_levels(ci, 1);
115324 ci-&gt;levels[levelinfo[i].what] = level;
116325 notice_lang(s_ChanServ, u, CHAN_LEVELS_CHANGED,
117326 levelinfo[i].name, chan, level);
118327 put_channelinfo(ci);
119328 return;
120(gdb) p i
121$1 = 224
122
123
124&lt;&lt;V13&gt;&gt;
125
126</PRE>
127
128<!--endarticle-->
129 <HR>
130 <P><UL>
131 <!--threads-->
132 <LI>Previous message: <A HREF="000032.html">[IRCServices Coding] svcs5
133</A></li>
134 <LI>Next message: <A HREF="000041.html">[IRCServices Coding] Services 5 having problems to shut down
135</A></li>
136 <LI> <B>Messages sorted by:</B>
137 <a href="date.html#39">[ date ]</a>
138 <a href="thread.html#39">[ thread ]</a>
139 <a href="subject.html#39">[ subject ]</a>
140 <a href="author.html#39">[ author ]</a>
141 </LI>
142 </UL>
143
144</body></html>