Date: Thu, 20 Aug 1998 13:07:34 +0200 (CEST) From: Konrad Heuer <kheuer@gwdu60.gwdg.de> To: freebsd-hackers@FreeBSD.ORG Subject: Login w/ NFS-imported Home Message-ID: <Pine.BSF.3.96.980820125615.3004A-100000@gwdu60.gwdg.de>
next in thread | raw e-mail | index | archive | help
On one of my FreeBSD boxes (2.2.6-R) all user home directories are NFS-imported without root access (root mapped to nobody). Login fails (`no home directory') if the user doesn't give at least mode 755 to his/her home. I modified login.c to overcome this. I don't know whether my modification is really bug-free, and I don't know whether this problem has already been fixed in 2.2-stable or 3.0-current. In any case it would be nice to find the problem fixed in the future ... Here's the diff listing concerning my modification of login.c: *** /usr/src/usr.bin/login/login.c.org Wed Feb 18 13:07:42 1998 --- /usr/src/usr.bin/login/login.c Thu Aug 20 12:50:08 1998 *************** *** 51,56 **** --- 51,57 ---- * login -f name (for pre-authenticated login: datakit, xterm, etc.) */ + #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> #include <sys/time.h> *************** *** 156,161 **** --- 157,163 ---- int ask, ch, cnt, fflag, hflag, pflag, quietlog, rootlogin, rval; int changepass; time_t warntime; + uid_t euid; uid_t uid; char *domain, *p, *ep, *salt, *ttyn; char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10]; *************** *** 538,543 **** --- 540,547 ---- #else quietlog = 0; #endif + euid = geteuid(); + seteuid(pwd->pw_uid); if (!*pwd->pw_dir || chdir(pwd->pw_dir) < 0) { #ifdef LOGIN_CAP if (login_getcapbool(lc, "requirehome", 0)) *************** *** 551,556 **** --- 555,562 ---- } if (!quietlog) quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0; + + seteuid(euid); if (pwd->pw_change || pwd->pw_expire) (void)gettimeofday(&tp, (struct timezone *)NULL); Regards Konrad Heuer // Gesellschaft fuer wissenschaftliche Datenverarbeitung mbH // Goettingen (GWDG), Am Fassberg, D-37077 Goettingen, Germany // // kheuer@gwdu60.gwdg.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980820125615.3004A-100000>