fix_installer: address missing user#21797
Open
thiagoftsm wants to merge 1 commit intonetdata:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 4/5
- This PR looks safe to merge overall; the only concern is a moderate issue around user setup in the Windows packaging script.
packaging/windows/package-windows.shonly checks for the passwd file, so a missingnobodyentry can persist and keep the original failure mode in some environments.- Pay close attention to
packaging/windows/package-windows.sh- ensure thenobodyentry is added when absent even if the passwd file already exists.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packaging/windows/package-windows.sh">
<violation number="1" location="packaging/windows/package-windows.sh:54">
P2: Only checking for the passwd file’s existence can leave the `nobody` user missing when the file already exists. This keeps the original failure mode. Check for the `nobody` entry instead so it is added when absent.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| ${GITHUB_ACTIONS+echo "::endgroup::"} | ||
|
|
||
| ${GITHUB_ACTIONS+echo "::group::Nobody user"} | ||
| if [ ! -f "/opt/netdata/etc/passwd" ]; then |
Contributor
There was a problem hiding this comment.
P2: Only checking for the passwd file’s existence can leave the nobody user missing when the file already exists. This keeps the original failure mode. Check for the nobody entry instead so it is added when absent.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packaging/windows/package-windows.sh, line 54:
<comment>Only checking for the passwd file’s existence can leave the `nobody` user missing when the file already exists. This keeps the original failure mode. Check for the `nobody` entry instead so it is added when absent.</comment>
<file context>
@@ -45,7 +45,13 @@ rm -rf /opt/netdata/msys64/
${GITHUB_ACTIONS+echo "::endgroup::"}
+
+${GITHUB_ACTIONS+echo "::group::Nobody user"}
+if [ ! -f "/opt/netdata/etc/passwd" ]; then
+ echo 'nobody:*:65534:65534::/var/empty:/bin/false' >> /opt/netdata/etc/passwd
+fi
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When running netdata on Windows, it is possible to find issues like this:
This PR fixes this issue.
Test Plan
Additional Information
For users: How does this change affect me?
Summary by cubic
Fixes Windows installer packaging to prevent “Fallback user 'nobody' not found” errors by creating /opt/netdata/etc/passwd with a 'nobody' entry. Also initializes the editor setting only when /opt/netdata/etc/profile is missing to avoid duplicates.
Written for commit b3ee8f5. Summary will update on new commits.