projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1bfb84
)
fs-util: extra chase_symlink() safety check on "path" parameter
author
Lennart Poettering
<lennart@poettering.net>
Wed, 17 Jan 2018 11:00:12 +0000
(12:00 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 17 Jan 2018 11:04:15 +0000
(12:04 +0100)
It's not clear what an empty "path" is even supposed to mean, hence
refuse.
src/basic/fs-util.c
patch
|
blob
|
history
diff --git
a/src/basic/fs-util.c
b/src/basic/fs-util.c
index
15f9958
..
f0df79d
100644
(file)
--- a/
src/basic/fs-util.c
+++ b/
src/basic/fs-util.c
@@
-637,6
+637,9
@@
int chase_symlinks(const char *path, const char *original_root, unsigned flags,
if ((flags & (CHASE_NONEXISTENT|CHASE_OPEN)) == (CHASE_NONEXISTENT|CHASE_OPEN))
return -EINVAL;
+ if (isempty(path))
+ return -EINVAL;
+
/* This is a lot like canonicalize_file_name(), but takes an additional "root" parameter, that allows following
* symlinks relative to a root directory, instead of the root of the host.
*