Skip to content

[sudo-rs] use --preserve-env instead of -E#1689

Open
konstruktoid wants to merge 3 commits into
chef:mainfrom
konstruktoid:sudors
Open

[sudo-rs] use --preserve-env instead of -E#1689
konstruktoid wants to merge 3 commits into
chef:mainfrom
konstruktoid:sudors

Conversation

@konstruktoid

Copy link
Copy Markdown
Contributor

Description

After Ubuntu 25.10, sudo -E doesn't work with sudo-rs, see eg trifectatechfoundation/sudo-rs#1299

==> qemu.vm: Provisioning with shell script: ./packer_templates/scripts/ubuntu/networking_ubuntu.sh
==> qemu.vm: sudo: preserving the entire environment is not supported, '-E' is ignored
$ sudo.ws --version
Sudo version 1.9.17p2
Sudoers policy plugin version 1.9.17p2
Sudoers file grammar version 50
Sudoers I/O plugin version 1.9.17p2
Sudoers audit plugin version 1.9.17p2
$ sudo --version
sudo-rs 0.2.13-0ubuntu1
$ export HOME_DIR=/home/serenity
$ sudo.ws --preserve-env=HOME_DIR,http_proxy,https_proxy,no_proxy env | grep '^HOME_DIR'
HOME_DIR=/home/serenity
$ sudo.ws --E env | grep '^HOME_DIR'
sudo.ws: unrecognized option '--E'
$ sudo.ws -E env | grep '^HOME_DIR'
HOME_DIR=/home/serenity
$ sudo -E env | grep '^HOME_DIR'
sudo: preserving the entire environment is not supported, '-E' is ignored
$ sudo --preserve-env=HOME_DIR,http_proxy,https_proxy,no_proxy env | grep '^HOME_DIR'
HOME_DIR=/home/serenity
$ sudo --preserve-env=http_proxy,https_proxy,no_proxy env | grep '^HOME_DIR'
$ sudo.ws --preserve-env=http_proxy,https_proxy,no_proxy env | grep '^HOME_DIR'
$

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
@konstruktoid konstruktoid requested review from a team and Stromweld as code owners July 4, 2026 11:40
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.

1 participant