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 | |
parent | edb8075ae0c0986fb168b464b05e0b54537f8f30 (diff) | |
parent | 2ad8850398693cb572152e6d97c59de371996273 (diff) | |
download | sway-7494a48378bff3b11304ba4077bda5a84ed10087.tar.xz |
Merge pull request #1173 from JerziKaminsky/security_resolve_symlink
FOR_REVIEW: IPC security - Allow policy targets to be symlinks
Diffstat (limited to 'include')
-rw-r--r-- | include/sway/security.h | 8 | ||||
-rw-r--r-- | include/util.h | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/sway/security.h b/include/sway/security.h index c3a5cfd4..0edffdfa 100644 --- a/include/sway/security.h +++ b/include/sway/security.h @@ -3,9 +3,11 @@ #include <unistd.h> #include "sway/config.h" -uint32_t get_feature_policy(pid_t pid); -uint32_t get_ipc_policy(pid_t pid); -uint32_t get_command_policy(const char *cmd); +uint32_t get_feature_policy_mask(pid_t pid); +uint32_t get_ipc_policy_mask(pid_t pid); +uint32_t get_command_policy_mask(const char *cmd); + +struct feature_policy *get_feature_policy(const char *name); const char *command_policy_str(enum command_context context); 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 |