From owner-freebsd-hackers Thu Aug 20 04:08:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA02871 for freebsd-hackers-outgoing; Thu, 20 Aug 1998 04:08:20 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gwdu60.gwdg.de (gwdu60.gwdg.de [134.76.10.60]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA02866 for ; Thu, 20 Aug 1998 04:08:18 -0700 (PDT) (envelope-from kheuer@gwdu60.gwdg.de) Received: from localhost (kheuer@localhost) by gwdu60.gwdg.de (8.9.0/8.9.0) with SMTP id NAA03015 for ; Thu, 20 Aug 1998 13:07:35 +0200 (CEST) Date: Thu, 20 Aug 1998 13:07:34 +0200 (CEST) From: Konrad Heuer To: freebsd-hackers@FreeBSD.ORG Subject: Login w/ NFS-imported Home Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 #include #include #include *************** *** 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