+ * Before attempting to generate keys/certificates, first try
+ * link to them from the Citadel server if it's on the same host.
+ * We ignore any error return because it either meant that there
+ * was nothing in Citadel to link from (in which case we just
+ * generate new files) or the target files already exist (which
+ * is not fatal either).
+ */
+ if (!strcasecmp(ctdlhost, "uds")) {
+ sprintf(buf, "%s/keys/citadel.key", ctdlport);
+ rv = symlink(buf, CTDL_KEY_PATH);
+ if (!rv) syslog(1, "%s\n", strerror(errno));
+ sprintf(buf, "%s/keys/citadel.csr", ctdlport);
+ rv = symlink(buf, CTDL_CSR_PATH);
+ if (!rv) syslog(1, "%s\n", strerror(errno));
+ sprintf(buf, "%s/keys/citadel.cer", ctdlport);
+ rv = symlink(buf, CTDL_CER_PATH);
+ if (!rv) syslog(1, "%s\n", strerror(errno));
+ }
+
+ /*
+ * If we still don't have a private key, generate one.