root only from /.rhosts
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Sun, 4 Apr 1982 10:32:42 +0000 (02:32 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Sun, 4 Apr 1982 10:32:42 +0000 (02:32 -0800)
SCCS-vsn: usr.bin/login/login.c 4.16
SCCS-vsn: usr.bin/login/login.c.1 4.16

usr/src/usr.bin/login/login.c
usr/src/usr.bin/login/login.c.1

index 5cc8ce2..d9d1371 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)login.c     4.15 82/03/27";
+static char *sccsid = "@(#)login.c     4.16 82/04/03";
 /*
  * login [ name ]
  * login -r
 /*
  * login [ name ]
  * login -r
@@ -111,7 +111,7 @@ char **argv;
                                printf("%s: No such user\r\n", lusername);
                        goto abnormal;
                }
                                printf("%s: No such user\r\n", lusername);
                        goto abnormal;
                }
-               hostf = fopen("/etc/hosts.equiv", "r");
+               hostf = pwd->pw_uid ? fopen("/etc/hosts.equiv", "r") : 0;
        again:
                if (hostf) {
                  char ahost[32];
        again:
                if (hostf) {
                  char ahost[32];
@@ -337,19 +337,19 @@ normal:
 int    stopmotd;
 catch()
 {
 int    stopmotd;
 catch()
 {
+
        signal(SIGINT, SIG_IGN);
        stopmotd++;
 }
 
        signal(SIGINT, SIG_IGN);
        stopmotd++;
 }
 
-/*
- * return true if OK for root to login on this terminal
- */
 rootterm(tty)
 rootterm(tty)
-       char    *tty;
+       char *tty;
 {
        register FILE *fd;
 {
        register FILE *fd;
-       char    buf[100];
+       char buf[100];
 
 
+       if (rflag)
+               return(1);
        if ((fd = fopen(securetty, "r")) == NULL)
                return(1);
        while (fgets(buf, sizeof buf, fd) != NULL) {
        if ((fd = fopen(securetty, "r")) == NULL)
                return(1);
        while (fgets(buf, sizeof buf, fd) != NULL) {
index 8dc8303..d8cf510 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)login.c.1   4.15 82/03/27";
+static char *sccsid = "@(#)login.c.1   4.16 82/04/03";
 /*
  * login [ name ]
  * login -r
 /*
  * login [ name ]
  * login -r
@@ -111,7 +111,7 @@ char **argv;
                                printf("%s: No such user\r\n", lusername);
                        goto abnormal;
                }
                                printf("%s: No such user\r\n", lusername);
                        goto abnormal;
                }
-               hostf = fopen("/etc/hosts.equiv", "r");
+               hostf = pwd->pw_uid ? fopen("/etc/hosts.equiv", "r") : 0;
        again:
                if (hostf) {
                  char ahost[32];
        again:
                if (hostf) {
                  char ahost[32];
@@ -337,19 +337,19 @@ normal:
 int    stopmotd;
 catch()
 {
 int    stopmotd;
 catch()
 {
+
        signal(SIGINT, SIG_IGN);
        stopmotd++;
 }
 
        signal(SIGINT, SIG_IGN);
        stopmotd++;
 }
 
-/*
- * return true if OK for root to login on this terminal
- */
 rootterm(tty)
 rootterm(tty)
-       char    *tty;
+       char *tty;
 {
        register FILE *fd;
 {
        register FILE *fd;
-       char    buf[100];
+       char buf[100];
 
 
+       if (rflag)
+               return(1);
        if ((fd = fopen(securetty, "r")) == NULL)
                return(1);
        while (fgets(buf, sizeof buf, fd) != NULL) {
        if ((fd = fopen(securetty, "r")) == NULL)
                return(1);
        while (fgets(buf, sizeof buf, fd) != NULL) {