diff options
author | root <root@vps-18a7a2b7.vps.ovh.ca> | 2024-02-17 11:06:57 -0500 |
---|---|---|
committer | root <root@vps-18a7a2b7.vps.ovh.ca> | 2024-02-17 11:06:57 -0500 |
commit | 2ab6533b04c4918e2d6c057bf78d5e2f85c7958a (patch) | |
tree | 78ac1034b32ac121b7c781ea19f1cec403af906c | |
parent | c6a15000d36bd893297626baade32dae4431f6da (diff) |
check length of sha256sum output in case of short reads
-rwxr-xr-x | mariadb/mariadb-push-databases-to-empty-replica | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mariadb/mariadb-push-databases-to-empty-replica b/mariadb/mariadb-push-databases-to-empty-replica index c04fd6f..29b7bb3 100755 --- a/mariadb/mariadb-push-databases-to-empty-replica +++ b/mariadb/mariadb-push-databases-to-empty-replica | |||
@@ -218,10 +218,10 @@ dns_check_servers() | |||
218 | 218 | ||
219 | truncated_machineid_decimal_string_int32() | 219 | truncated_machineid_decimal_string_int32() |
220 | { | 220 | { |
221 | systemd-id128 machine-id | | 221 | local REPLY |
222 | sha256sum | | 222 | read -r -n8 < <(systemd-id128 machine-id | sha256sum) && |
223 | ( read -n8 && | 223 | [ ${#REPLY} = 8 ] && |
224 | printf '%u\n' 0x"$REPLY" ) | 224 | printf '%u\n' 0x"$REPLY" |
225 | } | 225 | } |
226 | 226 | ||
227 | run_both() | 227 | run_both() |