]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
e2image: require that -a option is used only with raw or QCOW2 image
authorTomas Racek <tracek@redhat.com>
Mon, 22 Apr 2013 03:21:32 +0000 (23:21 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Apr 2013 03:21:46 +0000 (23:21 -0400)
All data cannot be included in normal image file so e2image should exit
in this case.

Signed-off-by: Tomas Racek <tracek@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
misc/e2image.c

index 6988c4d26e4d55e6dbd6f167d44f607b2c83a69d..70bb9ac2004ad4697e27b3f3045eaa94126d3d22 100644 (file)
@@ -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];