OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version openwrt-18.06
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Robert - 07.11.2018
Last edited by Jo-Philipp Wich - 20.11.2018

FS#1931 - Root environment not set up while running /etc/init.d scripts

/etc/init.d scripts run as root, which is reflected in the ownership of files created by the scripts. But the environment does NOT have the correct USER=root and HOME=/root

The whole env at runtime is
SHLVL=1
HOME=/
TERM=linux
PATH=/usr/sbin:/usr/bin:/sbin:/bin
PWD=/

I see this on two different model TP Link routers running Openwrt 18.06.1

Closed by  Jo-Philipp Wich
20.11.2018 07:16
Reason for closing:  Not a bug
Robert commented on 14.11.2018 17:37

This bug is a problem because commands which as ssh refer to files/directories in the HOME directory, and HOME is not properly set

Admin
Jo-Philipp Wich commented on 20.11.2018 07:15

You should not rely on user specific environment variables during system init. If you need access to such variables, you must explicitly declare them. Quoting POSIX spec:

HOME - The system shall initialize this variable at the time of login to be a pathname of the user's home directory.

Since during system init no user is logged in, providing a user specific environment would be wrong.

Reference: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing