From owner-freebsd-bugs@FreeBSD.ORG Fri Sep 12 07:30:55 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 5CCEE106564A for ; Fri, 12 Sep 2008 07:30:55 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-gx0-f17.google.com (mail-gx0-f17.google.com [209.85.217.17]) by mx1.freebsd.org (Postfix) with ESMTP id E999C8FC0A for ; Fri, 12 Sep 2008 07:30:54 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by gxk10 with SMTP id 10so18207335gxk.19 for ; Fri, 12 Sep 2008 00:30:54 -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=8u4BORe4hZUteCVWn31utdZY/f/UJY4r7wSl0LnHbsk=; b=SYgscY/6PuE8Lo/frDtAeg5rqXNIM8kwlOZxVkUCUmVOdQLC3HEC0ktlDI6ACTm+fP 43uzRCvTNhKsgtX/ZSUhbrdYPNY9F1O12jOCvY0u5HCD5QyWKRbs3y9RXFlPsZBcq5Ut kk0UJe0X6E2bXz8UV07nmwJjPlA5n96Z2/r+g= 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=Nf7F4Wj8KanVW98uAteTC+gREUaPdi5Nt+fIk7ahDbfu9SlKYcSEHUHIXBqODnP+lX /G2YEzXaNJjR+RWW53vJ0tjqCDn20mjwCU1br2G7ZKQ7iaw1d1UEqJIkFAMQcL+xjRTz chnz4uhbPM5Nf7s68zJaxokv/6iVqr2H/BjEk= Received: by 10.86.98.10 with SMTP id v10mr2881387fgb.46.1221204653519; Fri, 12 Sep 2008 00:30:53 -0700 (PDT) Received: by 10.86.62.14 with HTTP; Fri, 12 Sep 2008 00:30:53 -0700 (PDT) Message-ID: <7d6fde3d0809120030q561ecfb0r663191fe8a95f8a7@mail.gmail.com> Date: Fri, 12 Sep 2008 00:30:53 -0700 From: "Garrett Cooper" To: freebsd-bugs@freebsd.org In-Reply-To: <200809120700.m8C705js006421@freefall.freebsd.org> 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> 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: Fri, 12 Sep 2008 07:30:55 -0000 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