From nicolas@narr.dyn.dhs.org  Mon Mar  4 01:23:49 2002
Return-Path: <nicolas@narr.dyn.dhs.org>
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <list@rachinsky.de>
Reply-To: Nicolas Rachinsky <list@rachinsky.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: user-ppp handles long line names inconsistently
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35531
>Category:       bin
>Synopsis:       user-ppp handles long line names inconsistently
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 04 01:30:01 PST 2002
>Closed-Date:    Tue Mar 5 05:04:29 PST 2002
>Last-Modified:  Tue Mar 05 05:05:01 PST 2002
>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:
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: cjc 
Responsible-Changed-When: Mon Mar 4 09:26:52 PST 2002 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35531 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Tue Mar 5 05:04:29 PST 2002 
State-Changed-Why:  
A patch has been committed to -current.  I'll MFC after 2 weeks if there 
are no problems. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=35531 
>Unformatted:
