V8.13.400.2025.11.08
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m11s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m11s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -95,17 +95,27 @@ normalize_ssh_key_file() {
|
||||
var_tmp_file="${var_key_file}.noCR.$$"
|
||||
|
||||
### Remove only '\r', keep everything else as-is.
|
||||
tr -d '\r' < "${var_key_file}" > "${var_tmp_file}" || {
|
||||
echo "ERROR: Failed to normalize CRLF in ${var_key_file}" >&2
|
||||
rm -f "${var_tmp_file}"
|
||||
return 1
|
||||
}
|
||||
if ! tr -d '\r' < "${var_key_file}" >| "${var_tmp_file}"; then
|
||||
|
||||
mv "${var_tmp_file}" "${var_key_file}" || {
|
||||
echo "ERROR: Failed to replace normalized file ${var_key_file}" >&2
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ Failed to normalize CRLF: [%s] \e[0m\n" "${var_key_file}"
|
||||
rm -f "${var_tmp_file}"
|
||||
return 1
|
||||
}
|
||||
return "${ERR_SANITIZING}"
|
||||
|
||||
fi
|
||||
|
||||
mv "${var_tmp_file}" "${var_key_file}"
|
||||
|
||||
if command -v ssh-keygen >/dev/null 2>&1; then
|
||||
|
||||
if ! ssh-keygen -lf "${var_key_file}" >/dev/null; then
|
||||
|
||||
printf "\e[91m++++ ++++ ++++ ++++ ++++ ++++ ++ ❌ Failed check ssh-keygen -lf: [%s] \e[0m\n" "${var_key_file}"
|
||||
return "${ERR_SANITIZING}"
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user