diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-02 11:22:56 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-07-30 13:51:21 +0200 |
commit | 7d1e91d1a9504ab1bc03894038f90a8e87a4e982 (patch) | |
tree | b628e7ca3ba4a24cb88cea2248b001f8b8caa700 /src/shared/unit-file.h | |
parent | 54f44034852e640b4e6e89b8a9c5bd9834574de7 (diff) | |
download | systemd-7d1e91d1a9504ab1bc03894038f90a8e87a4e982.tar.gz systemd-7d1e91d1a9504ab1bc03894038f90a8e87a4e982.tar.bz2 systemd-7d1e91d1a9504ab1bc03894038f90a8e87a4e982.zip |
shared/unit-file: add a function to validate unit alias symlinks
It turns out most possible symlinks are invalid, because the type has to match,
and template units can only be linked to template units.
I'm not sure if the existing code made the same checks consistently. At least
I don't see the same rules expressed in a single place.
Diffstat (limited to 'src/shared/unit-file.h')
-rw-r--r-- | src/shared/unit-file.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/shared/unit-file.h b/src/shared/unit-file.h index 2b9df655ee..e57f472f4f 100644 --- a/src/shared/unit-file.h +++ b/src/shared/unit-file.h @@ -35,3 +35,5 @@ enum UnitFileScope { bool unit_type_may_alias(UnitType type) _const_; bool unit_type_may_template(UnitType type) _const_; + +int unit_validate_alias_symlink_and_warn(const char *filename, const char *target); |