From 7add64684196fa5ff8cc33b3df1c6d371dcc0d66 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 12 Aug 2015 23:16:49 -0400 Subject: [PATCH] rbd:Check the dest image name, if it is empty string, refuse to execute and give a message Signed-off-by: solesoul1127 --- src/rbd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rbd.cc b/src/rbd.cc index ff3d46da3073..5a007325e3c2 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -3474,7 +3474,7 @@ if (!set_conf_param(v, p1, p2, p3)) { \ } if ((opt_cmd == OPT_COPY || opt_cmd == OPT_CLONE || opt_cmd == OPT_RENAME) && - !destname ) { + ((!destname) || (destname[0] == '\0')) ) { cerr << "rbd: destination image name was not specified" << std::endl; return EXIT_FAILURE; } -- 2.47.3