Debian Bug report logs - #406799
the varying permissions of /etc/apt/trusted.gpg

version graph

Package: apt; Maintainer for apt is APT Development Team <deity@lists.debian.org>; Source for apt is src:apt (PTS, buildd, popcon).

Reported by: Joey Hess <joeyh@debian.org>

Date: Sun, 14 Jan 2007 07:33:06 UTC

Severity: normal

Found in version apt/0.6.46.4

Fixed in version 0.7.25.1

Done: David Kalnischkies <kalnischkies+debian@gmail.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, APT Development Team <deity@lists.debian.org>:
Bug#406799; Package apt. (full text, mbox, link).


Acknowledgement sent to Joey Hess <joeyh@debian.org>:
New Bug report received and forwarded. Copy sent to APT Development Team <deity@lists.debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Joey Hess <joeyh@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: the varying permissions of /etc/apt/trusted.gpg
Date: Sun, 14 Jan 2007 02:15:18 -0500
[Message part 1 (text/plain, inline)]
Package: apt
Version: 0.6.46.4
Severity: normal

Apparently a bunch of systems have a /etc/apt/trusted.gpg that's mode
644, while many others have one that's mode 600.

As best I can tell, it used to be the case that during debootstrap, 
the file was created by apt's postinst:

        if ! test -f /etc/apt/trusted.gpg; then
                cp /usr/share/apt/debian-archive.gpg /etc/apt/trusted.gpg
        fi

That cp results in the file being 644, and it's 644 on all my older
systems.

But if I debootstrap etch today, the file is instead mode 600. This is
because apt now depends on debian-archive-keyring, which does this in
its postinst:

	if [ -x /usr/bin/apt-key ]; then
		/usr/bin/apt-key update
	fi

Currently in debootstrap, apt-key exists at this point, and when it
runs on a system with no trusted.gpg, gpg defaults to mode 600.

This came to my attention, because the debian-installer package failed
to access /etc/apt/trusted.gpg when running apt as a regular user,
during its download of udebs when building d-i images. I've worked
around that, by making debian-installer use
/usr/share/keyrings/debian-archive-keyring.gpg instead. (Which I feel is
suboptimal, but oh well..)

I feel that the current situation is bad, because the mode of the file
on a newly installed system is not well defined. Using a different
method to bootstrap a Debian system can easily result in apt not yet
being installed when debian-archive-keyring is first configured, and
then the file will be installed mode 644 again.

This also seems easy enough to fix in apt: Just pick a mode (preferably
one that's a good choice for most users), and make apt-key and apt's
postinst both ensure that if the file doesn't exist, it's created with
that mode. 

(Or, if the mode you choose if 600, just remove the
abovequoted lines from apt's postinst, and remove the old obsolete
/usr/share/apt/debian-archive.gpg -- the apt-key update that follows
those lines would then result in the file always being created mode
600.)

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Reply sent to David Kalnischkies <kalnischkies+debian@gmail.com>:
You have taken responsibility. (Mon, 01 Feb 2010 22:51:12 GMT) (full text, mbox, link).


Notification sent to Joey Hess <joeyh@debian.org>:
Bug acknowledged by developer. (Mon, 01 Feb 2010 22:51:12 GMT) (full text, mbox, link).


Message #10 received at 406799-done@bugs.debian.org (full text, mbox, reply):

From: David Kalnischkies <kalnischkies+debian@gmail.com>
To: 406799-done <406799-done@bugs.debian.org>
Subject: Close: the varying permissions of /etc/apt/trusted.gpg
Date: Mon, 1 Feb 2010 23:49:41 +0100
Version: 0.7.25.1

APT version 0.7.25.1 doesn't ship his own version of the
archive keyrings any longer as indicated in the changelog:

  * share/*-archive.gpg:
    - remove the horrible outdated files. We already depend on
      the keyring so we don't need to ship our own version

So the problem reported here should be fixed and i therefore
close this bug now, but feel free to reopen it if you disagree.



Best regards / Mit freundlichen Grüßen,

David "DonKult" Kalnischkies




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 02 Mar 2010 07:45:15 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Aug 14 22:39:04 2018; Machine Name: beach

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.