From: Wilfried Göesgens Date: Mon, 20 Mar 2006 13:42:39 +0000 (+0000) Subject: * removed last occurance of static paths in favour of citadel_dirs X-Git-Tag: v7.86~4101 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=7171da73d800ab3e60810a8e6c69099ed706c716;p=citadel.git * removed last occurance of static paths in favour of citadel_dirs --- diff --git a/citadel/Makefile.in b/citadel/Makefile.in index 5e0549a5f..d53d46074 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -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 diff --git a/citadel/citadel_dirs.c b/citadel/citadel_dirs.c index 8a41feade..5f507f1dd 100644 --- a/citadel/citadel_dirs.c +++ b/citadel/citadel_dirs.c @@ -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 diff --git a/citadel/citadel_dirs.h b/citadel/citadel_dirs.h index fb20355cf..fce8008d7 100644 --- a/citadel/citadel_dirs.h +++ b/citadel/citadel_dirs.h @@ -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]; diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index 840c4f2c6..72c4900dd 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -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"); diff --git a/citadel/configure.ac b/citadel/configure.ac index f2120b6b9..c881b8f26 100644 --- a/citadel/configure.ac +++ b/citadel/configure.ac @@ -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], diff --git a/citadel/server_main.c b/citadel/server_main.c index e04fd6286..d77789700 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -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). diff --git a/citadel/whobbs.c b/citadel/whobbs.c index 82d9f0d26..323867103 100644 --- a/citadel/whobbs.c +++ b/citadel/whobbs.c @@ -13,6 +13,7 @@ #include #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