NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43963: libsa cd9660.c pathname lookup problem



Hi,

ok, further investigation reveals that there is nothing wrong with the
original code (except for the issue with multiple path separators.)
The in-tree-code does exactly what it is designed to do.

Note that the recipe from the How-to-Repeat in the PR does indeed fail,
but that's the result of the '-' character in the filename, which is
invalid in 9660 filenames, and not the result of some incorrectly
parsed tables.  Note also, that the fix proposed in the PR doesn't do
anything to change this.

I'd be happy to change the code to handle the multiple '/' issue (see
attached patch), but other than that, IMHO this PR should be closed.

Ciao,
Wolfgang
--
Wolfgang%Solfrank.net@localhost                          Wolfgang Solfrank
Index: cd9660.c
===================================================================
RCS file: /cvsroot/src/sys/lib/libsa/cd9660.c,v
retrieving revision 1.25
diff -u -r1.25 cd9660.c
--- cd9660.c    22 Mar 2010 16:57:54 -0000      1.25
+++ cd9660.c    15 Oct 2010 11:19:17 -0000
@@ -196,13 +196,14 @@
        bno = isonum_732(pp->block) + isonum_711(pp->extlen);
 
        rc = ENOENT;
-       /*
-        * Remove extra separators
-        */
-       while (*path == '/')
-               path++;
 
        while (*path) {
+               /*
+                * Remove extra separators
+                */
+               while (*path == '/')
+                       path++;
+
                if ((char *)pp >= (char *)buf + psize)
                        break;
                if (isonum_722(pp->parent) != parent)


Home | Main Index | Thread Index | Old Index