From alexs@qqmore.rinet.ru  Tue May 18 01:03:42 2004
Return-Path: <alexs@qqmore.rinet.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id B54CB16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 May 2004 01:03:42 -0700 (PDT)
Received: from relay.rinet.ru (relay.rinet.ru [195.54.192.35])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B887243D2D
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 May 2004 01:03:38 -0700 (PDT)
	(envelope-from alexs@qqmore.rinet.ru)
Received: from relay.rinet.ru (localhost [127.0.0.1])
	by relay.rinet.ru (8.12.9p2/8.12.9) with ESMTP id i4I83bbF050812
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 May 2004 12:03:37 +0400 (MSD)
	(envelope-from alexs@qqmore.rinet.ru)
Received: (from uucp@localhost)
	by relay.rinet.ru (8.12.9p2/8.12.9/Submit) with UUCP id i4I83bjJ050811
	for FreeBSD-gnats-submit@freebsd.org; Tue, 18 May 2004 12:03:37 +0400 (MSD)
	(envelope-from alexs@qqmore.rinet.ru)
Received: from qqmore.rinet.ru. (localhost.rinet.ru [127.0.0.1])
	by qqmore.rinet.ru. (8.12.11/8.12.11) with ESMTP id i4I83H17027570
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 18 May 2004 12:03:17 +0400 (MSD)
	(envelope-from alexs@qqmore.rinet.ru)
Received: (from alexs@localhost)
	by qqmore.rinet.ru. (8.12.11/8.12.11/Submit) id i4I83Gjw027569;
	Tue, 18 May 2004 12:03:16 +0400 (MSD)
	(envelope-from alexs)
Message-Id: <200405180803.i4I83Gjw027569@qqmore.rinet.ru.>
Date: Tue, 18 May 2004 12:03:16 +0400 (MSD)
From: Alex Semenyaka <alex@semenyaka.ru>
Reply-To: Alex Semenyaka <alex@semenyaka.ru>
To: FreeBSD-gnats-submit@freebsd.org
Subject: Old dev.db leads to the wrong program behaviour (4.x specific)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         66791
>Category:       conf
>Synopsis:       Old dev.db leads to the wrong program behaviour (4.x specific)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 18 01:10:23 PDT 2004
>Closed-Date:    Wed Apr 25 21:50:41 GMT 2007
>Last-Modified:  Wed Apr 25 21:50:41 GMT 2007
>Originator:     Alex Semenyaka
>Release:        FreeBSD 4.10-PRERELEASE i386
>Organization:
no
>Environment:
System: FreeBSD qqmore.rinet.ru 4.10-PRERELEASE FreeBSD 4.10-PRERELEASE #7: Sat May 8 18:33:04 MSD 2004 root@qqmore.rinet.ru:/.ad4s1a/usr/src/sys/compile/BOOJUM i386

>Description:

	If the set of devices has been changed the dev.db need to be rebuilt
	under 4.x, otherwise devname() and ttyname() can give the wrong results.
	They rely upon the content of /var/run/dev.db that can be obsoleted if
	new devices were created. That file is rebuilding during the start-up
	process.

	However the content of /dev can be changed without reboot, on the fly.
	Moreover, /dev/MAKEDEV can be changed during the system update but
	run just after the reboot so /var/run/dev.db will not be rebuilt.

	The problem caused by that are pretty rare but sometimes they can
	happened.

>How-To-Repeat:

	Exchange major or minor version of two devices, open first of them
	with open(2) and print the result of devname(3) for the descriptor.
	It is absolutely non-typical but simple to illustrate the point.

>Fix:

	Do not rely on the reboot, rebuild dev.db directly from MAKEDEV.
	To do so, add to the very end of /dev/MAKEDEV the string

/sbin/dev_mkdb

	Also pretty useful would be adding the reference to the dev_mkdb manual
	page to the MAKEDEV manual page. To do it, apply the following
	patch to both i386/MAKEDEV.8 and alpha/MAKEDEV.8:

--- MAKEDEV.8.old       Tue May 18 11:58:09 2004
+++ MAKEDEV.8   Tue May 18 11:58:22 2004
@@ -116,2 +116,3 @@
 .Xr config 8 ,
-.Xr mknod 8
+.Xr mknod 8 ,
+.Xr dev_mkdb 8

>Release-Note:
>Audit-Trail:

From: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
To: bug-followup@FreeBSD.org, alex@semenyaka.ru
Cc:  
Subject: Re: conf/66791: Old dev.db leads to the wrong program behaviour
	(4.x specific)
Date: Wed, 25 Apr 2007 21:43:29 +0100

 This PR can be closed.  It is 4.x specific, which is now EoL - the
 relevant code was removed before 5.2 was released.
 
 Gavin
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Apr 25 21:49:38 UTC 2007 
State-Changed-Why:  
I'm sorry, but we did not get around to including this during the 4.X 
lifecycle.  It was one of a number of PRs that simply didn't get handled 
due to having more PRs than committers.  In any case, thanks for your 
submission. 

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