Subject: v24i034: Elm mail system, release 2.3, patches, Part10/11 Newsgroups: comp.sources.unix Approved: rsalz@uunet.UU.NET X-Checksum-Snefru: 58dc4f17 c5bd09e2 004fc601 b13f0847 Submitted-by: Syd Weinstein Posting-number: Volume 24, Issue 34 Archive-name: elm2.3patches/part10 Subject: elm 2.3 Patch #10 Summary: This is an official patch for elm 2.3 system. Please apply it. Priority: HIGH This patch fixes the deleted line that causes the Segmentation Violation. Add back missing line in length check From: Syd Revision 4.1.1.1 90/12/19 09:44:06 syd Fix not checking for mail before scanning From: Syd via report from Joern Lubkoll Fix: From rn, say "| patch -p -N -d DIR", where DIR is your elm source directory. Outside of rn, say "cd DIR; patch -p -N + * * Revision 4.1.1.5 90/10/10 12:49:46 syd * Fix calling sequence to copy_message calls for * new MMDF argument *************** *** 120,125 **** --- 124,134 ---- #else struct utimbuf utime_buffer; /* utime command */ #endif + #ifdef VOIDSIG + void (*oldstop)(); + #else + int (*oldstop)(); + #endif register int to_delete = 0, to_store = 0, to_keep = 0, i, marked_deleted, marked_read, marked_unread, last_sortby, ask_questions, asked_storage_q, *************** *** 377,382 **** --- 386,395 ---- /* Everything's GO - so ouput that user message and go to it. */ + #ifdef SIGTSTP + oldstop = signal(SIGTSTP, SIGIGN); + #endif + dprint(2, (debugfile, "Action: %s\n", buffer)); error(buffer); *************** *** 392,397 **** --- 405,413 ---- dprint(1, (debugfile, "** %s - %s **\n", error_name(errno), error_description(errno))); unlock(); + #ifdef SIGTSTP + signal(SIGTSTP, oldstop); + #endif return(0); } if ((temp = fopen(recvd_mail,"a")) == NULL) { *************** *** 432,437 **** --- 448,456 ---- dprint(1, (debugfile, "** %s - %s **\n", error_name(errno), error_description(errno))); unlock(); + #ifdef SIGTSTP + signal(SIGTSTP, oldstop); + #endif return(0); } if ((temp = fopen(temp_keep_file,"w")) == NULL) { *************** *** 468,473 **** --- 487,495 ---- * simply remove the old original folder and that's it! */ (void)unlink(cur_folder); + #ifdef SIGTSTP + signal(SIGTSTP, oldstop); + #endif return(1); } *************** *** 610,615 **** --- 632,640 ---- mailfile_size = bytes(cur_folder); unlock(); /* remove the lock on the file ASAP! */ + #ifdef SIGTSTP + signal(SIGTSTP, oldstop); + #endif return(1); } Index: src/returnadd.c Prereq: 4.1.1.2 *** ../elm2.3/src/returnadd.c Wed Dec 5 23:42:09 1990 --- src/returnadd.c Tue Dec 11 15:36:10 1990 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: returnadd.c,v 4.1.1.2 90/12/05 22:33:58 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.2 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: returnadd.c,v 4.1.1.3 90/12/11 15:35:56 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.3 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust *************** *** 14,19 **** --- 14,23 ---- * ******************************************************************************* * $Log: returnadd.c,v $ + * Revision 4.1.1.3 90/12/11 15:35:56 syd + * Add back missing strlen line, fixes segv problem + * From: Syd + * * Revision 4.1.1.2 90/12/05 22:33:58 syd * Fix missing close brace due to indention error * From: Syd *************** *** 295,300 **** --- 299,305 ---- buf[len_buf] = '\0'; } strncat(buf, buf2, (SLEN-len_buf-1)); + len_buf = strlen(buf); ok = (int) (fgets(buf2, SLEN, mailfile) != NULL); if (ok) { len_buf2 = strlen(buf2); Index: utils/fastmail.c Prereq: 4.1.1.2 *** ../elm2.3/utils/fastmail.c Sun Oct 7 21:55:00 1990 --- utils/fastmail.c Thu Dec 6 10:39:21 1990 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: fastmail.c,v 4.1.1.2 90/10/07 20:56:25 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.2 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: fastmail.c,v 4.1.1.3 90/12/06 10:38:55 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.3 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust *************** *** 14,19 **** --- 14,23 ---- * ******************************************************************************* * $Log: fastmail.c,v $ + * Revision 4.1.1.3 90/12/06 10:38:55 syd + * Fix getlogin returning null causing a core dump + * From: Nigel Metheringham + * * Revision 4.1.1.2 90/10/07 20:56:25 syd * Add ifndef NO_XHEADER to X-Mailer * From: syd via request of Frank Elsner *************** *** 101,106 **** --- 105,111 ---- char filename[SLEN], tempfilename[SLEN], command_buffer[256]; char replyto[SLEN], cc_list[SLEN], bcc_list[SLEN], to_list[SLEN]; char from_addr[SLEN]; + char *tmplogname; int c, sendmail_available, debug = 0; from_string[0] = '\0'; *************** *** 156,162 **** gethostname(hostname, sizeof(hostname)); #endif ! strcpy(username, getlogin()); if (strlen(username) == 0) cuserid(username); --- 161,171 ---- gethostname(hostname, sizeof(hostname)); #endif ! tmplogname = getlogin(); ! if (tmplogname != NULL) ! strcpy(username, tmplogname); ! else ! username[0] = '\0'; if (strlen(username) == 0) cuserid(username); Index: utils/newalias.c Prereq: 4.1.1.2 *** ../elm2.3/utils/newalias.c Wed Aug 15 23:51:42 1990 --- utils/newalias.c Thu Dec 6 10:24:07 1990 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: newalias.c,v 4.1.1.2 90/08/02 21:57:58 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.2 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: newalias.c,v 4.1.1.3 90/12/06 10:23:22 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 4.1.1.3 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990 USENET Community Trust *************** *** 14,19 **** --- 14,23 ---- * ******************************************************************************* * $Log: newalias.c,v $ + * Revision 4.1.1.3 90/12/06 10:23:22 syd + * Prevent newalias from trying to process lines without two = signs + * From: Syd via report from integow!ronald + * * Revision 4.1.1.2 90/08/02 21:57:58 syd * The newly introduced function 'stricmp' has a name conflict with a libc * function under SunOS 4.1. Changed name to istrcmp. *************** *** 234,239 **** --- 238,254 ---- char comment[LONG_STRING], c; int first, last, i = 0, j = 0; + /* check for two = signs */ + for (i = 0, j = 0; buffer[i]; i++) + if (buffer[i] == '=') + j++; + + if (j < 2) { + printf("Error - alias data line is not in proper format:\n'%s'\n", buffer); + error++; + return; + } + remove_all(' ', TAB, buffer); for (i=0; buffer[i] != '=' && i < LONG_STRING; i++) exit 0 # Just in case...