Repository navigation
Fix sudo env passing on Ubuntu 26.04 (sudo-rs); v1.5.5 - #29
Merged
Merged
Conversation
… 26.04) sudo-rs ignores -E, so router-registration, zt-upgrade and vm-support-bundle lost NF_PORT_BYPASS and proxy vars. --preserve-env=list works on classic sudo (22.04/24.04) and sudo-rs. Drop unneeded -E from zt-router-cpu. Bump to 1.5.5.
r-caamano
approved these changes
Nov 23, 2026
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.
Problem
Ubuntu 26.04 defaults to sudo-rs, which ignores
sudo -E(preserving the entire environment is not supported, '-E' is ignored). Therouter-registration,zt-upgradeandvm-support-bundlealiases therefore lost their environment (e.g.NF_PORT_BYPASS, read at edge-router-registrationrouter_registration.py:166).Change
sudo -Ewithsudo --preserve-env=${NF_SUDO_ENV}whereNF_SUDO_ENV=NF_PORT_BYPASS,http_proxy,https_proxy,no_proxy,HTTP_PROXY,HTTPS_PROXY,NO_PROXY.--preserve-env=listis supported by classic sudo (22.04/24.04, since 1.8.21) and sudo-rs (26.04).-Efromzt-router-cpu(matches the other pprof aliases).Note
Env vars other than those listed are no longer passed. In particular, auto-enroll args supplied as upper-cased env vars (
check_env_vars()) must now be passed as CLI flags.Verification
bash -n nfhelp.shOK;./nfhelp.sh -v→ 1.5.5; nosudo -Eremains.