diff --git a/NT/tools/sprshd b/NT/tools/sprshd
index 461698561f3681c26652b33fec379a3252e18910..48080213e86c375c6305d8f48be23d0dc8ee6fc9 100755
--- a/NT/tools/sprshd
+++ b/NT/tools/sprshd
@@ -282,8 +282,10 @@ void handle_connections(string *hosts)
   {
     if(object io=accept())
     {
+      int ok=0;
       sscanf(io->query_address(),"%s ",string ip);
-      if(search(hosts, ip)==-1)
+      foreach(hosts, string host) ok+=glob(host, ip);
+      if(!ok)
       {
 	werror("Connection from %s denied!!\n",ip);
 	destruct(io);