*
*/
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
#include "sysdep.h"
#include <stdlib.h>
#include <sys/stat.h>
#include "config.h"
struct config config;
-char bbs_home_directory[PATH_MAX] = BBSDIR;
-int home_specified = 0;
/*
* get_config() is called during the initialization of any program which
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);
}
- cfp = fopen("citadel.config", "rb");
+ cfp = fopen(file_citadel_config, "rb");
if (cfp == NULL) {
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),
- strerror(errno));
+ "Unable to open %s\n"
+ "Error: %s\n",
+ file_citadel_config,
+ strerror(errno));
exit(1);
}
fread((char *) &config, sizeof(struct config), 1, cfp);
if (fstat(fileno(cfp), &st)) {
- perror("citadel.config");
+ perror(file_citadel_config);
exit(1);
}
#ifndef __CYGWIN__
- if (st.st_uid != BBSUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
- fprintf(stderr, "check the permissions on citadel.config\n");
+ if (st.st_uid != CTDLUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) {
+ fprintf(stderr, "check the permissions on %s\n", file_citadel_config);
+ // fprintf(stderr, "check the permissions on citadel.config\n");
exit(1);
}
#endif
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;
{
FILE *cfp;
- if ((cfp = fopen("citadel.config", "rb+")) == NULL)
- perror("citadel.config");
+ if ((cfp = fopen(file_citadel_config, "rb+")) == NULL)
+ perror(file_citadel_config);
else {
fwrite((char *) &config, sizeof(struct config), 1, cfp);
fclose(cfp);