From jonny@jonny.eng.br  Sun Jul  5 00:15:43 1998
Received: from roma.coe.ufrj.br (jonny@roma.coe.ufrj.br [146.164.53.65])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id AAA29622
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 5 Jul 1998 00:15:40 -0700 (PDT)
          (envelope-from jonny@jonny.eng.br)
Received: (from jonny@localhost)
	by roma.coe.ufrj.br (8.8.8/8.8.8) id EAA02017;
	Sun, 5 Jul 1998 04:15:41 -0300 (EST)
	(envelope-from jonny)
Message-Id: <199807050715.EAA02017@roma.coe.ufrj.br>
Date: Sun, 5 Jul 1998 04:15:41 -0300 (EST)
From: Joao Carlos Mendes Luis <jonny@jonny.eng.br>
Reply-To: jonny@jonny.eng.br
To: FreeBSD-gnats-submit@freebsd.org
Subject: elm cannot pgp for more than one recipient
X-Send-Pr-Version: 3.2

>Number:         7167
>Category:       ports
>Synopsis:       elm cannot pgp for more than one recipient
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul  5 00:20:00 PDT 1998
>Closed-Date:    Mon May 29 19:20:18 PDT 2000
>Last-Modified:  Mon May 29 19:23:44 PDT 2000
>Originator:     Joao Carlos Mendes Luis
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
COPPE/UFRJ
>Environment:

	FreeBSD-stable, elm from current ports

>Description:

	When sending encrypted mail for more than one recipient,
	elm cannot find the second and other recipients' key.

>How-To-Repeat:

	Send pgp encrypted mail for more than one recipient.

>Fix:
	
	Here's a patch that worked for me.  Since this behaviour
	in elm is relatively recent, and according to the patches
	below, the "bug" was introduced in a (maybe not so) "recent" 
	fix in FreeBSD's pclose.c.  I would send the patch to the
	author, but could not find the right address, although I
	must confess I did not search enough.

	BTW: While you are there, verify that elm does not package.  :)

--- src/pgp.c.org	Sat Mar 28 02:23:20 1998
+++ src/pgp.c	Sun Jul  5 03:47:06 1998
@@ -65,6 +65,8 @@
   char buf[STRING], address[STRING], *c, **keys=0, *pc, userpart[STRING];
   int i=0, keys_len=0, keys_max=0, return_val=0, start=0;
   FILE *p;
+  pid_t pid;
+  int status;
 
   if (!name || !target)
     return(-1);
@@ -106,7 +108,7 @@
 
     while (*c && isspace (*c)) c++; /* move past any leading space! */
     
-    if (fork () == 0) {
+    if ( ( pid = fork () ) == 0) {
       int tmp;
       
       setgid(groupid);
@@ -160,7 +162,8 @@
 	++keys_len;
       }
     }
-    pclose(p);
+    fclose(p);
+    waitpid(pid, &status, 0);
     if (keys_len > 0 || i > 1)
       break;
     else {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->ache 
Responsible-Changed-By: hoek 
Responsible-Changed-When: Thu Jul 23 02:11:49 PDT 1998 
Responsible-Changed-Why:  
Over to maintainer. 
State-Changed-From-To: open->feedback 
State-Changed-By: steve 
State-Changed-When: Mon May 29 16:16:28 PDT 2000 
State-Changed-Why:  
Is this still true with the current version in the ports collection? 


Responsible-Changed-From-To: ache->freebsd-ports 
Responsible-Changed-By: steve 
Responsible-Changed-When: Mon May 29 16:16:28 PDT 2000 
Responsible-Changed-Why:  
Andrey no longer maintains this port. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=7167 
State-Changed-From-To: feedback->closed 
State-Changed-By: steve 
State-Changed-When: Mon May 29 19:20:18 PDT 2000 
State-Changed-Why:  
Since the patch no longer applies (pgp.c no longer exists) the originator 
says it is okay to close this PR.  He did leave us with a few words of 
wisdom, "Try mutt, instead".   Robert Ollivier already converted me or 
I'd do just that. :) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=7167 
>Unformatted:
