dbus: wait for 'netplan try' to be ready (LP: #1949893)#245
dbus: wait for 'netplan try' to be ready (LP: #1949893)#245
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #245 +/- ##
=======================================
Coverage 99.09% 99.09%
=======================================
Files 58 58
Lines 9913 9977 +64
=======================================
+ Hits 9823 9887 +64
Misses 90 90 ☔ View full report in Codecov by Sentry. |
b015bc5 to
99e6190
Compare
This comment has been minimized.
This comment has been minimized.
8d58917 to
cc37ced
Compare
|
Thank you @mvo5 for your comments! Indeed having a "stamp file" is a much more universal approach. I'm not sure why I didn't think about that earlier... I thought about passing signals from child to parent process (like we do from parent to child currently) and also about passing DBus signal directly from the Python code (but that would probably be overkill as we do not have proper DBus integration with the python code, currently and on the Polling for a file is plain and simple solution. |
cc37ced to
0bbc0d5
Compare
mvo5
left a comment
There was a problem hiding this comment.
Looks very nice! I have some comments/nitpicks/suggestions inline that are hopefully useful but nothing that would bock this. Thanks a lot for working on this!
netplan-dbus now waits for the spawned 'netplan try' child to touch the /tmp/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5sec it hits a timeout and returns an error.
9f27143 to
0cf3e7e
Compare
0cf3e7e to
0bd35a4
Compare
mvo5
left a comment
There was a problem hiding this comment.
Looks very nice, thank you! One tiny nitpick inline but feel free to ignore :)
to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
0bd35a4 to
5aa371b
Compare
|
Thank you so much @mvo5 for all your input here. I think this is ready for merging \o/ Let me run some more test on it before merging it early next week. |
netplan-dbus now waits for the spawned 'netplan try' child to touch the /run/netplan/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5 sec it hits a timeout and returns an error. Additionally, this PR places ephemeral netplan configs in /run/netplan/config-XXXXXX, to avoid potential exploits of tmpfiles, like https://lwn.net/Articles/250468/ COMMITS: * test:dbus: some cleanup * test:utils: add touch() method to MockCmd * cli:try: add touch/clear_ready_stamp methods * dbus: wait for 'netplan try' to be ready netplan-dbus now waits for the spawned 'netplan try' child to touch the /tmp/netplan-try.ready stamp file before it returns the DBus call. If no stamp file is detected within up to 5sec it hits a timeout and returns an error. * cli:apply: some more time for NM to have all interfaces created * dbus:cli: move netplan-try.ready stamp file to /run/netplan to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/ * dbus: move ephemeral netplan config states to /run/netplan to avoid potential expolits of tmpfiles, like https://lwn.net/Articles/250468/
|
Merged in e19441c |
Description
netplan-dbus now waits for the spawned 'netplan try' child to touch the
/run/netplan/netplan-try.readystamp file before it returns the DBus call. If no stamp file is detected within up to 5 sec it hits a timeout and returns an error.Additionally, this PR places ephemeral netplan configs in
/run/netplan/config-XXXXXX, to avoid potential exploits of tmpfiles, like https://lwn.net/Articles/250468/Checklist
make checksuccessfully.make check-coverage).