]> Zhao Yanbai Git Server - minix.git/commitdiff
Fixed ruserok not to required /etc/hosts.equiv.
authorPhilip Homburg <philip@cs.vu.nl>
Fri, 14 Jul 2006 12:48:01 +0000 (12:48 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Fri, 14 Jul 2006 12:48:01 +0000 (12:48 +0000)
lib/ip/ruserok.c

index ad6651771d077b68e3b9fdee20540b1c6fc375e1..ec00a792f7352ba092ecaeba52918db921541a29 100755 (executable)
@@ -12,6 +12,7 @@
  */
 
 #include <sys/types.h>
+#include <errno.h>
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -177,7 +178,12 @@ int iruserok(unsigned long raddr, int superuser,
            (void)strcat(pbuf, "/.rhosts");
        }
 
-       if ((hostf = fopen(pbuf, "r")) == NULL) return (-1);
+       if ((hostf = fopen(pbuf, "r")) == NULL)
+       {
+               if (errno == ENOENT)
+                       continue;
+               return (-1);
+       }
 
        r = __ivaliduser(hostf, raddr, luser, ruser);
        (void)fclose(hostf);