-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
libct/init_linux: retry chdir to fix EACCES (regression in rc93) #2894
Conversation
742b68e
to
4f412ee
Compare
84558ba
to
d4c3bbf
Compare
d4c3bbf
to
a3bbcbc
Compare
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.
LGTM
a3bbcbc
to
763bba6
Compare
I think IsPermission fixes the failures |
Alas, the EPERM on chdir saga continues... Unfortunately, the there were two releases between when opencontainers@5e0e67d was released and when the workaround opencontainers#2712 was added. Between this, folks started relying on the ability to have a workdir that the container user doesn't have access to. Since this case was previously valid, we should continue support for it. Now, we retry the chdir: Once at the top of the function (to catch cases where the runc user has access, but container user does not) and once after we setup user (to catch cases where the container user has access, and the runc user does not) Add a test case for this as well. Signed-off-by: Peter Hunt <[email protected]>
763bba6
to
6ce2d63
Compare
Ah, the
and there's no EPERM in the list of errors returned by chdir. So we could use |
CI on CentOS hit a snag; restarted. |
case err == nil: | ||
doChdir = false | ||
case os.IsPermission(err): | ||
// If we hit an EPERM, we should attempt again after setting up user. |
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 needs to mention EACCES not EPERM.
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.
LGTM except for a nit in a comment (not that important)
Alas, the EPERM on chdir saga continues...
Unfortunately, the there were two releases between when 5e0e67d was released
and when the workaround #2712 was added.
Between this, folks started relying on the ability to have a workdir that the container user doesn't have access to.
Since this case was previously valid, we should continue support for it.
Now, we retry the chdir:
Once at the top of the function (to catch cases where the runc user has access, but container user does not)
and once after we setup user (to catch cases where the container user has access, and the runc user does not)
Add a test case for this as well.
Signed-off-by: Peter Hunt [email protected]