Merge ~callmepk/ubuntu-release-upgrader:ubuntu/master into ubuntu-release-upgrader:ubuntu/master

Proposed by Patrick Wu
Status: Merged
Merged at revision: 4e308d5cfd4d0acd1a677f41d51f2148fd7c883d
Proposed branch: ~callmepk/ubuntu-release-upgrader:ubuntu/master
Merge into: ubuntu-release-upgrader:ubuntu/master
Diff against target: 17 lines (+6/-0)
1 file modified
debian/91-release-upgrade (+6/-0)
Reviewer Review Type Date Requested Status
Balint Reczey Approve
Patrick Wu (community) Needs Resubmitting
Review via email: mp+384183@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Balint Reczey (rbalint) wrote :

Please fix /etc/update-motd.d/91-release-upgrade to work as a normal user rather than hacking the executable bit.

review: Needs Fixing
Revision history for this message
Patrick Wu (callmepk) wrote :

Just did the fix as requested. Accidentally added a review status, please ignore.

Revision history for this message
Balint Reczey (rbalint) wrote :

This bug is not specific to WSL. It can be observed on all Ubuntu installations when running the following command as a normal user:

$ update-motd --show-only
Welcome to Ubuntu 20.04 LTS (GNU/Linux 5.4.0-29-lowlatency x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

 * MicroK8s passes 9 million downloads. Thank you to all our contributors!

     https://microk8s.io/

15 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable

/usr/lib/ubuntu-release-upgrader/release-upgrade-motd: 31: cannot create /var/lib/ubuntu-release-upgrader/release-upgrade-available: Permission denied

Please fix it in a generic way.

Revision history for this message
Patrick Wu (callmepk) wrote :

Just update the fix as requested. Righ now I tired to skip executing when it is using a non-root user

Revision history for this message
Balint Reczey (rbalint) wrote :

Thanks.
IMO it would be better to show the information when it is present cached, but most likely the cache would be absent on WSL anyway.

Please squash the commits to clean the history, then it will be OK.

Revision history for this message
Balint Reczey (rbalint) :
review: Needs Fixing
Revision history for this message
Patrick Wu (callmepk) wrote :

Thanks!
I have squashed the commits

Revision history for this message
Balint Reczey (rbalint) wrote :

@callmepkg would you like update that commit message, too?

Revision history for this message
Patrick Wu (callmepk) wrote :

Thanks and updated

Revision history for this message
Balint Reczey (rbalint) :
review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

$EUID is not set in dash, which is what provides /bin/sh in Ubuntu, so this ended up causing an autopkgtest failure for update-motd as 91-release-upgrades uses /bin/sh. I've sorted this out now but thought it was worth mentioning.

Revision history for this message
Patrick Wu (callmepk) wrote :

Hi Brian Murray,

Thanks for the information, and thank you for solving the issue. This also had the same issue in the backported version to focal, could you help me on that? Thanks and sorry for the hassle

Revision history for this message
Brian Murray (brian-murray) wrote :

There is a new version in the -proposed repository for focal which could use verification. Please see the relevant bug report for details.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/91-release-upgrade b/debian/91-release-upgrade
2index f00f489..95fe2ae 100755
3--- a/debian/91-release-upgrade
4+++ b/debian/91-release-upgrade
5@@ -4,6 +4,12 @@
6 if [ "$(lsb_release -sd | cut -d' ' -f4)" = "(development" ]; then
7 exit 0
8 fi
9+
10+# if it is non-root user, skip
11+if [ "$EUID" -ne 0 ]; then
12+ exit 0
13+fi
14+
15 if [ -x /usr/lib/ubuntu-release-upgrader/release-upgrade-motd ]; then
16 exec /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
17 fi

Subscribers

People subscribed via source and target branches