nextcloudpi icon indicating copy to clipboard operation
nextcloudpi copied to clipboard

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

Open theCalcaholic opened this issue 3 years ago • 0 comments

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.

theCalcaholic avatar Apr 12 '22 14:04 theCalcaholic