- if (invalid) {
- printf("Login incorrect\n");
- if (++t >= 5) {
- if (utmp.ut_host[0])
- syslog(LOG_ERR,
- "REPEATED LOGIN FAILURES ON %s FROM %.*s, %.*s",
- tty, HMAX, utmp.ut_host,
- NMAX, utmp.ut_name);
- else
- syslog(LOG_ERR,
- "REPEATED LOGIN FAILURES ON %s, %.*s",
- tty, NMAX, utmp.ut_name);
- ioctl(0, TIOCHPCL, (struct sgttyb *) 0);
- close(0), close(1), close(2);
- sleep(10);
- exit(1);
- }
- }
- if (*pwd->pw_shell == '\0')
- pwd->pw_shell = "/bin/sh";
- if (chdir(pwd->pw_dir) < 0 && !invalid ) {
- if (chdir("/") < 0) {
- printf("No directory!\n");
- invalid = TRUE;
- } else {
- printf("No directory! %s\n",
- "Logging in with home=/");
- pwd->pw_dir = "/";
- }
- }
- /*
- * Remote login invalid must have been because
- * of a restriction of some sort, no extra chances.
- */
- if (!usererr && invalid)
- exit(1);
- } while (invalid);
-/* committed to login turn off timeout */
- alarm(0);