nextcloud / nextcloud/nextcloudpi

Check for valid root environment in ncp-config/ncp-update/...

Open
#1,461 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.