example resolv.conf files don't have # prefixing non comments
[openresolv] / libc.in
diff --git a/libc.in b/libc.in
index ba0cbdd46c6e77d22e53b7b8b63157e9df9e8494..5ae02f4ac76f1223941fccd48c5fbdf92adeec31 100755 (executable)
--- a/libc.in
+++ b/libc.in
@@ -1,5 +1,4 @@
 #!/bin/sh
-# Copyright 2006 Gentoo Foundation
 # Copyright 2007 Roy Marples
 # All rights reserved
 
@@ -36,8 +35,8 @@ uniqify() {
     local result=
     while [ -n "$1" ]; do
                case " ${result} " in
-                       *" $1 "*) ;;
-                       *) result="${result} $1" ;;
+                       *" $1 "*);;
+                       *) result="${result} $1";;
                esac
                shift
        done
@@ -64,7 +63,7 @@ for N in ${OUR_NS}; do
        NS="${NS} ${N}"
        [ "${i}" = "3" ] && break
        case "${N}" in
-               127.*) LOCALH=true; break ;;
+               127.*) LOCALH=true; break;;
        esac
 done
 
@@ -74,7 +73,7 @@ done
 # ones. This means we prefer search then domain, otherwise, we use them in
 # the order given to us.
 OUR_SEARCH=
-if ${LOCALH} ; then
+if ${LOCALH}; then
        if [ -e "${BASE}" ]; then
                OUR_SEARCH="$(sed -n -e 's/^[[:space:]]*search[[:space:]]*//p' "${BASE}")"
        fi
@@ -139,7 +138,7 @@ if [ -e "${RESOLVCONF}"/run/resolv.conf ]; then
 fi
 
 # Create our resolv.conf now
-printf "${NEWCONF}" > "${RESOLVCONF}"/run/resolv.conf
+(umask 022; printf "${NEWCONF}" > "${RESOLVCONF}"/run/resolv.conf)
 
 resolvconf -s nscd restart