diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index 1665214a6..11f03987e 100755 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -1280,8 +1280,14 @@ sub set_ownership { local ($user, $group, $perms); if ($config{'file_owner'}) { + # From config ($user, $group) = split(/:/, $config{'file_owner'}); } +elsif ($_[0] =~ /^(.*)\/([^\/]+)$/) { + # Match parent dir + my @st = stat($1); + ($user, $group) = ($st[4], $st[5]); + } if ($config{'file_perms'}) { $perms = oct($config{'file_perms'}); }