mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06: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;
|
virFileActivateDirOverride;
|
||||||
virFileBindMountDevice;
|
virFileBindMountDevice;
|
||||||
virFileBuildPath;
|
virFileBuildPath;
|
||||||
|
virFileCanonicalizePath;
|
||||||
virFileClose;
|
virFileClose;
|
||||||
virFileComparePaths;
|
virFileComparePaths;
|
||||||
virFileCopyACLs;
|
virFileCopyACLs;
|
||||||
|
@ -3299,6 +3299,19 @@ virFileSanitizePath(const char *path)
|
|||||||
return cleanpath;
|
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:
|
* virFileRemoveLastComponent:
|
||||||
*
|
*
|
||||||
|
@ -218,6 +218,7 @@ int virFileGetMountReverseSubtree(const char *mtabpath,
|
|||||||
size_t *nmountsret) ATTRIBUTE_RETURN_CHECK;
|
size_t *nmountsret) ATTRIBUTE_RETURN_CHECK;
|
||||||
|
|
||||||
char *virFileSanitizePath(const char *path);
|
char *virFileSanitizePath(const char *path);
|
||||||
|
char *virFileCanonicalizePath(const char *path) ATTRIBUTE_NOINLINE;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
VIR_FILE_OPEN_NONE = 0,
|
VIR_FILE_OPEN_NONE = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user