RE: IP Filtering Patch
"Metzger, Michael" <[email protected]> Thu, 20 Feb 2003 09:36:07 -0600
| Newsgroups | gmane.music.equipment.slimp3.dev |
|---|---|
| Message-ID | <[email protected]> |
------_=_NextPart_001_01C2D8F5.C98F3CF0 Content-Type: text/plain; charset="iso-8859-1" Ok, so effectively wherever the server is being run will automatically be added to the allowed list. Now the question is, should I put this into the actual form validation code in Setup.pm and append accordingly to the preference or just leave it as an implicitly allowed host (as currently listed)? Mike -----Original Message----- From: Moser, Robert L. II [mailto:[email protected]] Sent: Thursday, February 20, 2003 9:25 AM To: '[email protected]' Subject: RE: [slimp3-dev] IP Filtering Patch In HTTP.pm in the init() portion we could look up the address corresponding to the host name and store it in a package variable. Then the validation could add that address to the acceptible addresses. To get the address - in HTTP.pm +my $hostaddr; sub init { + my $host = hostname(); + $hostaddr = inet_ntoa(scalar gethostbyname($host || 'localhost')); idle(); } + sub hostaddr { + return $hostaddr; +} and in Misc.pm sub isAllowedHost { my $host = shift; my @rules = split /\,/, SliMP3::Prefs::get('allowedHosts'); + unshift @rules,SliMP3::HTTP::hostaddr(); Robert -----Original Message----- From: Metzger, Michael [mailto:[email protected]] Sent: Thursday, February 20, 2003 6:55 AM To: '[email protected]' Subject: RE: [slimp3-dev] IP Filtering Patch I unfortunately don't have any access to OSX. I've noticed on Windows if you type in the machine name or the IP address, it will use the NIC address as the source and block the IP. If you type something like http://localhost:9000/ <http://localhost:9000/> it will use the localhost as the source and it works. The only option I can think of to work around this is grab the source IP from the request and add it in accordingly, but I'm not sure this is what is actually needed, especially if there are multiple NICs in the system. Any ideas? Thanks Mike -----Original Message----- From: dean blackketter [mailto:[email protected]] Sent: Thursday, February 20, 2003 12:57 AM To: [email protected] Subject: Re: [slimp3-dev] IP Filtering Patch I've checked in this patch (with some rewriting of the strings for clarity.) On my OS X machine, incoming connections from the same machine are blocked unless I explicitly put in the IP address for that machine, that is, even if 127.0.0.1 is allowed, I need to add 10.0.1.204 to make it work. I'd love a fix for this. -dean Yahoo! Groups Sponsor ADVERTISEMENT <http://rd.yahoo.com/M=245454.2994396.4323964.2848452/D=egroupweb/S=17082987 95:HM/A=1457554/R=0/*http://ipunda.com/clk/beibunmaisuiyuiwabei> <http://us.adserver.yahoo.com/l?M=245454.2994396.4323964.2848452/D=egroupmai l/S=:HM/A=1457554/rand=680828485> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ------_=_NextPart_001_01C2D8F5.C98F3CF0 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: 7bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <TITLE></TITLE> <META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=151333015-20022003><FONT face=Arial color=#0000ff size=2>Ok, so effectively wherever the server is being run will automatically be added to the allowed list. Now the question is, should I put this into the actual form validation code in Setup.pm and append accordingly to the preference or just leave it as an implicitly allowed host (as currently listed)?</FONT></SPAN></DIV> <DIV><SPAN class=151333015-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=151333015-20022003><FONT face=Arial color=#0000ff size=2>Mike</FONT></SPAN></DIV> <BLOCKQUOTE> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Moser, Robert L. II [mailto:[email protected]]<BR><B>Sent:</B> Thursday, February 20, 2003 9:25 AM<BR><B>To:</B> '[email protected]'<BR><B>Subject:</B> RE: [slimp3-dev] IP Filtering Patch<BR><BR></FONT></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2>In HTTP.pm in the init() portion we could look up the address corresponding to the host name and store it in a package variable. Then the validation could add that address to the acceptible addresses.</FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2>To get the address - in HTTP.pm</FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><!--StartFragment -->+my $hostaddr;</SPAN></DIV> <DIV><SPAN class=621071615-20022003>sub init {</SPAN></DIV> <DIV><SPAN class=621071615-20022003>+ my $host = hostname();<BR>+ $hostaddr = inet_ntoa(scalar gethostbyname($host || 'localhost'));</SPAN></DIV> <DIV><SPAN class=621071615-20022003> idle();</SPAN></DIV> <DIV><SPAN class=621071615-20022003>}</SPAN></DIV> <DIV><SPAN class=621071615-20022003>+ sub hostaddr {</SPAN></DIV> <DIV><SPAN class=621071615-20022003>+ return $hostaddr;</SPAN></DIV> <DIV><SPAN class=621071615-20022003>+}</SPAN></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2>and in Misc.pm</FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><!--StartFragment --> <TR><TD bgcolor="#aaffaa"><FONT face=Helvetica,Arial size=-1>sub isAllowedHost {</FONT></TD></TR> <TR><TD bgcolor="#cccccc"> </TD><TD bgcolor="#aaffaa"><FONT face=Helvetica,Arial size=-1> </FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Helvetica,Arial size=-1> my $host = shift;</FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><TR><TD bgcolor="#cccccc"></TD><TD bgcolor="#aaffaa"><FONT face=Helvetica,Arial size=-1> my @rules = split /\,/, SliMP3::Prefs::get('allowedHosts');</FONT></TD></TR> <TR><TD bgcolor="#cccccc"> </TD><TD bgcolor="#aaffaa"><FONT face=Helvetica,Arial size=-1></FONT></TD></TR> </SPAN></DIV> <DIV><SPAN class=621071615-20022003>+ unshift @rules,SliMP3::HTTP::hostaddr();</SPAN></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2>Robert</FONT></SPAN></DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=621071615-20022003><FONT face=Arial color=#0000ff size=2></FONT> </DIV> <P><FONT face=Arial color=#0000ff size=2></FONT></P></SPAN> <BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Metzger, Michael [mailto:[email protected]]<BR><B>Sent:</B> Thursday, February 20, 2003 6:55 AM<BR><B>To:</B> '[email protected]'<BR><B>Subject:</B> RE: [slimp3-dev] IP Filtering Patch<BR><BR></FONT></DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2>I unfortunately don't have any access to OSX. I've noticed on Windows if you type in the machine name or the IP address, it will use the NIC address as the source and block the IP. If you type something like <A href="http://localhost:9000/">http://localhost:9000/</A> it will use the localhost as the source and it works.</FONT></SPAN></DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2>The only option I can think of to work around this is grab the source IP from the request and add it in accordingly, but I'm not sure this is what is actually needed, especially if there are multiple NICs in the system. </FONT></SPAN></DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2>Any ideas?</FONT></SPAN></DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2>Thanks</FONT></SPAN></DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=829364714-20022003><FONT face=Arial color=#0000ff size=2>Mike</FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> dean blackketter [mailto:[email protected]]<BR><B>Sent:</B> Thursday, February 20, 2003 12:57 AM<BR><B>To:</B> [email protected]<BR><B>Subject:</B> Re: [slimp3-dev] IP Filtering Patch<BR><BR></FONT></DIV> <P>I've checked in this patch (with some rewriting of the strings for clarity.) </P><BR> <P>On my OS X machine, incoming connections from the same machine are blocked unless I explicitly put in the IP address for that machine, that is, even if 127.0.0.1 is allowed, I need to add 10.0.1.204 to make it work. I'd love a fix for this. </P><BR> <P>-dean </P></BLOCKQUOTE></BLOCKQUOTE><BR><BR><TT>To unsubscribe from this group, send an email to:<BR>[email protected]<BR><BR></TT><BR><BR><TT>Your use of Yahoo! Groups is subject to the <A href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</A>.</TT> <BR></BLOCKQUOTE> <br> <!-- |**|begin egp html banner|**| --> <table border=0 cellspacing=0 cellpadding=2> <tr bgcolor=#FFFFCC> <td align=center><font size="-1" color=#003399><b>Yahoo! Groups Sponsor</b></font></td> </tr> <tr bgcolor=#FFFFFF> <td align=center width=470><table border=0 cellpadding=0 cellspacing=0> <tr> <td align=center><font face=arial size=-2>ADVERTISEMENT</font><br><a href="http://rd.yahoo.com/M=245454.2994396.4323964.2848452/D=egroupweb/S=1708298795:HM/A=1457554/R=0/*http://ipunda.com/clk/beibunmaisuiyuiwabei"><img src="http://us.a1.yimg.com/us.yimg.com/a/qu/quinstreet/uofpoff_300_250_0001.gif" alt="" width="300" height="250" border="0"></a></td></tr></table></td> </tr> <tr><td><img alt="" width=1 height=1 src="http://us.adserver.yahoo.com/l?M=245454.2994396.4323964.2848452/D=egroupmail/S=:HM/A=1457554/rand=246795502"></td></tr> </table> <!-- |**|end egp html banner|**| --> <br> <tt> To unsubscribe from this group, send an email to:<BR> [email protected]<BR> <BR> </tt> <br> <br> <tt>Your use of Yahoo! Groups is subject to the <a href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</a>.</tt> </br> </BODY></HTML> ------_=_NextPart_001_01C2D8F5.C98F3CF0--