From owner-freebsd-bugs Mon Mar 4 1:30:28 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 3530F37B420 for ; Mon, 4 Mar 2002 01:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g249U1108411; Mon, 4 Mar 2002 01:30:01 -0800 (PST) (envelope-from gnats) Received: from mailout06.sul.t-online.com (mailout06.sul.t-online.com [194.25.134.19]) by hub.freebsd.org (Postfix) with ESMTP id 52EE937B402 for ; Mon, 4 Mar 2002 01:23:48 -0800 (PST) Received: from fwd09.sul.t-online.de by mailout06.sul.t-online.com with smtp id 16hoh9-0006xP-05; Mon, 04 Mar 2002 10:23:47 +0100 Received: from pc5.abc (520067998749-0001@[217.233.109.197]) by fmrl09.sul.t-online.com with esmtp id 16hogt-1La2euC; Mon, 4 Mar 2002 10:23:31 +0100 Received: (from nicolas@localhost) by pc5.abc (8.11.6/8.11.6) id g249NUY84458; Mon, 4 Mar 2002 10:23:30 +0100 (CET) (envelope-from nicolas) Message-Id: <200203040923.g249NUY84458@pc5.abc> Date: Mon, 4 Mar 2002 10:23:30 +0100 (CET) From: Nicolas Rachinsky Reply-To: Nicolas Rachinsky To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/35531: user-ppp handles long line names inconsistently 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 >Number: 35531 >Category: bin >Synopsis: user-ppp handles long line names inconsistently >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 04 01:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Nicolas Rachinsky >Release: FreeBSD 4.5-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD pc5.abc 4.5-RELEASE-p1 FreeBSD 4.5-RELEASE-p1 #1: Sat Mar 2 07:40:42 CET 2002 nicolas@pc5.abc:/usr/obj/usr/src/sys/NR i386 >Description: user-ppp handles the line name (ttyS1 or i4brbch0) differently on login and logout. In /usr/src/usr.sbin/ppp/id.c ID0logout replaces unnecessarily the last byte of the string with an nullbyte. If the name of your Line is UT_LINESIZE bytes long (e.g. i4brbch0) ppp creates an utmp and wtmp entry on login, but doesn't remove (or add an closing entry) on logout. >How-To-Repeat: Log in via ISDN from i4brbch0 >Fix: --- id.c 19 Aug 2000 09:30:03 -0000 1.18.2.1 +++ id.c 4 Mar 2002 09:13:41 -0000 @@ -221,8 +221,7 @@ { struct utmp ut; - strncpy(ut.ut_line, device, sizeof ut.ut_line - 1); - ut.ut_line[sizeof ut.ut_line - 1] = '\0'; + strncpy(ut.ut_line, device, sizeof ut.ut_line); ID0set0(); if (nologout || logout(ut.ut_line)) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message