20apt-esm-hook.conf is missing semicolons at end of option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Won't Fix
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Critical
|
Unassigned |
Bug Description
[Impact]
This bug caused aptdaemon to miss two configuration options that ubuntu-
Further, because aptdaemon could not parse these two options, it may result in operations triggered through aptdaemon not properly updating ubuntu advantage esm messaging. This means ubuntu-
The fix is to add the semicolons required in the apt config syntax that we missed. This fix allows aptdaemon to parse all of our config settings, and means apt and aptdaemon will have a shared understanding of the configuration again.
[Test Plan]
These test steps assume that the proposed version of ua to release is available in ppa:ua-
Start a container of an affected release (tested in xenial, but should work on any affected release). Inside the container:
```
sudo apt update
sudo apt install aptdaemon
```
Now run the following python3 script
```
from aptdaemon import config
c = config.
uataptconf = open("/
lines = uataptconf.
print(c.
uataptconf.close()
```
You should see output like the following:
```
dict_keys(
```
Note that the above only includes 2 out of the 4 intended config settings from our config file.
Now install the fixed version:
```
sudo add-apt-repository ppa:ua-
sudo apt-get update
sudo apt install ubuntu-
```
And run the above python script again. You should see output like the following:
```
dict_keys(
```
Notice that it now finds all of the intended config settings.
[Where problems could occur]
The fix is adding two semicolons to the apt config file. The only problem that could occur is that, if a mistake was made, a similar apt config parsing problem could occur. Perhaps if this caused additional config parsing problems, then our message updating hooks would be broken in a different way from this bug. This would result in lack of, or out-of-date, messaging about esm packages from ubuntu-
[Other Info]
A hotfix was already released to impish as 27.1.1 to stop the autopkgtest failures and unblock work that was interrupted by this bug. It successfully solved the issue.
[Original Description]
Recently aptdaemon started having autopkgtest failures with its tests.test_
Test if credentials of repositories are store securely in a ... ok
=======
ERROR: test_ (tests.
-------
Traceback (most recent call last):
File "/tmp/autopkgte
config[
KeyError: 'apt::install:
-------
Ran 79 tests in 109.732s
FAILED (errors=1, skipped=21)
Test failed: <unittest.
error: Test failed: <unittest.
The "APT::Install:
description: | updated |
tags: | added: update-excuse |
tags: | added: fr-1434 |
tags: | added: patch |
description: | updated |
tags: | added: regression-update |
Changed in ubuntu-advantage-tools (Ubuntu Groovy): | |
status: | New → Won't Fix |
ubuntu- advantage- tools has incorrect syntax in its apt.conf.d snippet; missing the semicolon at the end of the options for the new options introduced recently:
APT::Install: :Pre-Invoke { ubuntu- advantage/ apt-esm- hook ] || /usr/lib/ ubuntu- advantage/ apt-esm- hook pre-invoke || true";
"[ ! -f /usr/lib/
}
AptCli: :Hooks: :Upgrade { ubuntu- advantage/ apt-esm- json-hook ] || /usr/lib/ ubuntu- advantage/ apt-esm- json-hook || true";
"[ ! -f /usr/lib/
}
This causes aptdaemon's parser to stumble over it; while apt's is too badly written to notice :)