Re: cvs commit: src/lib/libarchive archive_entry.c
On Sat, 11 Dec 2004, Warner Losh wrote:
> This also pointed out a bug in our mknod() routine in one edge case.
> I believe we should return EINVAL when that happens in the syscall.
> Specifically "mknod foo c 255 0xffff00ff" results in a file foo with
> major/minor number of 0. This is because VNOVAL is -1 and there
> appear to be checks against it in the code later, hence we end up with
> 0, 0. I believe that we should either make it work (hard), or we
> should return EINVAL from the syscall wrapper or some routine early in
> the path.
I agree. It should return -1/EINVAL.
A dev_t with value 0xffffffff can also be generated by badsect(1) now
that daddr_t is 64 bits. badsect checks that the bad block number is
representable as a dev_t, but it doesn't know that 0xffffffff is
special. Also, it doesn't know that C99 broke long being longest, so
its error message for unrepresentable block numbers (ones larger than
0xffffffff) is now broken on machines with < 64-bit longs.
Received on Sat Dec 11 2004 - 21:33:15 UTC