From: Michele Tartara Date: Tue, 9 Jul 2013 16:05:00 +0000 (+0200) Subject: Cluster verify checks server.pem permissions X-Git-Tag: v2.8.0rc1~48 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/69ac3b7470962df05f6ff4f196fbf1d86fb198ac Cluster verify checks server.pem permissions Currently, ConfD must be able to access server.pem (though this is likely to change in the future). If this is not true, all sorts of weird things happen, such as "gnt-node list" printing lots of question marks instead of actual data, with no meaningful error. This patch adds a check for the proper access permission to "gnt-cluster verify". Fixes Issue 518. Signed-off-by: Michele Tartara Reviewed-by: Klaus Aehlig --- diff --git a/lib/cmdlib/cluster.py b/lib/cmdlib/cluster.py index 9ced853..d3e26bd 100644 --- a/lib/cmdlib/cluster.py +++ b/lib/cmdlib/cluster.py @@ -1277,6 +1277,13 @@ class LUClusterVerifyConfig(NoHooksLU, _VerifyErrors): (errcode, msg) = _VerifyCertificate(cert_filename) self._ErrorIf(errcode, constants.CV_ECLUSTERCERT, None, msg, code=errcode) + self._ErrorIf(not utils.CanRead(constants.CONFD_USER, + pathutils.NODED_CERT_FILE), + constants.CV_ECLUSTERCERT, + None, + pathutils.NODED_CERT_FILE + " must be accessible by the " + + constants.CONFD_USER + " user") + feedback_fn("* Verifying hypervisor parameters") self._VerifyHVP(_GetAllHypervisorParameters(self.cfg.GetClusterInfo(),