* removed last occurance of static paths in favour of citadel_dirs
authorWilfried Göesgens <willi@citadel.org>
Mon, 20 Mar 2006 13:42:39 +0000 (13:42 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 20 Mar 2006 13:42:39 +0000 (13:42 +0000)
citadel/Makefile.in
citadel/citadel_dirs.c
citadel/citadel_dirs.h
citadel/citadel_ipc.c
citadel/configure.ac
citadel/server_main.c
citadel/whobbs.c

index 5e0549a5f6dedf6dc22e299fc2f9f4fffe26d9e6..d53d46074461936c39bd1e6a56634c9a59a921a3 100644 (file)
@@ -114,10 +114,10 @@ utils: $(UTIL_TARGETS)
 
 citadel$(EXEEXT): citadel.o citadel_ipc.o client_chat.o client_passwords.o \
        commands.o html.o ipc_c_tcp.o md5.o messages.o rooms.o routines.o \
-       routines2.o screen.o tools.o $(LIBOBJS)
+       routines2.o screen.o tools.o citadel_dirs.o $(LIBOBJS)
        $(CC) citadel.o citadel_ipc.o client_chat.o client_passwords.o \
        commands.o html.o ipc_c_tcp.o md5.o messages.o rooms.o routines.o \
-       routines2.o screen.o tools.o $(LIBOBJS) \
+       routines2.o screen.o tools.o citadel_dirs.o $(LIBOBJS) \
        $(LDFLAGS) -o citadel $(LIBS)
 
 .y.c:
@@ -159,21 +159,21 @@ chkpwd: chkpwd.o auth.o config.o citadel_dirs.o
        $(CC) chkpwd.o auth.o config.o citadel_dirs.o $(LDFLAGS) -o chkpwd $(chkpwd_LIBS)
        chmod 4755 chkpwd
 
-whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
-       $(CC) whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o  $(LIBOBJS) $(LDFLAGS) -o whobbs $(LIBS)
+whobbs$(EXEEXT): whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o citadel_dirs.o $(LIBOBJS)
+       $(CC) whobbs.o ipc_c_tcp.o tools.o citadel_ipc.o  citadel_dirs.o $(LIBOBJS) $(LDFLAGS) -o whobbs $(LIBS)
 
-stress$(EXEEXT): stress.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS)
-       $(CC) stress.o ipc_c_tcp.o tools.o citadel_ipc.o $(LIBOBJS) $(LDFLAGS) -o stress $(LIBS)
+stress$(EXEEXT): stress.o ipc_c_tcp.o tools.o citadel_ipc.o citadel_dirs.o $(LIBOBJS)
+       $(CC) stress.o ipc_c_tcp.o tools.o citadel_ipc.o citadel_dirs.o $(LIBOBJS) $(LDFLAGS) -o stress $(LIBS)
 
-sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o $(LIBOBJS)
-       $(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o citadel_dirs.o \
-        $(LIBOBJS) $(LDFLAGS) -o sendcommand $(LIBS)
+sendcommand: sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o  $(LIBOBJS)
+       $(CC) sendcommand.o ipc_c_tcp.o citadel_ipc.o tools.o config.o  \
+        citadel_dirs.o $(LIBOBJS) $(LDFLAGS) -o sendcommand $(LIBS)
 
 base64: base64.o
        $(CC) base64.o $(LDFLAGS) -o base64
 
-userlist: userlist.o ipc_c_tcp.o citadel_ipc.o tools.o $(LIBOBJS)
-       $(CC) userlist.o ipc_c_tcp.o citadel_ipc.o tools.o \
+userlist: userlist.o ipc_c_tcp.o citadel_ipc.o tools.o citadel_dirs.o $(LIBOBJS)
+       $(CC) userlist.o ipc_c_tcp.o citadel_ipc.o tools.o citadel_dirs.o \
        $(LIBOBJS) $(LDFLAGS) -o userlist $(LIBS)
 
 msgform: msgform.o
index 8a41feadef7cfb498cd0de39b5345adcfd46e883..5f507f1dd139d94576c50b52a00fba2afaabfa5c 100644 (file)
@@ -53,6 +53,7 @@ char file_citadel_rc[PATH_MAX]="";
 char file_citadel_config[PATH_MAX]="";
 char file_lmtp_socket[PATH_MAX]="";
 char file_lmtp_unfiltered_socket[PATH_MAX]="";
+char file_citadel_socket[PATH_MAX]="";
 char file_mail_aliases[PATH_MAX]="";
 
 int home_specified = 0;
@@ -162,6 +163,10 @@ void calc_dirs_n_files(int relh, int home, const char *relhome,const char  *ctdl
                         "%slmtp-unfiltered.socket",
                         ctdl_run_dir);
 
+       snprintf(file_citadel_socket, 
+                        sizeof file_citadel_socket,
+                               "%scitadel.socket",
+                        ctdl_run_dir);
 
        /* 
         * DIRTY HACK FOLLOWS! due to configs in the network dir in the 
index fb20355cf8a6da7906c569cb73a30a7c6af2cb5c..fce8008d7790c0a20cb8c9599506755d8b1b7db7 100644 (file)
@@ -36,6 +36,7 @@ extern char file_citadel_rc[PATH_MAX];
 extern char file_citadel_config[PATH_MAX];
 extern char file_lmtp_socket[PATH_MAX];
 extern char file_lmtp_unfiltered_socket[PATH_MAX];
+extern char file_citadel_socket[PATH_MAX];
 extern char file_mail_aliases[PATH_MAX];
 
 
index 840c4f2c63708e6d4fa973d602e02aab93a1b650..72c4900dd9e114a2f94d2df547da534ff1b39253 100644 (file)
@@ -33,7 +33,7 @@
 #include "citadel_ipc.h"
 #include "citadel_decls.h"
 #include "tools.h"
-
+#include "citadel_dirs.h"
 #ifdef THREADED_CLIENT
 pthread_mutex_t rwlock;
 #endif
@@ -2942,11 +2942,7 @@ CtdlIPC* CtdlIPC_new(int argc, char **argv, char *hostbuf, char *portbuf)
        /* If we're using a unix domain socket we can do a bunch of stuff */
        if (!strcmp(cithost, UDS)) {
                if (!strcasecmp(citport, DEFAULT_PORT)) {
-#ifdef HAVE_RUN_DIR
-                       snprintf(sockpath, sizeof sockpath, RUN_DIR "/citadel.socket");
-#else
-                       snprintf(sockpath, sizeof sockpath, CTDLDIR "/citadel.socket");
-#endif
+                       snprintf(sockpath, sizeof sockpath, file_citadel_socket);
                }
                else {
                        snprintf(sockpath, sizeof sockpath, "%s/%s", citport, "citadel.socket");
index f2120b6b9377ee82205affbf3c6d6b9af2ec5827..c881b8f263d33d79242a3b68b665f8e48589ce4e 100644 (file)
@@ -11,6 +11,11 @@ else
        AC_DEFINE_UNQUOTED(CTDLDIR, "$prefix")
 fi
 
+
+dnl Make sure we see all GNU and Solaris extensions.
+AC_GNU_SOURCE
+
+
 dnl Checks for the Datadir
 AC_ARG_WITH(datadir, 
                    [  --with-datadir          directory to store the databases under],
index e04fd6286acb1f54ffbbf7e317e80a7e76a3f779..d777897000dfe2e88977ebe1efb8cc074bdd4b79 100644 (file)
@@ -195,15 +195,10 @@ int main(int argc, char **argv)
         * Bind the server to a Unix-domain socket.
         */
        CtdlRegisterServiceHook(0,
-#ifndef HAVE_RUN_DIR
-                                        "."
-#else
-                                        RUN_DIR
-#endif
-                               "/citadel.socket",
-                               citproto_begin_session,
-                               do_command_loop,
-                               do_async_loop);
+                                                       file_citadel_socket,
+                                                       citproto_begin_session,
+                                                       do_command_loop,
+                                                       do_async_loop);
 
        /*
         * Bind the server to our favorite TCP port (usually 504).
index 82d9f0d26716c33ecb0b001972172cb1965da003..32386710379e225c37d011838839edba45e8e883 100644 (file)
@@ -13,6 +13,7 @@
 #include <errno.h>
 #include "citadel.h"
 #include "citadel_ipc.h"
+#include "citadel_dirs.h"
 #include "tools.h"
 
 void logoff(int code)
@@ -61,6 +62,13 @@ int main(int argc, char **argv)
        time_t timenow;
        char *listing = NULL;
        CtdlIPC *ipc = NULL;
+       int relh=0;
+       int home=0;
+       char relhome[PATH_MAX]="";
+       char ctdldir[PATH_MAX]=CTDLDIR;
+
+
+       calc_dirs_n_files(relh, home, relhome, ctdldir);
 
        /* If this environment variable is set, we assume that the program
         * is being called as a cgi-bin from a webserver and will output