* crypto.c: keys/ directory is relative to the directory from which WebCit
authorArt Cancro <ajc@citadel.org>
Thu, 23 Jun 2005 16:17:49 +0000 (16:17 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 23 Jun 2005 16:17:49 +0000 (16:17 +0000)
  is actually running, not relative to the compiled-in WEBCITDIR

webcit/crypto.c
webcit/webserver.c

index 4d1a971cfdf8eec16c0aeeb0e4ce14ed9ff46e54..4d9880c9e4df13715d7db633047d8dc3e8ad4b02 100644 (file)
@@ -17,7 +17,7 @@
 #include "webcit.h"
 #include "webserver.h"
 
-#define        CTDL_CRYPTO_DIR         WEBCITDIR "/keys"
+#define        CTDL_CRYPTO_DIR         "./keys"
 #define CTDL_KEY_PATH          CTDL_CRYPTO_DIR "/citadel.key"
 #define CTDL_CSR_PATH          CTDL_CRYPTO_DIR "/citadel.csr"
 #define CTDL_CER_PATH          CTDL_CRYPTO_DIR "/citadel.cer"
index 7b366df3c2d020dd8e5b68a79688a18bc7689e7d..16dbef92438aa9eae7c8d3d3ebf4f6a0d3275edb 100644 (file)
@@ -408,14 +408,18 @@ int main(int argc, char **argv)
        int port = PORT_NUM;    /* Port to listen on */
        char tracefile[PATH_MAX];
        char ip_addr[256];
+       char *webcitdir = WEBCITDIR;
 
        /* Parse command line */
 #ifdef HAVE_OPENSSL
-       while ((a = getopt(argc, argv, "hi:p:t:x:cs")) != EOF)
+       while ((a = getopt(argc, argv, "h:i:p:t:x:cs")) != EOF)
 #else
-       while ((a = getopt(argc, argv, "hi:p:t:x:c")) != EOF)
+       while ((a = getopt(argc, argv, "h:i:p:t:x:c")) != EOF)
 #endif
                switch (a) {
+               case 'h':
+                       webcitdir = strdup(optarg);
+                       break;
                case 'i':
                        safestrncpy(ip_addr, optarg, sizeof ip_addr);
                        break;
@@ -467,12 +471,15 @@ int main(int argc, char **argv)
        }
        /* Tell 'em who's in da house */
        lprintf(1, SERVER "\n"
-               "Copyright (C) 1996-2005 by the Citadel/UX development team.\n"
-               "This software is distributed under the terms of the GNU General Public\n"
-               "License.  If you paid for this software, someone is ripping you off.\n\n");
+               "Copyright (C) 1996-2005 by the Citadel development team.\n"
+               "This software is distributed under the terms of the "
+               "GNU General Public License.\n\n"
+       );
 
-       if (chdir(WEBCITDIR) != 0)
+       lprintf(9, "Changing directory to %s\n", webcitdir);
+       if (chdir(webcitdir) != 0) {
                perror("chdir");
+       }
 
        /*
         * Set up a place to put thread-specific data.