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:
$(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
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;
"%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
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];
#include "citadel_ipc.h"
#include "citadel_decls.h"
#include "tools.h"
-
+#include "citadel_dirs.h"
#ifdef THREADED_CLIENT
pthread_mutex_t rwlock;
#endif
/* 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");
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],
* 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).
#include <errno.h>
#include "citadel.h"
#include "citadel_ipc.h"
+#include "citadel_dirs.h"
#include "tools.h"
void logoff(int code)
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