1 From 75a3ec48814e7b9a9b22259a04009076363be3f1 Mon Sep 17 00:00:00 2001
2 From: Igor Kolar <igor.kolar@gmail.com>
3 Date: Thu, 17 Oct 2013 00:48:23 +0200
4 Subject: [PATCH 1/2] node: added --servicedir switch to munin-node
6 This code is copied over from munin-node-config, that already does the same
8 node/sbin/munin-node | 7 ++++++-
9 1 file changed, 6 insertions(+), 1 deletion(-)
11 diff --git a/node/sbin/munin-node b/node/sbin/munin-node
12 index 7b2e180..0a93450 100755
13 --- a/node/sbin/munin-node
14 +++ b/node/sbin/munin-node
15 @@ -35,7 +35,7 @@ use Munin::Node::OS;
16 use Munin::Node::Service;
17 use Munin::Node::Server;
20 +my $servicedir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugins";
21 my $sconfdir = "$Munin::Common::Defaults::MUNIN_CONFDIR/plugin-conf.d";
22 my $conffile = "$Munin::Common::Defaults::MUNIN_CONFDIR/munin-node.conf";
24 @@ -101,6 +101,7 @@ sub parse_args
26 print_usage_and_exit() unless GetOptions(
27 "config=s" => \$conffile,
28 + "servicedir=s" => \$servicedir,
30 "pidebug!" => \$PIDEBUG,
31 "paranoia!" => \$paranoia,
32 @@ -166,6 +167,10 @@ and returning the output they produce.
34 Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
36 +=item B<< --servicedir <dir> >>
38 +Override plugin directory [@@CONFDIR@@/plugins/]
40 =item B< --[no]paranoia >
42 Only run plugins owned by root. Check permissions as well. [--noparanoia]
47 From b8e17cbe73ae4c71b93ff5687ba86db1d0c1f5bd Mon Sep 17 00:00:00 2001
48 From: Steve Schnepp <steve.schnepp@pwkf.org>
49 Date: Thu, 17 Oct 2013 11:52:10 +0200
50 Subject: [PATCH 2/2] node: untaint the service-dir args
53 node/sbin/munin-node | 6 +++++-
54 1 file changed, 5 insertions(+), 1 deletion(-)
56 diff --git a/node/sbin/munin-node b/node/sbin/munin-node
57 index 0a93450..909c8c4 100755
58 --- a/node/sbin/munin-node
59 +++ b/node/sbin/munin-node
60 @@ -99,9 +99,10 @@ sub parse_args
62 my @ORIG_ARGV = @ARGV;
64 + my $servicedir_cmdline;
65 print_usage_and_exit() unless GetOptions(
66 "config=s" => \$conffile,
67 - "servicedir=s" => \$servicedir,
68 + "servicedir=s" => \$servicedir_cmdline,
70 "pidebug!" => \$PIDEBUG,
71 "paranoia!" => \$paranoia,
72 @@ -109,6 +110,9 @@ sub parse_args
73 "help" => \&print_usage_and_exit,
76 + # We untaint the args brutally, since the sysadm should know what he does
77 + $servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
79 # Reset ARGV (for HUPing)