Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
cmd/snap-update-ns: detect and report read-only filesystems #4166
Conversation
zyga
added some commits
Oct 19, 2017
codecov-io
commented
Nov 7, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #4166 +/- ##
==========================================
+ Coverage 75.52% 75.57% +0.05%
==========================================
Files 436 436
Lines 37766 37814 +48
==========================================
+ Hits 28521 28578 +57
+ Misses 7250 7244 -6
+ Partials 1995 1992 -3
Continue to review full report at Codecov.
|
stolowski
approved these changes
Nov 9, 2017
Looks good, with two tiny remarks for you to consider.
| + // Declare var and don't assign-declare below to ensure we don't swallow | ||
| + // any errors by mistake. | ||
| + var err error | ||
| + var fd int |
stolowski
Nov 9, 2017
Contributor
I'd initialize it to a sane and safe value (which is -1 in this code), just to avoid nasty bugs in the future.
zyga
Nov 11, 2017
Contributor
I did and later undid this. It is an ineffectual assignment as all code paths later overwrite the value before it has a chance of being used. This is an error according to our validation tools.
| + segment := segments[i] | ||
| + made := true | ||
| + var err error | ||
| + var newFd int |
zyga commentedNov 7, 2017
This is based on #4163
This small patch adds detection of read-only filesystems to
secure-mkdir-all. This will be soon picked up by the hole-poking code.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com