2023-04-08 18:46:47 |
caleb collins-parks |
bug |
|
|
added bug |
2023-04-22 13:09:02 |
Jamie Strandboge |
ufw: status |
New |
Triaged |
|
2023-04-22 13:09:41 |
Jamie Strandboge |
ufw: importance |
Undecided |
High |
|
2023-05-01 21:05:45 |
Jamie Strandboge |
ufw: status |
Triaged |
Fix Committed |
|
2023-05-01 21:05:50 |
Jamie Strandboge |
ufw: assignee |
|
Jamie Strandboge (jdstrand) |
|
2023-05-18 14:04:31 |
Jamie Strandboge |
ufw: status |
Fix Committed |
Fix Released |
|
2023-05-18 16:00:41 |
Jamie Strandboge |
bug task added |
|
ufw (Ubuntu) |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
nominated for series |
|
Ubuntu Mantic |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
bug task added |
|
ufw (Ubuntu Mantic) |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
nominated for series |
|
Ubuntu Focal |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
bug task added |
|
ufw (Ubuntu Focal) |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
nominated for series |
|
Ubuntu Jammy |
|
2023-05-18 16:00:56 |
Jamie Strandboge |
bug task added |
|
ufw (Ubuntu Jammy) |
|
2023-05-18 16:01:04 |
Jamie Strandboge |
ufw (Ubuntu Mantic): status |
New |
Triaged |
|
2023-05-18 16:01:07 |
Jamie Strandboge |
ufw (Ubuntu Jammy): status |
New |
Triaged |
|
2023-05-18 16:01:10 |
Jamie Strandboge |
ufw (Ubuntu Focal): status |
New |
Triaged |
|
2023-05-18 16:01:16 |
Jamie Strandboge |
ufw (Ubuntu Mantic): importance |
Undecided |
High |
|
2023-05-18 16:01:18 |
Jamie Strandboge |
ufw (Ubuntu Jammy): importance |
Undecided |
High |
|
2023-05-18 16:01:20 |
Jamie Strandboge |
ufw (Ubuntu Focal): importance |
Undecided |
High |
|
2023-05-19 07:48:36 |
Launchpad Janitor |
ufw (Ubuntu Mantic): status |
Triaged |
Fix Released |
|
2023-07-17 14:29:46 |
Jamie Strandboge |
description |
When I enable systemd in WSL2 (it became supported recently), install ufw, and run sudo ufw enable, I get the error detailed in https://superuser.com/questions/1775776/enabling-ufw-failed-with-ubuntu-from-wsl2. You may already be aware of this error, I'm not sure if "NotTheDr01ds" has talked to you about this yet. Note that the WSL2 /proc/[pid]/stat format, although weird, does comply with the spec: https://man7.org/linux/man-pages/man5/proc.5.html
I verified that you can fix this issue by replacing the first split in line 427 with rsplit(')', 1) so it splits based on the last parenthesis instead of the all parenthesis.
Before:
ppid = open(name).readlines()[0].split(')')[1].split()[1]
After:
ppid = open(name).readlines()[0].rsplit(')',1)[1].split()[1]
C:\Users\caleb>wsl --version
WSL version: 1.1.6.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2728
➜ ufw git:(master) ufw --version
ufw 0.36
Copyright 2008-2015 Canonical Ltd.
➜ ufw git:(master) cat /proc/229/stat | cut -c -23
229 (Relay(230)) S 228 |
[ Impact ]
Currently, ufw is unusable on WSL due to this bug because the get_ppid() function traces back on /proc when the command name has parentheses (like in WSL). get_ppid() is called with 'ufw enable' and so ufw is not able to be enabled on WSL. The upstream patch adjusts get_ppid() for this and adds unit tests for this function.
[ Test Plan ]
Call 'sudo ufw enable' (it should not trace back) and call 'sudo ufw status' to show that it was enabled. Importantly, this is called as part of autopkgtests already.
Furthermore, look in the build logs for:
test_util
...
test_get_ppid (tests.unit.test_util.UtilTestCase)
Test get_ppid() ... ok
test_get_ppid_no_space (tests.unit.test_util.UtilTestCase)
Test get_ppid() no space ... ok
test_get_ppid_with_parens (tests.unit.test_util.UtilTestCase)
Test get_ppid() with parens ... ok
test_get_ppid_with_space (tests.unit.test_util.UtilTestCase)
Test get_ppid() with space ... ok
...
----------------------------------------------------------------------
Ran 49 tests in 0.355s
OK
[ Where problems could occur ]
The risk of regression is considered low since comprehensive unit tests are added for the patched function. Not only is this change in upstream ufw 0.36.2, it is already in Debian Bookworm and Ubuntu Mantic as part of 0.36.2-1.
# Original Description
When I enable systemd in WSL2 (it became supported recently), install ufw, and run sudo ufw enable, I get the error detailed in https://superuser.com/questions/1775776/enabling-ufw-failed-with-ubuntu-from-wsl2. You may already be aware of this error, I'm not sure if "NotTheDr01ds" has talked to you about this yet. Note that the WSL2 /proc/[pid]/stat format, although weird, does comply with the spec: https://man7.org/linux/man-pages/man5/proc.5.html
I verified that you can fix this issue by replacing the first split in line 427 with rsplit(')', 1) so it splits based on the last parenthesis instead of the all parenthesis.
Before:
ppid = open(name).readlines()[0].split(')')[1].split()[1]
After:
ppid = open(name).readlines()[0].rsplit(')',1)[1].split()[1]
C:\Users\caleb>wsl --version
WSL version: 1.1.6.0
Kernel version: 5.15.90.1
WSLg version: 1.0.50
MSRDC version: 1.2.3770
Direct3D version: 1.608.2-61064218
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2728
➜ ufw git:(master) ufw --version
ufw 0.36
Copyright 2008-2015 Canonical Ltd.
➜ ufw git:(master) cat /proc/229/stat | cut -c -23
229 (Relay(230)) S 228 |
|
2023-07-17 15:07:03 |
Jamie Strandboge |
ufw (Ubuntu Focal): status |
Triaged |
In Progress |
|
2023-07-17 15:07:05 |
Jamie Strandboge |
ufw (Ubuntu Jammy): status |
Triaged |
In Progress |
|
2023-07-17 15:07:08 |
Jamie Strandboge |
ufw (Ubuntu Focal): assignee |
|
Jamie Strandboge (jdstrand) |
|
2023-07-17 15:07:10 |
Jamie Strandboge |
ufw (Ubuntu Jammy): assignee |
|
Jamie Strandboge (jdstrand) |
|
2023-07-17 15:07:12 |
Jamie Strandboge |
ufw (Ubuntu Mantic): assignee |
|
Jamie Strandboge (jdstrand) |
|
2023-07-18 03:43:16 |
Ubuntu Archive Robot |
bug |
|
|
added subscriber Jamie Strandboge |
2023-07-19 14:28:02 |
Robie Basak |
ufw (Ubuntu Jammy): status |
In Progress |
Incomplete |
|
2023-07-19 14:28:05 |
Robie Basak |
ufw (Ubuntu Focal): status |
In Progress |
Incomplete |
|
2023-07-19 15:08:19 |
Jamie Strandboge |
ufw (Ubuntu Focal): status |
Incomplete |
In Progress |
|
2023-07-19 15:08:21 |
Jamie Strandboge |
ufw (Ubuntu Jammy): status |
Incomplete |
In Progress |
|
2023-07-20 13:09:21 |
Jamie Strandboge |
nominated for series |
|
Ubuntu Lunar |
|
2023-07-20 13:09:21 |
Jamie Strandboge |
bug task added |
|
ufw (Ubuntu Lunar) |
|
2023-07-20 13:09:30 |
Jamie Strandboge |
ufw (Ubuntu Lunar): importance |
Undecided |
High |
|
2023-07-20 13:09:45 |
Jamie Strandboge |
ufw (Ubuntu Lunar): status |
New |
In Progress |
|
2023-07-20 13:09:49 |
Jamie Strandboge |
ufw (Ubuntu Lunar): assignee |
|
Jamie Strandboge (jdstrand) |
|
2023-07-21 17:09:53 |
Steve Langasek |
ufw (Ubuntu Lunar): status |
In Progress |
Fix Committed |
|
2023-07-21 17:09:54 |
Steve Langasek |
bug |
|
|
added subscriber Ubuntu Stable Release Updates Team |
2023-07-21 17:09:57 |
Steve Langasek |
bug |
|
|
added subscriber SRU Verification |
2023-07-21 17:10:00 |
Steve Langasek |
tags |
wsl wsl2 |
verification-needed verification-needed-lunar wsl wsl2 |
|
2023-07-21 17:10:43 |
Steve Langasek |
ufw (Ubuntu Jammy): status |
In Progress |
Fix Committed |
|
2023-07-21 17:10:48 |
Steve Langasek |
tags |
verification-needed verification-needed-lunar wsl wsl2 |
verification-needed verification-needed-jammy verification-needed-lunar wsl wsl2 |
|
2023-07-21 17:12:02 |
Steve Langasek |
ufw (Ubuntu Focal): status |
In Progress |
Fix Committed |
|
2023-07-21 17:12:07 |
Steve Langasek |
tags |
verification-needed verification-needed-jammy verification-needed-lunar wsl wsl2 |
verification-needed verification-needed-focal verification-needed-jammy verification-needed-lunar wsl wsl2 |
|
2023-07-25 14:38:53 |
Jamie Strandboge |
tags |
verification-needed verification-needed-focal verification-needed-jammy verification-needed-lunar wsl wsl2 |
verification-done-lunar verification-needed verification-needed-focal verification-needed-jammy wsl wsl2 |
|
2023-07-25 14:44:59 |
Jamie Strandboge |
tags |
verification-done-lunar verification-needed verification-needed-focal verification-needed-jammy wsl wsl2 |
verification-done verification-done-focal verification-done-jammy verification-done-lunar wsl wsl2 |
|
2023-08-02 02:11:40 |
Chris Halse Rogers |
removed subscriber Ubuntu Stable Release Updates Team |
|
|
|
2023-08-02 02:12:12 |
Launchpad Janitor |
ufw (Ubuntu Focal): status |
Fix Committed |
Fix Released |
|
2023-08-02 02:12:15 |
Launchpad Janitor |
ufw (Ubuntu Jammy): status |
Fix Committed |
Fix Released |
|
2023-08-02 02:12:17 |
Launchpad Janitor |
ufw (Ubuntu Lunar): status |
Fix Committed |
Fix Released |
|