]> granicus.if.org Git - pdns/commitdiff
Recursor: Don't use `hostname -f` on Solaris/SunOS
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 20 Jul 2015 09:44:30 +0000 (11:44 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 8 Sep 2015 08:29:46 +0000 (10:29 +0200)
pdns/configure-recursor

index 802f3b9ede5458cdb42fd83a84433889c231b921..a2dc30723f709ee96b9b9700e0e0761d29cf48e0 100755 (executable)
@@ -26,8 +26,16 @@ CF_PIE=""
 LD_PIE=""
 CF_FORTIFY=""
 CF_STACK=""
-BUILD_HOST="$(id -u -n)@$(hostname -f 2>/dev/null || hostname 2>/dev/null || echo localhost)"
 
+BUILD_USER="$(id -u -n)"
+case $(uname) in
+  SunOS)
+    BUILD_HOST="${BUILD_USER}@$(hostname).$(domainname)" ;;
+  *)
+    BUILD_HOST="${BUILD_USER}@$(hostname -f || echo 'localhost')" ;;
+esac
+
+perl -p -i -e '/#define BUILD_HOST/d' config.h
 cat >> config.h << EOF
 #define BUILD_HOST "${BUILD_HOST}"
 EOF