From 08aff18c8afb0e08c3929ef993a0d6d375f27a96 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 9 Apr 1999 02:52:53 +0000 Subject: [PATCH] * config.c: now requires a setup run for *any* rev level difference * Updated docs & confs for 5.53b1 release --- citadel/ChangeLog | 4 ++++ citadel/IAFA-PACKAGE | 2 +- citadel/citadel.h | 4 ++-- citadel/citadel.lsm | 4 ++-- citadel/config.c | 46 +++++++++++++++++++++++++------------------- 5 files changed, 35 insertions(+), 25 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 4608c8c54..47b9a4127 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,7 @@ +Thu Apr 8 22:51:28 EDT 1999 Art Cancro + * config.c: now requires a setup run for *any* rev level difference + * Updated docs & confs for 5.53b1 release + 1999-04-08 Nathan Bryant * citserver.c: improved is_public_client(), also if a public_client only supplies a numeric address, attempt to resolve it diff --git a/citadel/IAFA-PACKAGE b/citadel/IAFA-PACKAGE index f4cb82cc4..56ba98222 100644 --- a/citadel/IAFA-PACKAGE +++ b/citadel/IAFA-PACKAGE @@ -1,5 +1,5 @@ Title: Citadel/UX -Version: 5.52 +Version: 5.53 Description: An advanced messaging system which can be used for BBS, groupware, and online community applications. It is multithreaded, diff --git a/citadel/citadel.h b/citadel/citadel.h index d0956a0ad..4af450c75 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -8,8 +8,8 @@ #include "sysdep.h" #include "sysconfig.h" #include "ipcdef.h" -#define CITADEL "Citadel/UX 5.52" -#define REV_LEVEL 551 +#define CITADEL "Citadel/UX 5.53b1" +#define REV_LEVEL 553 #define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please obtain SERVER_TYPE codes for your implementations */ diff --git a/citadel/citadel.lsm b/citadel/citadel.lsm index d9a76423a..f6deeeb31 100644 --- a/citadel/citadel.lsm +++ b/citadel/citadel.lsm @@ -1,7 +1,7 @@ Begin3 Title: Citadel/UX -Version: 5.52 -Entered-date: Tue Jan 26 22:16:47 EST 1999 +Version: 5.53 +Entered-date: Thu Apr 8 22:51:09 EDT 1999 Description: An advanced messaging system which can be used for BBS, groupware, and online community applications. It is multithreaded, client/server, database driven, and diff --git a/citadel/config.c b/citadel/config.c index e738ff57d..e178561b0 100644 --- a/citadel/config.c +++ b/citadel/config.c @@ -20,61 +20,67 @@ struct config config; char bbs_home_directory[PATH_MAX]; int home_specified = 0; +/* + * get_config() is called during the initialization of any program which + * directly accesses Citadel data files. It verifies the system's integrity + * and reads citadel.config into memory. + */ void get_config(void) { FILE *cfp; struct stat st; - if (chdir( home_specified ? bbs_home_directory : BBSDIR ) != 0) { - fprintf(stderr, "Cannot start.\nThere is no Citadel installation in %s\n%s\n", + if (chdir(home_specified ? bbs_home_directory : BBSDIR) != 0) { + fprintf(stderr, + "Cannot start.\nThere is no Citadel installation in %s\n%s\n", (home_specified ? bbs_home_directory : BBSDIR), strerror(errno)); exit(1); - } - cfp=fopen("citadel.config","rb"); - if (cfp==NULL) { + } + cfp = fopen("citadel.config", "rb"); + if (cfp == NULL) { fprintf(stderr, "Cannot start.\n"); fprintf(stderr, "There is no citadel.config in %s\n%s\n", (home_specified ? bbs_home_directory : BBSDIR), strerror(errno)); exit(1); - } - fread((char *)&config,sizeof(struct config),1,cfp); + } + fread((char *) &config, sizeof(struct config), 1, cfp); if (fstat(fileno(cfp), &st)) { perror("citadel.config"); exit(1); - } - if (st.st_uid != BBSUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) - { + } + if (st.st_uid != BBSUID || st.st_mode != (S_IFREG | S_IRUSR | S_IWUSR)) { fprintf(stderr, "check the permissions on citadel.config\n"); exit(1); - } + } fclose(cfp); - if ( (config.c_setup_level / 10) != (REV_LEVEL/10) ) { + if (config.c_setup_level != REV_LEVEL) { fprintf(stderr, "config: Your data files are out of date. "); fprintf(stderr, "Run setup to update them.\n"); fprintf(stderr, " This program requires level %d.%02d\n", - (REV_LEVEL / 100), (REV_LEVEL % 100) ); + (REV_LEVEL / 100), (REV_LEVEL % 100)); fprintf(stderr, " Data files are currently at %d.%02d\n", - (config.c_setup_level / 100), - (config.c_setup_level % 100) ); + (config.c_setup_level / 100), + (config.c_setup_level % 100)); exit(1); - } } +} /* * Occasionally, we will need to write the config file, because some operations * change site-wide parameters. */ -void put_config(void) { +void put_config(void) +{ FILE *cfp; - + if ((cfp = fopen("citadel.config", "rb+")) == NULL) perror("citadel.config"); else { - fwrite((char *)&config, sizeof(struct config), 1, cfp); + fwrite((char *) &config, sizeof(struct config), 1, cfp); fclose(cfp); - } } +} -- 2.39.2