diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-11-14 05:21:46 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-11-14 05:21:46 +0100 |
commit | 0bea7672957f142d8af58d04ade70b91e7ffb727 (patch) | |
tree | 5013126e36210705698072cc429a1198e01f5ce5 | |
parent | change prototypes for humanmode and machinemode (diff) | |
download | slibc-0bea7672957f142d8af58d04ade70b91e7ffb727.tar.gz slibc-0bea7672957f142d8af58d04ade70b91e7ffb727.tar.bz2 slibc-0bea7672957f142d8af58d04ade70b91e7ffb727.tar.xz |
doc: cleanname is not symlink-safe either
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r-- | include/libgen.h | 4 | ||||
-rw-r--r-- | src/libgen.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/libgen.h b/include/libgen.h index d417739..182f192 100644 --- a/include/libgen.h +++ b/include/libgen.h @@ -64,6 +64,10 @@ char* dirname(char*) * '..' directory components that should resolve up beyond '/', * are removed. Note that this can in fact mean that the resulting * path is not the same file if the processes is `chroot`:ed. + * Additionally, and more important, there is no consideration for + * symbolic links. For example, '/a/b/c/..' resolves to '/a/b', + * but if any of the directors are symbolic links, the real path + * is not necessarily '/a/b'. * * This is a slibc extension. * diff --git a/src/libgen.c b/src/libgen.c index 9f24da6..41f3dd0 100644 --- a/src/libgen.c +++ b/src/libgen.c @@ -113,6 +113,10 @@ char* dirname(char* filename) * '..' directory components that should resolve up beyond '/', * are removed. Note that this can in fact mean that the resulting * path is not the same file if the processes is `chroot`:ed. + * Additionally, and more important, there is no consideration for + * symbolic links. For example, '/a/b/c/..' resolves to '/a/b', + * but if any of the directors are symbolic links, the real path + * is not necessarily '/a/b'. * * This is a slibc extension. * |