From 662c24c5b501b894e847356d03e47c13602b95f1 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 7 Jun 2018 21:57:16 +0100 Subject: [PATCH] limit cli max hosts in prefix to 512 --- bin/netdisco-do | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/netdisco-do b/bin/netdisco-do index 13a07772..9faf8c12 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -112,6 +112,11 @@ my @hostlist = defined $device ? ($net->hostenum) : (undef); my @job_specs = (); my $exitstatus = 0; +if (scalar @hostlist > 512) { + info sprintf '%s: aborted - unwise to attempt %s jobs at once', $action, (scalar @hostlist); + exit 1; +} + foreach my $host (@hostlist) { my $dev = $host ? get_device($host->addr) : undef; if ($dev and not (blessed $dev and $dev->in_storage) and $action !~ m/^discover/) {