Re: IP Filtering Patch
dean blackketter <[email protected]> Thu, 20 Feb 2003 07:53:22 -0800
| Newsgroups | gmane.music.equipment.slimp3.dev |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail-10-877208976 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; format=flowed I think that the local host (and all it's aliases) should always be=20 allowed and shouldn't even appear. Somebody give me a patch? On Thursday, February 20, 2003, at 07:36 AM, Metzger, Michael wrote: > Ok, so effectively wherever the server is being run will automatically=20 > be added to the allowed list.=A0 Now the question is, should I put this=20 > into the actual form validation code in Setup.pm and append=20 > accordingly to the preference or just leave it as an implicitly=20 > allowed host (as currently listed)? > =A0 > 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=20 > corresponding to the host name and store it in a package variable.=A0=20 > Then the validation could add that address to the acceptible > addresses. > =A0 > To get the address - in HTTP.pm > +my $hostaddr; > sub init { > +=A0=A0=A0 my $host =3D hostname(); > +=A0=A0 $hostaddr =3D inet_ntoa(scalar gethostbyname($host || 'localhost'= )); > =A0=A0=A0 idle(); > } > + sub hostaddr { > +=A0=A0=A0 return $hostaddr; > +} > =A0 > and in Misc.pm > =A0 > > sub isAllowedHost { > > =A0 > > =A0 > =A0=A0=A0=A0=A0=A0=A0=A0=A0 > > =A0=A0=A0 my $host =3D shift; > > =A0=A0=A0 my @rules =3D split /\,/, SliMP3::Prefs::get('allowedHosts'); > > =A0 > > =A0 > > +=A0=A0=A0 unshift @rules,SliMP3::HTTP::hostaddr(); > =A0 > =A0 > Robert > =A0 > =A0 > =A0 > =A0 > > > > -----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.=A0 I've noticed on Windows= =20 > if you type in the machine name or the IP address, it will use the NIC=20 > address as the source and block the IP.=A0 If you type something like=20 > http://localhost:9000/ it will use the localhost as the source and it=20 > works. > =A0 > The only option I can think of to work around this is grab the source=20 > IP from the request and add it in accordingly, but I'm not sure this=20 > is what is actually needed, especially if there are multiple NICs in=20 > the system.=A0 > =A0 > Any ideas? > =A0 > Thanks > =A0 > 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=20 > clarity.) > > > On my OS X machine, incoming connections from the same machine are=20 > blocked unless I explicitly put in the IP address for that machine,=20 > that is, even if 127.0.0.1 is allowed, I need to add 10.0.1.204 to=20 > make it work. I'd love a fix for this. > > > -dean > > > > To unsubscribe from this group, send an email to: > [email protected] > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. > > <image.tiff> > > > To unsubscribe from this group, send an email to: > [email protected] > > > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --Apple-Mail-10-877208976 Content-Transfer-Encoding: quoted-printable Content-Type: text/enriched; charset=ISO-8859-1 I think that the local host (and all it's aliases) should always be allowed and shouldn't even appear. Somebody give me a patch? On Thursday, February 20, 2003, at 07:36 AM, Metzger, Michael wrote: = <excerpt><fontfamily><param>Arial</param><color><param>0000,0000,FFFF</par= am>Ok, so effectively wherever the server is being run will automatically be added to the allowed list.=A0 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)?</color></fontfamily> =A0 = <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>Mike</= color></fontfamily> <fontfamily><param>Tahoma</param>-----Original Message----- <bold>From:</bold> Moser, Robert L. II [mailto:[email protected]] <bold>Sent:</bold> Thursday, February 20, 2003 9:25 AM <bold>To:</bold> '[email protected]' <bold>Subject:</bold> RE: [slimp3-dev] IP Filtering Patch = </fontfamily><fontfamily><param>Arial</param><color><param>0000,0000,FFFF<= /param>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.=A0 Then the validation could add that address to the acceptible = addresses.</color></fontfamily> =A0 <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>To get the address - in HTTP.pm</color></fontfamily> +my $hostaddr; sub init { +=A0=A0=A0 my $host =3D hostname(); +=A0=A0 $hostaddr =3D inet_ntoa(scalar gethostbyname($host || = 'localhost')); =A0=A0=A0 idle(); } + sub hostaddr { +=A0=A0=A0 return $hostaddr; +} =A0 <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>and in Misc.pm</color></fontfamily> =A0 <fontfamily><param>Helvetica</param>sub isAllowedHost {</fontfamily> =A0 =A0 <fontfamily><param>Helvetica</param>=A0=A0=A0=A0=A0=A0=A0=A0=A0</fontfamil= y> <fontfamily><param>Helvetica</param>=A0=A0=A0 my $host =3D = shift;</fontfamily> <fontfamily><param>Helvetica</param>=A0=A0=A0 my @rules =3D split /\,/, SliMP3::Prefs::get('allowedHosts');</fontfamily> =A0 =A0 +=A0=A0=A0 unshift @rules,SliMP3::HTTP::hostaddr(); =A0 =A0 = <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>Robert= </color></fontfamily> =A0 =A0 =A0 =A0 <fontfamily><param>Tahoma</param>-----Original Message----- <bold>From:</bold> Metzger, Michael [mailto:[email protected]] <bold>Sent:</bold> Thursday, February 20, 2003 6:55 AM <bold>To:</bold> '[email protected]' <bold>Subject:</bold> RE: [slimp3-dev] IP Filtering Patch = </fontfamily><fontfamily><param>Arial</param><color><param>0000,0000,FFFF<= /param>I unfortunately don't have any access to OSX.=A0 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.=A0 If you type something like = </color><underline><color><param>1999,1999,FFFF</param>http://localhost:90= 00/</color></underline><color><param>0000,0000,FFFF</param> it will use the localhost as the source and it = works.</color></fontfamily> =A0 <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>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.=A0</color></fontfamily> =A0 <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>Any ideas?</color></fontfamily> =A0 = <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>Thanks= </color></fontfamily> =A0 = <fontfamily><param>Arial</param><color><param>0000,0000,FFFF</param>Mike</= color></fontfamily> <fontfamily><param>Tahoma</param>-----Original Message----- <bold>From:</bold> dean blackketter [mailto:[email protected]] <bold>Sent:</bold> Thursday, February 20, 2003 12:57 AM <bold>To:</bold> [email protected] <bold>Subject:</bold> Re: [slimp3-dev] IP Filtering Patch </fontfamily>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 To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to the <underline><color><param>1999,1999,FFFF</param>Yahoo! Terms of Service</color></underline>. </excerpt><<image.tiff> <excerpt> To unsubscribe from this group, send an email to: [email protected] Your use of Yahoo! Groups is subject to the <underline><color><param>1999,1999,FFFF</param>Yahoo! Terms of Service</color></underline>.</excerpt>= --Apple-Mail-10-877208976--