allow null passwd (from serge@arpa)
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 29 Aug 1985 01:02:29 +0000 (17:02 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 29 Aug 1985 01:02:29 +0000 (17:02 -0800)
SCCS-vsn: libexec/rshd/rshd.c 5.2

usr/src/libexec/rshd/rshd.c

index 369eac6..15b85ad 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)rshd.c     5.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)rshd.c     5.2 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -167,7 +167,8 @@ doit(f, fromp)
                exit(1);
 #endif
        }
                exit(1);
 #endif
        }
-       if (ruserok(hp->h_name, pwd->pw_uid == 0, remuser, locuser) < 0) {
+       if (pwd->pw_passwd != 0 && *pwd->pw_passwd != '\0' &&
+           ruserok(hp->h_name, pwd->pw_uid == 0, remuser, locuser) < 0) {
                error("Permission denied.\n");
                exit(1);
        }
                error("Permission denied.\n");
                exit(1);
        }