Subject: BETA TEST 2 of elm 2.4 Patch #23d Summary: This is an official patch for elm 2.4 system. Please apply it. Priority: HIGH THIS IS PART 4 OF A 4 PART PATCH THIS PATCH IS IN BETA TEST. IT IS SUBJECT TO CHANGE. SAVE YOUR ORIGINAL COPY OF ELM SOURCES SO YOU CAN BACK THIS OUT BEFORE APPLYING THE OFFICIAL PATCH 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 header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.31 1993/07/20 01:47:47 syd + * Fix time() declaration + * From: Syd via prompt from Dan Mosedale + * * Revision 5.30 1993/06/06 17:53:06 syd * Remove extranious clear * From: Chip *************** *** 189,201 **** #include "headers.h" #include "s_elm.h" #include - #include - #ifdef BSD - #undef tolower - #undef toupper - #endif - extern int errno; extern char version_buff[]; --- 215,221 ---- *************** *** 331,337 **** return(need_redraw); } ! chown (filename, userid, groupid); /* copy the message from standard input */ if (batch_only) { --- 351,358 ---- return(need_redraw); } ! chown (filename, -1, groupid); ! chown (filename, userid, -1); /* copy the message from standard input */ if (batch_only) { *************** *** 612,618 **** mailer, mailerflags, expanded_to, whole_msg_file, remove_cmd, whole_msg_file); } ! fclose(reply); if(batch_only) { --- 633,641 ---- mailer, mailerflags, expanded_to, whole_msg_file, remove_cmd, whole_msg_file); } ! ! free(whole_msg_file); ! fclose(reply); if(batch_only) { *************** *** 955,961 **** **/ char opentype[3]; ! long time(), thetime; char *ctime(); static FILE *filedesc; /* our friendly file descriptor */ char to_buf[VERY_LONG_STRING]; --- 978,984 ---- **/ char opentype[3]; ! time_t time(), thetime; char *ctime(); static FILE *filedesc; /* our friendly file descriptor */ char to_buf[VERY_LONG_STRING]; Index: src/mime.c Prereq: 5.10 *** ../elm2.4/src/mime.c Thu May 13 23:56:20 1993 --- src/mime.c Sun Aug 22 22:55:06 1993 *************** *** 1,5 **** /******************************************************************************* ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- + + static char rcsid[] = "@(#)$Id: mime.c,v 5.15 1993/08/23 02:55:05 syd Exp $"; + /******************************************************************************* ! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 11,16 **** --- 14,66 ---- * ****************************************************************************** * $Log: mime.c,v $ + * Revision 5.15 1993/08/23 02:55:05 syd + * Add missing parens + * From: dwolfe@pffft.sps.mot.com (Dave Wolfe) + * + * Revision 5.14 1993/08/10 18:53:31 syd + * I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and + * some reads of unitialized memory. + * From: vogt@isa.de + * + * Revision 5.13 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.12 1993/07/20 02:41:24 syd + * Three changes to expand_env() in src/read_rc.c: make it non-destructive, + * have it return an error code instead of bailing out, and add a buffer + * size argument to avoid overwritting the destination. The first is to + * avoid all of the gymnastics Elm needed to go through (and occasionally + * forgot to go through) to protect the value handed to expand_env(). + * The second is because expand_env() was originally written to support + * "elmrc" and bailing out was a reasonable thing to do there -- but not + * in the other places where it has since been used. The third is just + * a matter of practicing safe source code. + * + * This patch changes all invocations to expand_env() to eliminate making + * temporary copies (now that the routine is non-destructive) and to pass + * in a destination length. Since expand_env() no longer bails out on + * error, a do_expand_env() routine was added to src/read_rc.c handle + * this. Moreover, the error message now gives some indication of what + * the problem is rather than just saying "can't expand". + * + * Gratitous change to src/editmsg.c renaming filename variables to + * clarify the purpose. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.11 1993/06/10 03:12:10 syd + * Add missing rcs id lines + * From: Syd + * * Revision 5.10 1993/05/14 03:56:19 syd * A MIME body-part must end with a newline even when there was no newline * at the end of the actual body or the body is null. Otherwise the next *************** *** 73,79 **** #ifdef MIME #include - #include #include int check_for_multipart(filedesc) --- 123,128 ---- *************** *** 148,154 **** sleep(sleepmsg); return(-1); } ! expand_env(Expanded_Filename, Include_Filename); if (strlen(Content_Type) == 0) { Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoContentTypeGiven, --- 197,203 ---- sleep(sleepmsg); return(-1); } ! (void) expand_env(Expanded_Filename, Include_Filename, sizeof(Expanded_Filename)); if (strlen(Content_Type) == 0) { Write_to_screen(catgets(elm_msg_cat, ElmSet, ElmNoContentTypeGiven, *************** *** 272,278 **** if (!s) return(1); while (*s && isspace(*s)) ++s; t = buf; ! while (*s && !isspace(*s) && ((t-buf) < SLEN)) *t++ = *s++; EncType = check_encoding(buf); if ((EncType == ENCODING_NONE) || (EncType == ENCODING_7BIT) || --- 321,328 ---- if (!s) return(1); while (*s && isspace(*s)) ++s; t = buf; ! while (*s && !isspace(*s) && ((t-buf) < (SLEN-1))) *t++ = *s++; ! *t = '\0'; EncType = check_encoding(buf); if ((EncType == ENCODING_NONE) || (EncType == ENCODING_7BIT) || Index: src/newmbox.c Prereq: 5.26 *** ../elm2.4/src/newmbox.c Thu May 13 23:55:14 1993 --- src/newmbox.c Sun Aug 22 23:26:54 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: newmbox.c,v 5.26 1993/05/14 03:55:13 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.26 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: newmbox.c,v 5.30 1993/08/23 03:26:24 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.30 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,44 ---- * ******************************************************************************* * $Log: newmbox.c,v $ + * Revision 5.30 1993/08/23 03:26:24 syd + * Try setting group id separate from user id in chown to + * allow restricted systems to change group id of file + * From: Syd + * + * Revision 5.29 1993/08/23 02:46:51 syd + * Test ANSI_C, not __STDC__ (which is not set on e.g. AIX). + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg) + * + * Revision 5.28 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.27 1993/07/20 15:32:36 syd + * no dprint should be at level 0 + * From: Syd + * * Revision 5.26 1993/05/14 03:55:13 syd * The recent feature addition for the "readmsginc" variable did not modify * the output statement that is used when MMDF is defined. The following *************** *** 144,157 **** /** read new folder **/ - #include #include "headers.h" #include "s_elm.h" - #ifdef BSD - #undef tolower /* we have our own "tolower" routine instead! */ - #endif - #include #include --- 169,177 ---- *************** *** 166,172 **** char *error_description(); long bytes(); ! #ifndef __STDC__ /* avoid problemswith systems that declare atol as a macro */ extern void rewind(); extern long atol(); #endif --- 186,192 ---- char *error_description(); long bytes(); ! #ifndef ANSI_C /* avoid problems with systems that declare atol as a macro */ extern void rewind(); extern long atol(); #endif *************** *** 406,412 **** rm_temps_exit(); } copyit++; ! chown(cur_tempfolder, userid, groupid); chmod(cur_tempfolder, 0700); /* shut off file for other people! */ } else { --- 426,433 ---- rm_temps_exit(); } copyit++; ! chown(cur_tempfolder, -1, groupid); ! chown(cur_tempfolder, userid, -1); chmod(cur_tempfolder, 0700); /* shut off file for other people! */ } else { *************** *** 975,981 **** Raw(OFF); printf(catgets(elm_msg_cat, ElmSet, ElmLengthNESpool, "\nnewmbox - length of mbox. != spool mailbox length!!\n")); ! dprint(0, (debugfile, "newmbox - mbox. != spool mail length")); rm_temps_exit(); } if ((mailfile = fopen(cur_tempfolder,"r")) == NULL) { --- 996,1002 ---- Raw(OFF); printf(catgets(elm_msg_cat, ElmSet, ElmLengthNESpool, "\nnewmbox - length of mbox. != spool mailbox length!!\n")); ! dprint(1, (debugfile, "newmbox - mbox. != spool mail length")); rm_temps_exit(); } if ((mailfile = fopen(cur_tempfolder,"r")) == NULL) { Index: src/options.c Prereq: 5.12 *** ../elm2.4/src/options.c Sat May 8 16:25:47 1993 --- src/options.c Tue Aug 3 15:29:15 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: options.c,v 5.12 1993/05/08 20:25:33 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $ * * Copyright (c) 1986,1987 Dave Taylor * Copyright (c) 1988-1992 USENET Community Trust --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: options.c,v 5.16 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.16 $ $State: Exp $ * * Copyright (c) 1986,1987 Dave Taylor * Copyright (c) 1988-1992 USENET Community Trust *************** *** 14,19 **** --- 14,71 ---- * ******************************************************************************* * $Log: options.c,v $ + * Revision 5.16 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.15 1993/07/20 02:41:24 syd + * Three changes to expand_env() in src/read_rc.c: make it non-destructive, + * have it return an error code instead of bailing out, and add a buffer + * size argument to avoid overwritting the destination. The first is to + * avoid all of the gymnastics Elm needed to go through (and occasionally + * forgot to go through) to protect the value handed to expand_env(). + * The second is because expand_env() was originally written to support + * "elmrc" and bailing out was a reasonable thing to do there -- but not + * in the other places where it has since been used. The third is just + * a matter of practicing safe source code. + * + * This patch changes all invocations to expand_env() to eliminate making + * temporary copies (now that the routine is non-destructive) and to pass + * in a destination length. Since expand_env() no longer bails out on + * error, a do_expand_env() routine was added to src/read_rc.c handle + * this. Moreover, the error message now gives some indication of what + * the problem is rather than just saying "can't expand". + * + * Gratitous change to src/editmsg.c renaming filename variables to + * clarify the purpose. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.14 1993/06/12 05:32:00 syd + * fix calling sequence for new argument + * From: Syd + * + * Revision 5.13 1993/06/10 03:07:39 syd + * This fixes a bug in the MIME code. Include_Part() uses expand_env() + * to expand the include file name, but since expand_env() is destructive + * [it uses strtok()] the file name gets corrupted, and the "Content-Name" + * header can contain a bogus value. The easy fix would be a one-line + * hack to Include_Part to use a temporary buffer. This patch does not + * implement the easy fix. *Every* place expand_env() is used, its side + * effects cause problems. I think the right fix is to make expand_env() + * non-destructive (i.e. have it duplicate the input to a temporary buffer + * and work from there). The attached patch modifies expand_env() in + * that manner, and eliminates all of the `copy to a temporary buffer' + * calls that precede it throughout elm. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.12 1993/05/08 20:25:33 syd * Add sleepmsg to control transient message delays * From: Syd *************** *** 120,129 **** #include "save_opts.h" #include "s_elm.h" - #ifdef BSD - #undef tolower - #endif - #undef onoff #define onoff(n) (n == 1? on_name : off_name) --- 172,177 ---- *************** *** 133,154 **** static char *on_name = NULL; static char *off_name = NULL; static int resort = 0; ! static char temp[SLEN]; /* needed when an option is run through ! * expand_env(), because that function ! * is destructive of the original ! */ ! ! static post_cal(f) int f; {strcpy(temp,raw_calendar_file); expand_env(calendar_file,temp);} ! static post_editor(f) int f; {strcpy(temp,raw_editor); expand_env(editor,temp);} ! static post_pager(f) int f; { ! strcpy(temp, raw_pager); expand_env(pager, temp); ! clear_pages=(equal(pager,"builtin+")||equal(pager,"internal+")); ! } ! static post_folder(f) int f; {strcpy(temp,raw_folders); expand_env(folders,temp);} ! static post_sort(f) int f; {if (f) resort++;} ! static post_sent(f) int f; {strcpy(temp,raw_sentmail); expand_env(sent_mail,temp);} ! static post_print(f) int f; {strcpy(temp,raw_printout); expand_env(printout,temp);} ! static post_menu(f) int f; {headers_per_page=LINES-(mini_menu?13:8);} opts_menu cfg_opts[] = { --- 181,237 ---- static char *on_name = NULL; static char *off_name = NULL; static int resort = 0; ! ! ! static post_cal(f) ! int f; ! { ! (void) expand_env(calendar_file, raw_calendar_file, sizeof(calendar_file)); ! } ! ! static post_editor(f) ! int f; ! { ! (void) expand_env(editor, raw_editor, sizeof(editor)); ! } ! ! static post_pager(f) ! int f; ! { ! (void) expand_env(pager, raw_pager, sizeof(pager)); ! clear_pages = (equal(pager, "builtin+") || equal(pager, "internal+")); ! } ! ! static post_folder(f) ! int f; ! { ! (void) expand_env(folders, raw_folders, sizeof(folders)); ! } ! ! static post_sort(f) ! int f; ! { ! if (f) ! resort++; ! } ! ! static post_sent(f) ! int f; ! { ! (void) expand_env(sent_mail, raw_sentmail, sizeof(sent_mail)); ! } ! ! static post_print(f) ! int f; ! { ! (void) expand_env(printout, raw_printout, sizeof(printout)); ! } ! ! static post_menu(f) ! int f; ! { ! headers_per_page = LINES - (mini_menu ? 13 : 8); ! } opts_menu cfg_opts[] = { *************** *** 689,695 **** if (sleepmsg > 0) sleep((sleepmsg + 1) / 2); main_state(); ! sort_aliases(message_count, FALSE); main_state(); } ClearLine(LINES-2); /* clear alias_sort_one_liner()! */ --- 772,778 ---- if (sleepmsg > 0) sleep((sleepmsg + 1) / 2); main_state(); ! sort_aliases(message_count, FALSE, FALSE); main_state(); } ClearLine(LINES-2); /* clear alias_sort_one_liner()! */ Index: src/read_rc.c Prereq: 5.16 *** ../elm2.4/src/read_rc.c Sun May 16 16:59:20 1993 --- src/read_rc.c Sun Aug 22 22:58:06 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: read_rc.c,v 5.16 1993/05/16 20:59:14 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.16 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: read_rc.c,v 5.25 1993/08/23 02:58:04 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.25 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,100 ---- * ******************************************************************************* * $Log: read_rc.c,v $ + * Revision 5.25 1993/08/23 02:58:04 syd + * Call to expand_env for pager should be call to do_expand_env. + * temp_dir not initialized. + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.24 1993/08/10 18:49:32 syd + * When an environment variable was given as the tmpdir definition the src + * and dest overlapped in expand_env. This made elm produce a garbage + * expansion because expand_env cannot cope with overlapping src and + * dest. I added a new variable raw_temp_dir to keep src and dest not to + * overlap. + * From: Jukka Ukkonen + * + * Revision 5.23 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.22 1993/08/03 18:57:21 syd + * default_weedlist() can't use pmalloc, because weedout() calls free when + * it encounters *clear-weed-list*. + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.21 1993/08/03 18:55:42 syd + * Spaces in weedout strings wasn't preserved ("From " became "From"). + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.20 1993/07/20 02:41:24 syd + * Three changes to expand_env() in src/read_rc.c: make it non-destructive, + * have it return an error code instead of bailing out, and add a buffer + * size argument to avoid overwritting the destination. The first is to + * avoid all of the gymnastics Elm needed to go through (and occasionally + * forgot to go through) to protect the value handed to expand_env(). + * The second is because expand_env() was originally written to support + * "elmrc" and bailing out was a reasonable thing to do there -- but not + * in the other places where it has since been used. The third is just + * a matter of practicing safe source code. + * + * This patch changes all invocations to expand_env() to eliminate making + * temporary copies (now that the routine is non-destructive) and to pass + * in a destination length. Since expand_env() no longer bails out on + * error, a do_expand_env() routine was added to src/read_rc.c handle + * this. Moreover, the error message now gives some indication of what + * the problem is rather than just saying "can't expand". + * + * Gratitous change to src/editmsg.c renaming filename variables to + * clarify the purpose. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.19 1993/06/10 03:08:38 syd + * I have been repetedly crashing elm 2.4.22 until I discovered that a + * test for failing to open the system elmrc file is mising. This could + * usefully be added in read_rc.c. Version info and patch follows: + * From: "C.R. Ritson" + * + * Revision 5.18 1993/06/10 03:07:39 syd + * This fixes a bug in the MIME code. Include_Part() uses expand_env() + * to expand the include file name, but since expand_env() is destructive + * [it uses strtok()] the file name gets corrupted, and the "Content-Name" + * header can contain a bogus value. The easy fix would be a one-line + * hack to Include_Part to use a temporary buffer. This patch does not + * implement the easy fix. *Every* place expand_env() is used, its side + * effects cause problems. I think the right fix is to make expand_env() + * non-destructive (i.e. have it duplicate the input to a temporary buffer + * and work from there). The attached patch modifies expand_env() in + * that manner, and eliminates all of the `copy to a temporary buffer' + * calls that precede it throughout elm. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.17 1993/06/10 02:55:34 syd + * Write options to elmrc even if their values are empty strings. + * Rationalize code that reads and writes weedouts and alternates. + * From: chip%fin@myrddin.sybus.com + * * Revision 5.16 1993/05/16 20:59:14 syd * fix not closing file * From: Syd *************** *** 172,187 **** **/ #define SAVE_OPTS - #include #include "headers.h" #include "save_opts.h" #include "s_elm.h" #include - #ifdef BSD - #undef tolower - #endif - extern opts_menu *find_cfg_opts(); extern int errno; --- 253,263 ---- *************** *** 203,208 **** --- 279,299 ---- static int lineno = 0; static int errors = 0; + + static void + do_expand_env(descr, dest, src, destlen) + char *descr, *dest, *src; + unsigned destlen; + { + if (expand_env(dest, src, destlen) != 0) { + printf(catgets(elm_msg_cat, ElmSet, ElmCannotInitErrorExpanding, + "\r\nCannot initialize \"%s\" - error expanding \"%s\".\r\n"), + descr, src); + leave(0); + } + } + + read_rc_file() { /** this routine does all the actual work of reading in the *************** *** 237,270 **** strcpy(raw_shell, ((cp = getenv("SHELL")) == NULL)? default_shell : cp); ! strcpy(temp, raw_shell); ! expand_env(shell, temp); strcpy(raw_pager, ((cp = getenv("PAGER")) == NULL)? default_pager : cp); ! strcpy(temp, raw_pager); ! expand_env(pager, temp); ! ! strcpy(raw_editor, ((cp = getenv("EDITOR")) == NULL)? default_editor:cp); ! strcpy(temp_dir, ((cp = getenv("TMPDIR")) == NULL)? default_temp:cp); if (temp_dir[strlen (temp_dir)-1] != '/') ! strcat(temp_dir, "/"); strcpy(alternative_editor, raw_editor); ! strcpy(temp, raw_editor); ! expand_env(editor, temp); strcpy(raw_printout, default_printout); ! strcpy(temp, raw_printout); ! expand_env(printout, temp); sprintf(raw_folders, "~/%s", default_folders); ! strcpy(temp, raw_folders); ! expand_env(folders, temp); sprintf(raw_calendar_file, "~/%s", dflt_calendar_file); ! strcpy(temp, raw_calendar_file); ! expand_env(calendar_file, temp); strcpy(e_editor, emacs_editor); strcpy(v_editor, default_editor); --- 328,356 ---- strcpy(raw_shell, ((cp = getenv("SHELL")) == NULL)? default_shell : cp); ! do_expand_env("shell", shell, raw_shell, sizeof(shell)); strcpy(raw_pager, ((cp = getenv("PAGER")) == NULL)? default_pager : cp); ! do_expand_env("pager", pager, raw_pager, sizeof(pager)); ! strcpy(raw_temp_dir, (cp = getenv("TMPDIR")) ? cp : default_temp); ! do_expand_env("temp_dir", temp_dir, raw_temp_dir, sizeof(temp_dir)); if (temp_dir[strlen (temp_dir)-1] != '/') ! strcat(temp_dir, "/"); + strcpy(raw_editor, ((cp = getenv("EDITOR")) == NULL)? default_editor:cp); strcpy(alternative_editor, raw_editor); ! do_expand_env("editor", editor, raw_editor, sizeof(editor)); strcpy(raw_printout, default_printout); ! do_expand_env("printout", printout, raw_printout, sizeof(printout)); sprintf(raw_folders, "~/%s", default_folders); ! do_expand_env("folders", folders, raw_folders, sizeof(folders)); sprintf(raw_calendar_file, "~/%s", dflt_calendar_file); ! do_expand_env("calendar_file", calendar_file, raw_calendar_file, ! sizeof(calendar_file)); strcpy(e_editor, emacs_editor); strcpy(v_editor, default_editor); *************** *** 306,312 **** fflush(stdout); ch=getchar(); ! if (isupper(ch)) ch = tolower(ch); if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */ ch = *def_ans_no; --- 392,398 ---- fflush(stdout); ch=getchar(); ! ch = tolower(ch); if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */ ch = *def_ans_no; *************** *** 332,339 **** /* try system-wide rc file */ file = fopen(system_rc_file, "r"); ! do_rc(file, SYSTEM_RC); ! fclose(file); /* Look for the elmrc file */ sprintf(filename, "%s/%s", home, elmrcfile); --- 418,427 ---- /* try system-wide rc file */ file = fopen(system_rc_file, "r"); ! if ( file != NULL ) { ! do_rc(file, SYSTEM_RC); ! fclose(file); ! } /* Look for the elmrc file */ sprintf(filename, "%s/%s", home, elmrcfile); *************** *** 381,416 **** } *t = '\0'; } ! strcpy(buffer, raw_folders); ! expand_env(folders, buffer); ! ! strcpy(buffer, temp_dir); ! expand_env(temp_dir, buffer); ! if (temp_dir[strlen (temp_dir)-1] != '/') ! strcat(temp_dir, "/"); ! strcpy(buffer, raw_shell); ! expand_env(shell, buffer); ! strcpy(buffer, raw_editor); ! expand_env(editor, buffer); ! strcpy(buffer, raw_calendar_file); ! expand_env(calendar_file, buffer); ! strcpy(buffer, raw_printout); ! expand_env(printout, buffer); ! strcpy(buffer, raw_pager); ! expand_env(pager, buffer); if (equal(pager, "builtin+") || equal(pager, "internal+")) clear_pages++; ! strcpy(buffer, raw_local_signature); ! expand_env(local_signature, buffer); ! ! strcpy(buffer, raw_remote_signature); ! expand_env(remote_signature, buffer); if (equal(local_signature, remote_signature) && (equal(shift_lower(local_signature), "on") || --- 469,497 ---- } *t = '\0'; } ! do_expand_env("folders", folders, raw_folders, sizeof(folders)); ! do_expand_env("temp_dir", temp_dir, raw_temp_dir, sizeof(temp_dir)); ! if (temp_dir[strlen (temp_dir)-1] != '/') ! strcat(temp_dir, "/"); ! ! do_expand_env("shell", shell, raw_shell, sizeof(shell)); ! do_expand_env("editor", editor, raw_editor, sizeof(editor)); ! do_expand_env("calendar_file", calendar_file, raw_calendar_file, ! sizeof(calendar_file)); ! do_expand_env("printout", printout, raw_printout, sizeof(printout)); ! do_expand_env("pager", pager, raw_pager, sizeof(pager)); if (equal(pager, "builtin+") || equal(pager, "internal+")) clear_pages++; ! do_expand_env("local_signature", local_signature, ! raw_local_signature, sizeof(local_signature)); ! do_expand_env("remote_signature", remote_signature, ! raw_remote_signature, sizeof(remote_signature)); if (equal(local_signature, remote_signature) && (equal(shift_lower(local_signature), "on") || *************** *** 477,483 **** fflush(stdout); ch=getchar(); ! if (isupper(ch)) ch = tolower(ch); if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */ ch = *def_ans_yes; --- 558,564 ---- fflush(stdout); ch=getchar(); ! ch = tolower(ch); if (ch == '\n' || ch == '\r') /* they took the default by pressing cr */ ch = *def_ans_yes; *************** *** 510,517 **** strcpy(raw_recvdmail, default_recvdmail); } ! strcpy(buffer, raw_recvdmail); ! expand_env(recvd_mail, buffer); if(metachar(recvd_mail[0])) { strcpy(buffer, &recvd_mail[1]); --- 591,598 ---- strcpy(raw_recvdmail, default_recvdmail); } ! do_expand_env("recvd_mail", recvd_mail, raw_recvdmail, ! sizeof(recvd_mail)); if(metachar(recvd_mail[0])) { strcpy(buffer, &recvd_mail[1]); *************** *** 523,530 **** sprintf(sent_mail, default_sentmail); } ! strcpy(buffer, raw_sentmail); ! expand_env(sent_mail, buffer); if(metachar(sent_mail[0])) { strcpy(buffer, &sent_mail[1]); --- 604,610 ---- sprintf(sent_mail, default_sentmail); } ! do_expand_env("sent_mail", sent_mail, raw_sentmail, sizeof(sent_mail)); if(metachar(sent_mail[0])) { strcpy(buffer, &sent_mail[1]); *************** *** 744,783 **** { /** This routine is called with a list of headers to weed out. **/ ! char *strptr, *header; ! register int i, len; strptr = string; ! while ((header = strtok(strptr, "\t ,\"'")) != NULL) { ! if (strlen(header) > 0) { ! if (! istrcmp(header, "*end-of-user-headers*")) break; ! if (! istrcmp(header, "*clear-weed-list*")) { ! weedlist[0] = "*end-of-defaults*"; ! weedcount = 1; ! } ! if (weedcount > MAX_IN_WEEDLIST) { ! printf(catgets(elm_msg_cat, ElmSet, ElmTooManyWeedHeaders, ! "Too many weed headers! Leaving...\n\r")); ! exit(1); ! } ! if ((weedlist[weedcount] = pmalloc(strlen(header) + 1)) == NULL) { ! printf(catgets(elm_msg_cat, ElmSet, ElmTooManyWeedPmalloc, ! "Too many weed headers! Out of memory! Leaving...\n\r")); ! exit(1); ! } ! for (i=0, len = strlen(header); i< len; i++) ! if (header[i] == '_') header[i] = ' '; ! if(!matches_weedlist(header)) { ! strcpy(weedlist[weedcount], header); ! weedcount++; ! } ! /* since this used both for system defaults and user's */ ! if (equal(header, "*end-of-defaults*")) break; } ! strptr = NULL; } } --- 824,872 ---- { /** This routine is called with a list of headers to weed out. **/ ! char *strptr, *header, *p; ! int finished; + finished = FALSE; strptr = string; + while (!finished && (header = strtokq(strptr, "\t ,", TRUE)) != NULL) { + strptr = NULL; ! if (!*header) ! continue; ! ! for (p = header; *p; ++p) { ! if (*p == '_') ! *p = ' '; ! } ! if (! istrcmp(header, "*end-of-user-headers*")) ! break; ! if (! istrcmp(header, "*end-of-defaults*")) ! finished = TRUE; ! ! if (! istrcmp(header, "*clear-weed-list*")) { ! while (weedcount) ! free(weedlist[--weedcount]); ! header = "*end-of-defaults*"; } ! ! if (matches_weedlist(header)) ! continue; ! ! if (weedcount > MAX_IN_WEEDLIST) { ! printf(catgets(elm_msg_cat, ElmSet, ElmTooManyWeedHeaders, ! "Too many weed headers! Leaving...\n\r")); ! exit(1); ! } ! if ((p = malloc(strlen(header) + 1)) == NULL) { ! printf(catgets(elm_msg_cat, ElmSet, ElmTooManyWeedPmalloc, ! "Too many weed headers! Out of memory! Leaving...\n\r")); ! exit(1); ! } ! strcpy(p, header); ! weedlist[weedcount++] = p; } } *************** *** 840,846 **** for (weedcount = 0; default_list[weedcount] != (char *) 0;weedcount++){ if ((weedlist[weedcount] = ! pmalloc(strlen(default_list[weedcount]) + 1)) == NULL) { printf(catgets(elm_msg_cat, ElmSet, ElmNoMemDefaultWeed, "\nNot enough memory for default weedlist. Leaving.\n")); leave(1); --- 929,935 ---- for (weedcount = 0; default_list[weedcount] != (char *) 0;weedcount++){ if ((weedlist[weedcount] = ! malloc(strlen(default_list[weedcount]) + 1)) == NULL) { printf(catgets(elm_msg_cat, ElmSet, ElmNoMemDefaultWeed, "\nNot enough memory for default weedlist. Leaving.\n")); leave(1); *************** *** 883,892 **** for (i=0;buffer[i] != '\0' && ok_rc_char(buffer[i]); i++) if (buffer[i] == '_') word1[i] = '-'; - else if (isupper(buffer[i])) - word1[i] = tolower(buffer[i]); else ! word1[i] = buffer[i]; word1[i++] = '\0'; /* that's the first word! */ --- 972,979 ---- for (i=0;buffer[i] != '\0' && ok_rc_char(buffer[i]); i++) if (buffer[i] == '_') word1[i] = '-'; else ! word1[i] = tolower(buffer[i]); word1[i++] = '\0'; /* that's the first word! */ *************** *** 913,967 **** } ! expand_env(dest, buffer) ! char *dest, *buffer; { ! /** expand possible metacharacters in buffer and then copy ! to dest... ! BEWARE!! Because strtok() is used on buffer, buffer may be changed. ! This routine knows about "~" being the home directory, ! and "$xxx" being an environment variable. ! **/ ! char *word, *string, next_word[SLEN]; ! ! if (buffer[0] == '/') { ! dest[0] = '/'; ! dest[1] = '\0'; ! /* Added for Apollos - handle //node */ ! if (buffer[1] == '/') { ! dest[1] = '/'; ! dest[2] = '\0'; ! } ! } ! else ! dest[0] = '\0'; ! string = (char *) buffer; ! while ((word = strtok(string, "/")) != NULL) { ! if (word[0] == '$') { ! next_word[0] = '\0'; ! if (getenv((char *) (word + 1)) != NULL) ! strcpy(next_word, getenv((char *) (word + 1))); ! if (strlen(next_word) == 0) ! leave(printf(catgets(elm_msg_cat, ElmSet, ElmCantExpandEnvVar, ! "\n\rCan't expand environment variable '%s'.\n\r"), ! word)); ! } ! else if (word[0] == '~' && word[1] == '\0') ! strcpy(next_word, home); ! else ! strcpy(next_word, word); ! sprintf(dest, "%s%s%s", dest, ! (strlen(dest) > 0 && lastch(dest) != '/' ? "/":""), ! next_word); - string = (char *) NULL; } } #define on_off(s) (s == 1? "ON " : "OFF") --- 1000,1098 ---- } ! ! /* ! * expand_env() - Perform environment expansion on a pathname. Also ! * replaces "~" at the front of the path with the user's home directory. ! * Environment expansion occurs at the path component boundaries, e.g. ! * "/foo/$BAR/baz" is subject to expansion but "/foo/zzz$BAR/baz" is not. ! * Returns 0 if expansion successful, -1 if an error occurs (result too ! * long, cannot get home directory, or environment expansion failed). ! */ ! expand_env(dest, src, destlen) ! char *dest; /* pointer to space to hold the result */ ! char *src; /* pointer to string to expand */ ! unsigned destlen; /* size of the destination buffer */ { ! char envname_buf[SLEN], *envname_front, *expval; ! int check_for_env, len, ret; ! --destlen; /* reserve space for trailing '\0' */ ! ret = 0; /* assume success */ ! /* ! * Replace "~" at front with user's home directory. ! */ ! if (src[0] == '~' && (src[1] == '\0' || src[1] == '/')) { ! if (home[0] == '\0') { ! expval = "~"; ! ret = -1; ! } else { ! expval = home; ! } ! if ((len = strlen(expval)) > destlen) ! len = destlen; ! strfcpy(dest, expval, len+1); ! dest += len; ! destlen -= len; ! ++src; ! } ! ! /* ! * Copy through the rest, performing $NAME expansion where appropriate. ! */ ! check_for_env = TRUE; ! while (destlen > 0 && *src != '\0') { ! /* ! * Check for "$NAME" at the start of every path component. ! */ ! if (check_for_env && *src == '$') { ! /* ! * Get the environment parameter name into "envname_buf" ! * and advance "src" to the next path component. ! */ ! envname_front = ++src; ! if ((len = strcspn(src, "/")) == 0) ! len = strlen(src); ! src += len; ! if (len > sizeof(envname_buf)-1) ! len = sizeof(envname_buf)-1; ! strfcpy(envname_buf, envname_front, len+1); ! ! /* ! * Copy over the environment expansion. If the environment ! * parameter is undefined then copy over unchanged and set ! * a fail return status. ! */ ! if ((expval = getenv(envname_buf)) == NULL) { ! *dest++ = '$'; ! --destlen; ! expval = envname_buf; ! ret = -1; ! } ! if ((len = strlen(expval)) > destlen) ! len = destlen; ! strfcpy(dest, expval, len+1); ! dest += len; ! destlen -= len; ! check_for_env = FALSE; ! } else { ! check_for_env = (*src == '/'); ! *dest++ = *src++; ! --destlen; } + + } + + *dest = '\0'; + if (destlen <= 0) + ret = -1; + return ret; } #define on_off(s) (s == 1? "ON " : "OFF") *************** *** 1045,1051 **** register int i, j; for (i=0, j=0; word[i] != '\0'; i++) ! mybuffer[j++] = isupper(word[i]) ? tolower(word[i]) : word[i]; mybuffer[j] = '\0'; return( (strncmp(mybuffer, "on", 2) == 0) || --- 1176,1182 ---- register int i, j; for (i=0, j=0; word[i] != '\0'; i++) ! mybuffer[j++] = tolower(word[i]); mybuffer[j] = '\0'; return( (strncmp(mybuffer, "on", 2) == 0) || Index: src/remail.c Prereq: 5.10 *** ../elm2.4/src/remail.c Tue Apr 20 21:25:47 1993 --- src/remail.c Sun Aug 22 23:26:55 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: remail.c,v 5.10 1993/04/21 01:25:45 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: remail.c,v 5.12 1993/08/23 03:26:24 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,29 ---- * ******************************************************************************* * $Log: remail.c,v $ + * Revision 5.12 1993/08/23 03:26:24 syd + * Try setting group id separate from user id in chown to + * allow restricted systems to change group id of file + * From: Syd + * + * Revision 5.11 1993/08/10 18:53:31 syd + * I compiled elm 2.4.22 with Purify 2 and fixed some memory leaks and + * some reads of unitialized memory. + * From: vogt@isa.de + * * Revision 5.10 1993/04/21 01:25:45 syd * I'm using Elm 2.4.21 under Linux. Linux has no Bourne shell. Each * user installs her favorite shell as /bin/sh. I use Bash 1.12. *************** *** 127,139 **** "Sorry - couldn't open file %s for writing (%s)."), error_description(err)); set_error(buffer); return(1); } /** now let's copy the message into the newly opened buffer... **/ ! chown (filename, userid, groupid); #ifdef MMDF if (strcmp(submitmail, mailer) == 0) --- 137,151 ---- "Sorry - couldn't open file %s for writing (%s)."), error_description(err)); set_error(buffer); + free(filename); return(1); } /** now let's copy the message into the newly opened buffer... **/ ! chown (filename, -1, groupid); ! chown (filename, userid, -1); #ifdef MMDF if (strcmp(submitmail, mailer) == 0) *************** *** 158,163 **** --- 170,176 ---- set_error(catgets(elm_msg_cat, ElmSet, ElmBounceCancelled, "Bounce of message canceled.")); (void) unlink(filename); + free(filename); return(1); } *************** *** 185,190 **** --- 198,205 ---- (void) system_call(buffer, 0); set_error(catgets(elm_msg_cat, ElmSet, ElmMailResent, "Mail resent.")); + free(filename); + return(1); } #ifdef MMDF Index: src/reply.c Prereq: 5.12 *** ../elm2.4/src/reply.c Sun Apr 11 23:02:06 1993 --- src/reply.c Tue Aug 3 15:29:18 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: reply.c,v 5.12 1993/04/12 03:02:05 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: reply.c,v 5.15 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,56 ---- * ******************************************************************************* * $Log: reply.c,v $ + * Revision 5.15 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.14 1993/07/20 02:05:17 syd + * A long-standing bug of handling replies to VMS systems. + * Original "From: " -line is of format: + * From: "NAME \"Real Name\"" + * (PMDF mailer) + * Anyway, parse_arpa_who() strips quotes too cleanly + * resulting data: + * NAME \"Real Name\ + * which, when put into parenthesis, becomes: + * (NAME \"Real Name\) + * which in its turn lacks closing `)' + * Patch of lib/parsarpwho.c fixes that. + * strtokq() started one position too late to search for next double-quote (") char. + * Another one-off (chops off trailing comment character, quote or not..) in src/reply.c + * From: Matti Aarnio + * + * Revision 5.13 1993/06/10 03:02:46 syd + * break_down_tolist() tried to blindly split address lists at "," which + * caused bogus results with addreses that had a comma inside a comment + * or quoted text, such as "user@domain (Last, First)". This patch steps + * through the address in quanta of RFC-822 tokens when searching for a + * delimiting comma. It also adds "rfc822_toklen()" to the library to + * get that length. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.12 1993/04/12 03:02:05 syd * If a To: or Cc: line is split in a comment, that is between ( and ), * get_and_expand_everyone won't parse that correctly. *************** *** 79,89 **** #include "headers.h" #include "s_elm.h" #include - #include - - #ifdef BSD - #undef tolower - #endif /** Note that this routine generates automatic header information for the subject and (obviously) to lines, but that these can --- 116,121 ---- *************** *** 609,619 **** buffer[loc++] = buf[(*iindex)++]; /* Copy final " */ } ! ! while (buf[*iindex] != ',' && buf[*iindex] != '\0') ! buffer[loc++] = buf[(*iindex)++]; ! ! (*iindex)++; buffer[loc] = '\0'; while (whitespace(buffer[loc])) /* remove trailing whitespace */ --- 641,664 ---- buffer[loc++] = buf[(*iindex)++]; /* Copy final " */ } ! /* ! * Previously, we just went looking for a "," to seperate the ! * addresses. This meant that addresses like: ! * ! * joe@acme.com (LastName, Firstname) ! * ! * got split right down the middle. The following was changed ! * to step through the address in quanta of RFC-822 tokens. ! * That fixes the bug, but this routine is still incurably ugly. ! */ ! i = *iindex; ! while (buf[i] != ',' && buf[i] != '\0') { ! len = rfc822_toklen(buf+i); ! strncpy(buffer+loc, buf+i, len); ! loc += len; ! i += len; ! } ! *iindex = i + (buf[i] != '\0' ? 1 : 0); buffer[loc] = '\0'; while (whitespace(buffer[loc])) /* remove trailing whitespace */ *************** *** 649,659 **** for (loc = 0, len = strlen(buffer);buffer[loc] != '<' && loc < len; loc++) /* get to the opening comment character... */ ; while (whitespace(buffer[loc])) loc--; /* back up */ /** get the comment field... **/ comment[0] = '('; ! for (i=1; i < loc; i++) comment[i] = buffer[i-1]; comment[i++] = ')'; comment[i] = '\0'; --- 694,705 ---- for (loc = 0, len = strlen(buffer);buffer[loc] != '<' && loc < len; loc++) /* get to the opening comment character... */ ; while (whitespace(buffer[loc])) loc--; /* back up */ + if (loc >= 0 && !whitespace(buffer[loc])) loc++; /* And fwd again! */ /** get the comment field... **/ comment[0] = '('; ! for (i=1; i <= loc; i++) comment[i] = buffer[i-1]; comment[i++] = ')'; comment[i] = '\0'; Index: src/save_opts.c Prereq: 5.2 *** ../elm2.4/src/save_opts.c Sun Apr 11 23:10:54 1993 --- src/save_opts.c Sun Aug 22 23:26:56 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: save_opts.c,v 5.2 1993/04/12 03:10:54 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: save_opts.c,v 5.6 1993/08/23 03:26:24 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,37 ---- * ******************************************************************************* * $Log: save_opts.c,v $ + * Revision 5.6 1993/08/23 03:26:24 syd + * Try setting group id separate from user id in chown to + * allow restricted systems to change group id of file + * From: Syd + * + * Revision 5.5 1993/08/10 18:54:45 syd + * Elm was failing to write an empty "alternatives" list to elmrc. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.4 1993/08/03 19:03:52 syd + * "*clear-weed-list*" in elmrc was wiped out when one saved the options in elm. + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.3 1993/06/10 02:55:34 syd + * Write options to elmrc even if their values are empty strings. + * Rationalize code that reads and writes weedouts and alternates. + * From: chip%fin@myrddin.sybus.com + * * Revision 5.2 1993/04/12 03:10:54 syd * The onoff macro assumes a boolean option only has values 1 or 0. * This is not true for forms option (may be 2 == MAYBE). *************** *** 86,92 **** if (rename(newfname, oldfname) < 0) dprint(2, (debugfile, "Unable to rename %s to %s\n", newfname, oldfname)); ! (void) chown(oldfname, userid, groupid); } --- 104,111 ---- if (rename(newfname, oldfname) < 0) dprint(2, (debugfile, "Unable to rename %s to %s\n", newfname, oldfname)); ! (void) chown(oldfname, -1, groupid); ! (void) chown(oldfname, userid, -1); } *************** *** 241,247 **** continue; local_value = save_info[x].flags & FL_LOCAL; ! s=""; switch(save_info[x].flags & DT_MASK) { case DT_MLT: case DT_SYN: --- 260,266 ---- continue; local_value = save_info[x].flags & FL_LOCAL; ! s = NULL; switch(save_info[x].flags & DT_MASK) { case DT_MLT: case DT_SYN: *************** *** 260,292 **** break; case DT_WEE: ! { int len = 0 ,i; add_comment(x, newelmrc); if (!local_value) fprintf(newelmrc, "### "); ! fprintf(newelmrc, "%s = ", save_info[x].name); ! len = strlen(save_info[x].name) + 4; ! for (i = 0; i < weedcount && strcmp(weedlist[i], "*end-of-defaults*") !=0; i++) ! /* intentional null loop body */; ! ! while (i < weedcount && equal(weedlist[i], "*end-of-defaults*")) i++; ! while (i < weedcount) { ! if (strlen(weedlist[i]) + len > 78) { if (local_value) fprintf(newelmrc, "\n\t"); else fprintf(newelmrc, "\n###\t"); len = 8; } ! fprintf(newelmrc, "\"%s\" ", weedlist[i]); ! len += strlen(weedlist[i]) + 4; ! ++i; } ! fprintf(newelmrc, "\t\"*end-of-user-headers*\"\n"); } break; --- 279,330 ---- break; case DT_WEE: ! { int len, i; ! char *w; add_comment(x, newelmrc); if (!local_value) fprintf(newelmrc, "### "); ! fprintf(newelmrc, "%s =", save_info[x].name); ! len = strlen(save_info[x].name) + 6; ! i = 0; ! while (i < weedcount ! && istrcmp(weedlist[i], "*end-of-defaults*")) ! i++; ! while (i < weedcount ! && !istrcmp(weedlist[i], "*end-of-defaults*")) i++; + if (i == 1) { + /* end-of-defaults in the first position means + ** that there are no defaults, i.e. + ** a clear-weed-list has been done. + */ + fprintf(newelmrc, " \"*clear-weed-list*\""); + len += 20; + } ! while (i <= weedcount) { ! char *w; ! ! w = (i < weedcount) ? weedlist[i] ! : "*end-of-user-headers*"; ! if (strlen(w) + len > 72) { if (local_value) fprintf(newelmrc, "\n\t"); else fprintf(newelmrc, "\n###\t"); len = 8; } ! else { ! fprintf(newelmrc, " "); ! ++len; ! } ! fprintf(newelmrc, "\"%s\"", w); ! len += strlen(w) + 3; ! i++; } ! fprintf(newelmrc, "\n"); } break; *************** *** 295,331 **** int len=0; alts = *SAVE_INFO_ALT(x); - if (!alts) break; - add_comment(x, newelmrc); if (!local_value) fprintf(newelmrc, "### "); ! fprintf(newelmrc, "%s = ", save_info[x].name); ! len = strlen(save_info[x].name) + 4; for ( ;alts; alts = alts->next) { ! if (strlen(alts->address) + len > 78) { if (local_value) fprintf(newelmrc, "\n\t"); else fprintf(newelmrc, "\n###\t"); len = 8; } ! fprintf(newelmrc, "%s ", alts->address); ! len += strlen(alts->address) + 2; } } - fprintf(newelmrc,"\n"); break; } ! if (*s) { add_comment(x, newelmrc); ! if (local_value) ! fprintf(newelmrc, "%s = %s\n", save_info[x].name, s); ! else ! fprintf(newelmrc, "### %s = %s\n", save_info[x].name, s); ! } } fclose(newelmrc); if ( elminfo_fd != NULL ) { --- 333,370 ---- int len=0; alts = *SAVE_INFO_ALT(x); add_comment(x, newelmrc); if (!local_value) fprintf(newelmrc, "### "); ! fprintf(newelmrc, "%s =", save_info[x].name); ! len = strlen(save_info[x].name) + 6; for ( ;alts; alts = alts->next) { ! if (strlen(alts->address) + len > 72) { if (local_value) fprintf(newelmrc, "\n\t"); else fprintf(newelmrc, "\n###\t"); len = 8; } ! else { ! fprintf(newelmrc, " "); ! ++len; ! } ! fprintf(newelmrc, "%s", alts->address); ! len += strlen(alts->address); } + fprintf(newelmrc,"\n"); } break; } ! if (s) { add_comment(x, newelmrc); ! if (!local_value) ! fprintf(newelmrc, "### "); ! fprintf(newelmrc, "%s = %s\n", save_info[x].name, s); } + } fclose(newelmrc); if ( elminfo_fd != NULL ) { Index: src/showmsg.c Prereq: 5.13 *** ../elm2.4/src/showmsg.c Sat May 8 16:25:51 1993 --- src/showmsg.c Sun Aug 22 22:46:09 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: showmsg.c,v 5.13 1993/05/08 20:25:33 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.13 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: showmsg.c,v 5.15 1993/08/23 02:46:07 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.15 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,35 ---- * ******************************************************************************* * $Log: showmsg.c,v $ + * Revision 5.15 1993/08/23 02:46:07 syd + * Don't declare _exit() if already did it. + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg) + * + * Revision 5.14 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.13 1993/05/08 20:25:33 syd * Add sleepmsg to control transient message delays * From: Syd *************** *** 85,102 **** #include "headers.h" #include "s_elm.h" - #include #include #ifdef BSD # include ! # undef tolower #endif extern int errno; extern char *elm_date_str(), *error_description(); - void _exit(); int memory_lock = FALSE; /* is it available?? */ int pipe_abort = FALSE; /* did we receive a SIGNAL(SIGPIPE)? */ --- 101,119 ---- #include "headers.h" #include "s_elm.h" #include #ifdef BSD # include ! #endif ! ! #ifndef I_UNISTD ! void _exit(); #endif extern int errno; extern char *elm_date_str(), *error_description(); int memory_lock = FALSE; /* is it available?? */ int pipe_abort = FALSE; /* did we receive a SIGNAL(SIGPIPE)? */ Index: src/signals.c Prereq: 5.8 *** ../elm2.4/src/signals.c Sun Apr 11 23:04:59 1993 --- src/signals.c Tue Aug 3 15:10:51 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: signals.c,v 5.8 1993/04/12 03:04:58 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: signals.c,v 5.9 1993/08/03 19:10:50 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,26 ---- * ******************************************************************************* * $Log: signals.c,v $ + * Revision 5.9 1993/08/03 19:10:50 syd + * Patch for Elm 2.4 PL22 to correct handling of SIGWINCH signals on + * DecStations with Ultrix 4.2. + * The problem was that elm running in an xterm exits silently when the + * window is resize. This was caused by incorrect signal handling for BSD. + * From: vogt@isa.de + * * Revision 5.8 1993/04/12 03:04:58 syd * The USR2 signal lost messages on some OS:es and did an unnecessary resync * on others. *************** *** 201,210 **** SIGHAND_TYPE winch_signal(sig) { #ifndef BSD signal(SIGWINCH, winch_signal); #endif - resize_screen = 1; } #endif --- 208,220 ---- SIGHAND_TYPE winch_signal(sig) { + resize_screen = 1; #ifndef BSD signal(SIGWINCH, winch_signal); + #else + if (InGetPrompt) + longjmp(GetPromptBuf, 1); #endif } #endif Index: src/string2.c Prereq: 5.1 *** ../elm2.4/src/string2.c Sat Oct 3 18:59:20 1992 --- src/string2.c Tue Aug 3 15:29:21 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: string2.c,v 5.1 1992/10/03 22:58:40 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.1 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: string2.c,v 5.2 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.2 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,31 ---- * ******************************************************************************* * $Log: string2.c,v $ + * Revision 5.2 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.1 1992/10/03 22:58:40 syd * Initial checkin as of 2.4 Release at PL0 * *************** *** 26,37 **** **/ #include "headers.h" - #include - - #ifdef BSD - #undef tolower - #undef toupper - #endif int --- 38,43 ---- Index: src/strings.c Prereq: 5.6 *** ../elm2.4/src/strings.c Tue Jan 19 22:02:41 1993 --- src/strings.c Tue Aug 3 15:29:23 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: strings.c,v 5.6 1993/01/20 03:02:19 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: strings.c,v 5.8 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $ * * Copyright (c) 1986, 1987 Dave Taylor * Copyright (c) 1988, 1989, 1990, 1991 USENET Community Trust *************** *** 14,19 **** --- 14,35 ---- * ******************************************************************************* * $Log: strings.c,v $ + * Revision 5.8 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.7 1993/07/20 02:26:58 syd + * Fix copy_sans_escape handling of tabs + * From: Syd via code from G A Smant + * * Revision 5.6 1993/01/20 03:02:19 syd * Move string declarations to defs.h * From: Syd *************** *** 55,67 **** #include "headers.h" #include "s_elm.h" - #include - #ifdef BSD - #undef tolower - #undef toupper - #endif - /** forward declarations **/ char *format_long(), *strip_commas(), *tail_of_string(), --- 71,77 ---- *************** *** 81,89 **** while (i < len && j < len && source[i] != '\0') { if (source[i] == '\t') { ! n = next_tab(j) - j; while (n-- && j < len) dest[j++] = ' '; } else if (iscntrl(source[i])) { dest[j++] = '^'; if (j < len) --- 91,100 ---- while (i < len && j < len && source[i] != '\0') { if (source[i] == '\t') { ! n = (next_tab(j) - j) - 1; while (n-- && j < len) dest[j++] = ' '; + i++; } else if (iscntrl(source[i])) { dest[j++] = '^'; if (j < len) *************** *** 200,209 **** break; while (--len >= 0) { ! if (islower(*buffer)) ! *first = *buffer; ! else ! *first = tolower(*buffer); buffer++; first++; } --- 211,217 ---- break; while (--len >= 0) { ! *first = tolower(*buffer); buffer++; first++; } *************** *** 219,228 **** */ for (; *buffer; buffer++, rest++) ! if (islower(*buffer)) ! *rest = *buffer; ! else ! *rest = tolower(*buffer); *rest = '\0'; --- 227,233 ---- */ for (; *buffer; buffer++, rest++) ! *rest = tolower(*buffer); *rest = '\0'; Index: src/syscall.c Prereq: 5.7 *** ../elm2.4/src/syscall.c Sat May 8 16:25:52 1993 --- src/syscall.c Sun Aug 22 22:46:10 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: syscall.c,v 5.7 1993/01/20 03:48:08 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: syscall.c,v 5.8 1993/08/23 02:46:07 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,23 **** * ******************************************************************************* * $Log: syscall.c,v $ ! * Revision 5.7 1993/01/20 03:48:08 syd ! * Fix not to use vfork if SY_ENV_SHELL is set, as this causes the ! * parent environment to be modified. ! * From: Syd * * Revision 5.7 1993/01/20 03:48:08 syd * Fix not to use vfork if SY_ENV_SHELL is set, as this causes the --- 14,22 ---- * ******************************************************************************* * $Log: syscall.c,v $ ! * Revision 5.8 1993/08/23 02:46:07 syd ! * Don't declare _exit() if already did it. ! * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg) * * Revision 5.7 1993/01/20 03:48:08 syd * Fix not to use vfork if SY_ENV_SHELL is set, as this causes the *************** *** 69,76 **** # include #endif char *argv_zero(); - void _exit(); #ifdef ALLOW_SUBSHELL --- 68,78 ---- # include #endif + #ifndef I_UNISTD + void _exit(); + #endif + char *argv_zero(); #ifdef ALLOW_SUBSHELL Index: src/utils.c Prereq: 5.10 *** ../elm2.4/src/utils.c Sun Apr 11 23:11:50 1993 --- src/utils.c Sun Aug 22 23:26:56 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: utils.c,v 5.10 1993/04/12 03:11:50 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: utils.c,v 5.12 1993/08/23 03:26:24 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,36 ---- * ******************************************************************************* * $Log: utils.c,v $ + * Revision 5.12 1993/08/23 03:26:24 syd + * Try setting group id separate from user id in chown to + * allow restricted systems to change group id of file + * From: Syd + * + * Revision 5.11 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.10 1993/04/12 03:11:50 syd * nameof() didn't check that the character after the common string was /, thus * (if Mail is the folderdir) Maildir/x was made to be =dir/x. *************** *** 69,81 **** #include "headers.h" #include "s_elm.h" #include - #include #include - #ifdef BSD - #undef tolower - #endif - extern int errno; create_new_folders() --- 86,93 ---- *************** *** 95,101 **** (void) system_call(com, 0); #endif /* MKDIR */ ! chown(folders, userid, groupid); } create_new_elmdir() --- 107,114 ---- (void) system_call(com, 0); #endif /* MKDIR */ ! chown(folders, -1, groupid); ! chown(folders, userid, -1); } create_new_elmdir() *************** *** 118,124 **** (void) system_call(com, 0); #endif /* MKDIR */ ! chown( source, userid, groupid); } move_old_files_to_new() --- 131,138 ---- (void) system_call(com, 0); #endif /* MKDIR */ ! chown( source, -1, groupid); ! chown( source, userid, -1); } move_old_files_to_new() Index: src/wordwrap.c Prereq: 5.4 *** ../elm2.4/src/wordwrap.c Sun Apr 11 23:02:40 1993 --- src/wordwrap.c Tue Aug 3 15:29:25 1993 *************** *** 1,5 **** /******************************************************************************* ! * The Elm Mail System - $Revision: 5.4 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- + + static char rcsid[] = "@(#)$Id: wordwrap.c,v 5.6 1993/08/03 19:28:39 syd Exp $"; + /******************************************************************************* ! * The Elm Mail System - $Revision: 5.6 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 11,16 **** --- 14,35 ---- * ******************************************************************************* * $Log: wordwrap.c,v $ + * Revision 5.6 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * + * Revision 5.5 1993/06/10 03:12:10 syd + * Add missing rcs id lines + * From: Syd + * * Revision 5.4 1993/04/12 03:02:40 syd * Check for EINTR if getchar() returns EOF. Happens after a resume from an * interactive stop. *************** *** 42,52 **** #include "headers.h" #include - #include - - #ifdef BSD - # undef tolower - #endif extern int errno; /* system error number */ --- 61,66 ---- Index: utils/answer.c Prereq: 5.5 *** ../elm2.4/utils/answer.c Thu Feb 4 10:32:52 1993 --- utils/answer.c Tue Aug 10 14:54:15 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: answer.c,v 5.5 1993/02/04 15:32:52 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.5 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: answer.c,v 5.7 1993/08/10 18:54:13 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,35 ---- * ******************************************************************************* * $Log: answer.c,v $ + * Revision 5.7 1993/08/10 18:54:13 syd + * A change to answer:s mail command to be like those of elm and filter. + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.6 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.5 1993/02/04 15:32:52 syd * Add cast to silence compiler warning. * From: chip@chinacat.unicom.com (Chip Rosenthal) *************** *** 50,60 **** #include "ndbz.h" #include "s_answer.h" #include "sysdefs.h" - #include - - #ifdef BSD - #undef tolower - #endif #define ELM "elm" /* where the elm program lives */ --- 66,71 ---- *************** *** 250,257 **** fclose(fd); sprintf(buffer, catgets(elm_msg_cat, AnswerSet, AnswerElmCommand, ! "( ( %s -s \"While You Were Out\" %s ; %s %s) & ) < %s > /dev/null"), ! ELM, strip_parens(address), remove_cmd, tempfile, tempfile); system(buffer); } --- 261,268 ---- fclose(fd); sprintf(buffer, catgets(elm_msg_cat, AnswerSet, AnswerElmCommand, ! "( ( %s -s \"While You Were Out\" %s < %s ; %s %s) & ) > /dev/null"), ! ELM, strip_parens(address), tempfile, remove_cmd, tempfile); system(buffer); } *************** *** 270,277 **** for (i=0, len = strlen(fullname); i < len; i++) { ! if (isupper(fullname[i])) ! fullname[i] = tolower(fullname[i]); if (fullname[i] == ' ') if (lastname) { --- 281,287 ---- for (i=0, len = strlen(fullname); i < len; i++) { ! fullname[i] = tolower(fullname[i]); if (fullname[i] == ' ') if (lastname) { Index: utils/arepdaem.c Prereq: 5.12 *** ../elm2.4/utils/arepdaem.c Mon May 31 15:39:25 1993 --- utils/arepdaem.c Tue Aug 3 15:29:26 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.12 1993/05/31 19:39:24 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.12 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: arepdaem.c,v 5.13 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.13 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,31 ---- * ******************************************************************************* * $Log: arepdaem.c,v $ + * Revision 5.13 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.12 1993/05/31 19:39:24 syd * check for missing replyfile * From: roy@lorien.gatech.edu (Roy Mongiovi) *************** *** 107,113 **** #endif #include - #include #include #define arep_lock_file "LCK..arep" --- 119,124 ---- Index: utils/elmalias.c Prereq: 5.2 *** ../elm2.4/utils/elmalias.c Sun May 16 16:55:32 1993 --- utils/elmalias.c Sun Aug 22 22:44:41 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: elmalias.c,v 5.2 1993/05/16 20:55:32 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.2 $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: elmalias.c,v 5.6 1993/08/23 02:44:41 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.6 $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,35 ---- * ******************************************************************************* * $Log: elmalias.c,v $ + * Revision 5.6 1993/08/23 02:44:41 syd + * fix where checkalias doesn't fully expand multi-database aliases + * From: Steve Wolf + * + * Revision 5.5 1993/08/03 19:23:25 syd + * Added -d option to elmalias. + * From: Jan.Djarv@sa.erisoft.se (Jan Djarv) + * + * Revision 5.4 1993/07/27 20:27:33 syd + * fix strchr, Elm uses define to make index strchr when needed + * From: Syd + * + * Revision 5.3 1993/07/20 02:59:53 syd + * Support aliases both on 64 bit and 32 bit machines at the same time. + * From: Dan Mosedale + * * Revision 5.2 1993/05/16 20:55:32 syd * fix elmalias bug * From: chip@chinacat.unicom.com (Chip Rosenthal) *************** *** 60,69 **** * alias chip is address "chip@chinacat.unicom.com" (Chip Rosenthal) * * Synopsis: ! * elmalias [-aensuvV] [-f format] [alias ...] * * Options: * -a Display alias name. Equivalent to -f "%-20.20a %v". * -e Fully expand alias values. * -f fmt User-specified output format. * -n Display name. Equivalent to -f "%v?n (%n)?". --- 76,86 ---- * alias chip is address "chip@chinacat.unicom.com" (Chip Rosenthal) * * Synopsis: ! * elmalias [-adensuvV] [-f format] [alias ...] * * Options: * -a Display alias name. Equivalent to -f "%-20.20a %v". + * -d Turn debugging on. Only useful if DEBUG is defined. * -e Fully expand alias values. * -f fmt User-specified output format. * -n Display name. Equivalent to -f "%v?n (%n)?". *************** *** 114,120 **** void usage_error() { fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet, ElmaliasUsage, ! "usage: %s [-aenrsuvV] [-f format] [alias ...]\n"), Progname); exit(1); /*NOTREACHED*/ } --- 131,137 ---- void usage_error() { fprintf(stderr, catgets(elm_msg_cat, ElmaliasSet, ElmaliasUsage, ! "usage: %s [-adenrsuvV] [-f format] [alias ...]\n"), Progname); exit(1); /*NOTREACHED*/ } *************** *** 168,178 **** /* * Crack command line options. */ ! while ((i = getopt(argc, argv, "aef:nrsuvV")) != EOF) { switch (i) { case 'a': /* show alias name and value */ out_fmt = "%-20.20a %v"; break; case 'e': /* recursively expand aliases */ do_expand = TRUE; break; --- 185,200 ---- /* * Crack command line options. */ ! while ((i = getopt(argc, argv, "adef:nrsuvV")) != EOF) { switch (i) { case 'a': /* show alias name and value */ out_fmt = "%-20.20a %v"; break; + case 'd': + #ifdef DEBUG + debug = 10; + #endif + break; case 'e': /* recursively expand aliases */ do_expand = TRUE; break; *************** *** 273,279 **** ar = make_dummy_rec(argv[i]); print_alias(out_fmt, ar); } else if (do_expand && (ar->type & GROUP)) { ! exp_print_alias(dblist[d], out_fmt, ar); } else { print_alias(out_fmt, ar); } --- 295,301 ---- ar = make_dummy_rec(argv[i]); print_alias(out_fmt, ar); } else if (do_expand && (ar->type & GROUP)) { ! exp_print_alias(dblist, out_fmt, ar); } else { print_alias(out_fmt, ar); } *************** *** 336,343 **** /* * Recursively expand out a list of addresses and print the expansions. */ ! void exp_print_alias(db, fmt, ar) ! DBZ *db; char *fmt; struct alias_rec *ar; { --- 358,365 ---- /* * Recursively expand out a list of addresses and print the expansions. */ ! void exp_print_alias(dblist, fmt, ar) ! DBZ *dblist[]; char *fmt; struct alias_rec *ar; { *************** *** 345,350 **** --- 367,373 ---- char *acurr; /* pointer to current address within "abuf" */ char *anext; /* pointer to next address within "abuf" */ struct alias_rec *ar0; + int d; /* dblist index */ /* * Create a copy of this address we can scribble upon. *************** *** 358,367 **** * Go through all of the addresses and expand them out. */ while ((acurr = next_addr_in_list(&anext)) != NULL) { ! if ((ar0 = fetch_alias(db, acurr)) == NULL) ar0 = make_dummy_rec(acurr); if (ar0->type & GROUP) ! exp_print_alias(db, fmt, ar0); else print_alias(fmt, ar0); (void) free((malloc_t)ar0); --- 381,394 ---- * Go through all of the addresses and expand them out. */ while ((acurr = next_addr_in_list(&anext)) != NULL) { ! for (d = 0 ; dblist[d] != NULL ; ++d) { ! if ((ar0 = fetch_alias(dblist[d], acurr)) != NULL) ! break; ! } ! if (ar0 == NULL) ar0 = make_dummy_rec(acurr); if (ar0->type & GROUP) ! exp_print_alias(dblist, fmt, ar0); else print_alias(fmt, ar0); (void) free((malloc_t)ar0); *************** *** 401,407 **** */ pfmt[0] = *fmt++; n = 1; ! while (strchr("-.0123456789", *fmt) != NULL) { if (n < sizeof(pfmt)-2) pfmt[n++] = *fmt; ++fmt; --- 428,434 ---- */ pfmt[0] = *fmt++; n = 1; ! while (index("-.0123456789", *fmt) != NULL) { if (n < sizeof(pfmt)-2) pfmt[n++] = *fmt; ++fmt; Index: utils/fastmail.c Prereq: 5.7 *** ../elm2.4/utils/fastmail.c Sun Jun 6 14:32:10 1993 --- utils/fastmail.c Mon Jul 19 22:46:37 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.7 1993/06/06 18:31:43 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.7 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: fastmail.c,v 5.8 1993/07/20 02:46:36 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.8 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,24 ---- * ******************************************************************************* * $Log: fastmail.c,v $ + * Revision 5.8 1993/07/20 02:46:36 syd + * In fastmail, if environment variable $REPLYTO is set, use it as + * default Reply-To. Also, eliminate unnecessary strlen() calls. + * From: decwrl!uunet.UU.NET!fin!chip (Chip Salzenberg) + * * Revision 5.7 1993/06/06 18:31:43 syd * fix typo * *************** *** 99,105 **** char replyto[SLEN], cc_list[SLEN], bcc_list[SLEN], to_list[SLEN]; char from_addr[SLEN], comments[SLEN], inreplyto[NLEN]; char references[SLEN]; ! char *tmplogname; int c, sendmail_available, debug = 0; elm_msg_cat = catopen("elm2.4", 0); --- 104,110 ---- char replyto[SLEN], cc_list[SLEN], bcc_list[SLEN], to_list[SLEN]; char from_addr[SLEN], comments[SLEN], inreplyto[NLEN]; char references[SLEN]; ! char *p; int c, sendmail_available, debug = 0; elm_msg_cat = catopen("elm2.4", 0); *************** *** 115,120 **** --- 120,128 ---- inreplyto[0] = '\0'; references[0] = '\0'; + if ((p = getenv("REPLYTO")) != NULL) + strcpy(replyto, p); + while ((c = getopt(argc, argv, "b:c:C:df:F:i:r:R:s:")) != EOF) { switch (c) { case 'b' : strcpy(bcc_list, optarg); break; *************** *** 147,159 **** gethostname(hostname, sizeof(hostname)); #endif ! tmplogname = getlogin(); ! if (tmplogname != NULL) ! strcpy(username, tmplogname); ! else ! username[0] = '\0'; ! ! if (strlen(username) == 0) cuserid(username); if (strcmp(filename, "-")) { --- 155,164 ---- gethostname(hostname, sizeof(hostname)); #endif ! username[0] = '\0'; ! if ((p = getlogin()) != NULL) ! strcpy(username, p); ! if (!username[0]) cuserid(username); if (strcmp(filename, "-")) { *************** *** 213,237 **** fprintf(tempfile, "Date: %s\n", get_arpa_date()); ! if (strlen(replyto) > 0) fprintf(tempfile, "Reply-To: %s\n", replyto); ! while (optind < argc) ! sprintf(to_list, "%s%s%s", to_list, (strlen(to_list) > 0? ",":""), ! argv[optind++]); fprintf(tempfile, "To: %s\n", to_list); ! if (strlen(cc_list) > 0) fprintf(tempfile, "Cc: %s\n", cc_list); ! if (strlen(references) > 0) fprintf(tempfile, "References: %s\n", references); ! if (strlen(inreplyto) > 0) fprintf(tempfile, "In-Reply-To: %s\n", inreplyto); ! if (strlen(comments) > 0) fprintf(tempfile, "Comments: %s\n", comments); #ifndef NO_XHEADER --- 218,244 ---- fprintf(tempfile, "Date: %s\n", get_arpa_date()); ! if (replyto[0]) fprintf(tempfile, "Reply-To: %s\n", replyto); ! while (optind < argc) { ! if (to_list[0]) ! strcat(to_list, ","); ! strcat(to_list, argv[optind++]); ! } fprintf(tempfile, "To: %s\n", to_list); ! if (cc_list[0]) fprintf(tempfile, "Cc: %s\n", cc_list); ! if (references[0]) fprintf(tempfile, "References: %s\n", references); ! if (inreplyto[0]) fprintf(tempfile, "In-Reply-To: %s\n", inreplyto); ! if (comments[0]) fprintf(tempfile, "Comments: %s\n", comments); #ifndef NO_XHEADER *************** *** 248,255 **** if (debug) printf("Mailing to %s%s%s%s%s [via %s]\n", to_list, ! (strlen(cc_list) > 0 ? " ":""), cc_list, ! (strlen(bcc_list) > 0 ? " ":""), bcc_list, sendmail_available? "sendmail" : "rmail"); sprintf(command_buffer, "cat %s %s | %s %s %s %s", --- 255,262 ---- if (debug) printf("Mailing to %s%s%s%s%s [via %s]\n", to_list, ! (cc_list[0] ? " ":""), cc_list, ! (bcc_list[0] ? " ":""), bcc_list, sendmail_available? "sendmail" : "rmail"); sprintf(command_buffer, "cat %s %s | %s %s %s %s", Index: utils/newmail.c Prereq: 5.18 *** ../elm2.4/utils/newmail.c Sun Jun 6 14:24:48 1993 --- utils/newmail.c Tue Aug 3 15:29:27 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: newmail.c,v 5.18 1993/06/06 18:00:10 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.18 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: newmail.c,v 5.19 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.19 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,31 ---- * ******************************************************************************* * $Log: newmail.c,v $ + * Revision 5.19 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.18 1993/06/06 18:00:10 syd * Fix max folder check, off by one * *************** *** 143,149 **** **/ #include "elmutil.h" - #include #include "s_newmail.h" #ifdef PWDINSYS --- 155,160 ---- Index: utils/prlong.c Prereq: 5.2 *** ../elm2.4/utils/prlong.c Tue Apr 20 21:41:19 1993 --- utils/prlong.c Tue Aug 3 15:29:28 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: prlong.c,v 5.2 1993/04/21 01:41:14 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.2 $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: prlong.c,v 5.3 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.3 $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,31 ---- * ******************************************************************************* * $Log: prlong.c,v $ + * Revision 5.3 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.2 1993/04/21 01:41:14 syd * Needs ctype.h * From: Syd *************** *** 61,67 **** #include - #include #include "defs.h" #define MAXWID 78 /* default maximum line width */ --- 73,78 ---- Index: utils/readmsg.c Prereq: 5.9 *** ../elm2.4/utils/readmsg.c Tue Apr 20 21:17:52 1993 --- utils/readmsg.c Tue Aug 3 15:29:29 1993 *************** *** 1,8 **** ! static char rcsid[] = "@(#)$Id: readmsg.c,v 5.9 1993/04/21 01:17:51 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.9 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor --- 1,8 ---- ! static char rcsid[] = "@(#)$Id: readmsg.c,v 5.10 1993/08/03 19:28:39 syd Exp $"; /******************************************************************************* ! * The Elm Mail System - $Revision: 5.10 $ $State: Exp $ * * Copyright (c) 1988-1992 USENET Community Trust * Copyright (c) 1986,1987 Dave Taylor *************** *** 14,19 **** --- 14,31 ---- * ******************************************************************************* * $Log: readmsg.c,v $ + * Revision 5.10 1993/08/03 19:28:39 syd + * Elm tries to replace the system toupper() and tolower() on current + * BSD systems, which is unnecessary. Even worse, the replacements + * collide during linking with routines in isctype.o. This patch adds + * a Configure test to determine whether replacements are really needed + * (BROKE_CTYPE definition). The header file is now included + * globally through hdrs/defs.h and the BROKE_CTYPE patchup is handled + * there. Inclusion of was removed from *all* the individual + * files, and the toupper() and tolower() routines in lib/opt_utils.c + * were dropped. + * From: chip@chinacat.unicom.com (Chip Rosenthal) + * * Revision 5.9 1993/04/21 01:17:51 syd * readmsg treated a line with From_ preceeded by whitespace as a valid * message delimiter. *************** *** 115,121 **** #include "elmutil.h" #include "s_readmsg.h" - #include /** three defines for what level of headers to display **/ #define ALL 1 --- 127,132 ----