version 1.62, 2014/05/20 01:25:23 |
version 1.63, 2015/01/16 06:40:09 |
|
|
* login -p (preserve existing environment; for getty) |
* login -p (preserve existing environment; for getty) |
*/ |
*/ |
|
|
#include <sys/param.h> |
|
#include <sys/socket.h> |
#include <sys/socket.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
#include <ttyent.h> |
#include <ttyent.h> |
#include <tzfile.h> |
#include <tzfile.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <limits.h> |
#include <utmp.h> |
#include <utmp.h> |
#include <util.h> |
#include <util.h> |
#include <bsd_auth.h> |
#include <bsd_auth.h> |
|
|
{ |
{ |
char *domain, *p, *ttyn, *shell, *fullname, *instance; |
char *domain, *p, *ttyn, *shell, *fullname, *instance; |
char *lipaddr, *script, *ripaddr, *style, *type, *fqdn; |
char *lipaddr, *script, *ripaddr, *style, *type, *fqdn; |
char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10]; |
char tbuf[PATH_MAX + 2], tname[sizeof(_PATH_TTY) + 10]; |
char localhost[MAXHOSTNAMELEN], *copyright; |
char localhost[HOST_NAME_MAX+1], *copyright; |
char mail[sizeof(_PATH_MAILDIR) + 1 + NAME_MAX]; |
char mail[sizeof(_PATH_MAILDIR) + 1 + NAME_MAX]; |
int ask, ch, cnt, fflag, pflag, quietlog, rootlogin, lastchance; |
int ask, ch, cnt, fflag, pflag, quietlog, rootlogin, lastchance; |
int error, homeless, needto, authok, tries, backoff; |
int error, homeless, needto, authok, tries, backoff; |
|
|
shell = login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell); |
shell = login_getcapstr(lc, "shell", pwd->pw_shell, pwd->pw_shell); |
if (*shell == '\0') |
if (*shell == '\0') |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
else if (strlen(shell) >= MAXPATHLEN) { |
else if (strlen(shell) >= PATH_MAX) { |
syslog(LOG_ERR, "shell path too long: %s", shell); |
syslog(LOG_ERR, "shell path too long: %s", shell); |
warnx("invalid shell"); |
warnx("invalid shell"); |
quickexit(1); |
quickexit(1); |