Additional work on the alias table. This is taking longer than it ought to because...
[citadel.git] / webcit / sysdep.c
index cbfba25f955d6e5e4c4687e6d3b4868940440fb1..e5fcc2a80b71f09031eef57a115fb78cf3f2f468 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.
@@ -70,19 +70,15 @@ 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. */
-const char markdown_editor_absolutedir[]=MARKDOWNEDITORDIR;
-
 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... */
-       (char*)markdown_editor_absolutedir
+       "./static",
+       "./static.local",
+       "./tiny_mce",
+       "./static/webcit_icons"
 };
 
 int ExitPipe[2];
@@ -137,10 +133,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)
@@ -181,6 +176,8 @@ void end_critical_section(int which_one)
 
 void ShutDownWebcit(void)
 {
+
+       DeleteHash(&GZMimeBlackList);
        free_zone_directory ();
        icaltimezone_release_zone_tab ();
        icalmemory_free_ring ();
@@ -555,6 +552,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