mountinfo: add "empty source" test case #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TIL older kernels (presumably < 5.1) has a bug of not showing
the "source" field in /proc/self/mountinfo in case an empty
string was passed as the source argument to mount() syscall.
My best guess is it was fixed by the kernel commit 8f2918898eb5f
("new helpers: vfs_create_mount(), fc_mount()", Nov 4 2018) which
is
v5.1-rc1~12^2~37
, i.e. kernel 5.1 should be the one with the fix.I was able to reproduce it on a machine with an old kernel:
The most interesting thing is this package is not affected by the bug,
working as expected, since strings.Split by a space gives an empty
element in case of two spaces.
Nevertheless, it makes sense to add a test case for it.
Signed-off-by: Kir Kolyshkin [email protected]