From owner-freebsd-ports Thu Feb 21 4:20:27 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 36AD837B405 for ; Thu, 21 Feb 2002 04:20:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1LCK1G88624; Thu, 21 Feb 2002 04:20:01 -0800 (PST) (envelope-from gnats) Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id 38A5C37B404 for ; Thu, 21 Feb 2002 04:11:36 -0800 (PST) Received: from albatross.mcc.ac.uk ([130.88.202.16]) by probity.mcc.ac.uk with esmtp (Exim 2.05 #7) id 16ds4O-000H7p-00 for FreeBSD-gnats-submit@freebsd.org; Thu, 21 Feb 2002 12:11:28 +0000 Received: (from ip@localhost) by albatross.mcc.ac.uk (8.11.6/8.11.6) id g1LCBRa44020; Thu, 21 Feb 2002 12:11:27 GMT (envelope-from ip) Message-Id: <200202211211.g1LCBRa44020@albatross.mcc.ac.uk> Date: Thu, 21 Feb 2002 12:11:27 GMT From: Ian Pallfreeman Reply-To: Ian Pallfreeman To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/35179: elm-2.5.5_1: bounce command doesn't work Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35179 >Category: ports >Synopsis: elm-2.5.5_1: bounce command doesn't work >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 21 04:20:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Ian Pallfreeman >Release: FreeBSD 4.5-STABLE i386 >Organization: Manchester University, UK. >Environment: dark & chilly System: FreeBSD albatross 4.5-STABLE FreeBSD 4.5-STABLE #4: Thu Feb 7 15:23:11 GMT 2002 ip@karma:/usr/src/sys/compile/ALBATROSS i386 >Description: Using the 'b' (bounce) command, to remail a message, doesn't work in elm2.5. This appears to be a consequence of: kris 2001/07/23 20:01:26 PDT Modified files: mail/elm Makefile Added files: mail/elm/files patch-mkstemp Log: Fix insecure temporary file handling. Obtained from: RedHat Revision Changes Path 1.64 +2 -1 ports/mail/elm/Makefile which ends up passing garbage to system(). The mail isn't sent, nor is it deleted from /tmp. >How-To-Repeat: Try bouncing a message from elm... >Fix: --- reply.c.ports Thu Feb 21 12:06:09 2002 +++ reply.c Thu Feb 21 12:07:36 2002 @@ -571,12 +571,12 @@ FILE *mailfd; char entered[VERY_LONG_STRING], expanded[VERY_LONG_STRING]; - char *filename, buffer[VERY_LONG_STRING], *msg; + char buffer[VERY_LONG_STRING], *msg; int err,tmpfd; char tempfilename[255],*tmpdir; - filename = NULL; entered[0] = '\0'; + tempfilename[0] = '\0'; if (!get_to(entered, expanded, SM_ORIGINAL)) return FALSE; @@ -608,29 +608,24 @@ } if ((mailfd = fdopen(tmpfd, "w")) == NULL) goto failed; - (void) elm_chown(filename, userid, groupid); + (void) elm_chown(tempfilename, userid, groupid); #ifdef MMDF if (strcmp(submitmail, mailer) == 0) do_mmdf_addresses(mailfd, expanded); #endif /* MMDF */ copy_message(mailfd, curr_folder.curr_mssg, CM_REMOTE|CM_MMDF_HEAD|CM_REMAIL); - if (file_close(mailfd, filename) < 0) + if (file_close(mailfd, tempfilename) < 0) goto failed; - build_mailer_command(buffer, filename, + build_mailer_command(buffer, tempfilename, expanded, (char *)NULL, (char *)NULL); PutLine0(LINES, 0, catgets(elm_msg_cat, ElmSet, ElmResendingMail, "Resending mail...")); (void) system_call(buffer, 0); set_error(catgets(elm_msg_cat, ElmSet, ElmMailResent, "Mail resent.")); - free((malloc_t)filename); return TRUE; - failed: - if (filename != NULL) { - (void) unlink(filename); - free((malloc_t)filename); - } + (void) unlink(tempfilename); return TRUE; } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message