File bahamut-1.8.3_config_paths.patch of Package bahamut

Index: include/config.h
===================================================================
--- include/config.h.orig
+++ include/config.h
@@ -130,11 +130,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/bahamut"
+#define	RUNDIR	"/var/run/bahamut"
+#define	MPATH	ETCDIR "/ircd.motd"
+#define	SMPATH	ETCDIR "/ircd.smotd"
+#define	LPATH	"/var/log/bahamut/ircd.log"
+#define	PPATH	RUNDIR "/ircd.pid"
+#define	HPATH	ETCDIR "/opers.txt"
 
 
 /* Services Definitions */
@@ -207,7 +209,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/bahamut/.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/bahamut/.ircd.entropy", "w");
     if(!fp)
     {
-        printf("Could not open .ircd.entropy for writing: %s\n", 
+        printf("Could not open /var/lib/bahamut/.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/bahamut/.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/bahamut/.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/bahamut/.ircd.entropy");
 
     return 0;
 }
openSUSE Build Service is sponsored by