Package: pacemaker-mgmt
Version: 2.0.0+hg1141-2.2
Severity: normal
Tags: patch
My pacemaker cluster is running wheezy with a backport of the
pacemaker-mgmt package.
The "Tools" -> "Cluster Report" command fails instantly. The cluster log
contains (hb_report ... /tmp/clrp.XXXXXX contains illegal characters),
which is from the following code in hb_report from the cluster-glue
(wheezy or sid) package ($1 = basename of report temp file):
chkname() {
[ "$1" ] || usage short
echo $1 | grep -qs '[^a-zA-Z0-9@_+=:-]' &&
fatal "$1 contains illegal characters"
}
The mgmtd daemon contains the following code to generate the reports
temporary file:
const char *tempdir = "/tmp";
char *dest = tempnam(tempdir, "clrp.");
I couldn't find a quick source for the character set used by tempnam to
generate the filename, so the patch might just be a incomplete / wrong
workaround.
--- pacemaker-mgmt-2.0.0+hg1141.orig/mgmt/daemon/mgmt_crm.c
+++ pacemaker-mgmt-2.0.0+hg1141/mgmt/daemon/mgmt_crm.c
@@ -1956,7 +1956,7 @@
char str[MAX_STRLEN];
char filename[MAX_STRLEN];
const char *tempdir = "/tmp";
- char *dest = tempnam(tempdir, "clrp.");
+ char *dest = tempnam(tempdir, "clrp_");
struct stat statbuf;
char *ret = NULL;
FILE *fstream = NULL;