* config.c: now requires a setup run for *any* rev level difference
authorArt Cancro <ajc@citadel.org>
Fri, 9 Apr 1999 02:52:53 +0000 (02:52 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 9 Apr 1999 02:52:53 +0000 (02:52 +0000)
* Updated docs & confs for 5.53b1 release

citadel/ChangeLog
citadel/IAFA-PACKAGE
citadel/citadel.h
citadel/citadel.lsm
citadel/config.c

index 4608c8c54f1a9a338393a6cfa803c1303e5ec13b..47b9a4127d802b955ea749ace9317fa0a205d33e 100644 (file)
@@ -1,3 +1,7 @@
+Thu Apr  8 22:51:28 EDT 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * config.c: now requires a setup run for *any* rev level difference
+       * Updated docs & confs for 5.53b1 release
+
 1999-04-08 Nathan Bryant <bryant@cs.usm.maine.edu>
        * citserver.c: improved is_public_client(), also if a public_client only
          supplies a numeric address, attempt to resolve it
index f4cb82cc409aea4a3a1d74df6a2c979d772ccacf..56ba982226bc3a5685511a1cd2296f502891750d 100644 (file)
@@ -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,
index d0956a0ad05aa708cb30ffe44e4df7d8128e7341..4af450c7551482044c6311ee36c5ebf4ffa8a603 100644 (file)
@@ -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 */
 
index d9a76423a83c88928f11fff3000a7692f19f6929..f6deeeb311e5402e8be144c0e4bf9b4f422dd249 100644 (file)
@@ -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
index e738ff57dcebec0802b9b3c8d3da3edfdf396f7a..e178561b06294629b56ec1e455007ddc42fb0aab 100644 (file)
@@ -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);
-               }
        }
+}