From owner-freebsd-bugs@FreeBSD.ORG Tue May 18 01:10:38 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E5D416A4CE for ; Tue, 18 May 2004 01:10:38 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFEF243D54 for ; Tue, 18 May 2004 01:10:23 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4I8ANsX016301 for ; Tue, 18 May 2004 01:10:23 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4I8ANkU016300; Tue, 18 May 2004 01:10:23 -0700 (PDT) (envelope-from gnats) Resent-Date: Tue, 18 May 2004 01:10:23 -0700 (PDT) Resent-Message-Id: <200405180810.i4I8ANkU016300@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, Alex Semenyaka Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B54CB16A4CE for ; 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 ; 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 ; Tue, 18 May 2004 12:03:37 +0400 (MSD) (envelope-from alexs@qqmore.rinet.ru) Received: (from uucp@localhost)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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/66791: Old dev.db leads to the wrong program behaviour (4.x specific) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alex Semenyaka List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 May 2004 08:10:38 -0000 >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: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 18 01:10:23 PDT 2004 >Closed-Date: >Last-Modified: >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: >Unformatted: