mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-03 23:28:58 +00:00
cache: add a comment about a realpath bug
This commit is contained in:
parent
eb574ba0b6
commit
6ff3e8a316
|
@ -3119,6 +3119,17 @@ vn_getcwd(char *buf, char **retbuf, size_t *buflen)
|
|||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Canonicalize a path by walking it forward and back.
|
||||
*
|
||||
* BUGS:
|
||||
* - Nothing guarantees the integrity of the entire chain. Consider the case
|
||||
* where the path "foo/bar/baz/qux" is passed, but "bar" is moved out of
|
||||
* "foo" into "quux" during the backwards walk. The result will be
|
||||
* "quux/bar/baz/qux", which could not have been obtained by an incremental
|
||||
* walk in userspace. Moreover, the path we return is inaccessible if the
|
||||
* calling thread lacks permission to traverse "quux".
|
||||
*/
|
||||
static int
|
||||
kern___realpathat(struct thread *td, int fd, const char *path, char *buf,
|
||||
size_t size, int flags, enum uio_seg pathseg)
|
||||
|
|
Loading…
Reference in a new issue