conf/66791: Old dev.db leads to the wrong program behaviour (4.x
specific)
Alex Semenyaka
alex at semenyaka.ru
Tue May 18 01:10:38 PDT 2004
>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 at 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:
More information about the freebsd-bugs
mailing list