diff options
author | joerg <joerg@FreeBSD.org> | 2003-01-11 20:10:41 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 2003-01-11 20:10:41 +0000 |
commit | fc7b77b4852541f21105a45b4f546a6fccdff978 (patch) | |
tree | d89a8bf9e2812f5bc8b4f9fd35a8ae2cb8560971 /sys/dev | |
parent | 660cebb9d7cdc56c46fa8c93ffec76fe7d950f30 (diff) | |
download | FreeBSD-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/dev')
-rw-r--r-- | sys/dev/fdc/fdc.c | 3 |
1 files changed, 3 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') { /* |