NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/43963: libsa cd9660.c pathname lookup problem
>Number: 43963
>Category: kern
>Synopsis: libsa cd9660.c pathname lookup problem
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Oct 12 14:15:00 +0000 2010
>Originator: Minoura Makoto
>Release: NetBSD 5.0.2
>Organization:
>Environment:
System: NetBSD jumbo 5.0.2 NetBSD 5.0.2 (JUMBO) #18: Mon Mar 8 22:21:10 JST
2010 root@jumbo:/usr/obj/sys/arch/i386/compile/JUMBO i386
Architecture: i386
Machine: i386
>Description:
cd9660_open() traverses the ISO9660 path table incorrectly,
and fails to open files in subdirectories.
I'm afraid the author misunderstood the order of the entries.
Note it can open any files in the root directory successfully.
>How-To-Repeat:
Put NetBSD/i386 CD-ROM and start the machine.
At the > boot prompt, type boot
i386/binary/kernel/netbsd-INSTALL_FLOPPY.gz etc.
>Fix:
Index: sys/lib/libsa/cd9660.c
===================================================================
RCS file: /cvsroot/src/sys/lib/libsa/cd9660.c,v
retrieving revision 1.23
diff -u -r1.23 cd9660.c
--- sys/lib/libsa/cd9660.c 24 Nov 2007 13:20:54 -0000 1.23
+++ sys/lib/libsa/cd9660.c 11 Oct 2010 11:41:02 -0000
@@ -205,9 +205,7 @@
while (*path) {
if ((char *)pp >= (char *)buf + psize)
break;
- if (isonum_722(pp->parent) != parent)
- break;
- if (!pnmatch(path, pp)) {
+ if (!pnmatch(path, pp) || (isonum_722(pp->parent) != parent)) {
pp = (struct ptable_ent *)((char *)pp + PTSIZE(pp));
ent++;
continue;
@@ -215,12 +213,6 @@
path += isonum_711(pp->namlen) + 1;
parent = ent;
bno = isonum_732(pp->block) + isonum_711(pp->extlen);
- while ((char *)pp < (char *)buf + psize) {
- if (isonum_722(pp->parent) == parent)
- break;
- pp = (struct ptable_ent *)((char *)pp + PTSIZE(pp));
- ent++;
- }
}
/*
>Unformatted:
and probably -current.
Home |
Main Index |
Thread Index |
Old Index