From 98252405f39ea4e05616b68d9bc02cb42b8c6713 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 9 Feb 2006 19:05:58 +0000 Subject: [PATCH] one typo in a define. moved file calculation to the rest. --- citadel/citadel_dirs.c | 16 ++++++++++++++++ citadel/citadel_dirs.h | 1 + citadel/msgbase.c | 16 +--------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/citadel/citadel_dirs.c b/citadel/citadel_dirs.c index a5cf4076d..807c722e3 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_mail_aliases[PATH_MAX]=""; int home_specified = 0; @@ -161,6 +162,21 @@ void calc_dirs_n_files(int relh, int home, const char *relhome,const char *ctdl "%slmtp-unfiltered.socket", ctdl_run_dir); + + /* + * DIRTY HACK FOLLOWS! due to configs in the network dir in the + * legacy installations, we need to calculate ifdeffed here. + */ + snprintf(file_mail_aliases, + sizeof file_mail_aliases, + "%smail.aliases", +#ifdef HAVE_ETC_DIR + ctdl_etc_dir +#else + ctdl_spool_dir +#endif + ); + } diff --git a/citadel/citadel_dirs.h b/citadel/citadel_dirs.h index cae218532..fb20355cf 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_mail_aliases[PATH_MAX]; extern void calc_dirs_n_files(int relh, int home, const char *relhome,const char *ctdldir); diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 2ca19528c..94784f48e 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -139,26 +139,12 @@ int alias(char *name) char node[64]; char testnode[64]; char buf[SIZ]; - char filename[256]; striplt(name); remove_any_whitespace_to_the_left_or_right_of_at_symbol(name); stripallbut(name, '<', '>'); - /* - * DIRTY HACK FOLLOWS! due to configs in the network dir in the - * legacy installations, we need to calculate ifdeffed here. - */ - snprintf(filename, - sizeof filename, - "%smail.aliases", -#ifndef HAVE_ETG_DIR - ctdl_spool_dir -#else - ctdl_etc_dir -#endif - ); - fp = fopen(filename, "r"); + fp = fopen(file_mail_aliases, "r"); if (fp == NULL) { fp = fopen("/dev/null", "r"); } -- 2.39.2