bin/112557: [patch] [bin] ppp(8) lock file should not use symlink name

Ighighi ighighi at gmail.com
Wed May 9 23:40:04 UTC 2007


>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 at 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:


More information about the freebsd-bugs mailing list