Ensure that block and character devices as well as fifo's and sockets
all have zero length. A non-zero length panic's the kernel when one of these is deleted. PR: 19426 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: dwmalone@FreeBSD.org
This commit is contained in:
parent
07632cbf66
commit
7932349eff
@ -209,6 +209,12 @@ checkinode(inumber, idesc)
|
|||||||
dp->di_mode = IFREG|0600;
|
dp->di_mode = IFREG|0600;
|
||||||
inodirty();
|
inodirty();
|
||||||
}
|
}
|
||||||
|
if ((mode == IFBLK || mode == IFCHR || mode == IFIFO ||
|
||||||
|
mode == IFSOCK) && dp->di_size != 0) {
|
||||||
|
if (debug)
|
||||||
|
printf("bad special-file size %qu:", dp->di_size);
|
||||||
|
goto unknown;
|
||||||
|
}
|
||||||
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
||||||
if (ndb < 0) {
|
if (ndb < 0) {
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -209,6 +209,12 @@ checkinode(inumber, idesc)
|
|||||||
dp->di_mode = IFREG|0600;
|
dp->di_mode = IFREG|0600;
|
||||||
inodirty();
|
inodirty();
|
||||||
}
|
}
|
||||||
|
if ((mode == IFBLK || mode == IFCHR || mode == IFIFO ||
|
||||||
|
mode == IFSOCK) && dp->di_size != 0) {
|
||||||
|
if (debug)
|
||||||
|
printf("bad special-file size %qu:", dp->di_size);
|
||||||
|
goto unknown;
|
||||||
|
}
|
||||||
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
||||||
if (ndb < 0) {
|
if (ndb < 0) {
|
||||||
if (debug)
|
if (debug)
|
||||||
|
@ -209,6 +209,12 @@ checkinode(inumber, idesc)
|
|||||||
dp->di_mode = IFREG|0600;
|
dp->di_mode = IFREG|0600;
|
||||||
inodirty();
|
inodirty();
|
||||||
}
|
}
|
||||||
|
if ((mode == IFBLK || mode == IFCHR || mode == IFIFO ||
|
||||||
|
mode == IFSOCK) && dp->di_size != 0) {
|
||||||
|
if (debug)
|
||||||
|
printf("bad special-file size %qu:", dp->di_size);
|
||||||
|
goto unknown;
|
||||||
|
}
|
||||||
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
ndb = howmany(dp->di_size, sblock.fs_bsize);
|
||||||
if (ndb < 0) {
|
if (ndb < 0) {
|
||||||
if (debug)
|
if (debug)
|
||||||
|
Loading…
Reference in New Issue
Block a user