From 9d926665fafb3d3efc19ad1d193f6cec49bc629d Mon Sep 17 00:00:00 2001 From: Marek 'marx' Grac <mgrac@redhat.com> Date: Mon, 19 Oct 2009 15:04:08 +0200 Subject: [PATCH] fence_rackswitch: Accept unknown options without value Agent fails when unknown option (without '=' sign) was entered. Resolves: rhbz#607265 --- fence/agents/rackswitch/do_rack.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fence/agents/rackswitch/do_rack.c b/fence/agents/rackswitch/do_rack.c index 921972f..dddb1e6 100644 --- a/fence/agents/rackswitch/do_rack.c +++ b/fence/agents/rackswitch/do_rack.c @@ -249,9 +249,13 @@ static void get_options(int argc, char **argv) } *value = 0; if( (value = strchr(arg, '=')) == NULL){ + /* in this agent we can ignore options without value + * as we don't need any of them, here. But we should + * accept and ignore them. + */ fprintf(stderr, "invalid input: '%s'\n", arg); - exit(DID_FAILURE); - } + continue; + } *value = 0; value++; /* bahfuck. "agent" is not passed to us anyway -- 1.6.0.6