From owner-freebsd-bugs@FreeBSD.ORG Wed May 9 23:40:04 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 95B7016A402 for ; Wed, 9 May 2007 23:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 5E6B313C44C for ; Wed, 9 May 2007 23:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l49Ne43B093447 for ; Wed, 9 May 2007 23:40:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l49Ne4BU093446; Wed, 9 May 2007 23:40:04 GMT (envelope-from gnats) Resent-Date: Wed, 9 May 2007 23:40:04 GMT Resent-Message-Id: <200705092340.l49Ne4BU093446@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ighighi Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A12F516A403 for ; Wed, 9 May 2007 23:34:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 92AD813C4B8 for ; Wed, 9 May 2007 23:34:00 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l49NY0sq099252 for ; Wed, 9 May 2007 23:34:00 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l49NSwEZ092773; Wed, 9 May 2007 23:28:58 GMT (envelope-from nobody) Message-Id: <200705092328.l49NSwEZ092773@www.freebsd.org> Date: Wed, 9 May 2007 23:28:58 GMT From: Ighighi To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: bin/112557: [patch] [bin] ppp(8) lock file should not use symlink name X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2007 23:40:04 -0000 >Number: 112557 >Category: bin >Synopsis: [patch] [bin] ppp(8) lock file should not use symlink name >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 09 23:40:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Ighighi >Release: 6.2-STABLE >Organization: >Environment: FreeBSD orion 6.2-STABLE FreeBSD 6.2-STABLE #1: Sat May 5 10:13:59 VET 2007 root@orion:/usr/obj/usr/src/sys/CUSTOM i386 >Description: If ppp(8) is instructed to use /dev/modem (with "set device /dev/modem" in /etc/ppp/ppp.conf) and /dev/modem is a symbolic link to the real device, the lock file should reference the real device. So a /var/lock/LCK..cuad0 (as in my system) should exist instead of /var/lock/LCK..modem). Many other programs in the base and ports tree (i.e., comms/minicom that use uu_lock() (implemented in /usr/src/lib/libutil/uucplock.c) could be auto-magically patched if this function is patched instead). A (trivial) patch to minicom similar to this one is available to anyone upon request. >How-To-Repeat: >Fix: Attached patch available. Patch attached with submission follows: --- usr.sbin/ppp/physical.c.orig Mon Oct 11 05:45:58 2004 +++ usr.sbin/ppp/physical.c Thu Feb 8 03:59:01 2007 @@ -976,6 +976,11 @@ int len = strlen(_PATH_DEV); if (name != p->name.full) { + char realname[PATH_MAX]; + + if (realpath(name, realname) != NULL) + name = (const char *) realname; + strncpy(p->name.full, name, sizeof p->name.full - 1); p->name.full[sizeof p->name.full - 1] = '\0'; } >Release-Note: >Audit-Trail: >Unformatted: