[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

Debian Bug report logs - #970440
apt-get update could show that not running as root when it fails

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: Jonny Grant <jg@jguk.org>

Date: Wed, 16 Sep 2020 12:09:02 UTC

Severity: normal

Found in version 2.0.2ubuntu0.1

Reply or subscribe to this bug.

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#970440; Package apt. (Wed, 16 Sep 2020 12:09:04 GMT) (full text, mbox, link).


Acknowledgement sent to Jonny Grant <jg@jguk.org>:
New Bug report received and forwarded. Copy sent to APT Development Team <deity@lists.debian.org>. (Wed, 16 Sep 2020 12:09:04 GMT) (full text, mbox, link).


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

From: Jonny Grant <jg@jguk.org>
To: submit@bugs.debian.org
Subject: apt-get update could show that not running as root when it fails
Date: Wed, 16 Sep 2020 13:05:06 +0100
Package: apt
Version: 2.0.2ubuntu0.1 

Current output:

$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)


Expected output:

$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock not running as root - open Permission denied
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)


it's easy enough to check uid is 0 by calling getuid()

There's no real reason to show the errno value 13, we don't all know these by heart. you could put EPERM if you wish to use the macro name



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Dec 5 03:42:37 2024; Machine Name: bembo

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.