RUT241 /etc/rc.local behavior regression in RUT2M_R_00.07.14.2 firmware

The behavior of /etc/rc.local changed from firmware version RUT2M_R_00.07.13.4 to RUT2M_R_00.07.14.2. Commands in that file are no longer run as user root, but as user admin instead. This is due to /etc/init.d/rclocal being changed.

Before:

#!/bin/sh /etc/rc.common

START=99
boot() {
	# process user commands
	[ -f /etc/rc.local ] && {
		sh /etc/rc.local
	}
}

After:

#!/bin/sh /etc/rc.common

START=99
boot() {
	# process user commands
	[ -f /etc/rc.local ] && {
		chmod 770 /etc/rc.local
		chown admin:user /etc/rc.local
		su admin -s /bin/sh -c /etc/rc.local
	}
}

The admin user is much less privileged than the root user so this breaks all the commands I am running from /etc/rc.local. I cannot be the only person where this is a problem.

Please revert this change in the firmware, you have removed a feature that has existed since the beginning in OpenWrt.

1 Like

To be a bit more precise: the admin user does not own many directories in the filesystem, so it is impossible to make all desired changes to the system through /etc/rc.local.

I use it to create some custom branding like an SSH login banner, install packages, deploy some SSH keys.

This has been fixed in the RUT2M_R_00.07.14.3 firmware version. Thanks a bundle!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.