Changed the naming convention of the setup wizard filename
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 20 Sep 2011 19:02:25 +0000 (15:02 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 18 Oct 2011 18:56:54 +0000 (20:56 +0200)
webcit/auth.c
webcit/webserver.c

index 6c71b9aeb420665ff4bd55f1e6d36c713fb364cc..76fb13dc1dfcf0b4eb80e6d7e2bd1a59cdb6465b 100644 (file)
@@ -433,16 +433,10 @@ void do_welcome(void)
                if (!setup_wizard) {
                        int len;
                        sprintf(wizard_filename, "setupwiz.%s.%s",
-                               ctdlhost, ctdlport);
-                       len = strlen(wizard_filename);
-                       for (i=0; i<len; ++i) {
-                               if (    (wizard_filename[i]==' ')
-                                       || (wizard_filename[i] == '/')
-                               ) {
-                                       wizard_filename[i] = '_';
-                               }
-                       }
-       
+                               abs(HashLittle(ctdlhost, strlen(ctdlhost))),
+                               abs(HashLittle(ctdlport, strlen(ctdlport)))
+                       );
+
                        fp = fopen(wizard_filename, "r");
                        if (fp != NULL) {
                                fgets(buf, sizeof buf, fp);
index 603265eca352f4605b881b092b8cec54c760eb19..612ac5d086507408efc3119001df8b84115bc917 100644 (file)
@@ -39,18 +39,16 @@ extern void webcit_calc_dirs_n_files(int relh, const char *basedir, int home, ch
 extern void worker_entry(void);
 extern void drop_root(uid_t UID);
 
-char socket_dir[PATH_MAX];                     /* where to talk to our citadel server */
-
+char socket_dir[PATH_MAX];     /* where to talk to our citadel server */
 char *server_cookie = NULL;    /* our Cookie connection to the client */
 int http_port = PORT_NUM;      /* Port to listen on */
-char *ctdlhost = DEFAULT_HOST; /* our name */
-char *ctdlport = DEFAULT_PORT; /* our Port */
-int setup_wizard = 0;          /* should we run the setup wizard? \todo */
-char wizard_filename[PATH_MAX];        /* where's the setup wizard? */
+char *ctdlhost = DEFAULT_HOST; /* Host name or IP address of Citadel server */
+char *ctdlport = DEFAULT_PORT; /* Port number of Citadel server */
+int setup_wizard = 0;          /* should we run the setup wizard? */
+char wizard_filename[PATH_MAX];        /* location of file containing the last webcit version against which we ran setup wizard */
 int running_as_daemon = 0;     /* should we deamonize on startup? */
 
 
-
 /* #define DBG_PRINNT_HOOKS_AT_START */
 #ifdef DBG_PRINNT_HOOKS_AT_START
 extern HashList *HandlerHash;
@@ -436,7 +434,7 @@ int main(int argc, char **argv)
 
        /* Become a worker thread.  More worker threads will be spawned as they are needed. */
        worker_entry();
-       ShutDownLibCitadel ();
+       ShutDownLibCitadel();
        return 0;
 }