]> jfr.im git - irc.git/blob - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices-coding/2003/002020.html
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices-coding / 2003 / 002020.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices Coding] Associating NickGroupInfo with two nicks
5 at once
6 </TITLE>
7 <LINK REL="Index" HREF="index.html" >
8 <LINK REL="made" HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%09Associating%20NickGroupInfo%20with%20two%20nicks%0A%09at%20once&In-Reply-To=">
9 <META NAME="robots" CONTENT="index,nofollow">
10 <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
11 <LINK REL="Previous" HREF="002019.html">
12 <LINK REL="Next" HREF="002021.html">
13 </HEAD>
14 <BODY BGCOLOR="#ffffff">
15 <H1>[IRCServices Coding] Associating NickGroupInfo with two nicks
16 at once</H1>
17 <B>Georges Berscheid</B>
18 <A HREF="mailto:ircservices-coding%40ircservices.za.net?Subject=%5BIRCServices%20Coding%5D%20%09Associating%20NickGroupInfo%20with%20two%20nicks%0A%09at%20once&In-Reply-To="
19 TITLE="[IRCServices Coding] Associating NickGroupInfo with two nicks
20 at once">georges at berscheid.lu
21 </A><BR>
22 <I>Tue Apr 22 07:40:25 PDT 2003</I>
23 <P><UL>
24 <LI>Previous message: <A HREF="002019.html">[IRCServices Coding]
25 Associating NickGroupInfo with two nicks at once
26 </A></li>
27 <LI>Next message: <A HREF="002021.html">[IRCServices Coding] Associating NickGroupInfo with two nicks at
28 once
29 </A></li>
30 <LI> <B>Messages sorted by:</B>
31 <a href="date.html#2020">[ date ]</a>
32 <a href="thread.html#2020">[ thread ]</a>
33 <a href="subject.html#2020">[ subject ]</a>
34 <a href="author.html#2020">[ author ]</a>
35 </LI>
36 </UL>
37 <HR>
38 <!--beginarticle-->
39 <PRE>Hi,
40
41 you might need to add the user that you want to get the privileges of
42 one NickGroupInfo to the id_users array in that specific struct. This
43 could help making the user being recognized as owner of the ngi.
44 Please note that this is a mere speculation, and that it is not based on
45 any experience :)
46 Furthermore I don't think you should associate the ni reference to the
47 user that does a SU, but only the ngi (which contains the privileges
48 data), since the ni struct has a user member which can only be set to
49 one specific user. So you will get in trouble if the real owner of the
50 nick is online as well when any other use wants to get his privileges
51 using SU.
52
53 Georges
54
55
56
57 Craig Edwards wrote:
58
59 &gt;<i>Hi, we're writing a module which allows a web interface to &quot;su&quot; to a nickname, similar to the way the unix &quot;su&quot; command (dont ask! :)) heres how it works:
60 </I>&gt;<i>
61 </I>&gt;<i>basically, /msg somepseudoclient su &lt;nick&gt; &lt;pass&gt;
62 </I>&gt;<i>
63 </I>&gt;<i>..and you gain the privilages of that nick, wether or not they are using it at the time. What we're doing at the moment is associating the user's ngi and ni fields with the nickgroupinfo of the registered nickname, e.g.
64 </I>&gt;<i>
65 </I>&gt;<i>NickInfo* MyNickInf = get_nickinfo(somenick);
66 </I>&gt;<i>NickGroupInfo* MyNGroupInf = get_ngi(MyNickInf);
67 </I>&gt;<i>
68 </I>&gt;<i>u-&gt;ngi = MyNGroupInf;
69 </I>&gt;<i>u-&gt;ni = MyNickInf;
70 </I>&gt;<i>/* user u is now logged in with privilages of &quot;ngi&quot; nick, send +r as a raw if neccessary */
71 </I>&gt;<i>
72 </I>&gt;<i>sorry for any errors in this code, im typing it off the top of my head.
73 </I>&gt;<i>Basically, the problem we have is, that only one nick can have &quot;ownership&quot; of a groupinfo at any one time, if we associate user 'u' with MyNGroupInf, then if some other user online at the time (lets call them u2) has this same association (u2-&gt;ngi == MyNGroupInf) than u2 is logged out (and has to re-identify using /msg nickserv identify &lt;pass&gt;). Basically we cant give two people ownership of the same nickgroup at the same time. Is there any way we can get around this, e.g. by memcpy'ing the NickGroupInfo? The ownership of the nick by the second user only needs to be temporary, until disconnect, so there shouldnt be any corruption of services DB's by having two people pointing at the same nickgroup in the file, or anything as weird as that :)
74 </I>&gt;<i>
75 </I>&gt;<i>If theres any way to solve this problem simply, without needing andy to rewrite the core, or for us to approach the problem a different way, we'd be grateful of anyone could tell us how :)
76 </I>&gt;<i>
77 </I>&gt;<i>Thanks,
78 </I>&gt;<i>Brain
79 </I>&gt;<i>ChatSpike Services-dev
80 </I>&gt;<i>
81 </I>&gt;<i>
82 </I>&gt;<i>
83 </I>&gt;<i>------------------------------------------------------------------
84 </I>&gt;<i>To unsubscribe or change your subscription options, visit:
85 </I>&gt;<i><A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices-coding">http://www.ircservices.za.net/mailman/listinfo/ircservices-coding</A>
86 </I>&gt;<i>
87 </I>&gt;<i>
88 </I>&gt;<i>
89 </I>&gt;<i>
90 </I>
91
92
93 </PRE>
94
95 <!--endarticle-->
96 <HR>
97 <P><UL>
98 <!--threads-->
99 <LI>Previous message: <A HREF="002019.html">[IRCServices Coding]
100 Associating NickGroupInfo with two nicks at once
101 </A></li>
102 <LI>Next message: <A HREF="002021.html">[IRCServices Coding] Associating NickGroupInfo with two nicks at
103 once
104 </A></li>
105 <LI> <B>Messages sorted by:</B>
106 <a href="date.html#2020">[ date ]</a>
107 <a href="thread.html#2020">[ thread ]</a>
108 <a href="subject.html#2020">[ subject ]</a>
109 <a href="author.html#2020">[ author ]</a>
110 </LI>
111 </UL>
112
113 </body></html>