]> git.ipfire.org Git - people/stevee/guardian.git/blobdiff - modules/Config.pm
Allow to configure the owner of the UNIX socket.
[people/stevee/guardian.git] / modules / Config.pm
index 038ba35b6f625d414743cacbba2c1f8398bad291..75f1ab02496be95b735bd46b8f0d2b695fccd66c 100644 (file)
@@ -18,6 +18,7 @@ my %defaults = (
        "LogFacility" => "syslog",
        "BlockCount" => "3",
        "BlockTime" => "86400",
+       "FirewallEngine" => "none",
 );
 
 #
@@ -161,6 +162,17 @@ sub CheckConfig (\%) {
                return "Invalid LogLevel: $config{LogLevel}";
        }
 
+       # Check if an optional configured SocketOwner is valid.
+       if (exists($config{SocketOwner})) {
+               my ($user, $group) = split(/:/, $config{SocketOwner});
+
+               # Get the ID for the given user name.
+               my $uid = getpwnam($user) or return "The user $user does not exist.";
+
+               # Get the ID for given group name.
+               my $gid = getgrnam($group) or return "The group $group does not exist.";
+       } 
+
        # The config looks good, so return nothing (no error message).
        return undef
 }