From 2f37cfe569d3ed88b6e822ad2d1ff351ba7af5eb Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Mon, 27 Aug 2012 12:42:15 +0200 Subject: [PATCH] Do not scan rotational flag for non-block devices / file images. --- lib/utils_wipe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/utils_wipe.c b/lib/utils_wipe.c index e6190e4..96a183a 100644 --- a/lib/utils_wipe.c +++ b/lib/utils_wipe.c @@ -136,7 +136,8 @@ int crypt_wipe(struct device *device, return -EINVAL; } - if (type == CRYPT_WIPE_DISK) { + if (type == CRYPT_WIPE_DISK && S_ISBLK(st.st_mode)) { + rotational = 0; if (!crypt_sysfs_get_rotational(major(st.st_rdev), minor(st.st_rdev), &rotational)) -- 2.34.1