diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-16 10:17:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-16 10:17:43 -0400 |
commit | 7494a48378bff3b11304ba4077bda5a84ed10087 (patch) | |
tree | 21abe14fe200099fffe5de9b7770cf2ca921e371 /include/util.h | |
parent | edb8075ae0c0986fb168b464b05e0b54537f8f30 (diff) | |
parent | 2ad8850398693cb572152e6d97c59de371996273 (diff) |
Merge pull request #1173 from JerziKaminsky/security_resolve_symlink
FOR_REVIEW: IPC security - Allow policy targets to be symlinks
Diffstat (limited to 'include/util.h')
-rw-r--r-- | include/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/util.h b/include/util.h index 839af265..e5365458 100644 --- a/include/util.h +++ b/include/util.h @@ -49,4 +49,12 @@ pid_t get_parent_pid(pid_t pid); */ uint32_t parse_color(const char *color); +/** + * Given a path string, recurseively resolves any symlinks to their targets + * (which may be a file, directory) and returns the result. + * argument is returned. Caller must free the returned buffer. + * If an error occures, if the path does not exist or if the path corresponds + * to a dangling symlink, NULL is returned. + */ +char* resolve_path(const char* path); #endif |