aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-03-12 10:48:09 -0400
committerMike Frysinger <vapier@gentoo.org>2013-03-12 10:48:09 -0400
commitbca5c556c43ced7b368fdd90a24e4aecf40045ac (patch)
tree99574aa8b9f3a48f154e2e9f30a4d79525465054
parent9bbf6b98c42a212b8a4b1aa02975ac18bb612922 (diff)
downloadbusybox-w32-bca5c556c43ced7b368fdd90a24e4aecf40045ac.tar.gz
busybox-w32-bca5c556c43ced7b368fdd90a24e4aecf40045ac.tar.bz2
busybox-w32-bca5c556c43ced7b368fdd90a24e4aecf40045ac.zip
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 <vapier@gentoo.org>
-rwxr-xr-xexamples/udhcp/simple.script2
1 files changed, 1 insertions, 1 deletions
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
37 echo "Recreating $RESOLV_CONF" 37 echo "Recreating $RESOLV_CONF"
38 # If the file is a symlink somewhere (like /etc/resolv.conf 38 # If the file is a symlink somewhere (like /etc/resolv.conf
39 # pointing to /run/resolv.conf), make sure things work. 39 # pointing to /run/resolv.conf), make sure things work.
40 realconf=$(realpath "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF") 40 realconf=$(readlink -f "$RESOLV_CONF" 2>/dev/null || echo "$RESOLV_CONF")
41 tmpfile="$realconf-$$" 41 tmpfile="$realconf-$$"
42 > "$tmpfile" 42 > "$tmpfile"
43 [ -n "$domain" ] && echo "search $domain" >> "$tmpfile" 43 [ -n "$domain" ] && echo "search $domain" >> "$tmpfile"