Skip to content

Fix sudo env passing on Ubuntu 26.04 (sudo-rs); v1.5.5 - #29

Merged
emoscardini merged 1 commit into
mainfrom
fix/sudo-rs-preserve-env
Nov 23, 2026
Merged

emoscardini merged 1 commit into
mainfrom
fix/sudo-rs-preserve-env

Conversation

@emoscardini

Copy link
Copy Markdown
Member

Problem

Ubuntu 26.04 defaults to sudo-rs, which ignores sudo -E (preserving the entire environment is not supported, '-E' is ignored). The router-registration, zt-upgrade and vm-support-bundle aliases therefore lost their environment (e.g. NF_PORT_BYPASS, read at edge-router-registration router_registration.py:166).

Change

  • Replace sudo -E with sudo --preserve-env=${NF_SUDO_ENV} where NF_SUDO_ENV=NF_PORT_BYPASS,http_proxy,https_proxy,no_proxy,HTTP_PROXY,HTTPS_PROXY,NO_PROXY. --preserve-env=list is supported by classic sudo (22.04/24.04, since 1.8.21) and sudo-rs (26.04).
  • Drop unneeded -E from zt-router-cpu (matches the other pprof aliases).
  • Bump version to 1.5.5 and update CHANGELOG.

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.sh OK; ./nfhelp.sh -v → 1.5.5; no sudo -E remains.
  • Alias expands to the literal list at definition time.
  • Not yet tested on a live 22.04/24.04/26.04 router; image-build will verify on the next 26.04 image after release.

… 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.
@emoscardini
emoscardini merged commit 4db6b27 into main Nov 23, 2026
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.

2 participants