summaryrefslogtreecommitdiff
path: root/src/NetworkManagerUtils.h
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-10-19 10:21:53 +0200
committerThomas Haller <thaller@redhat.com>2018-10-23 10:32:53 +0200
commitf90b3adc153c78a828ad265aa8c65c0f7f54e023 (patch)
tree82ea76c72ebea201267c15249bb19cc634254014 /src/NetworkManagerUtils.h
parent9dce4a426ba82307cd27de23f3f3d8aed569d79b (diff)
downloadNetworkManager-f90b3adc153c78a828ad265aa8c65c0f7f54e023.tar.gz
core: add nm_utils_file_is_in_path() for checking paths
Add a helper function for the common check whether a file is inside a path. Also, this function handles special cases like repeated file separators. However, as it is still entirely text based, it also cannot recognize if two (literally) different paths reference the same inode/file.
Diffstat (limited to 'src/NetworkManagerUtils.h')
-rw-r--r--src/NetworkManagerUtils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/NetworkManagerUtils.h b/src/NetworkManagerUtils.h
index 26907243f6..93edb912dd 100644
--- a/src/NetworkManagerUtils.h
+++ b/src/NetworkManagerUtils.h
@@ -86,4 +86,10 @@ void nm_shutdown_wait_obj_unregister (NMShutdownWaitObjHandle *handle);
/*****************************************************************************/
+const char *
+nm_utils_file_is_in_path (const char *abs_filename,
+ const char *abs_path);
+
+/*****************************************************************************/
+
#endif /* __NETWORKMANAGER_UTILS_H__ */