bin/125932: pkg_add(1) doesn't prompt for root credentials and then fails badly

Garrett Cooper yanefbsd at gmail.com
Mon Jul 28 16:49:19 UTC 2008


On Jul 24, 2008, at 11:20 AM, Garrett Cooper wrote:

> The following reply was made to PR bin/125932; it has been noted by  
> GNATS.
>
> From: "Garrett Cooper" <yanefbsd at gmail.com>
> To: "Bruce Cran" <bruce at cran.org.uk>
> Cc: freebsd-gnats-submit at freebsd.org
> Subject: Re: bin/125932: pkg_add(1) doesn't prompt for root  
> credentials and then fails badly
> Date: Thu, 24 Jul 2008 11:18:31 -0700
>
> On Thu, Jul 24, 2008 at 6:48 AM, Bruce Cran <bruce at cran.org.uk> wrote:
>>
>>> Number:         125932
>>> Category:       bin
>>> Synopsis:       pkg_add(1) doesn't prompt for root credentials and  
>>> then fails badly
>>> Confidential:   no
>>> Severity:       non-critical
>>> Priority:       low
>>> Responsible:    freebsd-bugs
>>> State:          open
>>> Quarter:
>>> Keywords:
>>> Date-Required:
>>> Class:          sw-bug
>>> Submitter-Id:   current-users
>>> Arrival-Date:   Thu Jul 24 13:50:06 UTC 2008
>>> Closed-Date:
>>> Last-Modified:
>>> Originator:     Bruce Cran
>>> Release:        7.0
>>> Organization:
>>> Environment:
>> FreeBSD bsdbox01 7.0-RELEASE FreeBSD 7.0-RELEASE #1: Thu Feb 28  
>> 16:53:28 GMT 2008     bruccran at bsdbox01:/usr/obj/usr/src/sys/ 
>> MYKERNEL  i386
>>> Description:
>> Running pkg_add as a normal user fails. It should check if it's  
>> being run under root credentials and if not either abort or prompt  
>> for the root password.  The following errors are currently displayed:
>>
>>> pkg_add -r gkrellm
>> Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/gkrellm.tbz 
>> ... Done.
>> man/man8/gkrellmd.8.gz: Can't create 'man/man8/gkrellmd.8.gz':  
>> Permission denied
>> include/gkrellm2/gkrellmd.h: Failed to create dir 'include/ 
>> gkrellm2': No such file or directoryCan't create 'include/gkrellm2/ 
>> gkrellmd.h': No such file or directory
>> libdata/pkgconfig/gkrellmd.pc: Can't create 'libdata/pkgconfig/ 
>> gkrellmd.pc': Permission denied
>> sbin/gkrellmd: Can't create 'sbin/gkrellmd': Permission denied
>> tar: Error exit delayed from previous errors.
>> pkg_add: extract_plist: can not invoke 156 byte tar pipeline: /usr/ 
>> bin/tar cf - man/man8/gkrellmd.8.gz include/gkrellm2/gkrellmd.h  
>> libdata/pkgconfig/gkrellmd.pc sbin/gkrellmd|/usr/bin/tar --unlink - 
>> xpPf - -C /usr/local
>>
>>> 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.
>
> Cheers,
> -Garrett

For what it's worth, it appears that the SVN head version of pkg_add  
isn't afflicted by the same issue as the RELENG_7 copy.

My hunch is that the above errors that you're seeing are due to a call  
to tar, so until libarchive is integrated into pkg_install, those  
errors will persist.

-Garrett


More information about the freebsd-bugs mailing list