Date: 18 Apr 2002 23:01:04 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: "Matthew N. Dodd" <winter@jurai.net> Cc: current@FreeBSD.ORG Subject: Re: pam_unix and missing function warnings Message-ID: <xzpvgao90xb.fsf@flood.ping.uio.no> In-Reply-To: <xzpzo0097gu.fsf@flood.ping.uio.no> References: <20020418135935.K42854-100000@sasami.jurai.net> <xzp4ri8amnd.fsf@flood.ping.uio.no> <xzpzo0097gu.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-= Dag-Erling Smorgrav <des@ofug.org> 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 <sys/types.h> #include <fcntl.h> +#include <libutil.h> +#include <stdlib.h> +#include <ttyent.h> #include <unistd.h> -#include <stdlib.h> #include <utmp.h> -#include <libutil.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpvgao90xb.fsf>