mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-19 22:43:22 +01:00
Fixed so that it can grok old style "fastlinks".
This commit is contained in:
parent
87006abef6
commit
3aa3bb33c4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1820
@ -63,7 +63,7 @@ ckinode(dp, idesc)
|
||||
idesc->id_filesize = dp->di_size;
|
||||
mode = dp->di_mode & IFMT;
|
||||
if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
|
||||
dp->di_size < sblock.fs_maxsymlinklen))
|
||||
(dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0)))
|
||||
return (KEEPON);
|
||||
dino = *dp;
|
||||
ndb = howmany(dino.di_size, sblock.fs_bsize);
|
||||
|
@ -160,7 +160,7 @@ checkinode(inumber, idesc)
|
||||
* Fake ndb value so direct/indirect block checks below
|
||||
* will detect any garbage after symlink string.
|
||||
*/
|
||||
if (dp->di_size < sblock.fs_maxsymlinklen) {
|
||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
||||
ndb = howmany(dp->di_size, sizeof(daddr_t));
|
||||
if (ndb > NDADDR) {
|
||||
j = ndb - NDADDR;
|
||||
|
@ -63,7 +63,7 @@ ckinode(dp, idesc)
|
||||
idesc->id_filesize = dp->di_size;
|
||||
mode = dp->di_mode & IFMT;
|
||||
if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
|
||||
dp->di_size < sblock.fs_maxsymlinklen))
|
||||
(dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0)))
|
||||
return (KEEPON);
|
||||
dino = *dp;
|
||||
ndb = howmany(dino.di_size, sblock.fs_bsize);
|
||||
|
@ -160,7 +160,7 @@ checkinode(inumber, idesc)
|
||||
* Fake ndb value so direct/indirect block checks below
|
||||
* will detect any garbage after symlink string.
|
||||
*/
|
||||
if (dp->di_size < sblock.fs_maxsymlinklen) {
|
||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
||||
ndb = howmany(dp->di_size, sizeof(daddr_t));
|
||||
if (ndb > NDADDR) {
|
||||
j = ndb - NDADDR;
|
||||
|
@ -63,7 +63,7 @@ ckinode(dp, idesc)
|
||||
idesc->id_filesize = dp->di_size;
|
||||
mode = dp->di_mode & IFMT;
|
||||
if (mode == IFBLK || mode == IFCHR || (mode == IFLNK &&
|
||||
dp->di_size < sblock.fs_maxsymlinklen))
|
||||
(dp->di_size < sblock.fs_maxsymlinklen || dp->di_blocks == 0)))
|
||||
return (KEEPON);
|
||||
dino = *dp;
|
||||
ndb = howmany(dino.di_size, sblock.fs_bsize);
|
||||
|
@ -160,7 +160,7 @@ checkinode(inumber, idesc)
|
||||
* Fake ndb value so direct/indirect block checks below
|
||||
* will detect any garbage after symlink string.
|
||||
*/
|
||||
if (dp->di_size < sblock.fs_maxsymlinklen) {
|
||||
if ((dp->di_size < sblock.fs_maxsymlinklen) || dp->di_blocks == 0) {
|
||||
ndb = howmany(dp->di_size, sizeof(daddr_t));
|
||||
if (ndb > NDADDR) {
|
||||
j = ndb - NDADDR;
|
||||
|
Loading…
Reference in New Issue
Block a user