Update copyright.
[openresolv] / pdnsd.in
index f474196ef4c9237cea17ccbbdc550a7cd764a38a..0a0241a7c7b3df92e85fee20a020f8b6d598083e 100644 (file)
--- a/pdnsd.in
+++ b/pdnsd.in
@@ -48,7 +48,7 @@ remove_markers()
                sed "/^$m1/,/^$m2/d" $@
        else
                for x; do
-                       while read line; do
+                       while read -r line; do
                                case "$line" in
                                "$m1"*) in_marker=1;;
                                "$m2"*) in_marker=0;;
@@ -98,7 +98,8 @@ if [ -n "$pdnsd_resolv" ]; then
        done
 fi
 
-if [ -n "$pdnsd_conf" ]; then
+# Only modify the configuration if it exists and we can write to it
+if [ -w "$pdnsd_conf" ]; then
        cf="$pdnsd_conf.new"
        newconf=