check for invalid send/receive option syntax

This commit is contained in:
Christoph Klaffl 2019-02-04 18:19:44 +01:00
parent 10b2012401
commit 5812b57349
No known key found for this signature in database
GPG Key ID: FC1C525C2A47CC28
1 changed files with 10 additions and 0 deletions

10
syncoid
View File

@ -30,11 +30,21 @@ my %compressargs = %{compressargset($args{'compress'} || 'default')}; # Can't be
my @sendoptions = ();
if (length $args{'sendoptions'}) {
@sendoptions = parsespecialoptions($args{'sendoptions'});
if (! defined($sendoptions[0])) {
warn "invalid send options!";
pod2usage(2);
exit 127;
}
}
my @recvoptions = ();
if (length $args{'recvoptions'}) {
@recvoptions = parsespecialoptions($args{'recvoptions'});
if (! defined($recvoptions[0])) {
warn "invalid receive options!";
pod2usage(2);
exit 127;
}
}