From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 14 20:53:27 2008 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6CDE1065676 for ; Sun, 14 Sep 2008 20:53:27 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.30]) by mx1.freebsd.org (Postfix) with ESMTP id 779068FC0A for ; Sun, 14 Sep 2008 20:53:27 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so537340yxb.13 for ; Sun, 14 Sep 2008 13:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=RyLoxBGcdHhPYtgJJcsZq75X9gkGAzhTg38JuTL1LFs=; b=sVDaQPRmtxWSIoSmXeaEFFDnoG8SkXHq2IrA+R6j4xKbzEI3R42QlkD8AZRovIiYxc zum5YK87ZNFS3TjaEoCYa/LpuhBWB42URZwtL4FjitZ1Z+Nw2U8LqstVCzygAFoGWv9D j+q3k9WhqHEFASIjWqi/HO9FqSGQx++/9QNI0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=SSmfCtkenTFHx6QFNNAGa6+rY41OKKVyg834awK8hosbX3skOGrpnBdOaF8qY2a+3L JdM+lG1/JEUprQHGIbmBfIfWLL03K0RBSAiPse82vUAszHABSzFyLWW+4Uz6NJss9yNa spV6gzMFKIGx8w85SjR1LJxfwqVjv1NbvARHI= Received: by 10.86.92.7 with SMTP id p7mr5267597fgb.72.1221425601430; Sun, 14 Sep 2008 13:53:21 -0700 (PDT) Received: by 10.86.62.14 with HTTP; Sun, 14 Sep 2008 13:53:21 -0700 (PDT) Message-ID: <7d6fde3d0809141353r7245b77as70f58d2609a7684c@mail.gmail.com> Date: Sun, 14 Sep 2008 13:53:21 -0700 From: "Garrett Cooper" To: freebsd-bugs@freebsd.org In-Reply-To: <7d6fde3d0809141351w5683cf0q6fabc514cdec6317@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200809120700.m8C705js006421@freefall.freebsd.org> <7d6fde3d0809120030q561ecfb0r663191fe8a95f8a7@mail.gmail.com> <7d6fde3d0809141351w5683cf0q6fabc514cdec6317@mail.gmail.com> Subject: Re: bin/125932: pkg_add(1) doesn't prompt for root credentials and then fails badly X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2008 20:53:28 -0000 On Sun, Sep 14, 2008 at 1:51 PM, Garrett Cooper wrote: > On Fri, Sep 12, 2008 at 12:30 AM, Garrett Cooper wrote: >> On Fri, Sep 12, 2008 at 12:00 AM, Garrett Cooper wrote: >>> The following reply was made to PR bin/125932; it has been noted by GNATS. >>> >>> From: "Garrett Cooper" >>> To: "Bruce Cran" >>> Cc: bug-followup@freebsd.org >>> Subject: Re: bin/125932: pkg_add(1) doesn't prompt for root credentials and then fails badly >>> Date: Thu, 11 Sep 2008 23:24:33 -0700 >>> >>> On Tue, Sep 9, 2008 at 1:23 PM, Bruce Cran wrote: >>> > On Thu, 24 Jul 2008 11:18:31 -0700 >>> > "Garrett Cooper" wrote: >>> > >>> >> On Thu, Jul 24, 2008 at 6:48 AM, Bruce Cran wrote: >>> >> >>How-To-Repeat: >>> >> > Run pkg_add -r as a non-root user. >>> >> >>Fix: >>> >> >>> >> The issue isn't the fact that you're running as non-root; it's that >>> >> someone's not checking to see whether or not a fetch init succeeded >>> >> (filehandle's open, writing's being done) before continuing. >>> >> >>> >> I'll fix this later on tonight when I get back from San Jose. >>> >> >>> > >>> > Did you make any progress with this? >>> >>> I thought I made a comment about this earlier, but apparently I didn't >>> send it out or it wasn't recorded: >>> >>> Symptom: >>> >>> The issue is caused by tar in the PUSHOUT macro in add/extract.c as >>> identified below, during the extract. If and when the tar stuff is >>> replaced with libarchive, this issue will fail sooner (and this should >>> be done because this would save a lot of time and resources when >>> extracting large packages like openoffice): >>> >>> #define PUSHOUT(todir) /* push out string */ \ >>> if (where_count > (int)sizeof(STARTSTRING)-1) { \ >>> strcat(where_args, "|/usr/bin/tar --unlink -xpPf - -C "); \ >>> strcat(where_args, todir); \ >>> if (system(where_args)) { \ /*** XXX: FAILS HERE ***/ >>> cleanup(0); \ >>> errx(2, "%s: can not invoke %ld byte tar pipeline: %s", \ >>> __func__, (long)strlen(where_args), where_args); \ >>> } \ >>> >>> Real problem: >>> >>> The actual problem is that the master and slave pkg_add processes >>> aren't communicating properly with one another, s.t. the slave >>> instances aren't breaking the master execution at the first sign of >>> failure. >>> >>> HTH, >>> -Garrett >> >> Ugh... gimme the weekend and I'll rewrite fileGetURL(..) in `lib/url.c'. >> -Garrett > > Almost done with the coding portion. I'm going to go grab some > lunch, finish that up in a few hours, test my changes a bit and if I > don't run into some major roadblocks I'll have the patch posted on > pastebin by no later than 10pm PST. > As part of the changes I'm integrating some of the new code from > Ander's SoC pkg_improved project, as he had some nice things in his > revision of lib/url.c. > Cheers, > -Garrett And yes, archive(3)'s going to be in and the crappy forking and piping of file descriptors will be out. -Garrett