Home | History | Annotate | Download | only in login

Lines Matching refs:pwd

62 #include <pwd.h>
342 if (failures > (pwd ? 0 : 1))
348 pwd = getpwnam(username);
353 * within the next block. pwd can be NULL since it
356 lc = login_getclass(pwd ? pwd->pw_class : NULL);
364 if (pwd) {
365 if (pwd->pw_uid == 0)
368 if (fflag && (uid == 0 || uid == pwd->pw_uid)) {
375 } else if (pwd->pw_passwd[0] == '\0') {
401 if (pwd == NULL) {
407 k5login(pwd, instance, localhost, p) == 0) {
423 if (!sflag && *pwd->pw_passwd != '\0' &&
424 !strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd)) {
441 if (pwd && !rval && rootlogin && !rootterm(tty)) {
447 pwd->pw_name, hostname, tty);
451 pwd->pw_name, tty);
455 if (pwd && !rval)
502 (void)setegid(pwd->pw_gid);
503 initgroups(username, pwd->pw_gid);
504 (void)seteuid(pwd->pw_uid);
506 if (chdir(pwd->pw_dir) < 0) {
510 pwd->pw_dir);
514 (void)printf("No home directory %s!\n", pwd->pw_dir);
517 pwd->pw_dir = __UNCONST("/");
536 if (pwd->pw_expire) {
537 if (now.tv_sec >= pwd->pw_expire) {
540 } else if (pwd->pw_expire - now.tv_sec < pw_warntime &&
543 ctime(&pwd->pw_expire));
545 if (pwd->pw_change) {
546 if (pwd->pw_change == _PASSWORD_CHGNOW)
548 else if (now.tv_sec >= pwd->pw_change) {
551 } else if (pwd->pw_change - now.tv_sec < pw_warntime &&
554 ctime(&pwd->pw_change));
560 (void)chown(ttyn, pwd->pw_uid,
561 (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid);
563 if (ttyaction(ttyn, "login", pwd->pw_name))
577 if (nested == NULL && setusercontext(lc, pwd, pwd->pw_uid,
582 if (setusercontext(lc, pwd, pwd->pw_uid,
588 (void)setgid(pwd->pw_gid);
590 initgroups(username, pwd->pw_gid);
592 if (nested == NULL && setlogin(pwd->pw_name) < 0)
599 (void)setuid(pwd->pw_uid);
602 if (*pwd->pw_shell == '\0')
603 pwd->pw_shell = __UNCONST(_PATH_BSHELL);
610 pwd->pw_shell = shell;
614 (void)setenv("HOME", pwd->pw_dir, 1);
615 (void)setenv("SHELL", pwd->pw_shell, 1);
626 (void)setenv("LOGNAME", pwd->pw_name, 1);
627 (void)setenv("USER", pwd->pw_name, 1);
630 setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETPATH);
673 sizeof(tbuf), "%s/%s", _PATH_MAILDIR, pwd->pw_name);
689 (void)strlcpy(tbuf + 1, (p = strrchr(pwd->pw_shell, '/')) ?
690 p + 1 : pwd->pw_shell, sizeof(tbuf) - 1);
721 execlp(pwd->pw_shell, tbuf, NULL);
722 err(EXIT_FAILURE, "%s", pwd->pw_shell);