]> code.citadel.org Git - citadel.git/blobdiff - citadel/config.c
* Variable names, comments, documentation, etc... removed the acronym 'BBS'
[citadel.git] / citadel / config.c
index 117f2bf2c8414d2ffd37a4c2d3e18ebeb2a0a331..8562f3472f213f4e4ddbe2113d227464c38a60e0 100644 (file)
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
 #include "config.h"
 
 struct config config;
-char bbs_home_directory[PATH_MAX] = BBSDIR;
+char ctdl_home_directory[PATH_MAX] = CTDLDIR;
 int home_specified = 0;
 
 /*
@@ -36,12 +36,12 @@ void get_config(void) {
        FILE *cfp;
        struct stat st;
 
-       if (chdir(home_specified ? bbs_home_directory : BBSDIR) != 0) {
+       if (chdir(home_specified ? ctdl_home_directory : CTDLDIR) != 0) {
                fprintf(stderr,
                        "This program could not be started.\n"
                        "Unable to change directory to %s\n"
                        "Error: %s\n",
-                       (home_specified ? bbs_home_directory : BBSDIR),
+                       (home_specified ? ctdl_home_directory : CTDLDIR),
                        strerror(errno));
                exit(1);
        }
@@ -50,7 +50,7 @@ void get_config(void) {
                fprintf(stderr, "This program could not be started.\n"
                        "Unable to open %s/citadel.config\n"
                        "Error: %s\n",
-                       (home_specified ? bbs_home_directory : BBSDIR),
+                       (home_specified ? ctdl_home_directory : CTDLDIR),
                        strerror(errno));
                exit(1);
        }
@@ -60,7 +60,7 @@ void get_config(void) {
                exit(1);
        }
 #ifndef __CYGWIN__
-       if (st.st_uid != BBSUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
+       if (st.st_uid != CTDLUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
                fprintf(stderr, "check the permissions on citadel.config\n");
                exit(1);
        }
@@ -80,11 +80,12 @@ void get_config(void) {
                exit(1);
        }
 
-        /* Default maximum message length is 'unlimited' (max int)
-         * and the minimum is 8192
+        /* Default maximum message length is 10 megabytes.  This is site
+        * configurable.  Also check to make sure the limit has not been
+        * set below 8192 bytes.
          */
         if (config.c_maxmsglen <= 0)
-                config.c_maxmsglen = INT_MAX;
+                config.c_maxmsglen = 10485760;
         if (config.c_maxmsglen < 8192)
                 config.c_maxmsglen = 8192;