fs-util: rename path_is_safe() → path_is_normalized()

Already, path_is_safe() refused paths container the "." dir. Doing that
isn't strictly necessary to be "safe" by most definitions of the word.
But it is necessary in order to consider a path "normalized". Hence,
"path_is_safe()" is slightly misleading a name, but
"path_is_normalize()" is more descriptive, hence let's rename things
accordingly.

No functional changes.
This commit is contained in:
Lennart Poettering
2017-11-17 11:13:44 +01:00
parent 5db9818772
commit 99be45a46f
11 changed files with 23 additions and 24 deletions
+2 -2
View File
@@ -1278,7 +1278,7 @@ int cg_split_spec(const char *spec, char **controller, char **path) {
assert(spec);
if (*spec == '/') {
if (!path_is_safe(spec))
if (!path_is_normalized(spec))
return -EINVAL;
if (path) {
@@ -1331,7 +1331,7 @@ int cg_split_spec(const char *spec, char **controller, char **path) {
return -ENOMEM;
}
if (!path_is_safe(u) ||
if (!path_is_normalized(u) ||
!path_is_absolute(u)) {
free(t);
free(u);