mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix script security path normalization in presence of links (#15481)
This commit is contained in:
parent
e9080f91f2
commit
a4d1b5b155
7 changed files with 112 additions and 38 deletions
|
@ -131,6 +131,12 @@ std::string RemoveRelativePathComponents(std::string path);
|
|||
// components and symlinks removed. Returns "" on error.
|
||||
std::string AbsolutePath(const std::string &path);
|
||||
|
||||
// This is a combination of RemoveRelativePathComponents() and AbsolutePath()
|
||||
// It will resolve symlinks for the leading path components that exist and
|
||||
// still remove "." and ".." in the rest of the path.
|
||||
// Returns "" on error.
|
||||
std::string AbsolutePathPartial(const std::string &path);
|
||||
|
||||
// Returns the filename from a path or the entire path if no directory
|
||||
// delimiter is found.
|
||||
const char *GetFilenameFromPath(const char *path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue