SystemError: E:Opening /etc/apt/sources.list.d/private-ppa.launchpad.<something>list - ifstream::ifstream (13: Permission denied)

Bug #746625 reported by Natalia Bidart
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: python-apt

When creating a Cache instance with:

cache = apt.Cache()

if any of the sources file is not readable by the current user, we get this trace:

   cache = apt.Cache()
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 88, in __init__
    self.open(progress)
  File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 130, in open
    self._list.read_main_list()
SystemError: E:Opening /etc/apt/sources.list.d/private-ppa.launchpad_<something>.list - ifstream::ifstream (13: Permission denied)

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: python-apt 0.7.100.2ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-7.39-generic 2.6.38
Uname: Linux 2.6.38-7-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Thu Mar 31 15:09:10 2011
ProcEnviron:
 LANGUAGE=en_US:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: python-apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Natalia Bidart (nataliabidart) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

There's nothing we can do here. APT needs read access to all sources.list, configuration, and preferences files. Marking a sources.list file as unreadable is not supported, and useless, as the cache and /var/lib/apt/lists/ will contain the data from the repository anyway.

Changed in python-apt (Ubuntu):
status: New → Invalid
Revision history for this message
Michael Terry (mterry) wrote :

Can this be reconsidered or at least re-assigned? It's very easy to get into this situation:

1) Install a for-purchase app in Software Center
2) Software Center installs a sources.list.d file with -rw-r----- (root, admin) privileges
3) Now any user not in the admin group will hit this crash

Revision history for this message
Julian Andres Klode (juliank) wrote :

I don't see how this can be fixed and I do not want to fix it, but I am reassigning it to APT, if that makes you happy.

affects: python-apt (Ubuntu) → apt (Ubuntu)
Changed in apt (Ubuntu):
status: Invalid → New
Revision history for this message
David Kalnischkies (donkult) wrote :

And i don't know what APT should make different here. I mean, we can't read the file, so we can't know all sources, so the Cache will be incomplete, so the solution will be incomplete - if we found any. But most likely we will "just" miss important security updates or alike.

So, if we have such a problem, why we shouldn't be allowed to error out instead of pretending that everything is okay?

That setting a sources.list(.d) file as non-readable isn't very useful said already Julian, so you might better of asking the program(s) which created these files to stop making them non-readable…

Sidenote: If it's non-readable because a password is written in it directly they should having a look at https certificates or the netrc-like config file for user-credentials instead…

Changed in apt (Ubuntu):
status: New → Invalid
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

I reported the equivalent bug for Ubuntu Software Center as bug 852003.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.