-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix path_symlink only works when dir mounted to / #2229
Conversation
This commit fixes `path_symlink` not working when `-mount` is not supplied with a mapped directory. fixes tetratelabs#2228 Signed-off-by: Yage Hu <me@huyage.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the test case that ensures the behavior and previously failed.
Signed-off-by: Yage Hu <me@huyage.dev>
@@ -4941,7 +4973,7 @@ func requireOpenFile(t *testing.T, tmpDir string, pathName string, data []byte, | |||
if readOnly { | |||
fsConfig = fsConfig.WithReadOnlyDirMount(tmpDir, "/") | |||
} else { | |||
fsConfig = fsConfig.WithDirMount(tmpDir, "/") | |||
fsConfig = fsConfig.WithDirMount(tmpDir, "preopen") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary to expose the problem because the original path join would discard the /
, masking the bug. Preopening a directory and mounting it at a non-root location would cause the bug.
Signed-off-by: Yage Hu <me@huyage.dev>
Signed-off-by: Yage Hu <me@huyage.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me, waiting for others to review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This commit fixes
path_symlink
not working when-mount
is not supplied with a mapped directory.fixes #2228