Sender: hurtta@attruh.keh.iki.fi From: "Kari E. Hurtta" Subject: Patch: Elm 2.4ME+ PL116 (25) -> Elm 2.4ME+ PL116a (25) Newsgroups: alt.sources,comp.mail.elm Reply-To: "Kari E. Hurtta" Message-ID: References: In-Reply-To: Lines: 518 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 11 Jun 2004 17:37:24 GMT NNTP-Posting-Host: 193.208.81.208 X-Complaints-To: abuse@inet.fi X-Trace: read3.inet.fi 1086975444 193.208.81.208 (Fri, 11 Jun 2004 20:37:24 EEST) NNTP-Posting-Date: Fri, 11 Jun 2004 20:37:24 EEST Organization: Sonera corp Internet services Xref: newsread1.funet.fi alt.sources:898 comp.mail.elm:1957 X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Archive-name: elm2.4ME+/PL116 Is available on ozone.FMI.FI via anonymous ftp directory KEH/ file elm-2.4ME+PL116a.patch.gz for a moment (1). Is available on ftp.funet.fi via anonymous ftp directory pub/unix/mail/elm/elm-2.4ME+/ files elm-2.4ME+PL116a.patch.gz Is available with via WWW. Is available with via WWW. (1) NOTE: It is currently unknown what will be done for ftp.ozone.fmi.fi www.ozone.fmi.fi. Also ozone.fmi.fi will retire. For apply patch use command patch -p1 < {path...}/elm-2.4ME+PL116a.patch on top level directory of Elm 2.4ME+ distribution (ie. on directory where Configure is.) SUMMARY: This patch fixes bug where alternatives and weedout list are replaced with Q letters on elmrc and fixes bug where gpg key of recipient is not found when sending mail. Notice: ME+ series is not official Elm. This patch is agaist Elm 2.4ME+ PL116 (25) -------------------------------- Index: elm2.4.ME+.116a-cvs/hdrs/patchlevel.h Prereq: 1116400000 *** elm2.4.ME+.116/hdrs/patchlevel.h 2004-05-19 19:10:14.000000000 +0300 --- elm2.4.ME+.116a-cvs/hdrs/patchlevel.h 2004-06-09 20:15:23.000000000 +0300 *************** *** 1,12 **** ! #define PATCHLEVEL "116 (25)" /* Used by Configure: SHAREDTAG: .1.0.116 */ ! #define LAST_REPORT_TIME 1116400000 #define BUG_REPORT_ADDR "Kari Hurtta " ! #define VERS_DATE "May, 2004" /* for elm -v option */ #define WHAT_STRING \ ! "@(#) Version 2.4(ME+), USENET supported version, released May, 2004" /* * Local Variables: --- 1,12 ---- ! #define PATCHLEVEL "116a (25)" /* Used by Configure: SHAREDTAG: .1.0.116 */ ! #define LAST_REPORT_TIME 1118000000 #define BUG_REPORT_ADDR "Kari Hurtta " ! #define VERS_DATE "Jun, 2004" /* for elm -v option */ #define WHAT_STRING \ ! "@(#) Version 2.4(ME+), USENET supported version, released Jun, 2004" /* * Local Variables: Index: elm2.4.ME+.116a-cvs/README.ME+ *** elm2.4.ME+.116/README.ME+ 2004-05-19 19:10:14.000000000 +0300 --- elm2.4.ME+.116a-cvs/README.ME+ 2004-06-09 22:56:19.000000000 +0300 *************** *** 1,4 **** ! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760 2004/05/19 12:02:16 hurtta Exp $ Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+. Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b. --- 1,4 ---- ! $Header: /data/cvsroot/mail/elmme+/README.ME+,v 1.760.2.4 2004/06/09 19:56:19 hurtta Exp $ Version Elm2.4ME+ PL0 (25) is based on version Elm2.4 PL24 ME8b+. Version Elm2.4 PL24 ME8b+ is based on version Elm2.4 PL24 ME8b. *************** *** 13,18 **** --- 13,41 ---- Version Elm2.4 PL24 ME8b is based on version Elm2.4 PL24. Version Elm2.4ME+ PLx (25) includes patch of version Elm2.4 PL25. + Changes of Elm2.4ME+ PL116a (25) compared with Elm2.4ME+ PL116 (25) + ------------------------------------------------------------------- + + - Alternatives and weedout and list was replaced with Q letters + Problem noted by: Cyrille Lefevre + + - Reprint last error on "Mail Pre-Send Screen" after + clearing screen. + + - Trying send encrypted messages with gpg was giving + error message + Couldn't find key matching 'xxx@yyy' + Problem noted by: Olivier COLIN + (and probably others) + > Make GetPGPKey() retry reading of result on case of + interrupt. + + - GetPGPKey() was not collect status of exted gpg and + was left lot of defunct processes. Converted code to + use start_run(). + + - Do not quote addresses on alternatives. + Changes of Elm2.4ME+ PL116 (25) compared with Elm2.4ME+ PL115 (25) ------------------------------------------------------------------- *************** *** 98,104 **** on '(' to ')' on make_surface_addr() on lib/outheaders.c - Changes of Elm2.4ME+ PL115a (25) compared with Elm2.4ME+ PL115 (25) ------------------------------------------------------------------- --- 121,126 ---- Index: elm2.4.ME+.116a-cvs/lib/rc_handle.c *** elm2.4.ME+.116/lib/rc_handle.c 2004-05-19 19:10:14.000000000 +0300 --- elm2.4.ME+.116a-cvs/lib/rc_handle.c 2004-06-09 23:08:54.000000000 +0300 *************** *** 1,7 **** ! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24 2004/05/01 19:08:19 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.24 $ $State: Exp $ * * Author: Kari Hurtta (was hurtta+elm@ozone.FMI.FI) **************************************************************************** --- 1,7 ---- ! static char rcsid[] = "@(#)$Id: rc_handle.c,v 1.24.4.3 2004/06/09 20:08:54 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.24.4.3 $ $State: Exp $ * * Author: Kari Hurtta (was hurtta+elm@ozone.FMI.FI) **************************************************************************** *************** *** 1446,1451 **** --- 1446,1454 ---- fprintf(F, "%s = ",r->name); for (i = 0; i < r->val.path->nlen; i++) { + /* NOTE: space is always valid separator even when + PATH_sep_comma or PATH_sep_colon is set */ + if (i > 0) { if (len + strlen(r->val.path->list[i]) > 70) { fprintf(F, "\n"); *************** *** 1458,1464 **** } if (r->val.path->flags & PATH_quote) ! elm_fprintf(F,FRM("Q"),r->val.path->list[i]); else if (r->val.path->flags & PATH_quote_single) { fputc('\'',F); fputs(r->val.path->list[i],F); --- 1461,1467 ---- } if (r->val.path->flags & PATH_quote) ! elm_fprintf(F,FRM("%Q"),r->val.path->list[i]); else if (r->val.path->flags & PATH_quote_single) { fputc('\'',F); fputs(r->val.path->list[i],F); Index: elm2.4.ME+.116a-cvs/lib/read_rc.c *** elm2.4.ME+.116/lib/read_rc.c 2004-05-19 19:10:14.000000000 +0300 --- elm2.4.ME+.116a-cvs/lib/read_rc.c 2004-06-09 22:56:20.000000000 +0300 *************** *** 1,7 **** ! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136 2004/05/01 19:08:19 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.136 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) --- 1,7 ---- ! static char rcsid[] = "@(#)$Id: read_rc.c,v 1.136.4.1 2004/06/09 19:56:20 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.136.4.1 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) *************** *** 143,149 **** int alias_sortby = NAME_SORT; /* how to sort aliases... */ char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */ PATH alternative_addresses = { /* how else do we get mail? */ ! PATH_sep_comma|PATH_quote|PATH_quote_single, NULL, 0,NULL }; --- 143,149 ---- int alias_sortby = NAME_SORT; /* how to sort aliases... */ char alternative_editor[SLEN] = "EDITOR"; /* alternative editor... */ PATH alternative_addresses = { /* how else do we get mail? */ ! PATH_sep_comma, NULL, 0,NULL }; Index: elm2.4.ME+.116a-cvs/src/mailmsg2.c *** elm2.4.ME+.116/src/mailmsg2.c 2004-03-30 19:38:44.000000000 +0300 --- elm2.4.ME+.116a-cvs/src/mailmsg2.c 2004-06-09 20:10:20.000000000 +0300 *************** *** 1,7 **** ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76 2004/03/27 18:31:45 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.76 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) --- 1,7 ---- ! static char rcsid[] = "@(#)$Id: mailmsg2.c,v 1.76.12.1 2004/06/09 17:10:20 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.76.12.1 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) *************** *** 1182,1194 **** if (do_redraw) { do_redraw = 0; *need_redraw_p = TRUE; ! menu_ClearScreen(page); print_format_center(0, CATGETS(elm_msg_cat, ElmSet, ElmMailScreenTitle, "Mail Pre-Send Screen")); show_presend_headers(headers,hdr_charset, page); if (headers->env_from && user_level > 0) { --- 1182,1196 ---- if (do_redraw) { do_redraw = 0; *need_redraw_p = TRUE; ! menu_ClearScreen(page); print_format_center(0, CATGETS(elm_msg_cat, ElmSet, ElmMailScreenTitle, "Mail Pre-Send Screen")); + show_last_error(); + show_presend_headers(headers,hdr_charset, page); if (headers->env_from && user_level > 0) { Index: elm2.4.ME+.116a-cvs/src/pgp.c *** elm2.4.ME+.116/src/pgp.c 2004-03-30 19:38:44.000000000 +0300 --- elm2.4.ME+.116a-cvs/src/pgp.c 2004-06-09 20:14:18.000000000 +0300 *************** *** 1,7 **** ! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38 2004/03/27 18:31:46 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.38 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) --- 1,7 ---- ! static char rcsid[] = "@(#)$Id: pgp.c,v 1.38.14.1 2004/06/09 17:14:18 hurtta Exp $"; /****************************************************************************** ! * The Elm (ME+) Mail System - $Revision: 1.38.14.1 $ $State: Exp $ * * Modified by: Kari Hurtta * (was hurtta+elm@ozone.FMI.FI) *************** *** 75,80 **** --- 75,91 ---- /* not reached */ } + + + static void close_pipe P_((struct run_state *rs)); + static void close_pipe(rs) + struct run_state *rs; + { + int *array = rs->ext_init_data; + + close(array[0]); + } + static int GetPGPKey P_((char *name, char *target, int targetsize, enum pgp_version v)); *************** *** 125,131 **** for (;;) { int fd[2]; ! if (pipe (fd) == -1) { DPRINT(Debug,1,(&Debug, "GetPGPKey()=-1: ERROR: pipe (errno %d)\n", --- 136,151 ---- for (;;) { int fd[2]; ! int array[1]; ! CONST char * argv[10]; ! int code; ! int stat = -1; ! ! struct run_state RS; ! ! while (*c && isspace (*c)) c++; /* move past any leading space! */ ! DPRINT(Debug,10,(&Debug, "GetPGPKey: c=%s\n",c)); ! if (pipe (fd) == -1) { DPRINT(Debug,1,(&Debug, "GetPGPKey()=-1: ERROR: pipe (errno %d)\n", *************** *** 134,207 **** return -1; } ! while (*c && isspace (*c)) c++; /* move past any leading space! */ ! DPRINT(Debug,10,(&Debug, "GetPGPKey: c=%s\n",c)); ! if ((pid = fork()) == -1) { ! perror("fork"); ! close(fd[0]); ! close(fd[1]); ! return -1; ! } else if (pid == 0) { ! int tmp = 0; ! if (-1 == setgid(groupid)) { ! int err = errno; ! fprintf(stderr,"GetPGPKey: setgid(%d) FAILED: %s\n", ! groupid,error_description(err)); ! fflush(stderr); ! _exit(err); ! } ! if (-1 == setuid(userid)) { ! int err = errno; ! fprintf(stderr,"GetPGPKey: setuid(%d) FAILED: %s\n", ! userid,error_description(err)); ! fflush(stderr); ! _exit(err); ! } ! close (fd[0]); ! close (1); ! dup (fd[1]); ! close (fd[1]); ! ! switch(v) { ! char *path; ! case pgp2: ! ! execl(pgp2_path, ! pgp2_path,"+verbose=0", "+language=en", "-kv", c, ! (char *)0); ! tmp = errno; ! perror(pgp2_path); ! break; ! case pgp5: ! path = elm_message(FRM("%s/pgpk"),pgp5_dir); ! execl(path, ! path, "+verbose=0","+language=en", ! "-l", c, (char *)0); ! tmp = errno; ! perror(path); ! break; ! case gpg: ! execl(gpg_path, ! gpg_path,"--list-public-keys",c,(char *)0); ! tmp = errno; ! perror(gpg_path); ! break; ! } ! _exit(tmp); } close (fd[1]); p = fdopen (fd[0], "r"); if (p == NULL) { DPRINT(Debug,1,(&Debug, ! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n", errno)); return -1; } while (fgets(buf, STRING, p) != NULL) { DPRINT(Debug,10,(&Debug, "GetPGPKey: %s\n",buf)); --- 154,228 ---- return -1; } ! array[0] = fd[0]; ! RS.save_errno = 0; ! RS.ext_init_data = array; ! RS.ext_init = close_pipe; ! RS.ext_env = NULL; ! ! switch(v) { ! static char path[1000]; ! int n; ! case pgp2: ! n = 0; ! ! argv[n++] = pgp2_path; ! argv[n++] = "+verbose=0"; ! argv[n++] = "+language=en"; ! argv[n++] = "-kv"; ! argv[n++] = c; ! argv[n] = NULL; ! break; ! case pgp5: ! n = 0; ! elm_sfprintf(path, sizeof path,FRM("%s/pgpk"),pgp5_dir); ! argv[n++] = path; ! argv[n++] = "+verbose=0"; ! argv[n++] = "+language=en"; ! argv[n++] = "-l"; ! argv[n++] = c; ! argv[n] = NULL; ! break; ! case gpg: ! n = 0; ! argv[n++] = gpg_path; ! argv[n++] = "--list-public-keys"; ! argv[n++] = c; ! argv[n++] = NULL; ! break; } + code = start_run(&RS, SY_RUN_STATE_INIT, argv , + -1,fd[1]); + close (fd[1]); + + if (!code) { + DPRINT(Debug,1,(&Debug, + "GetPGPKey()=-1: running pgp/gpg failed\n")); + return -1; + } + + p = fdopen (fd[0], "r"); if (p == NULL) { + int tmp; + int err = errno; + DPRINT(Debug,1,(&Debug, ! "GetPGPKey()=-1: ERROR: fdopen (errno %d)\n", ! err)); ! kill(RS.pid,SIGTERM); ! wait_end(&RS,&tmp); ! return -1; } + retry: while (fgets(buf, STRING, p) != NULL) { DPRINT(Debug,10,(&Debug, "GetPGPKey: %s\n",buf)); *************** *** 262,268 **** --- 283,318 ---- } } } + + if (ferror(p) && EINTR == errno) { + clearerr(p); + DPRINT(Debug,5,(&Debug, + "Reading of result interrupted (EINTR) -- retrying\n")); + + if (0 == code) { + code = run_already_done(&RS,&stat); + if (0 != code) { + DPRINT(Debug,5,(&Debug, + "now pgp/gpg is completing\n")); + } + } + + goto retry; + } + fclose(p); + + if (0 == code) + code = wait_end(&RS,&stat); + + if (code < 0) { + DPRINT(Debug,5,(&Debug, + "pgp/gpg dies on signal %d\n", + -code)); + } else { + DPRINT(Debug,5,(&Debug,"pgp/gpgp exited with status %d\n",stat)); + } + if (keys_len > 0 || i > 1) break; else {