The pre-update hook systemd services fail when not executed by the root user
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned | ||
Lunar |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Although calls to apt update are always executed as root from the command line, in some scenarios a user may call 'update' on a Cache as a non-root user. Even being a corner case, some test suites for python-apt did run into this problem, for instance.
For what we need (esm-caches and apt-news), only the root calls should be enough.
Being defensive here avoids errors in undesired scenarios.
[Test Case]
There is an automated test script (with a python snippet) under sru/release-
[Regression Potential]
No visible regression potential, as the check for root user will just ensure default behavior in all use cases. The change is only making the code more defensive, and will not cause impact in any other package by skipping the u-a-t updates.
Related branches
- Andreas Hasenack: Approve
-
Diff: 396 lines (+179/-22)14 files modifiedapt-hook/20apt-esm-hook.conf (+1/-1)
debian/changelog (+11/-0)
debian/ubuntu-advantage-tools.postinst (+17/-0)
debian/ubuntu-advantage-tools.postrm (+9/-0)
debian/ubuntu-advantage-tools.preinst (+54/-0)
features/attached_enable.feature (+0/-1)
features/fix.feature (+5/-5)
features/steps/machines.py (+2/-1)
features/steps/output.py (+10/-10)
features/ubuntu_pro.feature (+1/-1)
features/ubuntu_upgrade_unattached.feature (+2/-2)
sru/release-27.13.2/python-apt-snippet.py (+5/-0)
sru/release-27.13.2/test-apt-hook-nonroot.sh (+61/-0)
uaclient/version.py (+1/-1)
description: | updated |
Hello Renan, or anyone else affected,
Accepted ubuntu- advantage- tools into kinetic-proposed. The package will build now and be available at https:/ /launchpad. net/ubuntu/ +source/ ubuntu- advantage- tools/27. 13.2~22. 10.1 in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See https:/ /wiki.ubuntu. com/Testing/ EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification- needed- kinetic to verification- done-kinetic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification- failed- kinetic. In either case, without details of your testing we will not be able to proceed.
Further information regarding the verification process can be found at https:/ /wiki.ubuntu. com/QATeam/ PerformingSRUVe rification . Thank you in advance for helping!
N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.