From 0927a4e51a14e10b1891cf6cbd5473edfc4044d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Sat, 13 Feb 2021 18:46:11 +0100 Subject: [PATCH] bsp: Allow for arguments in passwd function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, we have added a passwd function to our shell which executes passwd and restarts uhttpd afterwards, so the WebUI password is updated. This adds the ability to still pass command-line arguments to passwd. The quoting of the shell variable $@ is special: "$@" expands to "$1" "$2" .., so its use is correct here. Fixes: #117 Signed-off-by: Fabian Bläse Reviewed-by: Robert Langhammer --- bsp/default/root_file_system/etc/profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/default/root_file_system/etc/profile b/bsp/default/root_file_system/etc/profile index 0e9ad14f..8de20517 100644 --- a/bsp/default/root_file_system/etc/profile +++ b/bsp/default/root_file_system/etc/profile @@ -14,7 +14,7 @@ export HOME=${HOME:-/root} [ -x /usr/bin/ldd ] || ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } # update uhttpd passwd on passwd-change -[ -e /etc/rc.d/S50uhttpd ] && passwd() { /bin/passwd && /etc/init.d/uhttpd restart; } +[ -e /etc/rc.d/S50uhttpd ] && passwd() { /bin/passwd "$@" && /etc/init.d/uhttpd restart; } # I'm lazy, let's add some aliases alias ..='cd ..'