From: root Date: Thu, 13 Aug 2015 03:16:49 +0000 (-0400) Subject: rbd:Check the dest image name, if it is empty string, refuse to execute and give... X-Git-Tag: v9.1.0~368^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5560%2Fhead;p=ceph.git rbd:Check the dest image name, if it is empty string, refuse to execute and give a message Signed-off-by: solesoul1127 --- diff --git a/src/rbd.cc b/src/rbd.cc index ff3d46da307..5a007325e3c 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; }