Skip to content

common-utils: Make sudoers configuration optional - #1723

Open
Daniel Weuthen (weuthen-sipgate) wants to merge 2 commits into
devcontainers:mainfrom
weuthen-sipgate:main
Open

common-utils: Make sudoers configuration optional#1723
Daniel Weuthen (weuthen-sipgate) wants to merge 2 commits into
devcontainers:mainfrom
weuthen-sipgate:main

Conversation

@weuthen-sipgate

Copy link
Copy Markdown

This pull request adds a new configurable option to the common-utils feature that allows users to control whether a non-root user is added to the passwordless sudoers list. By default, this option is enabled, but it can now be disabled if desired. The changes include updates to documentation, feature configuration, implementation logic, and new tests to verify both enabled and disabled scenarios.

Feature enhancement:

  • Added a new sudoers boolean option to devcontainer-feature.json, allowing users to specify whether the non-root user should be added to passwordless sudoers (defaults to true).
  • Updated the documentation in README.md to describe the new sudoers option.
  • Bumped the common-utils feature version to 2.6.0 to reflect the new functionality.

Implementation update:

  • Modified main.sh to respect the new SUDOERS environment variable and conditionally add the non-root user to the sudoers file only if the option is enabled. [1] [2]

Testing improvements:

  • Added new test scenarios and scripts (sudoers-true and sudoers-false) to verify the correct behavior of the sudoers option, ensuring the sudoers file is created or omitted as expected. [1] [2] [3]

@weuthen-sipgate

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="sipgate"

@microsoft-github-policy-service

Copy link
Copy Markdown

Daniel Weuthen (@weuthen-sipgate) the command you issued was incorrect. Please try again.

Examples are:

@microsoft-github-policy-service agree

and

@microsoft-github-policy-service agree company="your company"

@weuthen-sipgate

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="sipgate"

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