Skip to content

Commit 5c590f6

Browse files
committed
Low: fencer: Fix ISO 8601 interval parsing in pcmk_delay_base
An ISO 8601 interval can include a colon character. I can't think of any valid reason why a user would specify an interval this way for a fencing delay, but there doesn't seem to be any reason to exclude mapping values that have a colon. The "make sure there's no colon" check seemed to be an artifact of the way the parsing code worked before we started using g_strsplit(), etc. Signed-off-by: Reid Wahl <[email protected]>
1 parent e01a014 commit 5c590f6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

daemons/fenced/fenced_commands.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ get_value_for_target(const char *target, const char *values)
261261
return value;
262262
}
263263

264+
/* @TODO Consolidate some of this with build_port_aliases(). But keep in mind
265+
* that build_port_aliases()/pcmk__host_map supports either '=' or ':' as a
266+
* mapping separator, while pcmk_delay_base supports only ':'.
267+
*/
264268
static int
265269
get_action_delay_base(const fenced_device_t *device, const char *action,
266270
const char *target)
@@ -293,10 +297,11 @@ get_action_delay_base(const fenced_device_t *device, const char *action,
293297
stripped = NULL;
294298
}
295299

296-
if (strchr(delay_base_s, ':') == NULL) {
297-
pcmk_parse_interval_spec(delay_base_s, &delay_base);
298-
delay_base /= 1000;
299-
}
300+
/* @TODO Should we accept only a simple time+units string, rather than an
301+
* ISO 8601 interval?
302+
*/
303+
pcmk_parse_interval_spec(delay_base_s, &delay_base);
304+
delay_base /= 1000;
300305

301306
g_free(stripped);
302307
g_free(delay_base_s);

0 commit comments

Comments
 (0)