Project

General

Profile

Actions

Bug #490

closed

[PATCH] TinyDNS: Incorrect check for directory etc/dnscache{$dnsidx}/env

Added by Henrik Kaare Poulsen over 15 years ago. Updated over 15 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DNS Server
Target version:
-
Start date:
04/08/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

In tinydns.inc we have the following:

if (!is_dir("{$g['varetc_path']}/etc/dnscache{$dnsidx}/env/IP"))
exec("/bin/mkdir -p {$g['varetc_path']}/etc/dnscache{$dnsidx}/env");
exec("echo {$dnscacheip} > {$g['varetc_path']}/etc/dnscache{$dnsidx}/env/IP");

However, /etc/dnscache{$dnsidx}/env/IP is a file, not a directory.

I believe the correct check would be:

--- a/config/tinydns/tinydns.inc
+++ b/config/tinydns/tinydns.inc
@@ -239,7 +239,7 @@ function tinydns_custom_php_changeip_command() {
                        $dnsuserip = $arr[0];
                        exec("/usr/local/bin/dnscache-conf Gdnscache Gdnslog {$g['varetc_path']}/etc/dnscache{$dnsidx} {$dnscacheip}");
                        exec("/bin/ln -s {$g['varetc_path']}/etc/dnscache{$dnsidx} {$g['varrun_path']}/service/");
-                       if (!is_dir("{$g['varetc_path']}/etc/dnscache{$dnsidx}/env/IP"))
+                       if (!is_dir("{$g['varetc_path']}/etc/dnscache{$dnsidx}/env"))
                                exec("/bin/mkdir -p {$g['varetc_path']}/etc/dnscache{$dnsidx}/env");
                        exec("echo {$dnscacheip} > {$g['varetc_path']}/etc/dnscache{$dnsidx}/env/IP");
                        tinydns_dnscache_forwarding_servers($dnsidx);

Actions #1

Updated by Ermal Luçi over 15 years ago

  • Status changed from New to Feedback

Thanks

Actions #2

Updated by Henrik Kaare Poulsen over 15 years ago

Looks good to me - thank you!

Actions #3

Updated by Chris Buechler over 15 years ago

  • Category set to DNS Server
Actions #4

Updated by Chris Buechler over 15 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF