summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2003-01-11 20:10:41 +0000
committerjoerg <joerg@FreeBSD.org>2003-01-11 20:10:41 +0000
commitfc7b77b4852541f21105a45b4f546a6fccdff978 (patch)
treed89a8bf9e2812f5bc8b4f9fd35a8ae2cb8560971 /sys
parent660cebb9d7cdc56c46fa8c93ffec76fe7d950f30 (diff)
downloadFreeBSD-src-fc7b77b4852541f21105a45b4f546a6fccdff978.zip
FreeBSD-src-fc7b77b4852541f21105a45b4f546a6fccdff978.tar.gz
Bail out of fd_clone() if the parsed unit number doesn't match our
expectation. This solves the problem, where in a constellation with two (or more) drives, an attempt is made to access a device name for that device using a historic partition letter, like /dev/fd1c. This is supposed to create a symlink to the master device, but previously, the link was always created to /dev/fd0, even if the request was for fd1*.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdc/fdc.c3
-rw-r--r--sys/isa/fd.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 1fc50a3..9173564 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -1136,6 +1136,9 @@ fd_clone(void *arg, char *name, int namelen, dev_t *dev)
return;
if (dev_stdclone(name, &n, "fd", &u) != 2)
return;
+ if (u != fd->fdu)
+ /* unit # mismatch */
+ return;
l = strlen(n);
if (l == 1 && *n >= 'a' && *n <= 'h') {
/*
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 1fc50a3..9173564 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -1136,6 +1136,9 @@ fd_clone(void *arg, char *name, int namelen, dev_t *dev)
return;
if (dev_stdclone(name, &n, "fd", &u) != 2)
return;
+ if (u != fd->fdu)
+ /* unit # mismatch */
+ return;
l = strlen(n);
if (l == 1 && *n >= 'a' && *n <= 'h') {
/*
OpenPOWER on IntegriCloud