The pre-update hook systemd services fail when not executed by the root user

Bug #2004057 reported by Renan Rodrigo
8
This bug affects 1 person
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-27.13.2/ to make sure this is covered.

[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

description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

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/PerformingSRUVerification . 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.

Changed in ubuntu-advantage-tools (Ubuntu Kinetic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-kinetic
Changed in ubuntu-advantage-tools (Ubuntu Jammy):
status: New → Fix Committed
tags: added: verification-needed-jammy
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Renan, or anyone else affected,

Accepted ubuntu-advantage-tools into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.13.2~22.04.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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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/PerformingSRUVerification . 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.

Changed in ubuntu-advantage-tools (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Renan, or anyone else affected,

Accepted ubuntu-advantage-tools into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.13.2~20.04.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-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. 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/PerformingSRUVerification . 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.

Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Renan, or anyone else affected,

Accepted ubuntu-advantage-tools into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.13.2~18.04.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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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/PerformingSRUVerification . 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.

Changed in ubuntu-advantage-tools (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed-bionic
Changed in ubuntu-advantage-tools (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Steve Langasek (vorlon) wrote :

Hello Renan, or anyone else affected,

Accepted ubuntu-advantage-tools into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-advantage-tools/27.13.2~16.04.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-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. 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/PerformingSRUVerification . 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.

Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

I have executed the test script in the sru/ folder to make sure this works. The results are attached.

I am marking verification-done for all pending releases.

tags: added: verification-done verification-done-bionic verification-done-focal verification-done-jammy verification-done-kinetic verification-done-xenial
removed: verification-needed verification-needed-bionic verification-needed-focal verification-needed-jammy verification-needed-kinetic verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~22.10.1

---------------
ubuntu-advantage-tools (27.13.2~22.10.1) kinetic; urgency=medium

  * Backport new upstream release: (LP: #2003977) to kinetic

ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 20:14:16 -0300

Changed in ubuntu-advantage-tools (Ubuntu Kinetic):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for ubuntu-advantage-tools has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~22.04.1

---------------
ubuntu-advantage-tools (27.13.2~22.04.1) jammy; urgency=medium

  * Backport new upstream release: (LP: #2003977) to jammy

ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 20:14:10 -0300

Changed in ubuntu-advantage-tools (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~20.04.1

---------------
ubuntu-advantage-tools (27.13.2~20.04.1) focal; urgency=medium

  * Backport new upstream release: (LP: #2003977) to focal

ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 20:14:06 -0300

Changed in ubuntu-advantage-tools (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~18.04.1

---------------
ubuntu-advantage-tools (27.13.2~18.04.1) bionic; urgency=medium

  * Backport new upstream release: (LP: #2003977) to bionic

ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 20:13:59 -0300

Changed in ubuntu-advantage-tools (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~16.04.1

---------------
ubuntu-advantage-tools (27.13.2~16.04.1) xenial; urgency=medium

  * Backport new upstream release: (LP: #2003977) to xenial

ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 20:13:50 -0300

Changed in ubuntu-advantage-tools (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-advantage-tools - 27.13.2~23.04.1

---------------
ubuntu-advantage-tools (27.13.2~23.04.1) lunar; urgency=medium

  * d/ubuntu-advantage-tools.{postinst,postrm,preinst}:
    - avoid a dpkg conf prompt if the only change to the original config file
      was to the apt_news flag (LP: #2003977)
  * apt-hook:
    - only run the pro client pre-update hook services when the apt update is
      executed as root user (LP: #2004057)

 -- Renan Rodrigo <email address hidden> Fri, 27 Jan 2023 18:46:42 -0300

Changed in ubuntu-advantage-tools (Ubuntu Lunar):
status: New → Fix Released
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.