diff options
-rw-r--r-- | libblkid/src/blkidP.h | 5 | ||||
-rw-r--r-- | libblkid/src/evaluate.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h index b6c2bc607..604de3ddb 100644 --- a/libblkid/src/blkidP.h +++ b/libblkid/src/blkidP.h @@ -13,9 +13,12 @@ #ifndef _BLKID_BLKIDP_H #define _BLKID_BLKIDP_H - +/* support debug output if LIBBLKID_DEBUG env. variable is set */ #define CONFIG_BLKID_DEBUG 1 +/* Always confirm that /dev/disk-by symlinks match with LABEL/UUID on device */ +/* #define CONFIG_BLKID_VERIFY_UDEV 1 */ + #include <sys/types.h> #include <dirent.h> #include <sys/stat.h> diff --git a/libblkid/src/evaluate.c b/libblkid/src/evaluate.c index fbd8a96fd..5a84b4325 100644 --- a/libblkid/src/evaluate.c +++ b/libblkid/src/evaluate.c @@ -48,6 +48,7 @@ * API. */ +#ifdef CONFIG_BLKID_VERIFY_UDEV /* returns zero when the device has NAME=value (LABEL/UUID) */ static int verify_tag(const char *devname, const char *name, const char *value) { @@ -91,6 +92,7 @@ done: /* for non-root users we use unverified udev links */ return errsv == EACCES ? 0 : rc; } +#endif /* CONFIG_BLKID_VERIFY_UDEV*/ /** * blkid_send_uevent: @@ -169,8 +171,10 @@ static char *evaluate_by_udev(const char *token, const char *value, int uevent) if (!path) return NULL; +#ifdef CONFIG_BLKID_VERIFY_UDEV if (verify_tag(path, token, value)) goto failed; +#endif return path; failed: |