Integrated the DKIM signer into serv_smtpclient, but disabled it
[citadel.git] / webcit / sysdep.c
index ae959505a24b93a65d189a305f1f4f4b6ad03f89..e5f928d521caf8b85b4bc56ead6a50beb6eec9dd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * WebCit "system dependent" code.
  *
- * Copyright (c) 1996-2012 by the citadel.org team
+ * Copyright (c) 1996-2021 by the citadel.org team
  *
  * This program is open source software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 3.
 #include <sys/socket.h>
 #include <syslog.h>
 #include <sys/syslog.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
-#endif
-
+#include <time.h>
 #include <limits.h>
 #include <sys/resource.h>
 #include <netinet/in.h>
@@ -59,7 +48,7 @@
 #include <sys/select.h>
 #endif
 
-#include "webserver.h"
+
 #include "modules_init.h"
 #if HAVE_BACKTRACE
 #include <execinfo.h>
@@ -75,22 +64,17 @@ extern void *context_loop(ParsedHttpHdrs *Hdr);
 extern void *housekeeping_loop(void);
 extern void do_housekeeping(void);
 
-char ctdl_key_dir[PATH_MAX]=SSL_DIR;
-char file_crpt_file_key[PATH_MAX]="";
-char file_crpt_file_csr[PATH_MAX]="";
-char file_crpt_file_cer[PATH_MAX]="";
 char file_etc_mimelist[PATH_MAX]="";
 
-const char editor_absolut_dir[PATH_MAX]=EDITORDIR;     /* nailed to what configure gives us. */
 char etc_dir[PATH_MAX];
 char static_dir[PATH_MAX];             /* calculated on startup */
 char static_local_dir[PATH_MAX];               /* calculated on startup */
 char static_icon_dir[PATH_MAX];          /* where should we find our mime icons? */
 char  *static_dirs[]={                         /* needs same sort order as the web mapping */
-       (char*)static_dir,                      /* our templates on disk */
-       (char*)static_local_dir,                /* user provided templates disk */
-       (char*)editor_absolut_dir,              /* the editor on disk */
-       (char*)static_icon_dir                  /* our icons... */
+       "./static",
+       "./static.local",
+       "./tiny_mce",
+       "./static/webcit_icons"
 };
 
 int ExitPipe[2];
@@ -145,10 +129,9 @@ void LoadMimeBlacklist(void)
 void CheckGZipCompressionAllowed(const char *MimeType, long MLen)
 {
        void *v;
-       wcsession *WCC = WC;
 
-       if (WCC->Hdr->HR.gzip_ok)
-           WCC->Hdr->HR.gzip_ok = GetHash(GZMimeBlackList, MimeType, MLen, &v) == 0;
+       if (WC->Hdr->HR.gzip_ok)
+           WC->Hdr->HR.gzip_ok = GetHash(GZMimeBlackList, MimeType, MLen, &v) == 0;
 }
 
 void InitialiseSemaphores(void)
@@ -189,16 +172,13 @@ void end_critical_section(int which_one)
 
 void ShutDownWebcit(void)
 {
+
+       DeleteHash(&GZMimeBlackList);
        free_zone_directory ();
        icaltimezone_release_zone_tab ();
        icalmemory_free_ring ();
        ShutDownLibCitadel ();
        shutdown_modules ();
-#ifdef HAVE_OPENSSL
-       if (is_https) {
-               shutdown_ssl();
-       }
-#endif
 }
 
 /*
@@ -531,20 +511,6 @@ webcit_calc_dirs_n_files(int relh, const char *basedir, int home, char *webcitdi
        StripSlashes(static_icon_dir, 1);
        StripSlashes(static_local_dir, 1);
 
-       snprintf(file_crpt_file_key,
-                sizeof file_crpt_file_key, 
-                "%s/citadel.key",
-                ctdl_key_dir);
-       snprintf(file_crpt_file_csr,
-                sizeof file_crpt_file_csr, 
-                "%s/citadel.csr",
-                ctdl_key_dir);
-       snprintf(file_crpt_file_cer,
-                sizeof file_crpt_file_cer, 
-                "%s/citadel.cer",
-                ctdl_key_dir);
-
-
        basedir=ETCDIR;
        COMPUTE_DIRECTORY(etc_dir);
        StripSlashes(etc_dir, 1);
@@ -563,6 +529,9 @@ webcit_calc_dirs_n_files(int relh, const char *basedir, int home, char *webcitdi
 void drop_root(uid_t UID)
 {
        struct passwd pw, *pwp = NULL;
+#ifdef HAVE_GETPWUID_R
+       char pwbuf[SIZ];
+#endif
 
        /*
         * Now that we've bound the sockets, change to the Citadel user id and its