]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r264417: realpath(): Properly fail "." or ".." components after
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 12 Aug 2014 19:57:12 +0000 (19:57 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 12 Aug 2014 19:57:12 +0000 (19:57 +0000)
commit58c5f86aa7d7f8f6dfa76e63456f2a4d35a8fd68
tree57f59a9934549e99f1bd1a4ff6de303f60e2e658
parent6363991881765d8453caa6ed43f88ae95bf28910
MFC r264417: realpath(): Properly fail "." or ".." components after
non-directories.

If realpath() is called on pathnames like "/dev/null/." or "/dev/null/..",
it should fail with [ENOTDIR]. Pathnames like "/dev/null/" already failed as
they should.

Also, put the check for non-directories after lstatting the previous
component instead of when the empty component (consecutive or trailing
slashes) is detected, saving an lstat() call and some lines of code.

PR: kern/82980

git-svn-id: svn://svn.freebsd.org/base/stable/9@269890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/stdlib/realpath.c