Skip to content

keyring: fix typo in EACCES check#235

Merged
rhatdan merged 1 commit intoopencontainers:mainfrom
cyphar:fix-keyring-err-check
Oct 8, 2025
Merged

keyring: fix typo in EACCES check#235
rhatdan merged 1 commit intoopencontainers:mainfrom
cyphar:fix-keyring-err-check

Conversation

@cyphar
Copy link
Copy Markdown
Member

@cyphar cyphar commented Oct 7, 2025

Commit 965323e ("SetKeyLabel: add thread group leader requirement")
added verification that the caller of SetKeyLabel is the thread-group
leader, however the check had a typo in it, which would almost always
cause all errors to be treated as ErrNotTGLeader.

It's a bit of a shame that os.Getuid() and os.Getpid() are untyped, as a
one-character typo like this can really easily cause bugs without type
checking...

Signed-off-by: Aleksa Sarai [email protected]

Commit 965323e ("SetKeyLabel: add thread group leader requirement")
added verification that the caller of SetKeyLabel is the thread-group
leader, however the check had a typo in it, which would almost always
cause all errors to be treated as ErrNotTGLeader.

It's a bit of a shame that os.Getuid() and os.Getpid() are untyped, as a
one-character typo like this can really easily cause bugs without type
checking...

Signed-off-by: Aleksa Sarai <[email protected]>
Copy link
Copy Markdown
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Oh 🤦🏻‍♂️

LGTM

Copy link
Copy Markdown
Collaborator

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit 74393ea into opencontainers:main Oct 8, 2025
17 checks passed
@cyphar cyphar deleted the fix-keyring-err-check branch October 8, 2025 02:44
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.

3 participants