From: Gerhard Muntingh Date: Tue, 14 Apr 2015 12:02:15 +0000 (+0200) Subject: ceph-authtool: exit(1) when printing a non-existing key X-Git-Tag: v9.0.1~122^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=16a3fbd56b3dcfcbdd4190c07bf8634ebc5a5f78;p=ceph.git ceph-authtool: exit(1) when printing a non-existing key When printing a non-existing key, ceph-authtool exits with a success value: [root@ip-172-31-3-178 ~]# ceph-authtool /etc/ceph/ceph.mon.keyring -p -n client.doesntexist ; echo $? entity client.doesntexist not found 0 Expected result: 1 Signed-off-by: Gerhard Muntingh --- diff --git a/src/tools/ceph_authtool.cc b/src/tools/ceph_authtool.cc index fd3f73fb591..caf1f0ac55b 100644 --- a/src/tools/ceph_authtool.cc +++ b/src/tools/ceph_authtool.cc @@ -264,6 +264,7 @@ int main(int argc, const char **argv) cout << key << std::endl; } else { cerr << "entity " << ename << " not found" << std::endl; + exit(1); } } @@ -274,6 +275,7 @@ int main(int argc, const char **argv) r = bl.write_file(fn.c_str(), 0600); if (r < 0) { cerr << "could not write " << fn << std::endl; + exit(1); } //cout << "wrote " << bl.length() << " bytes to " << fn << std::endl; }