From: Wilfried Göesgens Date: Wed, 24 Jan 2007 22:36:12 +0000 (+0000) Subject: * precalculate the position of chkpwd like we do it for the rest. X-Git-Tag: v7.86~3622 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=4142f26fefd695761522d2d4fd9826c2e33b4cdb;p=citadel.git * precalculate the position of chkpwd like we do it for the rest. --- diff --git a/citadel/citadel_dirs.c b/citadel/citadel_dirs.c index 4c2170eb2..32ddc75e3 100644 --- a/citadel/citadel_dirs.c +++ b/citadel/citadel_dirs.c @@ -60,6 +60,7 @@ char file_pid_file[PATH_MAX]=""; char file_crpt_file_key[PATH_MAX]=""; char file_crpt_file_csr[PATH_MAX]=""; char file_crpt_file_cer[PATH_MAX]=""; +char file_chkpwd[PATH_MAX]=""; int home_specified = 0; @@ -194,6 +195,11 @@ void calc_dirs_n_files(int relh, int home, const char *relhome,const char *ctdl sizeof file_crpt_file_cer, "%scitadel.cer", ctdl_key_dir); + + snprintf(file_chkpwd, + sizeof file_chkpwd, + "%schkpwd", + ctdl_sbin_dir); /* * DIRTY HACK FOLLOWS! due to configs in the network dir in the * legacy installations, we need to calculate ifdeffed here. diff --git a/citadel/citadel_dirs.h b/citadel/citadel_dirs.h index 960a1e8c8..15d6a8a39 100644 --- a/citadel/citadel_dirs.h +++ b/citadel/citadel_dirs.h @@ -44,7 +44,7 @@ extern char file_pid_file[PATH_MAX]; extern char file_crpt_file_key[PATH_MAX]; extern char file_crpt_file_csr[PATH_MAX]; extern char file_crpt_file_cer[PATH_MAX]; - +extern char file_chkpwd[PATH_MAX]; extern void calc_dirs_n_files(int relh, int home, const char *relhome,const char *ctdldir); diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 13e8db773..4b23c646f 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -47,6 +47,7 @@ #include "config.h" #include "tools.h" #include "citserver.h" +#include "citadel_dirs.h" #include "genstamp.h" /* @@ -608,8 +609,8 @@ static int validpw(uid_t uid, const char *pass) } close(pipev[0]); - execl(CTDLDIR "/chkpwd", CTDLDIR "/chkpwd", NULL); - perror(CTDLDIR "/chkpwd"); + execl(file_chkpwd, file_chkpwd, NULL); + perror(file_chkpwd); exit(1); }