Date: Mon, 4 Mar 2002 10:23:30 +0100 (CET) From: Nicolas Rachinsky <list@rachinsky.de> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/35531: user-ppp handles long line names inconsistently Message-ID: <200203040923.g249NUY84458@pc5.abc>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203040923.g249NUY84458>
