cvs commit: src/lib/libarchive archive_entry.c

Warner Losh imp at harmony.village.org
Sat Dec 11 11:29:45 PST 2004


>   Be more careful about assembling/disassembling
>   device numbers.  In particular, this should fix
>   a bug where archiving a device node with a very
>   large minor number would sometimes overflow and
>   corrupt the major number.

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.

Comments?

Warner




More information about the cvs-src mailing list