From owner-freebsd-current Fri Sep 18 23:40:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA00840 for freebsd-current-outgoing; Fri, 18 Sep 1998 23:40:30 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA00824 for ; Fri, 18 Sep 1998 23:40:25 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.1/8.9.1) id BAA25863; Sat, 19 Sep 1998 01:40:00 -0500 (CDT) Date: Sat, 19 Sep 1998 01:39:59 -0500 From: Dan Nelson To: Daniel Berlin , freebsd-current@FreeBSD.ORG Subject: Re: sigh, su Message-ID: <19980919013959.A25150@emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.94.3i In-Reply-To: ; from "Daniel Berlin" on Sat Sep 19 00:56:43 GMT 1998 X-OS: FreeBSD 2.2.7-STABLE Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Sep 19), Daniel Berlin said: > # su --help > Segmentation fault > > consistent too. > using 3.0-CURRENT. > > anyone else see this? > --Dan Yep. From what I can tell, the option-handling code in su.c needs a rewrite. It ends up setting user=NULL, then dying on a strcmp. Try the following patch (applies equally well to 2.2 or 3.0). I've also submitted a PR. -Dan Nelson dnelson@emsphone.com Index: su.c =================================================================== RCS file: /home/ncvs/src/usr.bin/su/su.c,v retrieving revision 1.14.2.9 diff -b -r1.14.2.9 su.c 137,138c137 < while(optind < argc) < if((ch = getopt(argc, argv, ARGSTR)) != -1) --- > while((ch = getopt(argc, argv, ARGSTR)) != -1) 166,167c165,166 < else < { --- > > if (optind < argc) 169,170d167 < break; < } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message