mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 12:44:53 +01:00
Fixed so that it can grok old style "fastlinks".
This commit is contained in:
parent
b0756e8093
commit
bd5cd438f2
@ -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