nextcloud / nextcloud/nextcloudpi
Check for valid root environment in ncp-config/ncp-update/...
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 2.9k
- Forks
- 318
- PR merge metrics
- No merged PRs in 30d
Description
Summary
So far, we check whether the current user is root in the various ncp utility scripts. As of debian 11, it might be worthwhile to check for the validity of the environment variables as well due to a change in the su command.
Description
In debian 11, the su command, if executed without arguments, will inherit the users environment variables (compare https://lists.debian.org/debian-user/2019/02/msg00698.html). That means, that for example /sbin, /usr/sbin and /usr/local/sbin are missing from the PATH variable which will break the ncp scripts. We should prevent the scripts from being executed if that's the case as it will cause failing scripts and misleading error messages.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ncp-config and ncp-update utility-script entry points, reviewing their existing root-user checks and how PATH is used. Reproduce the Debian 11 su environment described in the issue, then ensure the scripts detect an invalid environment before execution and avoid misleading failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- debian, shell
- Domain
- cli, operating-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100