[net.bugs.v7] minor fsck problem

henry (01/19/83)

Fsck(1) has a small problem.  The code that reconnects orphaned files
writes only seven characters of name (six digits plus a NUL) into the
lost+found directory.  If the file previously occupying that directory
slot had a name longer than 7 characters, you end up with a name which
is "unspeakable":  there is no name a program can feed to the kernel
that will match a name with a NUL in the middle.  (The nami routine is
not smart enough to stop comparing characters when it hits a NUL in the
name field of the directory entry.)

The remedy is to make fsck write the full 14 characters.  The simplest
(albeit ugliest) way to do this is to make it write a 13-digit number
instead of a 6-digit one.  Like this, in routine mkentry():

	1544c1544
	< 	p = &dirp->d_name[7];
	---
	> 	p = &dirp->d_name[DIRSIZ];