From: Art Cancro Date: Tue, 23 Jan 2018 03:19:51 +0000 (-0500) Subject: scraping the bits away X-Git-Tag: v939~442 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7b9d3ecad044318bdd54b8b80acbf85fc89d25ab scraping the bits away --- diff --git a/citadel/Makefile.in b/citadel/Makefile.in index c71cb9ed7..24bb68f4e 100644 --- a/citadel/Makefile.in +++ b/citadel/Makefile.in @@ -38,7 +38,7 @@ UTIL_TARGETS=citmail$(EXEEXT) sendcommand$(EXEEXT) UTILBIN_TARGETS= base64$(EXEEXT) setup$(EXEEXT) \ chkpw$(EXEEXT) chkpwd$(EXEEXT) \ - aidepost$(EXEEXT) msgform$(EXEEXT) \ + msgform$(EXEEXT) \ ctdlmigrate$(EXEEXT) @@ -70,7 +70,7 @@ LOCALEDIR=@LOCALEDIR@ .SILENT: -SOURCES=utils/aidepost.c utils/citmail.c \ +SOURCES=utils/citmail.c \ utils/setup.c utils/msgform.c utils/chkpw.c \ utils/sendcommand.c \ utils/ctdlmigrate.c utils/base64.c utils/chkpwd.c \ @@ -145,10 +145,6 @@ citserver$(EXEEXT): $(SERV_OBJS) echo "CC $<" $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $< -o $@ -aidepost$(EXEEXT): utils/aidepost.o utillib/citadel_dirs.o - $(CC) utils/aidepost.o utillib/citadel_dirs.o \ - $(LDFLAGS) -o aidepost$(EXEEXT) $(LIBS) - citmail$(EXEEXT): utils/citmail.o utillib/citadel_dirs.o $(CC) utils/citmail.o utillib/citadel_dirs.o \ $(LDFLAGS) -o citmail$(EXEEXT) $(LIBS) diff --git a/citadel/include/citadel_dirs.h b/citadel/include/citadel_dirs.h index 6ce044eed..9cde767d0 100644 --- a/citadel/include/citadel_dirs.h +++ b/citadel/include/citadel_dirs.h @@ -22,7 +22,6 @@ extern char ctdl_autoetc_dir[PATH_MAX]; extern char ctdl_run_dir[PATH_MAX]; extern char ctdl_spool_dir[PATH_MAX]; extern char ctdl_netout_dir[PATH_MAX]; -extern char ctdl_netin_dir[PATH_MAX]; extern char ctdl_netdigest_dir[PATH_MAX]; extern char ctdl_nettmp_dir[PATH_MAX]; extern char ctdl_netcfg_dir[PATH_MAX]; diff --git a/citadel/modules/ctdlproto/serv_file.c b/citadel/modules/ctdlproto/serv_file.c index f412b259e..44a5d3613 100644 --- a/citadel/modules/ctdlproto/serv_file.c +++ b/citadel/modules/ctdlproto/serv_file.c @@ -1,7 +1,7 @@ /* * Server functions which handle file transfers and room directories. * - * Copyright (c) 1987-2017 by the citadel.org team + * Copyright (c) 1987-2018 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. @@ -407,28 +407,6 @@ void cmd_ucls(char *cmd) fclose(CC->upload_fp); CCC->upload_fp = NULL; - if ((!strcasecmp(cmd, "1")) && (CCC->upload_type != UPL_FILE)) { - cprintf("%d Upload completed.\n", CIT_OK); - - if (CCC->upload_type == UPL_NET) { - char final_filename[PATH_MAX]; - snprintf(final_filename, sizeof final_filename, "%s/%s.%04lx.%04x", ctdl_netin_dir, CCC->net_node, (long)getpid(), ++seq); - - if (link(CCC->upl_path, final_filename) == 0) { - syslog(LOG_INFO, "serv_file: ucls updoaded %s", final_filename); - unlink(CCC->upl_path); - } - else { - syslog(LOG_INFO, "serv_file: cannot link %s to %s: %s", - CCC->upl_path, final_filename, strerror(errno) - ); - } - } - - CCC->upload_type = UPL_FILE; - return; - } - if (!strcasecmp(cmd, "1")) { cprintf("%d File '%s' saved.\n", CIT_OK, CCC->upl_path); fp = fopen(CCC->upl_filedir, "a"); diff --git a/citadel/modules/network/serv_netspool.c b/citadel/modules/network/serv_netspool.c index 036618123..7ec783c96 100644 --- a/citadel/modules/network/serv_netspool.c +++ b/citadel/modules/network/serv_netspool.c @@ -769,10 +769,6 @@ void create_spool_dirs(void) { 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_netin_dir, 0700) != 0) && (errno != EEXIST)) - syslog(LOG_EMERG, "netspool: unable to create directory [%s]: %s", ctdl_netin_dir, strerror(errno)); - if (chown(ctdl_netin_dir, CTDLUID, (-1)) != 0) - syslog(LOG_EMERG, "netspool: unable to set the access rights for [%s]: %s", ctdl_netin_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) diff --git a/citadel/modules/network/serv_network.c b/citadel/modules/network/serv_network.c index eb7941d00..0b77b359d 100644 --- a/citadel/modules/network/serv_network.c +++ b/citadel/modules/network/serv_network.c @@ -438,78 +438,6 @@ void network_cleanup_function(void) } -int ignet_aftersave(struct CtdlMessage *msg, recptypes *recps) -{ - /* For IGnet mail, we have to save a new copy into the spooler for - * each recipient, with the R and D fields set to the recipient and - * destination-node. This has two ugly side effects: all other - * recipients end up being unlisted in this recipient's copy of the - * message, and it has to deliver multiple messages to the same - * node. We'll revisit this again in a year or so when everyone has - * a network spool receiver that can handle the new style messages. - */ - if ((recps != NULL) && (recps->num_ignet > 0)) - { - char *recipient; - int rv = 0; - struct ser_ret smr; - FILE *network_fp = NULL; - char submit_filename[128]; - static int seqnum = 1; - int i; - char *hold_R, *hold_D, *RBuf, *DBuf; - long hrlen, hdlen, rblen, dblen, count, rlen; - CitContext *CCC = MyContext(); - - CM_GetAsField(msg, eRecipient, &hold_R, &hrlen);; - CM_GetAsField(msg, eDestination, &hold_D, &hdlen);; - - count = num_tokens(recps->recp_ignet, '|'); - rlen = strlen(recps->recp_ignet); - recipient = malloc(rlen + 1); - RBuf = malloc(rlen + 1); - DBuf = malloc(rlen + 1); - for (i=0; irecp_ignet, i, '|', rlen + 1); - - rblen = extract_token(RBuf, recipient, 0, '@', rlen + 1); - dblen = extract_token(DBuf, recipient, 1, '@', rlen + 1); - - CM_SetAsField(msg, eRecipient, &RBuf, rblen);; - CM_SetAsField(msg, eDestination, &DBuf, dblen);; - CtdlSerializeMessage(&smr, msg); - if (smr.len > 0) { - snprintf(submit_filename, sizeof submit_filename, - "%s/netmail.%04lx.%04x.%04x", - ctdl_netin_dir, - (long) getpid(), - CCC->cs_pid, - ++seqnum); - - network_fp = fopen(submit_filename, "wb+"); - if (network_fp != NULL) { - rv = fwrite(smr.ser, smr.len, 1, network_fp); - if (rv == -1) { - syslog(LOG_EMERG, "network: CtdlSubmitMsg() Couldn't write network spool file: %s", strerror(errno)); - } - fclose(network_fp); - } - free(smr.ser); - } - CM_GetAsField(msg, eRecipient, &RBuf, &rblen);; - CM_GetAsField(msg, eDestination, &DBuf, &dblen);; - } - free(RBuf); - free(DBuf); - free(recipient); - CM_SetAsField(msg, eRecipient, &hold_R, hrlen); - CM_SetAsField(msg, eDestination, &hold_D, hdlen); - return 1; - } - return 0; -} - - /* * Module entry point */ @@ -519,7 +447,6 @@ CTDL_MODULE_INIT(network) { if (!threading) { - CtdlRegisterMessageHook(ignet_aftersave, EVT_AFTERSAVE); CtdlFillSystemContext(&networker_spool_CC, "CitNetSpool"); CtdlRegisterSessionHook(network_cleanup_function, EVT_STOP, PRIO_STOP + 30); CtdlRegisterSessionHook(network_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 10); diff --git a/citadel/utillib/citadel_dirs.c b/citadel/utillib/citadel_dirs.c index 2d5dd7b2e..dca1e3d61 100644 --- a/citadel/utillib/citadel_dirs.c +++ b/citadel/utillib/citadel_dirs.c @@ -1,7 +1,7 @@ /* * citadel_dirs.c : calculate pathnames for various files used in the Citadel system * - * Copyright (c) 1987-2017 by the citadel.org team + * Copyright (c) 1987-2018 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. @@ -42,7 +42,6 @@ char ctdl_autoetc_dir[PATH_MAX]=""; char ctdl_run_dir[PATH_MAX]=""; char ctdl_spool_dir[PATH_MAX]="network"; char ctdl_netout_dir[PATH_MAX]="network/spoolout"; -char ctdl_netin_dir[PATH_MAX]="network/spoolin"; char ctdl_netdigest_dir[PATH_MAX]="network/digest"; char ctdl_nettmp_dir[PATH_MAX]="network/spooltmp"; char ctdl_netcfg_dir[PATH_MAX]="netconfigs"; @@ -176,13 +175,11 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, #endif COMPUTE_DIRECTORY(ctdl_spool_dir); COMPUTE_DIRECTORY(ctdl_netout_dir); - COMPUTE_DIRECTORY(ctdl_netin_dir); COMPUTE_DIRECTORY(ctdl_netdigest_dir); COMPUTE_DIRECTORY(ctdl_nettmp_dir); StripSlashes(ctdl_spool_dir, 1); StripSlashes(ctdl_netout_dir, 1); - StripSlashes(ctdl_netin_dir, 1); StripSlashes(ctdl_netdigest_dir, 1); StripSlashes(ctdl_nettmp_dir, 1); @@ -296,7 +293,6 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, DBG_PRINT(ctdl_run_dir); DBG_PRINT(ctdl_spool_dir); DBG_PRINT(ctdl_netout_dir); - DBG_PRINT(ctdl_netin_dir); DBG_PRINT(ctdl_netdigest_dir); DBG_PRINT(ctdl_nettmp_dir); DBG_PRINT(ctdl_netcfg_dir); @@ -406,7 +402,6 @@ int create_run_directories(long UID, long GID) 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_netout_dir , S_IRUSR|S_IWUSR|S_IXUSR, UID, -1); - rv += create_dir(ctdl_netin_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); diff --git a/citadel/utils/aidepost.c b/citadel/utils/aidepost.c deleted file mode 100644 index 43203a294..000000000 --- a/citadel/utils/aidepost.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * This is just a little hack to copy standard input to a message in Aide> - * - * Copyright (c) 1987-2012 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 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 -#include -#include -#include -#include -#include -#include -#include "citadel.h" -#include "citadel_dirs.h" - -/* - * Simplified function to generate a message in our format - */ -static void ap_make_message(FILE *fp, char *target_room, char *author, char *subject) -{ - int a; - long bb, cc; - time_t now; - time(&now); - putc(255, fp); - putc(MES_NORMAL, fp); - putc(1, fp); - fprintf(fp, "Proom_aide"); - putc(0, fp); - fprintf(fp, "T%ld", (long)now); - putc(0, fp); - fprintf(fp, "A%s", author); - putc(0, fp); - fprintf(fp, "O%s", target_room); - putc(0, fp); - if (strlen(subject) > 0) { - fprintf(fp, "U%s%c", subject, 0); - } - putc('M', fp); - bb = ftell(fp); - while (a = getc(stdin), a > 0) { - if (a != 8) - putc(a, fp); - else { - cc = ftell(fp); - if (cc != bb) - fseek(fp, (-1L), 1); - } - } - putc(0, fp); - putc(0, fp); - putc(0, fp); -} - - -int main(int argc, char **argv) -{ - char tempspool[64]; - char target_room[ROOMNAMELEN]; - char author[64]; - char subject[256]; - FILE *tempfp, *spoolfp; - int ch; - int i; - int relh=0; - int home=0; - char relhome[PATH_MAX]=""; - char ctdldir[PATH_MAX]=CTDLDIR; - - calc_dirs_n_files(relh, home, relhome, ctdldir, 0); - - strcpy(target_room, "Aide"); - strcpy(author, "Citadel"); - strcpy(subject, ""); - for (i=1; i= 0)) { - putc(ch, spoolfp); - } - - fclose(tempfp); - return(fclose(spoolfp)); -}