Currently corosync-keygen will fail if /etc/ais exists. This is absurd
surely. I appreciate that it needs to create the directory if it doesn't
exist, but there are plenty of reasons it might exist before someone
runs the command.
This patch only fails corosync-keygen if mkdir retuns other than EEXIST
--
Chrissie
Index: corosync-keygen.c
===================================================================
--- corosync-keygen.c (revision 2204)
+++ corosync-keygen.c (working copy)
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -57,8 +58,10 @@
exit (1);
}
if (mkdir (SYSCONFDIR "/ais", 0700)) {
- perror ("Failed to create directory: " SYSCONFDIR "/ais");
- exit (1);
+ if (errno != EEXIST) {
+ perror ("Failed to create directory: " SYSCONFDIR "/ais");
+ exit (1);
+ }
}
printf ("Gathering %lu bits for key from /dev/random.\n", (unsigned long)(sizeof (key) * 8));
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais