From: Mike Frysinger Date: Tue, 12 Mar 2013 14:48:09 +0000 (-0400) Subject: udhcpc: use readlink rather than realpath X-Git-Tag: 1_22_0~247 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=bca5c556c43ced7b368fdd90a24e4aecf40045ac;p=oweals%2Fbusybox.git udhcpc: use readlink rather than realpath The realpath utility requires all paths exist when canonicalizing symlinks. If /etc/resolv.conf points to a tmpfs, then it might not exist initially. Use `readlink -f` so that we follow all symlinks that are available. Signed-off-by: Mike Frysinger --- diff --git a/examples/udhcp/simple.script b/examples/udhcp/simple.script index 0397e506c..2a917eb6c 100755 --- a/examples/udhcp/simple.script +++ b/examples/udhcp/simple.script @@ -37,7 +37,7 @@ case "$1" in echo "Recreating $RESOLV_CONF" # If the file is a symlink somewhere (like /etc/resolv.conf # pointing to /run/resolv.conf), make sure things work. - realconf=$(realpath "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") + realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") tmpfile="$realconf-$$" > "$tmpfile" [ -n "$domain" ] && echo "search $domain" >> "$tmpfile"