1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-29 08:08:37 +00:00

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:
Kirk McKusick 2000-07-12 06:19:22 +00:00
parent 07632cbf66
commit 7932349eff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63003
3 changed files with 18 additions and 0 deletions

View File

@ -209,6 +209,12 @@ checkinode(inumber, idesc)
dp->di_mode = IFREG|0600;
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);
if (ndb < 0) {
if (debug)

View File

@ -209,6 +209,12 @@ checkinode(inumber, idesc)
dp->di_mode = IFREG|0600;
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);
if (ndb < 0) {
if (debug)

View File

@ -209,6 +209,12 @@ checkinode(inumber, idesc)
dp->di_mode = IFREG|0600;
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);
if (ndb < 0) {
if (debug)