[PATCH 3/3] e2image: require that -a option is used only with raw or QCOW2 image

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All data cannot be included in normal image file so e2image should exit
in this case.

Signed-off-by: Tomas Racek <tracek@xxxxxxxxxx>
---
 misc/e2image.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/misc/e2image.c b/misc/e2image.c
index 6988c4d..b4e4cf9 100644
--- a/misc/e2image.c
+++ b/misc/e2image.c
@@ -1295,6 +1295,13 @@ int main (int argc, char ** argv)
 		}
 	if (optind != argc - 2 )
 		usage();
+
+	if(all_data && !img_type) {
+		com_err(program_name, 0, "-a option can only be used "
+					 "with raw or QCOW2 images.");
+		exit(1);
+	}
+
 	device_name = argv[optind];
 	image_fn = argv[optind+1];
 
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux