Skip to content
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

Running superlinter as a user not defined in /etc/passwd causes error messages #4351

Merged
merged 6 commits into from
Jun 20, 2023

Conversation

sabbene
Copy link
Contributor

@sabbene sabbene commented Jun 3, 2023

Fixes #

Proposed Changes

  1. Change the whoami command to use id -un and discard stderr. Currently, when running superlinter with a UID that whoami or the id command cannot resolve. Two things happen:
    A) The following error is emitted: whoami: cannot find name for user ID 1234
    B) In the debug output the contents of "Runner" is blank like this: [DEBUG] Runner:[]

By changing to id -un 2>/dev/null, The error message is not printed, and the Runner is set to the uid if it is unable to determine a username: [DEBUG] Runner:[1234]
The standard behavior is retained when a username can be determined: [DEBUG] Runner:[root]

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@zkoppert zkoppert self-assigned this Jun 20, 2023
@zkoppert zkoppert added the bug Something isn't working label Jun 20, 2023
Copy link
Contributor

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

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

@sabbene Thanks for taking the time to contribute this back here! Appreciate the improvement! 🎉

@zkoppert zkoppert enabled auto-merge (squash) June 20, 2023 19:35
@zkoppert zkoppert merged commit 35d5a3e into super-linter:main Jun 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants