Skip to content

[release/1.4] Fix Windows service panic file to not be read-only#4766

Merged
estesp merged 1 commit intocontainerd:release/1.4from
dmcgowan:backport-4765
Nov 25, 2020
Merged

[release/1.4] Fix Windows service panic file to not be read-only#4766
estesp merged 1 commit intocontainerd:release/1.4from
dmcgowan:backport-4765

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

Go 1.14 introduced a change to os.OpenFile (and syscall.Open) on Windows
that uses the permissions passed to determine if the file should be
created read-only or not. If the user-write bit (0200) is not set, then
FILE_ATTRIBUTE_READONLY is set on the underlying CreateFile call.

This is a significant change for any Windows code which created new
files and set the permissions to 0 (previously the permissions had no
affect, so some code didn't set them at all).

This change fixes the issue for the Windows service panic file. It will
now properly be created as a non-read-only file on Go 1.14+.

I have looked over the rest of the containerd code and didn't see other
places where this seems like an issue.

Signed-off-by: Kevin Parsons [email protected]
(cherry picked from commit b2420eb)
Signed-off-by: Derek McGowan [email protected]

Go 1.14 introduced a change to os.OpenFile (and syscall.Open) on Windows
that uses the permissions passed to determine if the file should be
created read-only or not. If the user-write bit (0200) is not set, then
FILE_ATTRIBUTE_READONLY is set on the underlying CreateFile call.

This is a significant change for any Windows code which created new
files and set the permissions to 0 (previously the permissions had no
affect, so some code didn't set them at all).

This change fixes the issue for the Windows service panic file. It will
now properly be created as a non-read-only file on Go 1.14+.

I have looked over the rest of the containerd code and didn't see other
places where this seems like an issue.

Signed-off-by: Kevin Parsons <[email protected]>
(cherry picked from commit b2420eb)
Signed-off-by: Derek McGowan <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Nov 25, 2020

Build succeeded.

@kevpar
Copy link
Copy Markdown
Member

kevpar commented Nov 25, 2020

Thanks @dmcgowan! I was just about to do this.

Copy link
Copy Markdown
Contributor

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 3458984 into containerd:release/1.4 Nov 25, 2020
@dmcgowan dmcgowan deleted the backport-4765 branch April 20, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants