From: Tomas Racek Date: Mon, 22 Apr 2013 03:21:32 +0000 (-0400) Subject: e2image: require that -a option is used only with raw or QCOW2 image X-Git-Tag: v1.42.8~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdaf34f8c05698cdefb2db9825b2a957b486f380;p=thirdparty%2Fe2fsprogs.git e2image: require that -a option is used only with raw or QCOW2 image All data cannot be included in normal image file so e2image should exit in this case. Signed-off-by: Tomas Racek Signed-off-by: Theodore Ts'o Reviewed-by: Eric Sandeen --- diff --git a/misc/e2image.c b/misc/e2image.c index 6988c4d26..70bb9ac20 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];