Bug 2008 - Allow (DDNS) hostnames in allowedHosts
: Allow (DDNS) hostnames in allowedHosts
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Streaming From SlimServer
: 6.1.1
: PC Debian Linux
: P2 enhancement (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-08-23 23:23 UTC by Robert
Modified: 2008-09-15 14:36 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert 2005-08-23 23:23:00 UTC
The problem I have been facing is that I share a Slimserver on the WAN with some
friends. I have a Dynamic ip address and in order to use this Slimserver I had
to modify allowedHost in de pref file everytime my ip address changed. This
patch allows hostnames in the allowedHosts list.

@@ -1086,12 +1086,18 @@
 sub isAllowedHost {
        my $host = shift;
        my @rules = split /\,/, Slim::Utils::Prefs::get('allowedHosts');

        foreach my $item (@rules)
        {
+               # hack to allow hostnames in allowedHosts list
+               if(index ($item, "*") == -1){
+                       my $packed = gethostbyname($item) or return 0;
+                       $item = inet_ntoa($packed);
+               }
+
                if ($item eq $host)
                {
                #If the host matches a specific IP, return valid
                        return 1;
                } else {
                        my @matched = (0,0,0,0);
Comment 1 Dan Sully 2005-08-25 09:40:35 UTC
Thanks - applied in subversion change 4067