summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ifs/pass1.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-09-09 11:06:27 +0000
committerdg <dg@FreeBSD.org>1994-09-09 11:06:27 +0000
commit07c3866a6e3d1bc84ae70e71b9dc5209d2c82321 (patch)
treee0851b00dd84ff861664fa1372a7b37d8932f469 /sbin/fsck_ifs/pass1.c
parent692067737c6d489a3ad726eaa444614b94e79442 (diff)
downloadFreeBSD-src-07c3866a6e3d1bc84ae70e71b9dc5209d2c82321.zip
FreeBSD-src-07c3866a6e3d1bc84ae70e71b9dc5209d2c82321.tar.gz
Two fixes from the NetBSD group (Charles Hannum):
1) dir.c: get byte order right in mkentry() 2) pass1.c: When doing -c2 conversion, do secsize reads for a symlink - not doing so was causing the conversion to fail because the device driver can't deal with short reads.
Diffstat (limited to 'sbin/fsck_ifs/pass1.c')
-rw-r--r--sbin/fsck_ifs/pass1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/fsck_ifs/pass1.c b/sbin/fsck_ifs/pass1.c
index a3ab2f9..fc46eb0 100644
--- a/sbin/fsck_ifs/pass1.c
+++ b/sbin/fsck_ifs/pass1.c
@@ -95,7 +95,7 @@ checkinode(inumber, idesc)
struct zlncnt *zlnp;
int ndb, j;
mode_t mode;
- char symbuf[MAXSYMLINKLEN];
+ char *symbuf;
dp = getnextinode(inumber);
mode = dp->di_mode & IFMT;
@@ -141,9 +141,10 @@ checkinode(inumber, idesc)
if (doinglevel2 &&
dp->di_size > 0 && dp->di_size < MAXSYMLINKLEN &&
dp->di_blocks != 0) {
+ symbuf = alloca(secsize);
if (bread(fsreadfd, symbuf,
fsbtodb(&sblock, dp->di_db[0]),
- (long)dp->di_size) != 0)
+ (long)secsize) != 0)
errexit("cannot read symlink");
if (debug) {
symbuf[dp->di_size] = 0;
OpenPOWER on IntegriCloud