Skip to content

Conversation

@ian-knight-acacia
Copy link

@ian-knight-acacia ian-knight-acacia commented Jan 12, 2026

Describe your changes

Edit: sorry for the spam; I took a second pass at this for a cleaner implementation.

Fixes #5082 by using non-truncated user field output from ps instead of getting uid and converting with id.

  • Using -o 'user:256=' instead of --no-headers -o '%U' prevents truncation up to at least 256 chars (the username length limit)
  • Keeps simplified/refactored code from 9bd578d, avoiding the use of sed by using word-splitting on a known-format value.
  • Tested script and ps invocations against multiple current and history distributions, including Alma, Fedora, Debian, Ubuntu
  • Validated against shellcheck

Issue ticket number and link

#5082

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

This fixes a post-install script used in Linux packages, which should be invisible to regular users.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

N/A

Summary by CodeRabbit

  • Bug Fixes
    • Improved the post-installation process to more reliably retrieve user information during setup. All existing functionality is preserved.

✏️ Tip: You can customize this high-level summary in your review settings.

@CLAassistant
Copy link

CLAassistant commented Jan 12, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

Reworks the netbird-ui Debian post-install script to derive the runtime username from the running netbird-ui process using ps (and id -nu), removes quoted su username, and adjusts whitespace trimming and quoting in related commands. No exported/public API changes.

Changes

Cohort / File(s) Summary
Post-install script username retrieval fix
release_files/ui-post-install.sh
Replace /proc/[pid]/loginuid and prior id -nu approach with ps -o 'user:256=' -p based username retrieval; remove quotes around the su username, add shellcheck disable for intentional word-splitting, and adjust quoting/handling for pkill/nohup usage.

Sequence Diagram(s)

(omitted — change is a small script adjustment without multi-component sequential flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • pappz

Poem

🐰 A bash line hopped and found its clue,
It chased the process, learned who’s who,
Quotes trimmed away, whitespace made neat,
Upgrades now run without defeat — woo! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing the ui-post-install.sh script by removing the use of loginuid and switching to an alternative approach.
Linked Issues check ✅ Passed The PR addresses the core issue #5082 by replacing the loginuid approach with ps euid output to fix Debian package upgrade failures caused by invalid user IDs.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the post-install script issue described in #5082; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description follows the required template with all essential sections completed: changes described, issue ticket linked, checklist items marked, documentation decision selected with explanation, and CLA confirmation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Fixes netbirdio#5082 by using non-truncated user field output from ps instead of getting uid and converting with id.
Avoids the use of sed by using word-splitting on a known-format value.
@sonarqubecloud
Copy link

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.

netbird-ui 0.62.2 debian update problem

2 participants