projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a184abc
)
btrfs-progs: limit minimal num of args for btrfs-image
author
Gui Hecheng
<guihc.fnst@cn.fujitsu.com>
Mon, 30 Jun 2014 03:54:12 +0000
(11:54 +0800)
committer
David Sterba
<dsterba@suse.cz>
Fri, 22 Aug 2014 12:55:27 +0000
(14:55 +0200)
The btrfs-image requires at least 2 args to run,
one for the source dev/file, the other for the target dev/file.
This patch depends on patch:
btrfs-progs: move the check_argc_* functions into utils.c
Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-image.c
patch
|
blob
|
history
diff --git
a/btrfs-image.c
b/btrfs-image.c
index
03cf85e
..
985aa26
100644
(file)
--- a/
btrfs-image.c
+++ b/
btrfs-image.c
@@
-2522,6
+2522,10
@@
int main(int argc, char *argv[])
}
argc = argc - optind;
+ set_argv0(argv);
+ if (check_argc_min(argc, 2))
+ print_usage();
+
dev_cnt = argc - 1;
if (create) {