Skip to content
Snippets Groups Projects
Commit e22107cf authored by rhatto's avatar rhatto
Browse files

Validate created date on long_rotation to avoid too many arguments at comparison (upstream #3868)

parent 29286c7c
No related branches found
No related tags found
No related merge requests found
......@@ -421,6 +421,11 @@ function rotate_long {
else
created=0
fi
# Validate created date
if [ -z "$created" ] || echo $created | grep -v -q -e '^[0-9]*$'; then
warning "Invalid metatada $created. Skipping rotation."
break
fi
cutoff_time=$(( now - (seconds*(i-1)) ))
if [ ! $created -gt $cutoff_time ]; then
next=$(( i + 1 ))
......@@ -539,6 +544,11 @@ function rotate_long_remote {
else
created=0
fi
# Validate created date
if [ -z "\$created" ] || echo \$created | grep -v -q -e '^[0-9]*$'; then
echo "Warning: Invalid metatada \$created. Skipping rotation."
break
fi
cutoff_time=\$(( now - (seconds*(i-1)) ))
if [ ! \$created -gt \$cutoff_time ]; then
next=\$(( i + 1 ))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment