From 22095c4da0706cae686aae31e6384755c755aea2 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 12 Oct 2004 02:17:51 +0000 Subject: [PATCH] * Cleaned up some things that generated compiler warnings * crypto keys directory is now relative to the server's working directory, not to the compiled-in BBSDIR * Re-ordered the security checks in CtdlAccessCheck() --- citadel/ChangeLog | 7 ++++++- citadel/citadel_ipc.c | 1 + citadel/citserver.c | 11 +++++------ citadel/sysconfig.h | 2 +- citadel/sysdep.c | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index a2371253a..468ba8b5e 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,10 @@ $Log$ + Revision 626.9 2004/10/12 02:17:49 ajc + * Cleaned up some things that generated compiler warnings + * crypto keys directory is now relative to the server's working directory, + not to the compiled-in BBSDIR + * Re-ordered the security checks in CtdlAccessCheck() + Revision 626.8 2004/10/06 21:23:21 error * Fixup a few more compiler warnings from icc @@ -6147,4 +6153,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citadel_ipc.c b/citadel/citadel_ipc.c index cc79106da..d0d68b6fb 100644 --- a/citadel/citadel_ipc.c +++ b/citadel/citadel_ipc.c @@ -2714,6 +2714,7 @@ static void CtdlIPC_init_OpenSSL(void) } /* Get started */ + a = 0; ssl_ctx = NULL; dh = NULL; SSL_load_error_strings(); diff --git a/citadel/citserver.c b/citadel/citserver.c index f3a9ce048..eda6a754e 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -669,6 +669,11 @@ int CtdlAccessCheck(int required_level) { return(-1); } + if ((required_level >= ac_logged_in) && (CC->logged_in == 0)) { + cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN); + return(-1); + } + if (CC->user.axlevel >= 6) return(0); if (required_level >= ac_aide) { cprintf("%d This command requires Aide access.\n", @@ -683,12 +688,6 @@ int CtdlAccessCheck(int required_level) { return(-1); } - if (CC->logged_in) return(0); - if (required_level >= ac_logged_in) { - cprintf("%d Not logged in.\n", ERROR + NOT_LOGGED_IN); - return(-1); - } - /* shhh ... succeed quietly */ return(0); } diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 76f2855dc..bdb78502d 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -120,7 +120,7 @@ /* * Pathnames for cryptographic goodness */ -#define CTDL_CRYPTO_DIR BBSDIR "/keys" +#define CTDL_CRYPTO_DIR "./keys" #define CTDL_KEY_PATH CTDL_CRYPTO_DIR "/citadel.key" #define CTDL_CSR_PATH CTDL_CRYPTO_DIR "/citadel.csr" #define CTDL_CER_PATH CTDL_CRYPTO_DIR "/citadel.cer" diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 21722e173..d52b920be 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -896,7 +896,7 @@ void *worker_thread(void *arg) { struct CitContext *ptr; struct CitContext *bind_me = NULL; fd_set readfds; - int retval; + int retval = 0; struct CitContext *con= NULL; /* Temporary context pointer */ struct ServiceFunctionHook *serviceptr; int ssock; /* Descriptor for client socket */ -- 2.30.2