oneconf crashes if one apt list file is unreadable
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | oneconf (Ubuntu) |
High
|
Unassigned | ||
| | python-apt (Ubuntu) |
High
|
Unassigned | ||
Bug Description
oneconf-service will crash if one of the files in `/etc/apt/
In my case this is the error message
Traceback (most recent call last):
File "/usr/lib/
newpkg_list = self.distro.
File "/usr/lib/
with apt.Cache() as apt_cache:
File "/usr/lib/
File "/usr/lib/
SystemError: E:Opening /etc/apt/
| affects: | oneconf (Ubuntu) → python-apt (Ubuntu) |
| Changed in python-apt (Ubuntu): | |
| status: | New → Triaged |
| importance: | Undecided → High |
| Sebastien Bacher (seb128) wrote : | #1 |
| Julian Andres Klode (juliank) wrote : | #2 |
This is not a bug. First of all, it's not a bug in python-apt because we use APT to parse. Secondly, we have no intention of ignoring unreadable sources.list files as that would present an inconsistent view of the available sources.
| Changed in python-apt (Ubuntu): | |
| status: | Triaged → Invalid |
| Sebastien Bacher (seb128) wrote : | #3 |
The Debian maintainer marked that as wontfix for apt, that should be handled by the client
"Unreadable sources.list files are an unsupported mode of operation
and will not be supported in neither APT nor python-apt (which
directly calls the functions from APT).
Authentication data should not be stored in sources.list files,
but in a netrc file. Using that, there's no need for unreadable
sources.list files.
If you cannot read a sources.list file, the state would be
inconsistent."
| Changed in python-apt (Ubuntu): | |
| status: | Invalid → Won't Fix |
| Changed in oneconf (Ubuntu): | |
| importance: | Undecided → High |
| status: | New → Confirmed |
| Gioele Barabucci (gioele) wrote : | #4 |
It may not be a bug in python-apt, but it is a bug nevertheless. If unreadable files are not supported, the applications should ignore them or complain about them, not crash and raise an apport dialog every hour.
Please note that it is very easy to generate files in `sources.list.d` that are not readable by normal users. Just use `sudo apt-add-repository` and a 077 umask.
| Sebastien Bacher (seb128) wrote : | #5 |
you mean 770 umask? 077 is world readable...
| Gioele Barabucci (gioele) wrote : | #6 |
I mean `umask 077`. With umask 077 the default file permissions are 600.
With umask 077 a file created by root via sudo will be unreadable for a normal user.


That seems to still be an issue, sent to debian, https:/ /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 800500