]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
control: Allow ControlAllow to come from a file
authorIan Campbell <ian.campbell@citrix.com>
Wed, 29 May 2013 11:57:03 +0000 (12:57 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 29 May 2013 11:57:03 +0000 (12:57 +0100)
Emesinae/Common.pm
config/emesinae.conf
config/examples/test/control.users [new file with mode: 0644]
config/examples/test/emesinae.conf
config/examples/xen-bugs.xenproject.org/emesinae.conf

index ccd83c4086762beec4dbc0858e82cc37d3a376e2..97fbd913b7cc03384dfec32a14a8480951d00593 100644 (file)
@@ -33,6 +33,15 @@ sub readconfig () {
 
     $c{ControlAddressFull} = $c{ControlAddress} . "@" . $c{MailDomain};
     $c{OwnerAddressFull}   = $c{OwnerAddress} . "@" . $c{MailDomain};
+
+    if ( $c{ControlAllowPath} ) {
+        open CA, "<".$c{ControlAllowPath} or die "unable to open ".$c{ControlAllowPath}.": $!";
+        $c{ControAllow} = [];
+        while (<CA>) {
+            chomp;
+            push @ { $c{ControlAllow} }, $_;
+        }
+    }
 }
 
 #------- database -------
index e85d46d740ff8c650fff05fd72e8f1d231b0251a..a256fd2f2eeec50f456eab4833a32350b29bce70 100644 (file)
@@ -56,7 +56,14 @@ $c{ReportingURL} = "http://bugs.example.com/Howto_Report_Bugs.html";
     "gmane"     => "http://mid.gmane.org/<MSGID>",
 );
 
-@{ $c{ControlAllow} } = qw/admin@example.com/;
+# Users who are allowed to access privileged control commands.
+# $c{ControlAllowPath} takes precendence over $c{ControlAllow}.
+#
+# ControlAllowPath should contain the path to a file with one email address per
+# line.
+$c{ControlAllowPath} = "/etc/emesinae/control.users";
+# Otherwise ControlAllow should be an array of email addresses
+#@{ $c{ControlAllow} } = qw/admin@example.com/;
 
 # Severity levels, in decending order of criticality
 @{ $c{SeverityLevels} } = qw/blocker critical normal wishlist/;
diff --git a/config/examples/test/control.users b/config/examples/test/control.users
new file mode 100644 (file)
index 0000000..9d5be22
--- /dev/null
@@ -0,0 +1,2 @@
+Ian.Campbell@citrix.com
+ijc@hellion.org.uk
index ca302a6ffeca9094f9b85419f04b66327efcd7a7..8c29cbb8f656065cca966e5cf4b8abf4c2f8e5b9 100644 (file)
@@ -52,7 +52,14 @@ $c{ReportingURL} = "http://bugs.example.com/Howto_Report_Bugs.html";
     "gmane"     => "http://mid.gmane.org/<MSGID>",
 );
 
-@{ $c{ControlAllow} } = qw/Ian.Campbell@citrix.com ijc@hellion.org.uk/;
+# Users who are allowed to access privileged control commands.
+# $c{ControlAllowPath} takes precendence over $c{ControlAllow}.
+#
+# ControlAllowPath should contain the path to a file with one email address per
+# line.
+$c{ControlAllowPath} = "/srv/test/etc/control.users";
+# Otherwise ControlAllow should be an array of email addresses
+#@{ $c{ControlAllow} } = qw/admin@example.com/;
 
 # Severity levels, in decending order of criticality
 @{ $c{SeverityLevels} } = qw/blocker critical normal wishlist/;
index 22e163f9188d561b05580ba079a46c55c6cae79b..bc9b418e5313bd01d3a8174622086bdbc356afa5 100644 (file)
@@ -54,7 +54,14 @@ $c{ReportingURL} = "http://wiki.xen.org/wiki/Reporting_Bugs_against_Xen";
     "gmane"     => "http://mid.gmane.org/<MSGID>",
 );
 
-@{ $c{ControlAllow} } = qw/ian.campbell@citrix.com ijc@hellion.org.uk/;
+# Users who are allowed to access privileged control commands.
+# $c{ControlAllowPath} takes precendence over $c{ControlAllow}.
+#
+# ControlAllowPath should contain the path to a file with one email address per
+# line.
+$c{ControlAllowPath} = "/srv/xen-devel-bugs/etc/control.users";
+# Otherwise ControlAllow should be an array of email addresses
+#@{ $c{ControlAllow} } = qw/admin@example.com/;
 
 # Severity levels, in decending order of criticality
 @{ $c{SeverityLevels} } = qw/blocker critical normal wishlist/;