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*.
This commit is contained in:
Joerg Wunsch 2003-01-11 20:10:41 +00:00
parent 55dbef54ca
commit 294d88444b
2 changed files with 6 additions and 0 deletions

View file

@ -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') {
/*

View file

@ -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') {
/*