date and time created 90/06/19 19:22:39 by kfall
[unix-history] / usr / src / usr.bin / login / login.c
index 1af1b70..5c72828 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)login.c    5.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)login.c    5.55 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -33,7 +33,6 @@ static char sccsid[] = "@(#)login.c   5.49 (Berkeley) %G%";
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
-#include <ufs/quota.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -49,7 +48,7 @@ static char sccsid[] = "@(#)login.c   5.49 (Berkeley) %G%";
 #include <pwd.h>
 #include <setjmp.h>
 #include <stdio.h>
 #include <pwd.h>
 #include <setjmp.h>
 #include <stdio.h>
-#include <strings.h>
+#include <string.h>
 #include <tzfile.h>
 #include "pathnames.h"
 
 #include <tzfile.h>
 #include "pathnames.h"
 
@@ -63,7 +62,7 @@ int   timeout = 300;
 
 struct passwd *pwd;
 int    failures;
 
 struct passwd *pwd;
 int    failures;
-char   term[64], *hostname, *username, *tty;
+char   term[64], *envinit[1], *hostname, *username, *tty;
 
 struct sgttyb sgttyb;
 struct tchars tc = {
 
 struct sgttyb sgttyb;
 struct tchars tc = {
@@ -96,7 +95,7 @@ main(argc, argv)
        register char *p;
        int ask, fflag, hflag, pflag, rflag, cnt;
        int quietlog, passwd_req, ioctlval, timedout();
        register char *p;
        int ask, fflag, hflag, pflag, rflag, cnt;
        int quietlog, passwd_req, ioctlval, timedout();
-       char *domain, *salt, *envinit[1], *ttyn, *pp;
+       char *domain, *salt, *ttyn, *pp;
        char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
        char localhost[MAXHOSTNAMELEN];
        char *ctime(), *ttyname(), *stypeof(), *crypt(), *getpass();
        char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
        char localhost[MAXHOSTNAMELEN];
        char *ctime(), *ttyname(), *stypeof(), *crypt(), *getpass();
@@ -108,7 +107,8 @@ main(argc, argv)
        (void)signal(SIGQUIT, SIG_IGN);
        (void)signal(SIGINT, SIG_IGN);
        (void)setpriority(PRIO_PROCESS, 0, 0);
        (void)signal(SIGQUIT, SIG_IGN);
        (void)signal(SIGINT, SIG_IGN);
        (void)setpriority(PRIO_PROCESS, 0, 0);
-       (void)quota(Q_SETUID, 0, 0, 0);
+
+       openlog("login", LOG_ODELAY, LOG_AUTH);
 
        /*
         * -p is used by getty to tell login not to destroy the environment
 
        /*
         * -p is used by getty to tell login not to destroy the environment
@@ -123,8 +123,6 @@ main(argc, argv)
        else
                domain = index(localhost, '.');
 
        else
                domain = index(localhost, '.');
 
-       openlog("login", LOG_ODELAY, LOG_AUTH);
-
        fflag = hflag = pflag = rflag = 0;
        passwd_req = 1;
        uid = getuid();
        fflag = hflag = pflag = rflag = 0;
        passwd_req = 1;
        uid = getuid();
@@ -324,22 +322,6 @@ main(argc, argv)
        /* paranoia... */
        endpwent();
 
        /* paranoia... */
        endpwent();
 
-       if (quota(Q_SETUID, pwd->pw_uid, 0, 0) < 0 && errno != EINVAL) {
-               switch(errno) {
-               case EUSERS:
-                       (void)fprintf(stderr,
-               "Too many users logged on already.\nTry again later.\n");
-                       break;
-               case EPROCLIM:
-                       (void)fprintf(stderr,
-                           "You have too many processes running.\n");
-                       break;
-               default:
-                       perror("quota (Q_SETUID)");
-               }
-               sleepexit(0);
-       }
-
        if (chdir(pwd->pw_dir) < 0) {
                (void)printf("No directory %s!\n", pwd->pw_dir);
                if (chdir("/"))
        if (chdir(pwd->pw_dir) < 0) {
                (void)printf("No directory %s!\n", pwd->pw_dir);
                if (chdir("/"))
@@ -427,8 +409,6 @@ main(argc, argv)
 
        initgroups(username, pwd->pw_gid);
 
 
        initgroups(username, pwd->pw_gid);
 
-       quota(Q_DOWARN, pwd->pw_uid, (dev_t)-1, 0);
-
        if (*pwd->pw_shell == '\0')
                pwd->pw_shell = _PATH_BSHELL;
 
        if (*pwd->pw_shell == '\0')
                pwd->pw_shell = _PATH_BSHELL;