File fqircd-2.1.3b_config_paths.patch of Package fqircd
Index: include/config.h
===================================================================
--- include/config.h.orig
+++ include/config.h
@@ -40,8 +40,8 @@
* SSL stuff - hands off!
*/
#ifdef USE_SSL
-#define IRCDSSL_KPATH "ircd.key"
-#define IRCDSSL_CPATH "ircd.crt"
+#define IRCDSSL_KPATH "/etc/fqircd/fqircd.pem"
+#define IRCDSSL_CPATH "/etc/fqircd/fqircd.crt"
#define RECV_CHECK_SSL(from, buf, len) (IsSSL(from) && from->ssl) ?\
safe_SSL_read(from, buf, len) :\
@@ -152,11 +152,13 @@
/* File names
* the server will look for these files
*/
-#define MPATH "ircd.motd"
-#define SMPATH "ircd.smotd"
-#define LPATH "ircd.log"
-#define PPATH "ircd.pid"
-#define HPATH "opers.txt"
+#define ETCDIR "/etc/fqircd"
+#define RUNDIR "/var/run/fqircd"
+#define MPATH ETCDIR "/ircd.motd"
+#define SMPATH ETCDIR "/ircd.smotd"
+#define LPATH "/var/log/fqircd/ircd.log"
+#define PPATH RUNDIR "/ircd.pid"
+#define HPATH ETCDIR "/opers.txt"
/* Services Definitions */
@@ -229,7 +231,7 @@
*
* If you do not wish to use this feature, leave LOCKFILE #undef
*/
-#define LOCKFILE "/tmp/ircd.conf.lock"
+#define LOCKFILE RUNDIR "/ircd.conf.lock"
#define CHECK_PENDING_KLINES 10 /* in minutes */
/*
Index: src/dh.c
===================================================================
--- src/dh.c.orig
+++ src/dh.c
@@ -117,7 +117,7 @@
RAND_SRC, strerror(errno));
printf("ircd needs a %d byte random seed.\n", RAND_BYTES);
printf("You can place a file containing random data called"
- " .ircd.entropy\nin the directory with your ircd.conf."
+ " /var/lib/fqircd/.ircd.entropy\nin the directory with your ircd.conf."
" This file must be at least %d bytes\n", RAND_BYTES);
printf("long and should be suitably random.\n");
}
@@ -171,10 +171,10 @@
printf("Done.\n");
fclose(fp);
- fp = fopen(".ircd.entropy", "w");
+ fp = fopen("/var/lib/fqircd/.ircd.entropy", "w");
if(!fp)
{
- printf("Could not open .ircd.entropy for writing: %s\n",
+ printf("Could not open /var/lib/fqircd/.ircd.entropy for writing: %s\n",
strerror(errno));
return 0;
}
@@ -182,7 +182,7 @@
fwrite(randbuf, RAND_BYTES * 4, 1, fp);
fclose(fp);
- RAND_load_file(".ircd.entropy", -1);
+ RAND_load_file("/var/lib/fqircd/.ircd.entropy", -1);
return 1;
}
@@ -192,7 +192,7 @@
int ret;
time_t now;
- ret = RAND_load_file(".ircd.entropy", -1);
+ ret = RAND_load_file("/var/lib/fqircd/.ircd.entropy", -1);
if(ret <= 0)
{
if(!make_entropy())
@@ -206,7 +206,7 @@
/* this is probably not too good, but it saves just writing
the whole state back to disk with no changes. */
RAND_seed(&now, 4);
- RAND_write_file(".ircd.entropy");
+ RAND_write_file("/var/lib/fqircd/.ircd.entropy");
return 0;
}