From a520d904d0069654c57d2b69618bee1225ee3067 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 30 Jan 2021 16:04:44 -0500 Subject: [PATCH] don't run this, it's broken --- citadel/Makefile.in | 4 +- citadel/bootstrap | 0 citadel/citadel_dirs.h | 46 +++ citadel/citserver.c | 2 +- citadel/config.guess | 0 citadel/config.sub | 0 citadel/{include => }/ctdl_module.h | 0 citadel/database.c | 58 ++-- citadel/database_cleanup.sh.in | 0 citadel/guesstimezone.sh | 0 citadel/include/citadel_dirs.h | 59 ---- citadel/install-sh | 0 citadel/missing | 0 citadel/mkinstalldirs | 0 citadel/modules/fulltext/ft_wordbreaker.c | 53 +--- citadel/modules/fulltext/ft_wordbreaker.h | 33 +-- citadel/modules/fulltext/serv_fulltext.c | 1 - citadel/modules/network/serv_netmail.c | 2 +- citadel/modules/network/serv_netspool.c | 19 +- citadel/msgbase.c | 4 +- citadel/serv_extensions.c | 4 +- citadel/server_main.c | 119 ++++---- citadel/utillib/citadel_dirs.c | 321 ++------------------- citadel/utils/chkpw.c | 4 +- citadel/utils/citmail.c | 19 +- citadel/utils/ctdlmigrate.c | 3 +- citadel/utils/sendcommand.c | 4 +- citadel/utils/setup.c | 1 - contrib/configs/deb-amd64/libical_targets | 6 - contrib/configs/deb-amd64/libsieve_targets | 5 - contrib/configs/deb-amd64/targets | 6 - contrib/configs/deb-amd64/tinymce_targets | 5 - contrib/configs/deb-i386/libical_targets | 10 - contrib/configs/deb-i386/libsieve_targets | 5 - contrib/configs/deb-i386/targets | 10 - contrib/configs/deb-i386/tinymce_targets | 5 - libcitadel/buildpackages | 123 -------- libcitadel/debian/.gitignore | 6 - libcitadel/debian/changelog | 237 --------------- libcitadel/debian/control | 33 --- libcitadel/debian/libcitadel-dbg.install | 1 - libcitadel/debian/libcitadel-dev.dirs | 1 - libcitadel/debian/libcitadel-dev.install | 3 - libcitadel/debian/libcitadel4.install | 1 - libcitadel/debian/rules | 111 ------- libcitadel/hash_todo.txt | 55 ---- webcit/buildpackages | 88 ------ 47 files changed, 195 insertions(+), 1272 deletions(-) mode change 100755 => 100644 citadel/bootstrap create mode 100644 citadel/citadel_dirs.h mode change 100755 => 100644 citadel/config.guess mode change 100755 => 100644 citadel/config.sub rename citadel/{include => }/ctdl_module.h (100%) mode change 100755 => 100644 citadel/database_cleanup.sh.in mode change 100755 => 100644 citadel/guesstimezone.sh delete mode 100644 citadel/include/citadel_dirs.h mode change 100755 => 100644 citadel/install-sh mode change 100755 => 100644 citadel/missing mode change 100755 => 100644 citadel/mkinstalldirs delete mode 100644 contrib/configs/deb-amd64/libical_targets delete mode 100644 contrib/configs/deb-amd64/libsieve_targets delete mode 100644 contrib/configs/deb-amd64/targets delete mode 100644 contrib/configs/deb-amd64/tinymce_targets delete mode 100644 contrib/configs/deb-i386/libical_targets delete mode 100644 contrib/configs/deb-i386/libsieve_targets delete mode 100644 contrib/configs/deb-i386/targets delete mode 100644 contrib/configs/deb-i386/tinymce_targets delete mode 100755 libcitadel/buildpackages delete mode 100644 libcitadel/debian/.gitignore delete mode 100644 libcitadel/debian/changelog delete mode 100644 libcitadel/debian/control delete mode 100644 libcitadel/debian/libcitadel-dbg.install delete mode 100644 libcitadel/debian/libcitadel-dev.dirs delete mode 100644 libcitadel/debian/libcitadel-dev.install delete mode 100644 libcitadel/debian/libcitadel4.install delete mode 100755 libcitadel/debian/rules delete mode 100644 libcitadel/hash_todo.txt delete mode 100755 webcit/buildpackages diff --git a/citadel/Makefile.in b/citadel/Makefile.in index b110ee118..ce3229e06 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -44,8 +44,8 @@ ACLOCAL=@ACLOCAL@ AUTOCONF=@AUTOCONF@ chkpwd_LIBS=@chkpwd_LIBS@ CC=@CC@ -CFLAGS=@CFLAGS@ -I ./include/ -CPPFLAGS=@CPPFLAGS@ -I. -I ./include/ +CFLAGS=@CFLAGS@ -I. +CPPFLAGS=@CPPFLAGS@ -I. DATABASE=@DATABASE@ DEFS=@DEFS@ -DDIFF=\"@DIFF@\" -DPATCH=\"@PATCH@\" LDFLAGS=@LDFLAGS@ diff --git a/citadel/bootstrap b/citadel/bootstrap old mode 100755 new mode 100644 diff --git a/citadel/citadel_dirs.h b/citadel/citadel_dirs.h new file mode 100644 index 000000000..47f0c2d7e --- /dev/null +++ b/citadel/citadel_dirs.h @@ -0,0 +1,46 @@ +#ifndef __CITADEL_DIRS_H +#define __CITADEL_DIRS_H + +#include + +/* all our directories */ +extern char *ctdl_home_directory; +extern char *ctdl_db_dir; +extern char *ctdl_file_dir; +extern char *ctdl_shared_dir; +extern char *ctdl_image_dir; +extern char *ctdl_info_dir; +extern char *ctdl_key_dir; +extern char *ctdl_message_dir; +extern char *ctdl_usrpic_dir; +extern char *ctdl_autoetc_dir; +extern char *ctdl_run_dir; +extern char *ctdl_netdigest_dir; +extern char *ctdl_netcfg_dir; +extern char *ctdl_bbsbase_dir; +extern char *ctdl_sbin_dir; +extern char *ctdl_bin_dir; +extern char *ctdl_utilbin_dir; + +/* some of the frequently used files */ +extern char *file_citadel_config; +extern char *file_lmtp_socket; +extern char *file_lmtp_unfiltered_socket; +extern char *file_arcq; +extern char *file_citadel_socket; +extern char *file_citadel_admin_socket; +extern char *file_pid_file; +extern char *file_pid_paniclog; +extern char *file_crpt_file_key; +extern char *file_crpt_file_csr; +extern char *file_crpt_file_cer; +extern char *file_chkpwd; +extern char *file_guesstimezone; + +/* externs */ +extern int create_run_directories(long UID, long GUID); +extern size_t assoc_file_name(char *buf, size_t n, struct ctdlroom *qrbuf, const char *prefix); +extern FILE *create_digest_file(struct ctdlroom *room, int forceCreate); +extern void remove_digest_file(struct ctdlroom *room); + +#endif /* __CITADEL_DIRS_H */ diff --git a/citadel/citserver.c b/citadel/citserver.c index d1271e5f9..cde79e0f6 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -60,7 +60,7 @@ void master_startup(void) } if (create_run_directories(CTDLUID, gid) != 0) { - syslog(LOG_EMERG, "citserver: failed to access and create directories"); + syslog(LOG_ERR, "citserver: failed to access and create directories"); exit(1); } syslog(LOG_INFO, "Opening databases"); diff --git a/citadel/config.guess b/citadel/config.guess old mode 100755 new mode 100644 diff --git a/citadel/config.sub b/citadel/config.sub old mode 100755 new mode 100644 diff --git a/citadel/include/ctdl_module.h b/citadel/ctdl_module.h similarity index 100% rename from citadel/include/ctdl_module.h rename to citadel/ctdl_module.h diff --git a/citadel/database.c b/citadel/database.c index 2f6a5b5ce..ee6aaac2f 100644 --- a/citadel/database.c +++ b/citadel/database.c @@ -193,14 +193,14 @@ void open_databases(void) { /* * Silently try to create the database subdirectory. If it's already there, no problem. */ - if ((mkdir(ctdl_data_dir, 0700) != 0) && (errno != EEXIST)) { - syslog(LOG_ERR, "db: unable to create database directory [%s]: %m", ctdl_data_dir); + if ((mkdir(ctdl_db_dir, 0700) != 0) && (errno != EEXIST)) { + syslog(LOG_ERR, "db: unable to create database directory [%s]: %m", ctdl_db_dir); } - if (chmod(ctdl_data_dir, 0700) != 0) { - syslog(LOG_ERR, "db: unable to set database directory permissions [%s]: %m", ctdl_data_dir); + if (chmod(ctdl_db_dir, 0700) != 0) { + syslog(LOG_ERR, "db: unable to set database directory permissions [%s]: %m", ctdl_db_dir); } - if (chown(ctdl_data_dir, CTDLUID, (-1)) != 0) { - syslog(LOG_ERR, "db: unable to set the owner for [%s]: %m", ctdl_data_dir); + if (chown(ctdl_db_dir, CTDLUID, (-1)) != 0) { + syslog(LOG_ERR, "db: unable to set the owner for [%s]: %m", ctdl_db_dir); } syslog(LOG_DEBUG, "db: Setting up DB environment"); // db_env_set_func_yield((int (*)(u_long, u_long))sched_yield); @@ -238,20 +238,20 @@ void open_databases(void) { } flags = DB_CREATE | DB_INIT_MPOOL | DB_PRIVATE | DB_INIT_TXN | DB_INIT_LOCK | DB_THREAD | DB_INIT_LOG; - syslog(LOG_DEBUG, "db: dbenv->open(dbenv, %s, %d, 0)", ctdl_data_dir, flags); - ret = dbenv->open(dbenv, ctdl_data_dir, flags, 0); // try opening the database cleanly + syslog(LOG_DEBUG, "db: dbenv->open(dbenv, %s, %d, 0)", ctdl_db_dir, flags); + ret = dbenv->open(dbenv, ctdl_db_dir, flags, 0); // try opening the database cleanly if (ret == DB_RUNRECOVERY) { syslog(LOG_ERR, "db: dbenv->open: %s", db_strerror(ret)); syslog(LOG_ERR, "db: attempting recovery..."); flags |= DB_RECOVER; - ret = dbenv->open(dbenv, ctdl_data_dir, flags, 0); // try recovery + ret = dbenv->open(dbenv, ctdl_db_dir, flags, 0); // try recovery } if (ret == DB_RUNRECOVERY) { syslog(LOG_ERR, "db: dbenv->open: %s", db_strerror(ret)); syslog(LOG_ERR, "db: attempting catastrophic recovery..."); flags &= ~DB_RECOVER; flags |= DB_RECOVER_FATAL; - ret = dbenv->open(dbenv, ctdl_data_dir, flags, 0); // try catastrophic recovery + ret = dbenv->open(dbenv, ctdl_db_dir, flags, 0); // try catastrophic recovery } if (ret) { syslog(LOG_ERR, "db: dbenv->open: %s", db_strerror(ret)); @@ -291,11 +291,11 @@ void cdb_chmod_data(void) { struct dirent *d; char filename[PATH_MAX]; - dp = opendir(ctdl_data_dir); + dp = opendir(ctdl_db_dir); if (dp != NULL) { while (d = readdir(dp), d != NULL) { if (d->d_name[0] != '.') { - snprintf(filename, sizeof filename, "%s/%s", ctdl_data_dir, d->d_name); + snprintf(filename, sizeof filename, "%s/%s", ctdl_db_dir, d->d_name); syslog(LOG_DEBUG, "db: chmod(%s, 0600) returned %d", filename, chmod(filename, 0600)); syslog(LOG_DEBUG, "db: chown(%s, CTDLUID, -1) returned %d", filename, chown(filename, CTDLUID, (-1)) @@ -345,7 +345,7 @@ void close_databases(void) { /* Close the handle. */ ret = dbenv->close(dbenv, 0); if (ret) { - syslog(LOG_EMERG, "db: DBENV->close: %s", db_strerror(ret)); + syslog(LOG_ERR, "db: DBENV->close: %s", db_strerror(ret)); } } @@ -384,7 +384,7 @@ void cdb_decompress_if_necessary(struct cdbdata *cdb) { if (uncompress((Bytef *) uncompressed_data, (uLongf *) & destLen, (const Bytef *) compressed_data, (uLong) sourceLen) != Z_OK) { - syslog(LOG_EMERG, "db: uncompress() error"); + syslog(LOG_ERR, "db: uncompress() error"); cdb_abort(); } @@ -426,7 +426,7 @@ int cdb_store(int cdb, const void *ckey, int ckeylen, void *cdata, int cdatalen) compressed_data = malloc(buffer_len); if (compress2((Bytef *) (compressed_data + sizeof(struct CtdlCompressHeader)), &destLen, (Bytef *) cdata, (uLongf) cdatalen, 1) != Z_OK) { - syslog(LOG_EMERG, "db: compress2() error"); + syslog(LOG_ERR, "db: compress2() error"); cdb_abort(); } zheader.compressed_len = (size_t) destLen; @@ -443,7 +443,7 @@ int cdb_store(int cdb, const void *ckey, int ckeylen, void *cdata, int cdatalen) 0 // flags ); if (ret) { - syslog(LOG_EMERG, "db: cdb_store(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_store(%d): %s", cdb, db_strerror(ret)); cdb_abort(); } if (compressing) { @@ -465,7 +465,7 @@ int cdb_store(int cdb, const void *ckey, int ckeylen, void *cdata, int cdatalen) txabort(tid); goto retry; } else { - syslog(LOG_EMERG, "db: cdb_store(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_store(%d): %s", cdb, db_strerror(ret)); cdb_abort(); } } else { @@ -495,7 +495,7 @@ int cdb_delete(int cdb, void *key, int keylen) { if (TSD->tid != NULL) { ret = dbp[cdb]->del(dbp[cdb], TSD->tid, &dkey, 0); if (ret) { - syslog(LOG_EMERG, "db: cdb_delete(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_delete(%d): %s", cdb, db_strerror(ret)); if (ret != DB_NOTFOUND) { cdb_abort(); } @@ -511,7 +511,7 @@ int cdb_delete(int cdb, void *key, int keylen) { txabort(tid); goto retry; } else { - syslog(LOG_EMERG, "db: cdb_delete(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_delete(%d): %s", cdb, db_strerror(ret)); cdb_abort(); } } else { @@ -534,7 +534,7 @@ static DBC *localcursor(int cdb) { } if (ret) { - syslog(LOG_EMERG, "db: localcursor: %s", db_strerror(ret)); + syslog(LOG_ERR, "db: localcursor: %s", db_strerror(ret)); cdb_abort(); } @@ -574,7 +574,7 @@ struct cdbdata *cdb_fetch(int cdb, const void *key, int keylen) { } if ((ret != 0) && (ret != DB_NOTFOUND)) { - syslog(LOG_EMERG, "db: cdb_fetch(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_fetch(%d): %s", cdb, db_strerror(ret)); cdb_abort(); } @@ -585,7 +585,7 @@ struct cdbdata *cdb_fetch(int cdb, const void *key, int keylen) { tempcdb = (struct cdbdata *) malloc(sizeof(struct cdbdata)); if (tempcdb == NULL) { - syslog(LOG_EMERG, "db: cdb_fetch: Cannot allocate memory for tempcdb"); + syslog(LOG_ERR, "db: cdb_fetch: Cannot allocate memory for tempcdb"); cdb_abort(); return NULL; /* make it easier for static analysis... */ } else { @@ -631,7 +631,7 @@ void cdb_rewind(int cdb) { int ret = 0; if (TSD->cursors[cdb] != NULL) { - syslog(LOG_EMERG, "db: cdb_rewind: must close cursor on database %d before reopening", cdb); + syslog(LOG_ERR, "db: cdb_rewind: must close cursor on database %d before reopening", cdb); cdb_abort(); /* cclose(TSD->cursors[cdb]); */ } @@ -641,7 +641,7 @@ void cdb_rewind(int cdb) { */ ret = dbp[cdb]->cursor(dbp[cdb], TSD->tid, &TSD->cursors[cdb], 0); if (ret) { - syslog(LOG_EMERG, "db: cdb_rewind: db_cursor: %s", db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_rewind: db_cursor: %s", db_strerror(ret)); cdb_abort(); } } @@ -665,7 +665,7 @@ struct cdbdata *cdb_next_item(int cdb) { if (ret) { if (ret != DB_NOTFOUND) { - syslog(LOG_EMERG, "db: cdb_next_item(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_next_item(%d): %s", cdb, db_strerror(ret)); cdb_abort(); } cdb_close_cursor(cdb); @@ -688,7 +688,7 @@ void cdb_begin_transaction(void) { bailIfCursor(TSD->cursors, "can't begin transaction during r/o cursor"); if (TSD->tid != NULL) { - syslog(LOG_EMERG, "db: cdb_begin_transaction: ERROR: nested transaction"); + syslog(LOG_ERR, "db: cdb_begin_transaction: ERROR: nested transaction"); cdb_abort(); } @@ -726,7 +726,7 @@ void cdb_trunc(int cdb) { u_int32_t count; if (TSD->tid != NULL) { - syslog(LOG_EMERG, "db: cdb_trunc must not be called in a transaction."); + syslog(LOG_ERR, "db: cdb_trunc must not be called in a transaction."); cdb_abort(); } else { bailIfCursor(TSD->cursors, "attempt to write during r/o cursor"); @@ -742,9 +742,9 @@ void cdb_trunc(int cdb) { /* txabort(tid); */ goto retry; } else { - syslog(LOG_EMERG, "db: cdb_truncate(%d): %s", cdb, db_strerror(ret)); + syslog(LOG_ERR, "db: cdb_truncate(%d): %s", cdb, db_strerror(ret)); if (ret == ENOMEM) { - syslog(LOG_EMERG, "db: You may need to tune your database; please read http://www.citadel.org/doku.php?id=faq:troubleshooting:out_of_lock_entries for more information."); + syslog(LOG_ERR, "db: You may need to tune your database; please read http://www.citadel.org/doku.php?id=faq:troubleshooting:out_of_lock_entries for more information."); } exit(CTDLEXIT_DB); } diff --git a/citadel/database_cleanup.sh.in b/citadel/database_cleanup.sh.in old mode 100755 new mode 100644 diff --git a/citadel/guesstimezone.sh b/citadel/guesstimezone.sh old mode 100755 new mode 100644 diff --git a/citadel/include/citadel_dirs.h b/citadel/include/citadel_dirs.h deleted file mode 100644 index b30b4c6f2..000000000 --- a/citadel/include/citadel_dirs.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef __CITADEL_DIRS_H -#define __CITADEL_DIRS_H - -#include - - -extern char ctdl_home_directory[PATH_MAX]; - - -/* all our directories */ -extern char ctdl_data_dir[PATH_MAX]; -extern char ctdl_file_dir[PATH_MAX]; -extern char ctdl_shared_dir[PATH_MAX]; -extern char ctdl_image_dir[PATH_MAX]; -extern char ctdl_info_dir[PATH_MAX]; -extern char ctdl_key_dir[PATH_MAX]; -extern char ctdl_message_dir[PATH_MAX]; -extern char ctdl_usrpic_dir[PATH_MAX]; -extern char ctdl_autoetc_dir[PATH_MAX]; -extern char ctdl_run_dir[PATH_MAX]; -extern char ctdl_spool_dir[PATH_MAX]; -extern char ctdl_netdigest_dir[PATH_MAX]; -extern char ctdl_nettmp_dir[PATH_MAX]; -extern char ctdl_netcfg_dir[PATH_MAX]; -extern char ctdl_bbsbase_dir[PATH_MAX]; -extern char ctdl_sbin_dir[PATH_MAX]; -extern char ctdl_bin_dir[PATH_MAX]; -extern char ctdl_utilbin_dir[PATH_MAX]; - - - -/* some of the frequently used files */ -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_arcq[PATH_MAX]; -extern char file_citadel_socket[PATH_MAX]; -extern char file_citadel_admin_socket[PATH_MAX]; -extern char file_pid_file[PATH_MAX]; -extern char file_pid_paniclog[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 char file_guesstimezone[PATH_MAX]; - -extern void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, int dbg); - - -extern int create_run_directories(long UID, long GUID); - -extern size_t assoc_file_name(char *buf, - size_t n, - struct ctdlroom *qrbuf, - const char *prefix); - -extern FILE *create_digest_file(struct ctdlroom *room, int forceCreate); -extern void remove_digest_file(struct ctdlroom *room); -#endif /* __CITADEL_DIRS_H */ diff --git a/citadel/install-sh b/citadel/install-sh old mode 100755 new mode 100644 diff --git a/citadel/missing b/citadel/missing old mode 100755 new mode 100644 diff --git a/citadel/mkinstalldirs b/citadel/mkinstalldirs old mode 100755 new mode 100644 diff --git a/citadel/modules/fulltext/ft_wordbreaker.c b/citadel/modules/fulltext/ft_wordbreaker.c index 968fa9f02..4e1059a7f 100644 --- a/citadel/modules/fulltext/ft_wordbreaker.c +++ b/citadel/modules/fulltext/ft_wordbreaker.c @@ -56,10 +56,7 @@ * NOTE: if the noise word list is altered in any way, the FT_WORDBREAKER_ID * must also be changed, so that the index is rebuilt. */ - -noise_word *noise_words[26]; - -static char *noise_words_init[] = { +static char *noise_words[] = { "about", "after", "also", @@ -122,29 +119,7 @@ static char *noise_words_init[] = { "would", "your" }; - - -void initialize_noise_words(void) -{ - int i; - int len; - int ch; - noise_word *next; - - memset (noise_words, 0, sizeof(noise_words)); - - for (i=0; i<(sizeof(noise_words_init)/sizeof(char *)); ++i) - { - ch = noise_words_init[i][0] - 'a'; - len = strlen(noise_words_init[i]); - - next = malloc(sizeof(noise_word)); - next->len = len; - next->word = strdup(noise_words_init[i]); - next->next = noise_words[ch]; - noise_words[ch] = next; - } -} +#define NUM_NOISE (sizeof(noise_words) / sizeof(char *)) /* @@ -176,8 +151,6 @@ void wordbreaker(const char *text, int *num_tokens, int **tokens) { char word[256]; int i; int word_crc; - noise_word *noise; - if (text == NULL) { /* no NULL text please */ *num_tokens = 0; @@ -219,30 +192,22 @@ void wordbreaker(const char *text, int *num_tokens, int **tokens) { word_start = NULL; /* are we ok with the length? */ - if ( (word_len >= WB_MIN) - && (word_len <= WB_MAX) ) { + if ( (word_len >= WB_MIN) && (word_len <= WB_MAX) ) { for (i=0; ilen == word_len) - { - if (!strcmp(word, noise->word)) - { - word_len = 0; - break; - } + for (i=0; inext; } + if (word_len == 0) continue; - word_crc = (int) - CalcCRC16Bytes(word_len, word); + word_crc = (int) CalcCRC16Bytes(word_len, word); ++wb_num_tokens; if (wb_num_tokens > wb_num_alloc) { diff --git a/citadel/modules/fulltext/ft_wordbreaker.h b/citadel/modules/fulltext/ft_wordbreaker.h index 10a0651da..e36d6951e 100644 --- a/citadel/modules/fulltext/ft_wordbreaker.h +++ b/citadel/modules/fulltext/ft_wordbreaker.h @@ -1,22 +1,15 @@ /* - * Copyright (c) 2005-2012 by the citadel.org team + * Copyright (c) 2005-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. - * - * + * 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. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ - /* * This is an ID for the wordbreaker module. If we do pluggable wordbreakers * later on, or even if we update this one, we can use a different ID so the @@ -31,15 +24,3 @@ #define WB_MAX 40 void wordbreaker(const char *text, int *num_tokens, int **tokens); - -void initialize_noise_words(void); -void noise_word_cleanup(void); - - -typedef struct noise_word noise_word; - -struct noise_word { - unsigned int len; - char *word; - noise_word *next; -}; diff --git a/citadel/modules/fulltext/serv_fulltext.c b/citadel/modules/fulltext/serv_fulltext.c index 90c3e3685..9fc9cf5b0 100644 --- a/citadel/modules/fulltext/serv_fulltext.c +++ b/citadel/modules/fulltext/serv_fulltext.c @@ -479,7 +479,6 @@ CTDL_MODULE_INIT(fulltext) if (!threading) { initialize_ft_cache(); - initialize_noise_words(); CtdlRegisterProtoHook(cmd_srch, "SRCH", "Full text search"); CtdlRegisterDeleteHook(ft_delete_remove); CtdlRegisterSearchFuncHook(ft_search, "fulltext"); diff --git a/citadel/modules/network/serv_netmail.c b/citadel/modules/network/serv_netmail.c index 820c2fe9f..c6cee8e2a 100644 --- a/citadel/modules/network/serv_netmail.c +++ b/citadel/modules/network/serv_netmail.c @@ -239,7 +239,7 @@ void network_process_digest(SpoolControl *sc, struct CtdlMessage *omsg, long *de /* If there are digest recipients, we have to build a digest */ if (sc->digestfp == NULL) { - sc->digestfp = create_digest_file(&sc->room, 1); + sc->digestfp = tmpfile(); if (sc->digestfp == NULL) return; diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 5055eabfa..f4224d6ad 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -2,7 +2,7 @@ * This module handles shared rooms, inter-Citadel mail, and outbound * mailing list processing. * - * Copyright (c) 2000-2020 by the citadel.org team + * Copyright (c) 2000-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. @@ -357,7 +357,6 @@ void network_spoolout_room(SpoolControl *sc) network_deliver_digest(sc); /* deliver */ fclose(sc->digestfp); sc->digestfp = NULL; - remove_digest_file(&sc->room); } /* Now rewrite the netconfig */ @@ -394,21 +393,6 @@ void free_spoolcontrol_struct_members(SpoolControl *sc) } -/* - * It's ok if these directories already exist. Just fail silently. - */ -void create_spool_dirs(void) { - if ((mkdir(ctdl_spool_dir, 0700) != 0) && (errno != EEXIST)) - syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_spool_dir, strerror(errno)); - if (chown(ctdl_spool_dir, CTDLUID, (-1)) != 0) - syslog(LOG_EMERG, "netspool: unable to set the access rights for [%s]: %s", ctdl_spool_dir, strerror(errno)); - if ((mkdir(ctdl_nettmp_dir, 0700) != 0) && (errno != EEXIST)) - syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_nettmp_dir, strerror(errno)); - if (chown(ctdl_nettmp_dir, CTDLUID, (-1)) != 0) - syslog(LOG_EMERG, "netspool: unable to set the access rights for [%s]: %s", ctdl_nettmp_dir, strerror(errno)); -} - - /* * Module entry point */ @@ -423,7 +407,6 @@ CTDL_MODULE_INIT(network_spool) CtdlREGISTERRoomCfgType(digestrecp, ParseGeneric, 0, 1, SerializeGeneric, DeleteGenericCfgLine); CtdlREGISTERRoomCfgType(participate, ParseGeneric, 0, 1, SerializeGeneric, DeleteGenericCfgLine); CtdlREGISTERRoomCfgType(roommailalias, ParseRoomAlias, 0, 1, SerializeGeneric, DeleteGenericCfgLine); - create_spool_dirs(); } return "network_spool"; } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 45be98173..aff45e097 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -1054,14 +1054,14 @@ void mime_download(char *name, char *filename, char *partnum, char *disp, ) { CC->download_fp = tmpfile(); if (CC->download_fp == NULL) { - syslog(LOG_EMERG, "msgbase: mime_download() couldn't write: %m"); + syslog(LOG_ERR, "msgbase: mime_download() couldn't write: %m"); cprintf("%d cannot open temporary file: %s\n", ERROR + INTERNAL_ERROR, strerror(errno)); return; } rv = fwrite(content, length, 1, CC->download_fp); if (rv <= 0) { - syslog(LOG_EMERG, "msgbase: mime_download() Couldn't write: %m"); + syslog(LOG_ERR, "msgbase: mime_download() Couldn't write: %m"); cprintf("%d unable to write tempfile.\n", ERROR + TOO_BIG); fclose(CC->download_fp); CC->download_fp = NULL; diff --git a/citadel/serv_extensions.c b/citadel/serv_extensions.c index cc594ce65..f81008464 100644 --- a/citadel/serv_extensions.c +++ b/citadel/serv_extensions.c @@ -208,8 +208,8 @@ void LogPrintMessages(long err) StrBufAppendBufPlain(Message, HKEY("\n\n"), 0); StrBufAppendBufPlain(Message, CKEY(ErrGeneral[3]), 0); - syslog(LOG_EMERG, "extensions: %s", ChrPtr(Message)); - syslog(LOG_EMERG, "extensions: %s", ErrSubject); + syslog(LOG_ERR, "extensions: %s", ChrPtr(Message)); + syslog(LOG_ERR, "extensions: %s", ErrSubject); quickie_message("Citadel", NULL, NULL, AIDEROOM, ChrPtr(Message), FMT_FIXED, ErrSubject); FreeStrBuf(&Message); diff --git a/citadel/server_main.c b/citadel/server_main.c index ece0e3cb8..753e73a6b 100644 --- a/citadel/server_main.c +++ b/citadel/server_main.c @@ -19,7 +19,6 @@ #include #include #include - #include "citserver.h" #include "svn_revision.h" #include "modules_init.h" @@ -37,12 +36,13 @@ int sanity_diag_mode = 0; /* * Create or remove a lock file, so we only have one Citadel Server running at a time. + * Set 'op' to nonzero to lock, zero to unlock. */ -void ctdl_lockfile(int yo) { +void ctdl_lockfile(int op) { static char lockfilename[PATH_MAX]; static FILE *fp; - if (yo) { + if (op) { syslog(LOG_DEBUG, "main: creating lockfile"); snprintf(lockfilename, sizeof lockfilename, "%s/citadel.lock", ctdl_run_dir); fp = fopen(lockfilename, "w"); @@ -67,20 +67,16 @@ void ctdl_lockfile(int yo) { /* * Here's where it all begins. */ -int main(int argc, char **argv) -{ +int main(int argc, char **argv) { + size_t basesize = 64; char facility[32]; int a; /* General-purpose variables */ struct passwd pw, *pwp = NULL; char pwbuf[SIZ]; int drop_root_perms = 1; - int relh=0; - int home=0; - int dbg=0; int max_log_level = LOG_INFO; - char relhome[PATH_MAX]=""; - char ctdldir[PATH_MAX]=CTDLDIR; + char *ctdldir = CTDLDIR; int syslog_facility = LOG_DAEMON; uid_t u = 0; struct passwd *p = NULL; @@ -88,9 +84,22 @@ int main(int argc, char **argv) struct stat filestats; #endif - /* initialize the master context */ - InitializeMasterCC(); - InitializeMasterTSD(); + /* Tell 'em who's in da house */ + syslog(LOG_INFO, " "); + syslog(LOG_INFO, " "); + syslog(LOG_INFO, "*** Citadel server engine ***\n"); + syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, svn_revision()); + syslog(LOG_INFO, "Copyright (C) 1987-2021 by the Citadel development team."); + syslog(LOG_INFO, " "); + syslog(LOG_INFO, "This program is open source software: you can redistribute it and/or"); + syslog(LOG_INFO, "modify it under the terms of the GNU General Public License, version 3."); + syslog(LOG_INFO, " "); + syslog(LOG_INFO, "This program is distributed in the hope that it will be useful,"); + syslog(LOG_INFO, "but WITHOUT ANY WARRANTY; without even the implied warranty of"); + syslog(LOG_INFO, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); + syslog(LOG_INFO, "GNU General Public License for more details."); + syslog(LOG_INFO, " "); + syslog(LOG_INFO, "%s", libcitadel_version_string()); /* parse command-line arguments */ while ((a=getopt(argc, argv, "cl:dh:x:t:B:Dru:s:")) != EOF) switch(a) { @@ -114,14 +123,7 @@ int main(int argc, char **argv) // specify the data directory case 'h': - relh = optarg[0] != '/'; - if (!relh) { - safestrncpy(ctdl_home_directory, optarg, sizeof ctdl_home_directory); - } - else { - safestrncpy(relhome, optarg, sizeof relhome); - } - home=1; + ctdldir = optarg; break; // identify the desired logging severity level @@ -133,13 +135,13 @@ int main(int argc, char **argv) case 't': break; - // basesize (what is this?) + // basesize (passed to libcitadel) case 'B': basesize = atoi(optarg); break; + // deprecated case 'D': - dbg = 1; break; // -r tells the server not to drop root permissions. @@ -176,13 +178,25 @@ int main(int argc, char **argv) "citserver " "[-l LogFacility] " "[-x MaxLogLevel] " - "[-d] [-D] [-r] " + "[-d] [-r] " "[-u user] " "[-h HomeDir]\n" ); exit(1); } + if (chdir(ctdldir) != 0) { + syslog(LOG_ERR, "main: unable to change directory to [%s]: %m", ctdldir); + } + else { + syslog(LOG_INFO, "main: running in data directory %s", ctdldir); + } + + if ((ctdluid == 0) && (drop_root_perms == 0)) { + fprintf(stderr, "citserver: cannot determine user to run as; please specify -r or -u options\n"); + exit(CTDLEXIT_UNUSER); + } + /* Last ditch effort to determine the user name ... if there's a user called "citadel" then use that */ if (ctdluid == 0) { p = getpwnam("citadel"); @@ -200,10 +214,9 @@ int main(int argc, char **argv) } } - if ((ctdluid == 0) && (drop_root_perms == 0)) { - fprintf(stderr, "citserver: cannot determine user to run as; please specify -r or -u options\n"); - exit(CTDLEXIT_UNUSER); - } + /* initialize the master context */ + InitializeMasterCC(); + InitializeMasterTSD(); StartLibCitadel(basesize); setlogmask(LOG_UPTO(max_log_level)); @@ -212,30 +225,12 @@ int main(int argc, char **argv) syslog_facility ); - calc_dirs_n_files(relh, home, relhome, ctdldir, dbg); /* daemonize, if we were asked to */ if (running_as_daemon) { start_daemon(0); drop_root_perms = 1; } - /* Tell 'em who's in da house */ - syslog(LOG_INFO, " "); - syslog(LOG_INFO, " "); - syslog(LOG_INFO, "*** Citadel server engine ***\n"); - syslog(LOG_INFO, "Version %d (build %s) ***", REV_LEVEL, svn_revision()); - syslog(LOG_INFO, "Copyright (C) 1987-2021 by the Citadel development team."); - syslog(LOG_INFO, " "); - syslog(LOG_INFO, "This program is open source software: you can redistribute it and/or"); - syslog(LOG_INFO, "modify it under the terms of the GNU General Public License, version 3."); - syslog(LOG_INFO, " "); - syslog(LOG_INFO, "This program is distributed in the hope that it will be useful,"); - syslog(LOG_INFO, "but WITHOUT ANY WARRANTY; without even the implied warranty of"); - syslog(LOG_INFO, "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); - syslog(LOG_INFO, "GNU General Public License for more details."); - syslog(LOG_INFO, " "); - syslog(LOG_INFO, "%s", libcitadel_version_string()); - if ((mkdir(ctdl_run_dir, 0755) != 0) && (errno != EEXIST)) { syslog(LOG_ERR, "main: unable to create run directory [%s]: %m", ctdl_run_dir); } @@ -251,15 +246,14 @@ int main(int argc, char **argv) syslog(LOG_INFO, "main: upgrading modules"); // Run any upgrade entry points upgrade_modules(); -/* - * Load the user for the masterCC or create them if they don't exist - */ - if (CtdlGetUser(&masterCC.user, "SYS_Citadel")) - { + /* + * Load the user for the masterCC or create them if they don't exist + */ + if (CtdlGetUser(&masterCC.user, "SYS_Citadel")) { /* User doesn't exist. We can't use create user here as the user number needs to be 0 */ strcpy (masterCC.user.fullname, "SYS_Citadel") ; CtdlPutUser(&masterCC.user); - CtdlGetUser(&masterCC.user, "SYS_Citadel"); /* Just to be safe */ + CtdlGetUser(&masterCC.user, "SYS_Citadel"); /* Just to be safe */ } /* @@ -297,7 +291,6 @@ int main(int argc, char **argv) * Load any server-side extensions available here. */ syslog(LOG_INFO, "main: initializing server extensions"); - initialise_modules(0); /* @@ -314,28 +307,18 @@ int main(int argc, char **argv) checkcrash(); /* - * Now that we've bound the sockets, change to the Citadel user id and its - * corresponding group ids + * Now that we've bound the sockets, change to the Citadel user id and its corresponding group ids */ if (drop_root_perms) { cdb_chmod_data(); /* make sure we own our data files */ - -#ifdef HAVE_GETPWUID_R -#ifdef SOLARIS_GETPWUID - pwp = getpwuid_r(ctdluid, &pw, pwbuf, sizeof(pwbuf)); -#else // SOLARIS_GETPWUID getpwuid_r(ctdluid, &pw, pwbuf, sizeof(pwbuf), &pwp); -#endif // SOLARIS_GETPWUID -#else // HAVE_GETPWUID_R - pwp = NULL; -#endif // HAVE_GETPWUID_R - if (pwp == NULL) syslog(LOG_ERR, "main: WARNING, getpwuid(%ld): %m Group IDs will be incorrect.", (long)CTDLUID); else { initgroups(pw.pw_name, pw.pw_gid); - if (setgid(pw.pw_gid)) + if (setgid(pw.pw_gid)) { syslog(LOG_ERR, "main: setgid(%ld): %m", (long)pw.pw_gid); + } } syslog(LOG_INFO, "main: changing uid to %ld", (long)CTDLUID); if (setuid(CTDLUID) != 0) { @@ -349,12 +332,14 @@ int main(int argc, char **argv) /* We want to check for idle sessions once per minute */ CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER, PRIO_CLEANUP + 1); + /* Go into multithreaded mode. When this call exits, the server is stopping. */ go_threading(); + /* Get ready to shut down the server. */ int exit_code = master_cleanup(exit_signal); ctdl_lockfile(0); if (restart_server) { - syslog(LOG_INFO, "main: *** CITADEL SERVER IS RESTARTING ***"); + syslog(LOG_INFO, "main: *** CITADEL SERVER IS RESTARTING ***"); execv(argv[0], argv); } return(exit_code); diff --git a/citadel/utillib/citadel_dirs.c b/citadel/utillib/citadel_dirs.c index dfaaee8db..3bcff6e39 100644 --- a/citadel/utillib/citadel_dirs.c +++ b/citadel/utillib/citadel_dirs.c @@ -24,262 +24,38 @@ #include "citadel.h" #include "citadel_dirs.h" -/* our directories... */ -char ctdl_home_directory[PATH_MAX] = ""; -char ctdl_data_dir[PATH_MAX]="data"; -char ctdl_file_dir[PATH_MAX]="files"; -char ctdl_shared_dir[PATH_MAX]=""; -char ctdl_image_dir[PATH_MAX]="images"; -char ctdl_info_dir[PATH_MAX]="info"; -char ctdl_key_dir[PATH_MAX]=SSL_DIR; -char ctdl_message_dir[PATH_MAX]="messages"; -char ctdl_usrpic_dir[PATH_MAX]="userpics"; -char ctdl_bbsbase_dir[PATH_MAX]=""; -char ctdl_autoetc_dir[PATH_MAX]=""; -/* attention! this may be non volatile on some oses */ -char ctdl_run_dir[PATH_MAX]=""; -char ctdl_spool_dir[PATH_MAX]="network"; -char ctdl_netdigest_dir[PATH_MAX]="network/digest"; -char ctdl_nettmp_dir[PATH_MAX]="network/spooltmp"; -char ctdl_netcfg_dir[PATH_MAX]="netconfigs"; -char ctdl_utilbin_dir[PATH_MAX]=""; -char ctdl_sbin_dir[PATH_MAX]=""; -char ctdl_bin_dir[PATH_MAX]=""; - -/* some of our files, that are needed in several places */ -char file_citadel_config[PATH_MAX]=""; -char file_lmtp_socket[PATH_MAX]=""; -char file_lmtp_unfiltered_socket[PATH_MAX]=""; -char file_arcq[PATH_MAX]=""; -char file_citadel_socket[PATH_MAX]=""; -char file_citadel_admin_socket[PATH_MAX]=""; -char file_mail_aliases[PATH_MAX]=""; -char file_pid_file[PATH_MAX]=""; -char file_pid_paniclog[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]=""; -char file_guesstimezone[PATH_MAX]=""; - - - - - -#define COMPUTE_DIRECTORY(SUBDIR) memcpy(dirbuffer,SUBDIR, sizeof dirbuffer);\ - snprintf(SUBDIR,sizeof SUBDIR, "%s%s%s%s%s%s%s", \ - (home&!relh)?ctdl_home_directory:basedir, \ - ((basedir!=ctdldir)&(home&!relh))?basedir:"/", \ - ((basedir!=ctdldir)&(home&!relh))?"/":"", \ - relhome, \ - (relhome[0]!='\0')?"/":"",\ - dirbuffer,\ - (dirbuffer[0]!='\0')?"/":""); - -#define DBG_PRINT(A) if (dbg==1) fprintf (stderr,"%s : %s \n", #A, A) - - -void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, int dbg) -{ - const char* basedir = ""; - char dirbuffer[PATH_MAX] = ""; - - /* - * Ok, we keep our binaries either in the citadel base dir, - * or in /usr/sbin / /usr/bin - */ - StripSlashes(ctdldir, 1); -#ifdef HAVE_ETC_DIR - snprintf(ctdl_sbin_dir, sizeof ctdl_sbin_dir, "/usr/sbin/"); - snprintf(ctdl_bin_dir, sizeof ctdl_bin_dir, "/usr/bin/"); -#else - snprintf(ctdl_sbin_dir, sizeof ctdl_sbin_dir, ctdldir); - snprintf(ctdl_bin_dir, sizeof ctdl_bin_dir, ctdldir); -#endif - StripSlashes(ctdl_sbin_dir, 1); - StripSlashes(ctdl_bin_dir, 1); - -#ifndef HAVE_AUTO_ETC_DIR - basedir=ctdldir; -#else - basedir=AUTO_ETC_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_autoetc_dir); - StripSlashes(ctdl_autoetc_dir, 1); - -#ifndef HAVE_ETC_DIR - basedir=ctdldir; -#else - basedir=ETC_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_netcfg_dir); - StripSlashes(ctdl_netcfg_dir, 1); - -#ifndef HAVE_UTILBIN_DIR - basedir=ctdldir; -#else - basedir=UTILBIN_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_utilbin_dir); - StripSlashes(ctdl_utilbin_dir, 1); - -#ifndef HAVE_RUN_DIR - basedir=ctdldir; -#else - basedir=RUN_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_run_dir); - StripSlashes(ctdl_run_dir, 1); - -#ifndef HAVE_STATICDATA_DIR - basedir=ctdldir; -#else - basedir=STATICDATA_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_message_dir); - StripSlashes(ctdl_message_dir, 1); - -#ifndef HAVE_DATA_DIR - basedir=ctdldir; -#else - basedir=DATA_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_data_dir); - COMPUTE_DIRECTORY(ctdl_file_dir); - COMPUTE_DIRECTORY(ctdl_image_dir); - COMPUTE_DIRECTORY(ctdl_info_dir); - COMPUTE_DIRECTORY(ctdl_usrpic_dir); - COMPUTE_DIRECTORY(ctdl_bbsbase_dir); - - StripSlashes(ctdl_data_dir, 1); - StripSlashes(ctdl_file_dir, 1); - StripSlashes(ctdl_image_dir, 1); - StripSlashes(ctdl_info_dir, 1); - StripSlashes(ctdl_usrpic_dir, 1); - StripSlashes(ctdl_bbsbase_dir, 1); - -#ifndef HAVE_SPOOL_DIR - basedir=ctdldir; -#else - basedir=SPOOL_DIR; -#endif - COMPUTE_DIRECTORY(ctdl_spool_dir); - COMPUTE_DIRECTORY(ctdl_netdigest_dir); - COMPUTE_DIRECTORY(ctdl_nettmp_dir); - - StripSlashes(ctdl_spool_dir, 1); - StripSlashes(ctdl_netdigest_dir, 1); - StripSlashes(ctdl_nettmp_dir, 1); - - /* ok, now we know the dirs, calc some commonly used files */ - - snprintf(file_arcq, - sizeof file_arcq, - "%srefcount_adjustments.dat", - ctdl_autoetc_dir); - StripSlashes(file_arcq, 0); - - snprintf(file_citadel_config, - sizeof file_citadel_config, - "%scitadel.config", - ctdl_autoetc_dir); - StripSlashes(file_citadel_config, 0); - snprintf(file_lmtp_socket, - sizeof file_lmtp_socket, - "%slmtp.socket", - ctdl_run_dir); - StripSlashes(file_lmtp_socket, 0); - snprintf(file_lmtp_unfiltered_socket, - sizeof file_lmtp_socket, - "%slmtp-unfiltered.socket", - ctdl_run_dir); - StripSlashes(file_lmtp_unfiltered_socket, 0); - snprintf(file_citadel_socket, - sizeof file_citadel_socket, - "%scitadel.socket", - ctdl_run_dir); - StripSlashes(file_citadel_socket, 0); - snprintf(file_citadel_admin_socket, - sizeof file_citadel_admin_socket, - "%scitadel-admin.socket", - ctdl_run_dir); - StripSlashes(file_citadel_admin_socket, 0); - snprintf(file_pid_file, - sizeof file_pid_file, - "%scitadel.pid", - ctdl_run_dir); - StripSlashes(file_pid_file, 0); - snprintf(file_pid_paniclog, - sizeof file_pid_paniclog, - "%spanic.log", - ctdl_home_directory); - StripSlashes(file_pid_paniclog, 0); - snprintf(file_crpt_file_key, - sizeof file_crpt_file_key, - "%s/citadel.key", - ctdl_key_dir); - StripSlashes(file_crpt_file_key, 0); - snprintf(file_crpt_file_csr, - sizeof file_crpt_file_csr, - "%s/citadel.csr", - ctdl_key_dir); - StripSlashes(file_crpt_file_csr, 0); - snprintf(file_crpt_file_cer, - sizeof file_crpt_file_cer, - "%s/citadel.cer", - ctdl_key_dir); - StripSlashes(file_crpt_file_cer, 0); - snprintf(file_chkpwd, - sizeof file_chkpwd, - "%schkpwd", - ctdl_utilbin_dir); - StripSlashes(file_chkpwd, 0); - snprintf(file_guesstimezone, - sizeof file_guesstimezone, - "%sguesstimezone.sh", - ctdl_utilbin_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", - ctdl_spool_dir - ); - StripSlashes(file_mail_aliases, 0); - - DBG_PRINT(ctdl_data_dir); - DBG_PRINT(ctdl_file_dir); - DBG_PRINT(ctdl_image_dir); - DBG_PRINT(ctdl_info_dir); - DBG_PRINT(ctdl_key_dir); - DBG_PRINT(ctdl_message_dir); - DBG_PRINT(ctdl_usrpic_dir); - DBG_PRINT(ctdl_run_dir); - DBG_PRINT(ctdl_spool_dir); - DBG_PRINT(ctdl_netdigest_dir); - DBG_PRINT(ctdl_nettmp_dir); - DBG_PRINT(ctdl_netcfg_dir); - DBG_PRINT(ctdl_bbsbase_dir); - DBG_PRINT(ctdl_sbin_dir); - DBG_PRINT(ctdl_bin_dir); - DBG_PRINT(ctdl_utilbin_dir); - DBG_PRINT(file_citadel_config); - DBG_PRINT(file_lmtp_socket); - DBG_PRINT(file_lmtp_unfiltered_socket); - DBG_PRINT(file_arcq); - DBG_PRINT(file_citadel_socket); - DBG_PRINT(file_mail_aliases); - DBG_PRINT(file_pid_file); - DBG_PRINT(file_pid_paniclog); - DBG_PRINT(file_crpt_file_key); - DBG_PRINT(file_crpt_file_csr); - DBG_PRINT(file_crpt_file_cer); - DBG_PRINT(file_chkpwd); - DBG_PRINT(file_guesstimezone); -} +/* all our directories */ +char *ctdl_home_directory = "."; +char *ctdl_db_dir = "data"; +char *ctdl_file_dir = "files"; +char *ctdl_shared_dir = "."; +char *ctdl_image_dir = "images"; +char *ctdl_info_dir = "info"; +char *ctdl_key_dir = "keys"; +char *ctdl_message_dir = "messages"; +char *ctdl_usrpic_dir = "userpics"; +char *ctdl_autoetc_dir = "."; +char *ctdl_run_dir = "."; +char *ctdl_netcfg_dir = "netconfigs"; +char *ctdl_bbsbase_dir = "."; +char *ctdl_sbin_dir = "."; +char *ctdl_bin_dir = "."; +char *ctdl_utilbin_dir = "."; + +/* some of the frequently used files */ +char *file_citadel_config = "citadel.config"; +char *file_lmtp_socket = "lmtp.socket"; +char *file_lmtp_unfiltered_socket = "lmtp-unfiltered.socket"; +char *file_arcq = "refcount_adjustments.dat"; +char *file_citadel_socket = "citadel.socket"; +char *file_citadel_admin_socket = "citadel-admin.socket"; +char *file_pid_file = "/var/run/citserver.pid"; +char *file_pid_paniclog = "panic.log"; +char *file_crpt_file_key = "keys/citadel.key"; +char *file_crpt_file_csr = "keys/citadel.csr"; +char *file_crpt_file_cer = "keys/citadel.cer"; +char *file_chkpwd = "chkpwd"; +char *file_guesstimezone = "guesstimezone.sh"; /* @@ -290,36 +66,6 @@ size_t assoc_file_name(char *buf, size_t n, struct ctdlroom *qrbuf, const char * } -void remove_digest_file(struct ctdlroom *room) { - char buf[PATH_MAX]; - - snprintf(buf, PATH_MAX, "%s/%ld.eml", ctdl_netdigest_dir, room->QRnumber); - StripSlashes(buf, 0); - unlink(buf); -} - - -FILE *create_digest_file(struct ctdlroom *room, int forceCreate) { - struct stat stbuf; - char fn[PATH_MAX]; - int exists; - FILE *fp; - - snprintf(fn, PATH_MAX, "%s/%ld.eml", ctdl_netdigest_dir, room->QRnumber); - StripSlashes(fn, 0); - - exists = stat(fn, &stbuf); - if (!forceCreate && (exists == -1)) - return NULL; - - fp = fopen(fn, "w+"); - if (fp == NULL) { - syslog(LOG_ERR, "failed to create digest file %s: %s", fn, strerror(errno)); - } - return fp; -} - - int create_dir(char *which, long ACCESS, long UID, long GID) { int rv; rv = mkdir(which, ACCESS); @@ -354,9 +100,6 @@ int create_run_directories(long UID, long GID) { int rv = 0; rv += create_dir(ctdl_message_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); rv += create_dir(ctdl_file_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); - rv += create_dir(ctdl_spool_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); - rv += create_dir(ctdl_netdigest_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); - rv += create_dir(ctdl_nettmp_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); rv += create_dir(ctdl_key_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); rv += create_dir(ctdl_run_dir , S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH, UID, GID); return rv; diff --git a/citadel/utils/chkpw.c b/citadel/utils/chkpw.c index 227064638..9691b7343 100644 --- a/citadel/utils/chkpw.c +++ b/citadel/utils/chkpw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-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. @@ -115,8 +115,6 @@ int main(int argc, char **argv) { int uid; char ctdldir[PATH_MAX]=CTDLDIR; - calc_dirs_n_files(0,0,"", ctdldir, 0); - printf("\n\n ** host auth mode test utility **\n\n"); start_chkpwd_daemon(); diff --git a/citadel/utils/citmail.c b/citadel/utils/citmail.c index 651e561d7..a53655bad 100644 --- a/citadel/utils/citmail.c +++ b/citadel/utils/citmail.c @@ -3,15 +3,15 @@ * some other non-Citadel MTA. It basically just contacts the Citadel LMTP * listener on a unix domain socket and transmits the message. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2021by 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. + * 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. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ #include "sysdep.h" @@ -202,14 +202,11 @@ int main(int argc, char **argv) { } } - /* TODO: should we be able to calculate relative dirs? */ - calc_dirs_n_files(relh, home, relhome, ctdldir, 0); - pw = getpwuid(getuid()); fp = tmpfile(); if (fp == NULL) return(errno); - serv_sock = uds_connectsock(file_lmtp_socket); /* FIXME: if called as 'sendmail' connect to file_lmtp_unfiltered_socket */ + serv_sock = uds_connectsock(file_lmtp_socket); serv_gets(buf); if (buf[0] != '2') { fprintf(stderr, "%s\n", &buf[4]); diff --git a/citadel/utils/ctdlmigrate.c b/citadel/utils/ctdlmigrate.c index 2a9a2d817..5008cc5e4 100644 --- a/citadel/utils/ctdlmigrate.c +++ b/citadel/utils/ctdlmigrate.c @@ -5,7 +5,7 @@ * The scope of this program isn't wide enough to make a difference. If you don't like * it you can rewrite it. * - * Copyright (c) 2009-2018 citadel.org + * Copyright (c) 2009-2021 citadel.org * * 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. @@ -87,7 +87,6 @@ int main(int argc, char *argv[]) char spinning[4] = "-\\|/" ; int exitcode = 0; - calc_dirs_n_files(relh, home, relhome, ctdldir, 0); CtdlMakeTempFileName(socket_path, sizeof socket_path); cmdexit = system("clear"); diff --git a/citadel/utils/sendcommand.c b/citadel/utils/sendcommand.c index 001a4b1dc..b6c910248 100644 --- a/citadel/utils/sendcommand.c +++ b/citadel/utils/sendcommand.c @@ -1,7 +1,7 @@ /* * Command-line utility to transmit a server command. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-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. @@ -168,8 +168,6 @@ int main(int argc, char **argv) } } - calc_dirs_n_files(relh, home, relhome, ctdldir, 0); - fprintf(stderr, "sendcommand: started (pid=%d) connecting to Citadel server at %s\n", (int) getpid(), file_citadel_admin_socket diff --git a/citadel/utils/setup.c b/citadel/utils/setup.c index 710edfad5..8a9214564 100644 --- a/citadel/utils/setup.c +++ b/citadel/utils/setup.c @@ -726,7 +726,6 @@ int main(int argc, char *argv[]) } } - calc_dirs_n_files(relh, home, relhome, ctdldir, 0); SetTitles(); enable_home = ( relh | home ); diff --git a/contrib/configs/deb-amd64/libical_targets b/contrib/configs/deb-amd64/libical_targets deleted file mode 100644 index ac785b28c..000000000 --- a/contrib/configs/deb-amd64/libical_targets +++ /dev/null @@ -1,6 +0,0 @@ -ubuntu/CitadelBuildGutsy -ubuntu/CitadelBuildFeisty -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildEtch -debian/CitadelBuildSid diff --git a/contrib/configs/deb-amd64/libsieve_targets b/contrib/configs/deb-amd64/libsieve_targets deleted file mode 100644 index 9c456bb43..000000000 --- a/contrib/configs/deb-amd64/libsieve_targets +++ /dev/null @@ -1,5 +0,0 @@ -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildEtch -debian/CitadelBuildSid - diff --git a/contrib/configs/deb-amd64/targets b/contrib/configs/deb-amd64/targets deleted file mode 100644 index f7d237c32..000000000 --- a/contrib/configs/deb-amd64/targets +++ /dev/null @@ -1,6 +0,0 @@ -debian/CitadelBuildEtch -debian/CitadelBuildSid -ubuntu/CitadelBuildGutsy -ubuntu/CitadelBuildFeisty -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy diff --git a/contrib/configs/deb-amd64/tinymce_targets b/contrib/configs/deb-amd64/tinymce_targets deleted file mode 100644 index ae113e873..000000000 --- a/contrib/configs/deb-amd64/tinymce_targets +++ /dev/null @@ -1,5 +0,0 @@ -ubuntu/CitadelBuildBreezy -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildSarge -debian/CitadelBuildSarge_bdb44 diff --git a/contrib/configs/deb-i386/libical_targets b/contrib/configs/deb-i386/libical_targets deleted file mode 100644 index 2f48888d3..000000000 --- a/contrib/configs/deb-i386/libical_targets +++ /dev/null @@ -1,10 +0,0 @@ -ubuntu/CitadelBuildGutsy -ubuntu/CitadelBuildFeisty -ubuntu/CitadelBuildBreezy -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildEtch -debian/CitadelBuildEtch_bdb44 -debian/CitadelBuildSarge -debian/CitadelBuildSarge_bdb44 -debian/CitadelBuildSid diff --git a/contrib/configs/deb-i386/libsieve_targets b/contrib/configs/deb-i386/libsieve_targets deleted file mode 100644 index ae113e873..000000000 --- a/contrib/configs/deb-i386/libsieve_targets +++ /dev/null @@ -1,5 +0,0 @@ -ubuntu/CitadelBuildBreezy -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildSarge -debian/CitadelBuildSarge_bdb44 diff --git a/contrib/configs/deb-i386/targets b/contrib/configs/deb-i386/targets deleted file mode 100644 index 2f48888d3..000000000 --- a/contrib/configs/deb-i386/targets +++ /dev/null @@ -1,10 +0,0 @@ -ubuntu/CitadelBuildGutsy -ubuntu/CitadelBuildFeisty -ubuntu/CitadelBuildBreezy -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildEtch -debian/CitadelBuildEtch_bdb44 -debian/CitadelBuildSarge -debian/CitadelBuildSarge_bdb44 -debian/CitadelBuildSid diff --git a/contrib/configs/deb-i386/tinymce_targets b/contrib/configs/deb-i386/tinymce_targets deleted file mode 100644 index ae113e873..000000000 --- a/contrib/configs/deb-i386/tinymce_targets +++ /dev/null @@ -1,5 +0,0 @@ -ubuntu/CitadelBuildBreezy -ubuntu/CitadelBuildDapper -ubuntu/CitadelBuildEdgy -debian/CitadelBuildSarge -debian/CitadelBuildSarge_bdb44 diff --git a/libcitadel/buildpackages b/libcitadel/buildpackages deleted file mode 100755 index b7b8ab01d..000000000 --- a/libcitadel/buildpackages +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# find out the package version from conf -if test -f Makefile; then - make distclean -fi - -./bootstrap - -export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;LIBCITADEL;" -e "s;4.;;"` - -DATE=`date '+%a, %d %b %Y %H:%I:00 %z'` -ACTUAL_DIR=`pwd` - - -rm -rf debian/libcitadel debian/libcitadel-dev debian/libcitadel1 debian/libcitadel1-dbg debian/tmp -if echo "$ACTUAL_DIR" |grep -q "$LIBCITADEL_VERSION"; then - echo "directory ($ACTUAL_DIR) naming scheme seems right. nothing done." -else - done=false - if test -L "$ACTUAL_DIR"; then - SYMLINK_=`pwd` - SYMLINK=`ls -l $SYMLINK_|sed "s;.*-> ;;"` - if ls -l $SYMLINK|grep -q "$LIBCITADEL_VERSION"; then - done=true - fi - else - SYMLINK=`pwd|sed "s;.*/;;"` - fi - if test "$done" = "false"; then - cd .. - ln -sf libcitadel "libcitadel-$LIBCITADEL_VERSION" - cd "libcitadel-$LIBCITADEL_VERSION" - else - cd "../libcitadel-$LIBCITADEL_VERSION" - fi - -fi - - -case $1 in - debian) - if grep -q "($LIBCITADEL_VERSION" debian/changelog; then - echo rebuilding package. - else - echo "Upstream Version higher than local." - - fi - if test "$2" == "src"; then - cd .. - rm -rf tmp - mkdir tmp - cp -rL libcitadel-$LIBCITADEL_VERSION tmp - cd tmp/libcitadel-$LIBCITADEL_VERSION - rm -rf `find -name .svn ` svn*tmp config.log config.status `find -name .libs` - find -type f -exec chmod a-x {} \; - chmod a+x configure - cd .. - tar -chzf libcitadel_${LIBCITADEL_VERSION}.orig.tar.gz libcitadel-${LIBCITADEL_VERSION}/ --exclude "debian/*" - pwd - cd libcitadel-${LIBCITADEL_VERSION}; debuild -S -sa -kw.goesgens@outgesourced.org - else - fakeroot dpkg-buildpackage - fi - ;; - csw) - if !test -d ~/pkgs/; then - mkdir ~/pkgs - fi - echo " -PKG=CSWlibcitadel -NAME=libcitadel - The groupware server for Web 2.0 -VERSION=${PACKAGE_VERSION} -CATEGORY=application -VENDOR=http://www.citadel.org/ packaged for CSW by Wilfried Goesgens -HOTLINE=https://uncensored.citadel.org/ Room citadel support -EMAIL=citadel@outgesourced.org -" >~/pkgs/citadel - export LDFLAGS='-L/opt/csw/lib -L /usr/local/lib' - export CFLAGS='-I/opt/csw/include -I/usr/local/include -DDISABLE_CURSES' - ./configure \ - --with-db=/opt/csw/bdb44 \ - --with-ical=/usr/local/ \ - --without-curses \ - --with-prefix=/opt/csw/ \ - --with-datadir=/opt/csw/var/lib/citadel \ - --with-sysconfdir=/opt/csw/etc/citadel \ - --with-ssldir=/opt/csw/etc/ssl/citadel/ \ - --with-spooldir=/opt/csw/var/spool/citadel \ - --with-rundir=/opt/csw/var/run/citadel \ - --with-docdir=/opt/csw/share/doc/citadel-doc/ \ - --with-pam \ - --with-zlib \ - --with-ldap \ - --with-libsieve - - gmake citserver aidepost msgform citmail userlist sendcommand base64 whobbs citadel - gmake DESTDIR=$ACTUAL_DIR/cswstage install-new - - - - ;; - sourcedist) - cd ..; tar \ - --exclude ".gitignore" \ - --exclude "*.lo" \ - --exclude "*.o" \ - --exclude "*.d" \ - --exclude "autom4te.cache/*" \ - --exclude "debian/*" \ - --exclude "sysdep.h" \ - \ - --exclude .libs \ - --exclude tests/testdata \ - \ - -chvzf libcitadel-$LIBCITADEL_VERSION.tar.gz libcitadel-$LIBCITADEL_VERSION/ - ;; - version) - echo This would build libcitadel-$LIBCITADEL_VERSION - ;; - *) - echo "Not yet implemented. we have: debian, sourcedist " - ;; -esac diff --git a/libcitadel/debian/.gitignore b/libcitadel/debian/.gitignore deleted file mode 100644 index e8a272a7b..000000000 --- a/libcitadel/debian/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.log -*.substvars -*.debhelper -libcitadel2-dbg -libcitadel2 -files \ No newline at end of file diff --git a/libcitadel/debian/changelog b/libcitadel/debian/changelog deleted file mode 100644 index 2e9962e88..000000000 --- a/libcitadel/debian/changelog +++ /dev/null @@ -1,237 +0,0 @@ -libcitadel (925-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 19 Dec 2018 16:57:49 -0500 - -libcitadel (924-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 19 Dec 2018 16:57:49 -0500 - -libcitadel (917-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 03 Jan 2018 16:57:49 -0500 - -libcitadel (9.16-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 01 Jan 2018 12:56:30 -0400 - -libcitadel (9.14-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 26 Dec 2017 12:56:30 -0400 - -libcitadel (9.01-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 01 Apr 2015 12:56:30 -0400 - -libcitadel (8.29-1) stable; urgency=low - - * development prerelease - - -- Wilfried Goesgens Sat, 07 Dec 2013 11:41:23 +0100 - -libcitadel (8.21-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 16 Oct 2013 22:00:00 +0001 - -libcitadel (8.20-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 16 Jul 2013 22:00:00 +0001 - -libcitadel (8.19.99-1) stable; urgency=low - - * development vesrion - - -- Wilfried Goesgens Mon, 16 Jun 2012 22:00:00 +0001 - -libcitadel (8.13-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Mon, 16 Jun 2012 22:00:00 +0001 - -libcitadel (8.12-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 26 Jun 2012 22:00:00 +0001 - -libcitadel (8.11-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 16 May 2012 22:00:00 +0001 - -libcitadel (8.10-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Fri, 11 Nov 2011 22:00:00 +0001 - -libcitadel (8.02-1) stable; urgency=low - - * new release - - -- Wilfried Goesgens Fri, 11 Nov 2011 22:00:00 +0001 - -libcitadel (7.83-91) stable; urgency=low - - * new release - - -- Wilfried Goesgens Wed, 28 Jul 2010 22:00:00 +0001 - -libcitadel (7.80-90) stable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 19 Jul 2010 22:00:00 +0001 - -libcitadel (7.72-90) stable; urgency=low - - * new maintenance release - - -- Wilfried Goesgens Wed, 17 Feb 2010 22:00:00 +0001 - -libcitadel (7.71-89) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 5 Jan 2010 22:00:00 +0001 - -libcitadel (7.70-86) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 16 Dec 2009 22:00:00 +0002 - -libcitadel (7.67-85) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 1 Sep 2009 8:00:00 +0002 - -libcitadel (7.66-84) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Mon, 28 Sep 2009 18:00:00 +0001 - -libcitadel (7.63-83) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 1 Sep 2009 8:00:00 +0002 - -libcitadel (7.61-82) unstable; urgency=low - - * tiny bugfix - - -- Wilfried Goesgens Mon, 17 Aug 2009 23:00:00 +0002 - -libcitadel (7.61-81) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 6 Aug 2009 10:00:00 +0002 - -libcitadel (7.60-80) unstable; urgency=low - - * new release - - -- Wilfried Goesgens Tue, 28 Jul 2009 00:00:00 +0002 - -libcitadel (7.50-73) unstable; urgency=low - - * release - - -- Wilfried Goesgens Tue, 17 Mar 2009 00:00:00 +0002 - -libcitadel (7.43-72) unstable; urgency=low - - * Beta release - - -- Wilfried Goesgens Tue, 17 Mar 2009 00:00:00 +0002 - -libcitadel (7.42-71) unstable; urgency=low - - * Beta release - - -- Wilfried Goesgens Wed, 25 Feb 2009 00:00:00 +0002 - -libcitadel (7.41-70) unstable; urgency=low - - * Beta release - - -- Wilfried Goesgens Fri, 20 Feb 2009 18:00:00 +0002 - -libcitadel (7.38-8) stable; urgency=low - - * new upstream version - - -- Wilfried Goesgens Thu, 1 Aug 2008 22:00:00 +0002 - -libcitadel (7.37-7) stable; urgency=low - - * new upstream version - - -- Wilfried Goesgens Thu, 19 Jun 2008 22:00:00 +0002 - -libcitadel (1.14-6) stable; urgency=low - - * new upstream version - - -- Wilfried Goesgens Fri, 30 May 2008 19:00:00 +0002 - -libcitadel (1.09-5) stable; urgency=low - - * new upstream version - - -- Wilfried Goesgens Tue, 22 Apr 2008 19:00:00 +0002 - -libcitadel (1.08-5) stable; urgency=low - - * minor upstream bugfixes - - -- Wilfried Goesgens Mon, 17 Mar 2008 22:00:00 +0001 - -libcitadel (1.08-4) stable; urgency=high - - * release 1.08; hashing / sorting implemented - - -- Wilfried Goesgens Mo, 3 Mar 2008 22:00:00 +0001 -libcitadel (1.07-8) stable; urgency=high - - * new upstream version - - -- Wilfried Goesgens Sat, 23 Feb 2008 0:00:00 +0001 - -libcitadel (1.06-7) stable; urgency=high - - * mime to icon guessing - * fixed hash lookups - - -- Wilfried Goesgens Sat, 23 Feb 2008 0:00:00 +0001 -libcitadel (1.05-4) stable; urgency=high - - * include xdgmime - - -- Wilfried Goesgens Tue, 12 Feb 2008 0:00:00 +0001 -libcitadel (1.03-3) unstable; urgency=low - - * initial debian release - - -- Wilfried Goesgens Sun, 18 Nov 2007 23:55:21 +0100 diff --git a/libcitadel/debian/control b/libcitadel/debian/control deleted file mode 100644 index 61573bc8e..000000000 --- a/libcitadel/debian/control +++ /dev/null @@ -1,33 +0,0 @@ -Source: libcitadel -Section: libs -Priority: extra -Maintainer: Citadel Team -Uploaders: Wilfried Goesgens , Alexander Wirt -Build-Depends: debhelper (>= 5), zlib1g-dev -Standards-Version: 3.8.0 -Homepage: http://citadel.org - -Package: libcitadel4 -Architecture: any -Depends: ${shlibs:Depends}, shared-mime-info -Description: Citadel toolbox - This library contains the commonly used routines for the citadel suite. - -Package: libcitadel4-dbg -Section: libdevel -Architecture: any -Depends: ${shlibs:Depends}, libcitadel4 -Description: Debugging symbols for libcitadel4 - This library contains the commonly used routines for the citadel suite. - . - This package provides the debugging symbols. - -Package: libcitadel-dev -Section: libdevel -Architecture: any -Depends: ${shlibs:Depends}, pkg-config, - libcitadel4 (= ${binary:Version}) -Description: Development files for libcitadel4 - This library contains the commonly used routines for the citadel suite. - . - This package provides development files and static libraries. diff --git a/libcitadel/debian/libcitadel-dbg.install b/libcitadel/debian/libcitadel-dbg.install deleted file mode 100644 index 7276ecdef..000000000 --- a/libcitadel/debian/libcitadel-dbg.install +++ /dev/null @@ -1 +0,0 @@ -usr/share/doc diff --git a/libcitadel/debian/libcitadel-dev.dirs b/libcitadel/debian/libcitadel-dev.dirs deleted file mode 100644 index 7276ecdef..000000000 --- a/libcitadel/debian/libcitadel-dev.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/share/doc diff --git a/libcitadel/debian/libcitadel-dev.install b/libcitadel/debian/libcitadel-dev.install deleted file mode 100644 index 062126586..000000000 --- a/libcitadel/debian/libcitadel-dev.install +++ /dev/null @@ -1,3 +0,0 @@ -usr/lib/pkgconfig -usr/lib/*.{so,a} -usr/include diff --git a/libcitadel/debian/libcitadel4.install b/libcitadel/debian/libcitadel4.install deleted file mode 100644 index 093956b17..000000000 --- a/libcitadel/debian/libcitadel4.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/*.so.* diff --git a/libcitadel/debian/rules b/libcitadel/debian/rules deleted file mode 100755 index 11d290b9c..000000000 --- a/libcitadel/debian/rules +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/make -f -# -*- mode: makefile; coding: utf-8 -*- - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -export DH_COMPAT = 5 - -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -CFLAGS = -Wall -g -Wformat -Werror=format-security -#-finline-functions -LDFALGS = -# -finline-functions -ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND - EXTRA_ARGS = --with-backtrace -else -# CFLAGS += -O2 -fPIC - CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND -endif - -ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS))) - CFLAGS += -pg - LDFLAGS += -pg -endif - -ifneq (,$(findstring sprofiling,$(DEB_BUILD_OPTIONS))) - CFLAGS += -D SIZE_DEBUG -endif - -ifneq (,$(findstring gcov,$(DEB_BUILD_OPTIONS))) - CFLAGS += -fprofile-arcs -ftest-coverage - LDFLAGS += -fprofile-arcs -ftest-coverage -endif - - -build: build-stamp -build-stamp: - dh_testdir - - export CFLAGS="$(CFLAGS)"; export LDFLAGS="$(LDFLAGS)"; ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ - $(EXTRA_ARGS) \ - --prefix=/usr - -# Build libcitadel - $(MAKE) - - touch build-stamp - -clean: - dh_testdir - dh_testroot - rm -f build-stamp install*-stamp - - [ ! -f Makefile ] || $(MAKE) distclean - - dh_clean - -install: install-stamp -install-stamp: build-stamp - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - $(MAKE) DESTDIR=`pwd`/debian/tmp install - - touch install-stamp - -# Build architecture-independent files here. -binary-indep: build install -# dh_testdir -i - dh_testroot -i -# dh_installdocs -i -A README -# dh_installchangelogs -i debian/no-upstream-changelog -# dh_install -i --sourcedir=debian/tmp -# dh_link -i -# dh_strip -i -# dh_compress -i -# dh_fixperms -i -# dh_installdeb -i -# dh_shlibdeps -i -# dh_gencontrol -i -# dh_md5sums -i -# dh_builddeb -i - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -a - dh_testroot -a - dh_installchangelogs -a -plibcitadel4 - dh_installdocs -a - dh_install -a --sourcedir=debian/tmp - dh_link -a - dh_strip -a --dbg-package=libcitadel4-dbg - dh_compress -a - dh_fixperms -a - dh_makeshlibs -a -V - dh_installdeb -a - dh_shlibdeps -a - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a - -source diff: - @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install diff --git a/libcitadel/hash_todo.txt b/libcitadel/hash_todo.txt deleted file mode 100644 index f1f0004e6..000000000 --- a/libcitadel/hash_todo.txt +++ /dev/null @@ -1,55 +0,0 @@ -This file is for notes on converting things to use the hash functions Dothebart added. - - -Convert the server config to use these functions. -Alter citserver to read key value pairs for the config instead of an ordered file. -Alter citserver to store the config in the data base. -Add code to serv_upgrade to convert the current file into a normal message in the DB. -serv_upgrade will read the file create at setup time on first boot to get it into -the DB this way the existing setup tools don't need to be altered. - -Webcit can then ask for the site wide config using normal MSG* commands. -Webcit will need to parse the message into key value pairs which is dead simple to do. - -Hmm, just a thought but has anyone wondered about locking things like this so two Admins can't -change them at the same time which would result in some changes getting lost. - - - -We can use this code for any key value pair situation since the has should be faster than sequential search. -Possible candidates are. - - -get_user and friends. -Load the user list into the hash at boot. -Write new entries to the DB when the occur. -Use 2 hashes so we can quickly get user by name or number. This might be possible since -the hash value can be any object. user name hash is master and sync'd wuth DB and has real destructor, -user number hash uses exact same user object but dummy destructor that does nothing. That way -destructing a key from the hash has expected results. Destructor could also call purge_user maybe? -Perhaps delay writing changes if the server is busy. -This would save on DB accesses which can be a bottle neck. -Definately would save on DB reads. - - -netconfigs?? - - -mail.aliases -Load into a hash at startup and done with? -Perhaps even bring this into the DB as a MSG update the MSG if the file changes for backward compat. Then -we can make it changeable via client. File gets out of date though. -Read from the DB as needed, cache into the hash? - - -Webcit URL's -Some of these might benefit from a hash. -bstr does a sequential search for the key so a hash would be faster in cases where the URL contains lots of -stuff like site config and probably more. - - -Since the hash can store arbitrary objects we can probably use it to store contexts and threads. -At first this seems as though it won't do much for performance but done right I think we will be -able to do away with the locking of the entire list and reduce the granularity to locking only the context/thread struct -we are currently working on. -Perhaps a modified hash that locks the retrieved entry and unlocks the entry by a call to unlock key. diff --git a/webcit/buildpackages b/webcit/buildpackages deleted file mode 100755 index 511ab7925..000000000 --- a/webcit/buildpackages +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -if test -x Makefile; then - make clean -fi -./bootstrap -export `grep PACKAGE_VERSION= configure |sed -e "s;';;g" -e "s;PACKAGE;WEBCIT;"` - -PACKAGE_VERSION=`cat packageversion` -DATE=`date '+%a, %d %b %Y %H:%I:00 %z'` -ACTUAL_DIR=`pwd` - - -rm -rf debian/citadel-webcit debian/tmp/ -if echo "$ACTUAL_DIR" |grep -q "$WEBCIT_VERSION"; then - echo "directory ($ACTUAL_DIR) naming scheme seems right. nothing done." -else - done=false - if test -L "$ACTUAL_DIR"; then - SYMLINK_=`pwd` - SYMLINK=`ls -l $SYMLINK_|sed "s;.*-> ;;"` - if ls -l $SYMLINK_|grep -q "$WEBCIT_VERSION"; then - done=true - fi - else - SYMLINK=`pwd|sed "s;.*/;;"` - fi - if test "$done" = "false"; then - cd .. - ln -sf webcit "webcit-$WEBCIT_VERSION" - cd "webcit-$WEBCIT_VERSION" - else - cd "../webcit-$WEBCIT_VERSION" - fi - -fi - -case $1 in - debian) - if grep -q "($WEBCIT_VERSION" debian/changelog; then - echo rebuilding package. - else - echo "Upstream Version higher than local." - fi - if test "$2" == "src"; then - cd .. - rm -rf tmp - mkdir tmp - cp -rL webcit-$WEBCIT_VERSION tmp - cd tmp/webcit-$WEBCIT_VERSION - rm -rf `find -name .svn ` svn*tmp* build-stamp configure-stamp *~ config.guess config.log config.status autom4te.cache Makefile - find -type f -exec chmod a-x {} \; - chmod a+x configure debian/rules po/create-pot.sh mk_module_init.sh - cd .. - tar -chzf webcit_${WEBCIT_VERSION}.orig.tar.gz webcit-${WEBCIT_VERSION}/ --exclude "debian/*" - pwd - cd webcit-${WEBCIT_VERSION}; debuild -S -sa -kw.goesgens@outgesourced.org - else - fakeroot dpkg-buildpackage - fi - ;; - sourcedist) - if test "$2" == "dfsg"; then - NONDFSG=-"-exclude static/webcit_icons/openid-small.gif" - fi - cd ..; tar \ - --exclude ".gitignore" \ - --exclude "*.lo" \ - --exclude "*.o" \ - --exclude "*.d" \ - --exclude "autom4te.cache/*" \ - --exclude "debian/*" \ - --exclude "sysdep.h" \ - \ - $NONDFSG \ - \ - -cvhzf webcit-${WEBCIT_VERSION}.tar.gz webcit-${WEBCIT_VERSION}/ - ;; - i18n) - ./webcit -G `pwd`/i18n_templatelist.c - cd po/webcit; ./create-pot.sh - ;; - version) - echo This would build webcit-${WEBCIT_VERSION} - ;; - *) - echo "Not yet implemented. we have: debian, sourcedist, i18n (needs ready compiled & installed webcit in your system)" - ;; -esac -- 2.30.2