From owner-freebsd-bugs Wed Sep 4 13:10: 9 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6305537B400 for ; Wed, 4 Sep 2002 13:10:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2412D43E65 for ; Wed, 4 Sep 2002 13:10:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g84KA3JU028089 for ; Wed, 4 Sep 2002 13:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g84KA3CY028088; Wed, 4 Sep 2002 13:10:03 -0700 (PDT) Date: Wed, 4 Sep 2002 13:10:03 -0700 (PDT) Message-Id: <200209042010.g84KA3CY028088@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Chris S.J. Peron" Subject: Re: bin/42419: syslog enhancement for the nologin shell Reply-To: "Chris S.J. Peron" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/42419; it has been noted by GNATS. From: "Chris S.J. Peron" To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/42419: syslog enhancement for the nologin shell Date: Wed, 4 Sep 2002 14:55:15 -0500 Just a couple of changes for nologin.c 1) it possible that if a user is using su to change to another user, the syslog would report the calling users login and not the login of the desired user. FIX: use getenv() rather the utmp 2) close utmp file descriptor --- nologin.old.c Wed Sep 4 14:41:01 2002 +++ nologin.c Wed Sep 4 14:41:45 2002 @@ -99,8 +99,9 @@ if (strcmp(utp->ut_line, ontty()) == 0) syslog(LOG_AUTH | LOG_WARNING, "rejected login attempt for user %s %s from %s", - utp->ut_name, ontty(), utp->ut_host); + getenv("USER"), ontty(), utp->ut_host); } + close(fd); return(0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message