Author: ache
Date: Sat Jul 30 03:11:54 2016
New Revision: 303536
URL: https://svnweb.freebsd.org/changeset/base/303536

Log:
  Rework r303074 case 4. Don't immediatelly skip directory entries which
  cause MAXPATHLEN exceeded. Process them first through gl_errfunc() and
  GLOB_ERR.

Modified:
  head/lib/libc/gen/glob.c

Modified: head/lib/libc/gen/glob.c
==============================================================================
--- head/lib/libc/gen/glob.c    Sat Jul 30 03:11:53 2016        (r303535)
+++ head/lib/libc/gen/glob.c    Sat Jul 30 03:11:54 2016        (r303536)
@@ -803,6 +803,13 @@ glob3(Char *pathbuf, Char *pathend, Char
                        }
                        sc += clen;
                }
+               if (too_long && ((pglob->gl_errfunc != NULL &&
+                   pglob->gl_errfunc(buf, ENAMETOOLONG)) ||
+                   (pglob->gl_flags & GLOB_ERR))) {
+                       errno = ENAMETOOLONG;
+                       err = GLOB_ABORTED;
+                       break;
+               }
                if (too_long || !match(pathend, pattern, restpattern)) {
                        *pathend = EOS;
                        errno = 0;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to