From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jul 15 14:20:14 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C628A16A4CF for ; Thu, 15 Jul 2004 14:20:14 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABE2043D31 for ; Thu, 15 Jul 2004 14:20:14 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i6FEKEbF059457 for ; Thu, 15 Jul 2004 14:20:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6FEKExO059456; Thu, 15 Jul 2004 14:20:14 GMT (envelope-from gnats) Resent-Date: Thu, 15 Jul 2004 14:20:14 GMT Resent-Message-Id: <200407151420.i6FEKExO059456@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Xin LI Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6575316A4CE for ; Thu, 15 Jul 2004 14:14:10 +0000 (GMT) Received: from mail.FreeBSD.org.cn (dns3.freebsd.org.cn [61.129.66.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9631843D49 for ; Thu, 15 Jul 2004 14:14:07 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: (qmail 9280 invoked by uid 0); 15 Jul 2004 14:12:22 -0000 Received: from unknown (HELO beastie.frontfree.net) (218.107.145.7) by mail.FreeBSD.org.cn with AES256-SHA encrypted SMTP; 15 Jul 2004 14:12:22 -0000 Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 3702111B5E; Thu, 15 Jul 2004 22:13:58 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00902-08; Thu, 15 Jul 2004 22:13:57 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 816D511B22; Thu, 15 Jul 2004 22:13:56 +0800 (CST) Message-Id: <20040715141356.816D511B22@beastie.frontfree.net> Date: Thu, 15 Jul 2004 22:13:56 +0800 (CST) From: Xin LI To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: j@pureftpd.org Subject: ports/69098: [PATCH] pure-ftpd 1.0.19: Correct coredump on FreeBSD X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Xin LI List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jul 2004 14:20:14 -0000 >Number: 69098 >Category: ports >Synopsis: [PATCH] pure-ftpd 1.0.19: Correct coredump on FreeBSD >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 15 14:20:14 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Xin LI >Release: FreeBSD 5.2-delphij i386 >Organization: The FreeBSD Simplified Chinese Project >Environment: System: FreeBSD beastie.frontfree.net 5.2-delphij FreeBSD 5.2-delphij #80: Thu Jun 24 17:30:33 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 >Description: pure-pw no longer work when updated to pure-ftpd 1.0.19 due to a change of bsd-getopt-long.c >How-To-Repeat: pure-pw useradd test -f test.db -u 500 -g 500 -d /var/tmp And we will get a SIGV and a core >Fix: This is a hack which essentially backed out OpenBSD src/lib/libc/stdlib/getopt_long.c,v 1.15 carried in source distribution. Tested on FreeBSD 4.9 --- patch-pure-ftpd begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/ftp/pure-ftpd/Makefile,v retrieving revision 1.46 diff -u -r1.46 Makefile --- Makefile 25 Jun 2004 11:22:19 -0000 1.46 +++ Makefile 15 Jul 2004 14:09:49 -0000 @@ -7,6 +7,7 @@ PORTNAME= pure-ftpd PORTVERSION= 1.0.19 +PORTREVISION= 1 CATEGORIES= ftp ipv6 MASTER_SITES= ftp://ftp.pureftpd.org/pub/pure-ftpd/releases/ \ ftp://ftp2.fr.pureftpd.org/pub/mirrors/ftp.fr.pureftpd.org/pub/pure-ftpd/releases/ \ Index: files/patch-src_bsd-getopt_long.c =================================================================== RCS file: /home/ncvs/ports/ftp/pure-ftpd/files/patch-src_bsd-getopt_long.c,v retrieving revision 1.1 diff -u -r1.1 patch-src_bsd-getopt_long.c --- files/patch-src_bsd-getopt_long.c 25 Jun 2004 11:22:19 -0000 1.1 +++ files/patch-src_bsd-getopt_long.c 15 Jul 2004 14:09:49 -0000 @@ -1,11 +1,21 @@ ---- src/bsd-getopt_long.c.orig Sun Jun 20 19:29:34 2004 -+++ src/bsd-getopt_long.c Tue Jun 22 15:21:09 2004 -@@ -472,6 +472,8 @@ - *nargv[pure_optind + 1] != '-') { - pure_optarg = nargv[++pure_optind]; - } +--- src/bsd-getopt_long.c.orig Mon Jun 21 01:29:56 2004 ++++ src/bsd-getopt_long.c Thu Jul 15 22:03:34 2004 +@@ -462,16 +462,8 @@ + fprintf(stderr, recargchar, optchar); + pure_optopt = optchar; + return BADARG; +- } else if (!(flags & FLAG_PERMUTE)) { +- /* +- * If permutation is disabled, we can accept an +- * optional arg separated by whitespace so long +- * as it does not start with a dash (-). +- */ +- if (pure_optind + 1 < nargc && pure_optind + 1 > 0 && +- *nargv[pure_optind + 1] != '-') { +- pure_optarg = nargv[++pure_optind]; +- } + } else { -+ pure_optarg = nargv[pure_optind]; ++ pure_optarg = nargv[++pure_optind]; } } pure_place = EMSG; --- patch-pure-ftpd ends here --- >Release-Note: >Audit-Trail: >Unformatted: