[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#813786: apt: Warning "Can't drop privileges" when running "apt-get source" as root



Control: forcemerge 812511 -1

On Fri, Feb 05, 2016 at 10:39:43AM +0100, Raphaël Hertzog wrote:
> Package: apt
> Version: 1.2.1
> Severity: normal
> 
> Simple to reproduce:
> 
> $ LANG=C sudo apt-get source debian-installer
> [sudo] password for rhertzog: 
> Reading package lists... Done
> Building dependency tree        
> Reading state information... Done
> NOTICE: 'debian-installer' packaging is maintained in the 'Git' version control system at:
> git://git.debian.org/d-i/debian-installer.git
> Please use:
> git clone git://git.debian.org/d-i/debian-installer.git
> to retrieve the latest (possibly unreleased) updates to the package.
> Need to get 1 373 kB of source archives.
> Get:1 http://nas/debian unstable/main debian-installer 20160106 (dsc) [3 434 B]
> Get:2 http://nas/debian unstable/main debian-installer 20160106 (tar) [1 370 kB]
> Fetched 1 373 kB in 0s (26,2 MB/s)          
> dpkg-source: info: extracting debian-installer in debian-installer-20160106
> dpkg-source: info: unpacking debian-installer_20160106.tar.gz
> W: Can't drop privileges for downloading as file 'debian-installer_20160106.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

Yeah, isn't that great?

I don't get why there are bug reports about that. If you fetch in a directory
_apt cannot write to, it will run the fetchers as root instead of _apt so you
can do whatever foolish (no root needed here) task you are trying to do.

We could also just make it an error and say: This command does not work as
root, but that won't make people happy either.

While we might want to solve this at some point, this is no huge deal, and
would require a huge amount of work to fix.

> 
> $ ls -ald debian-installer*
> drwxr-xr-x 5 root root    4096 janv.  1 16:27 debian-installer-20160106
> -rw-r--r-- 1 root root    3434 janv.  6 06:12 debian-installer_20160106.dsc
> -rw-r--r-- 1 root root 1370014 janv.  6 06:12 debian-installer_20160106.tar.gz
> 
> There's no such error when you run apt-get source as a normal user (which
> is the usual case).
> 

Of course not. If you are not root than we setuid and friends won't
work anyway, so we don't even try.


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.

When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to (`inline'). Thank you.


Reply to: