mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
util: Introduce virFileCanonicalizePath()
It's a trivial wrapper around canonicalize_file_name(), which we need in order to fully mock file access on non-Linux platforms. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b71ce433bc
commit
026606caf2
@ -1760,6 +1760,7 @@ virFileAccessibleAs;
|
||||
virFileActivateDirOverride;
|
||||
virFileBindMountDevice;
|
||||
virFileBuildPath;
|
||||
virFileCanonicalizePath;
|
||||
virFileClose;
|
||||
virFileComparePaths;
|
||||
virFileCopyACLs;
|
||||
|
@ -3299,6 +3299,19 @@ virFileSanitizePath(const char *path)
|
||||
return cleanpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* virFileCanonicalizePath:
|
||||
*
|
||||
* Returns the canonical representation of @path.
|
||||
*
|
||||
* The returned string must be freed after use.
|
||||
*/
|
||||
char *
|
||||
virFileCanonicalizePath(const char *path)
|
||||
{
|
||||
return canonicalize_file_name(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* virFileRemoveLastComponent:
|
||||
*
|
||||
|
@ -218,6 +218,7 @@ int virFileGetMountReverseSubtree(const char *mtabpath,
|
||||
size_t *nmountsret) ATTRIBUTE_RETURN_CHECK;
|
||||
|
||||
char *virFileSanitizePath(const char *path);
|
||||
char *virFileCanonicalizePath(const char *path) ATTRIBUTE_NOINLINE;
|
||||
|
||||
enum {
|
||||
VIR_FILE_OPEN_NONE = 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user