mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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:
parent
55dbef54ca
commit
294d88444b
2 changed files with 6 additions and 0 deletions
|
|
@ -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') {
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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') {
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue