From owner-freebsd-current Thu Apr 18 14: 1:14 2002 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id DBAF837B417 for ; Thu, 18 Apr 2002 14:01:07 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 4390F5309; Thu, 18 Apr 2002 23:01:05 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: "Matthew N. Dodd" Cc: current@FreeBSD.ORG Subject: Re: pam_unix and missing function warnings References: <20020418135935.K42854-100000@sasami.jurai.net> From: Dag-Erling Smorgrav Date: 18 Apr 2002 23:01:04 +0200 In-Reply-To: Message-ID: Lines: 13 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Dag-Erling Smorgrav writes: > Yep, the problem seems to be that sshd calls pam_open_session(3) too > early. I'm looking into it right now. Try the attached patch. You'll need to rebuild libutil and restart sshd. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=login.diff --- //depot/vendor/freebsd/src/lib/libutil/login.3 2001/10/01 09:45:21 +++ //depot/user/des/pam/lib/libutil/login.3 2002/04/18 11:56:04 @@ -46,7 +46,7 @@ .Ar ut entry being passed into the appropriate slot of the .Xr utmp 5 -file (according to the controlling terminal of the calling process), +file, and appends it to the .Xr wtmp 5 file. The calling process must have permission to write to both files. --- //depot/vendor/freebsd/src/lib/libutil/login.c 2002/03/22 00:19:01 +++ //depot/user/des/pam/lib/libutil/login.c 2002/04/18 11:56:04 @@ -44,19 +44,25 @@ #include #include +#include +#include +#include #include -#include #include -#include void login(ut) struct utmp *ut; { + struct ttyent *ty; int fd; int tty; - tty = ttyslot(); + setttyent(); + for (tty = 1; (ty = getttyent()) != NULL; ++tty) + if (strcmp(ty->ty_name, ut->ut_line) == 0) + break; + endttyent(); if (tty > 0 && (fd = open(_PATH_UTMP, O_WRONLY|O_CREAT, 0644)) >= 0) { (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), L_SET); (void)write(fd, ut, sizeof(struct utmp)); --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message