From nobody@FreeBSD.org  Wed May  9 23:34:00 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id A12F516A403
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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<ighighi@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] [bin] ppp(8) lock file should not use symlink name
X-Send-Pr-Version: www-3.0

>Number:         112557
>Category:       bin
>Synopsis:       [patch] ppp(8) lock file should not use symlink name
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>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:  Sun Mar 09 13:07:37 UTC 2008
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Sun Mar 9 13:07:30 UTC 2008 
Responsible-Changed-Why:  
Over to maintainers. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=112557 
>Unformatted:
