[Libsysio-commit] HEAD: libsysio/src namei.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-08-20 01:06:13
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10820/src Modified Files: namei.c Log Message: The new logic in pathwalk introduced an error; Reported by Jason Cope at ANL. If a direcotry to be traversed did not grant X permission then the error was caught, the done flag set, and nd->nd_pno is left as NULL. The next thing that was done was to check that the parent mount was same as nd->nd_pno mount. Oops, nd->nd_pno was left set to NULL, resulting in the train wreck we know so well as SIGSEGV. In this change, when handling the error we now set the done flag, do the ENOENT check and if that fails, we break. No need to check if we crossed into a new mount point. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- namei.c 4 Aug 2009 14:19:00 -0000 1.35 +++ namei.c 20 Aug 2009 01:06:01 -0000 1.36 @@ -497,11 +497,13 @@ _sysio_path_walk(struct pnode *parent, s : NULL, (path && next.len) ? path : NULL); if (err) { + done = 1; if (err == -ENOENT && !next.len && (nd->nd_flags & ND_NEGOK)) err = 0; - done = 1; + else + break; } path = NULL; /* Stop that! */ /* |