Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validators: T6738: Revert "validators: T6739: fix ipaddrcheck argument quoting" #4104

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/validators/interface-address
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

ipaddrcheck --is-ipv4-host "$1" || ipaddrcheck --is-ipv6-host "$1"
ipaddrcheck --is-ipv4-host $1 || ipaddrcheck --is-ipv6-host $1
4 changes: 2 additions & 2 deletions src/validators/ip-address
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-any-single "$1"
ipaddrcheck --is-any-single $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IP address"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ip-cidr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-any-cidr "$1"
ipaddrcheck --is-any-cidr $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IP CIDR"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ip-host
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-any-host "$1"
ipaddrcheck --is-any-host $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IP host"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ip-prefix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-any-net "$1"
ipaddrcheck --is-any-net $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IP prefix"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv4 "$1"
ipaddrcheck --is-ipv4 $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not IPv4"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4-address
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv4-single "$1"
ipaddrcheck --is-ipv4-single $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv4 address"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4-host
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv4-host "$1"
ipaddrcheck --is-ipv4-host $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv4 host"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4-multicast
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv4-multicast "$1" && ipaddrcheck --is-ipv4-single "$1"
ipaddrcheck --is-ipv4-multicast $1 && ipaddrcheck --is-ipv4-single $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv4 multicast address"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4-prefix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv4-net "$1"
ipaddrcheck --is-ipv4-net $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv4 prefix"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv4-range
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ if [[ "$1" =~ "-" ]]; then
# hyphen as delimiter
readarray -d - -t strarr <<< $1

ipaddrcheck --is-ipv4-single "${strarr[0]}"
ipaddrcheck --is-ipv4-single ${strarr[0]}
if [ $? -gt 0 ]; then
error_exit $1
fi

ipaddrcheck --is-ipv4-single "${strarr[1]}"
ipaddrcheck --is-ipv4-single ${strarr[1]}
if [ $? -gt 0 ]; then
error_exit $1
fi
Expand Down
2 changes: 1 addition & 1 deletion src/validators/ipv4-range-mask
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ do
done

if [[ "${range}" =~ "-" ]]&&[[ ! -z ${mask} ]]; then
ipaddrcheck --range-prefix-length "${mask}" --is-ipv4-range "${range}"
ipaddrcheck --range-prefix-length ${mask} --is-ipv4-range ${range}
if [ $? -gt 0 ]; then
error_exit ${range} ${mask}
fi
Expand Down
4 changes: 2 additions & 2 deletions src/validators/ipv6
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv6 "$1"
ipaddrcheck --is-ipv6 $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not IPv6"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv6-address
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv6-single "$1"
ipaddrcheck --is-ipv6-single $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv6 address"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv6-host
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv6-host "$1"
ipaddrcheck --is-ipv6-host $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv6 host"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv6-multicast
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv6-multicast "$1" && ipaddrcheck --is-ipv6-single "$1"
ipaddrcheck --is-ipv6-multicast $1 && ipaddrcheck --is-ipv6-single $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv6 multicast address"
exit 1
fi

exit 0
exit 0
4 changes: 2 additions & 2 deletions src/validators/ipv6-prefix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

ipaddrcheck --is-ipv6-net "$1"
ipaddrcheck --is-ipv6-net $1

if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv6 prefix"
exit 1
fi

exit 0
exit 0
2 changes: 1 addition & 1 deletion src/validators/ipv6-srv6-segments
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ segments="$1"
export IFS="/"

for ipv6addr in $segments; do
ipaddrcheck --is-ipv6-single "$ipv6addr"
ipaddrcheck --is-ipv6-single $ipv6addr
if [ $? -gt 0 ]; then
echo "Error: $1 is not a valid IPv6 address"
exit 1
Expand Down
Loading