From 294d88444b7de0eaf12ff654ec9e6a7c3ce4a615 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sat, 11 Jan 2003 20:10:41 +0000 Subject: [PATCH] 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*. --- sys/dev/fdc/fdc.c | 3 +++ sys/isa/fd.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 1fc50a30c7b..917356495f9 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 1fc50a30c7b..917356495f9 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') { /*