util: whitelist Oracle ACFS as a shared filesystem

The magic number is taken from the coreutils stat.c file since
there is no constant for it in normal system headers.

Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-11-26 16:29:47 +00:00
parent 6881ef2e4e
commit 27660f7990
2 changed files with 8 additions and 1 deletions

View File

@ -3426,6 +3426,8 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
# define QB_MAGIC 0x51626d6e
# endif
# define VIR_ACFS_MAGIC 0x61636673
# define PROC_MOUNTS "/proc/mounts"
static int
@ -3578,6 +3580,9 @@ virFileIsSharedFSType(const char *path,
if ((fstypes & VIR_FILE_SHFS_QB) &&
(f_type == QB_MAGIC))
return 1;
if ((fstypes & VIR_FILE_SHFS_ACFS) &&
(f_type == VIR_ACFS_MAGIC))
return 1;
return 0;
}
@ -3765,7 +3770,8 @@ int virFileIsSharedFS(const char *path)
VIR_FILE_SHFS_CIFS |
VIR_FILE_SHFS_CEPH |
VIR_FILE_SHFS_GPFS|
VIR_FILE_SHFS_QB);
VIR_FILE_SHFS_QB |
VIR_FILE_SHFS_ACFS);
}

View File

@ -209,6 +209,7 @@ enum {
VIR_FILE_SHFS_CEPH = (1 << 6),
VIR_FILE_SHFS_GPFS = (1 << 7),
VIR_FILE_SHFS_QB = (1 << 8),
VIR_FILE_SHFS_ACFS = (1 << 9),
};
int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);