autodownload check in get_update_automation_level doesn't check hard enough

Bug #1630731 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

The function get_automation_level tries to see if updates will be installed automatically, however the check is really incomplete.

143 def get_update_automation_level(self):
144 """ Parse the apt cron configuration. Try to fit a predefined use case
145 and return it. Special case: if the user made a custom
146 configurtation, that we cannot represent it will return None """
147 if apt_pkg.config.find_i(softwareproperties.CONF_MAP["autoupdate"]) > 0:
148 # Autodownload
149 if apt_pkg.config.find_i(softwareproperties.CONF_MAP["unattended"]) == 1\
150 and os.path.exists("/usr/bin/unattended-upgrade"):
151 return softwareproperties.UPDATE_INST_SEC
152 elif apt_pkg.config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 1 and \
153 apt_pkg.config.find_i(softwareproperties.CONF_MAP["unattended"]) == 0:
154 return softwareproperties.UPDATE_DOWNLOAD
155 elif apt_pkg.config.find_i(softwareproperties.CONF_MAP["unattended"]) == 0 and \
156 apt_pkg.config.find_i(softwareproperties.CONF_MAP["autodownload"]) == 0:
157 return softwareproperties.UPDATE_NOTIFY
158 else:
159 return None

unattended maps to "APT::Periodic::Unattended-Upgrade" (see softwareproperties/__init__.py.

However, /etc/apt/apt.conf.d/50unattended-upgrades could contain Unattended-Upgrade and not allow any origins e.g.:

  1 // Automatically upgrade packages from these (origin:archive) pairs
  2 Unattended-Upgrade::Allowed-Origins {
  3 // "${distro_id}:${distro_codename}-security";
  4 // "${distro_id}:${distro_codename}-updates";
  5 // "${distro_id}:${distro_codename}-proposed";
  6 // "${distro_id}:${distro_codename}-backports";
  7 };

The check really should dig deeper in Unattended-Upgrade.

Tags: xenial yakkety
Changed in software-properties (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
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.