]> jfr.im git - irc.git/blob - software/RELEASES/ircservices/achurch.org/services/lists/ircservices/1999/000192.html
rename -> *.git
[irc.git] / software / RELEASES / ircservices / achurch.org / services / lists / ircservices / 1999 / 000192.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices] what do they think ?
5 </TITLE>
6 <LINK REL="Index" HREF="index.html" >
7 <LINK REL="made" HREF="mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20what%20do%20they%20think%20%3F&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="000193.html">
11 <LINK REL="Next" HREF="000194.html">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>[IRCServices] what do they think ?</H1>
15 <B>Andrew Church</B>
16 <A HREF="mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20what%20do%20they%20think%20%3F&In-Reply-To="
17 TITLE="[IRCServices] what do they think ?">achurch at dragonfire.net
18 </A><BR>
19 <I>Fri Oct 8 23:28:49 PDT 1999</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="000193.html">[IRCServices] what do they think ?
22 </A></li>
23 <LI>Next message: <A HREF="000194.html">[IRCServices] what do they think ?
24 </A></li>
25 <LI> <B>Messages sorted by:</B>
26 <a href="date.html#192">[ date ]</a>
27 <a href="thread.html#192">[ thread ]</a>
28 <a href="subject.html#192">[ subject ]</a>
29 <a href="author.html#192">[ author ]</a>
30 </LI>
31 </UL>
32 <HR>
33 <!--beginarticle-->
34 <PRE>&gt;<i>i had wrote this function on my services, it is working well, but i wold like
35 </I>&gt;<i>to hear coments and sugestions on it
36 </I>&gt;<i>
37 </I>&gt;<i>it send password information to the nick email (ni-&gt;email) and i changed the
38 </I>&gt;<i>do_register, so users must give a mail
39 </I>
40 From a functional standpoint, it's something I'd planned to do for quite
41 a while. From an implementation standpoint, I'd hang myself before releasing
42 code of this quality. No offense--if it works for you, fine; but there are
43 numerous potential problems and security holes in this implementation. To
44 point out a few: (further comments at the end of the message)
45
46 &gt;<i> lock = fopen(&quot;.senpass.nick&quot;, &quot;r&quot;);
47 </I>
48 (1) There's a huge distance between this check and the time the file
49 is created, leaving a big window for race conditions (except that since
50 you process this all in the same thread you don't need a lock in the first
51 place).
52
53 (2) Doing all the processing in the same thread, and especially waiting
54 for sendmail to finish, will slow down Services immensely. (Suppose your
55 sendmail is set to verify recipients' domain names before queueing mail; what
56 happens if someone registers a nick with an address in a domain they own, and
57 then shut off the nameserver for that domain?)
58
59 (3) This filename has a typo and so locking wouldn't ever work anyway.
60
61 &gt;<i> } else if (!strchr(ni-&gt;email, '@')) {
62 </I>[...]
63 &gt;<i> } else if(strlen(ni-&gt;email)&gt;50) {
64 </I>
65 This is a pretty weak check on E-mail address syntax.
66
67 &gt;<i> strcpy(illsend,&quot;/usr/sbin/sendmail &quot;);
68 </I>&gt;<i> strcat(illsend, ni-&gt;email);
69 </I>&gt;<i> strcat(illsend,&quot; &lt; .sendpass.nick&quot;);
70 </I>[...]
71 &gt;<i> system(illsend);
72 </I>
73 Lovely. Suppose I set my E-mail address to &quot;foo@;IFS=.;rm.-rf./&quot;?
74 Poof, there goes your system (or whatever part of it Services can access--
75 I hope you're not running as root). Not to mention the problems you get
76 with having a bogus &quot;sendmail&quot; in a directory in your PATH.
77
78 For the record, the proper way to do this would be to open a direct SMTP
79 connection to a known mail server and send the mail over that connection,
80 using select() to monitor the status of the connection (and timing out in a
81 reasonable period of time to prevent people from using up all file
82 descriptors by sending lots of SENDPASS requests). Note that a proper
83 implementation of this functionality requires quite a bit of work, including
84 redoing the main program loop and I/O code to be able to monitor multiple
85 sockets at once; this is why I never got around to adding this functionality.
86 If it were as simple as writing a function like the original poster did, I
87 would have done it long ago.
88
89 Andrew (Kempe): I'm willing to help you with this if you want, but you
90 need to be very careful about adding functionality like this; it can turn
91 into Swiss cheese (security- and stability-wise) if you don't watch out.
92
93 --Andrew Church
94 <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">achurch at dragonfire.net</A>
95 <A HREF="http://achurch.dragonfire.net/">http://achurch.dragonfire.net/</A>
96 ---------------------------------------------------------------
97 To unsubscribe, send email to <A HREF="http://www.ircservices.za.net/mailman/listinfo/ircservices">majordomo at ender.shadowfire.org</A>
98 with &quot;unsubscribe ircservices&quot; in the body, without the quotes.
99
100 </PRE>
101
102 <!--endarticle-->
103 <HR>
104 <P><UL>
105 <!--threads-->
106 <LI>Previous message: <A HREF="000193.html">[IRCServices] what do they think ?
107 </A></li>
108 <LI>Next message: <A HREF="000194.html">[IRCServices] what do they think ?
109 </A></li>
110 <LI> <B>Messages sorted by:</B>
111 <a href="date.html#192">[ date ]</a>
112 <a href="thread.html#192">[ thread ]</a>
113 <a href="subject.html#192">[ subject ]</a>
114 <a href="author.html#192">[ author ]</a>
115 </LI>
116 </UL>
117
118 </body></html>