I have come up with a patch for this to get the CLI plugin to take
allowedHosts in to account.


Code:
--------------------
    
  # diff -u Plugin.pm /usr/share/perl5/Slim/Plugin/CLI/Plugin.pm
  --- Plugin.pm   2021-02-07 15:16:17.312289873 +0000
  +++ /usr/share/perl5/Slim/Plugin/CLI/Plugin.pm  2021-02-07 15:21:54.397092988 
+0000
  @@ -243,7 +243,7 @@
  my $tmpaddr = inet_ntoa($client_socket->peeraddr);
  
  # Check allowed hosts
  -               if ( !Slim::Utils::Network::ip_is_host($tmpaddr)
  +               if ( !Slim::Utils::Network::ip_is_host($tmpaddr) && 
!Slim::Utils::Network::isAllowedHost($tmpaddr)
  && $prefsServer->get('protectSettings') && !$prefsServer->get('authorize')
  && ( Slim::Utils::Network::ip_is_gateway($tmpaddr) || 
Slim::Utils::Network::ip_on_different_network($tmpaddr) )
  ) {
  
--------------------


So long as the CLI client is in the allowedHosts list, it should be
accepted. This was literally my first attempt at patching this and it
seems to have worked. I've just noticed that comment, "Check allowed
hosts".....did this code used to have a check in here for this???


------------------------------------------------------------------------
troffasky's Profile: http://forums.slimdevices.com/member.php?userid=70248
View this thread: http://forums.slimdevices.com/showthread.php?t=113868

_______________________________________________
Squeezecenter mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/squeezecenter

Reply via email to