Skip to content

Commit

Permalink
Remove useless file recovery code
Browse files Browse the repository at this point in the history
The code here is all replaced by code within univeral_update()

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Mar 8, 2022
1 parent 16b3ca7 commit 10fcbd1
Showing 1 changed file with 9 additions and 85 deletions.
94 changes: 9 additions & 85 deletions easytls
Original file line number Diff line number Diff line change
Expand Up @@ -4041,13 +4041,7 @@ inline_tls_auth ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_tls_auth - inline_index_update add"
fi

# share this client FP with server defined by -r=<serv-name> option
Expand Down Expand Up @@ -4129,13 +4123,7 @@ inline_tls_crypt_v1 ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_tls_crypt_v1 - inline_index_update add"
fi

# share this client FP with server defined by -r=<serv-name> option
Expand Down Expand Up @@ -4329,13 +4317,7 @@ inline_tls_crypt_v2 ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_tls_crypt_v2 - inline_index_update add"
fi

# share this client FP with server defined by -r=<serv-name> option
Expand Down Expand Up @@ -4503,13 +4485,7 @@ inline_tls_cv2_group_server ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_tls_crypt_v2_group_server - inline_index_update add"
fi

name="${save_name}"
Expand Down Expand Up @@ -4706,13 +4682,7 @@ inline_tls_cv2_group_client ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_tls_crypt_v2_group_client - inline_index_update add"
fi

name="${save_name}"
Expand Down Expand Up @@ -4845,24 +4815,7 @@ inline_share_fingerprint ()
if inline_index_update del; then
: # OK
else
# Restore original inline-index
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}" || \
die "remove_inline - Restore original inline-index"
fi

# Undo move
if [ -z "${force_remove}" ]; then
"${EASYTLS_MV}" "${inline_file}-deleted" "${inline_file}" || \
die "Failed to restore: ${inline_file}"
else
"${EASYTLS_MV}" "${inline_file}-badhash" "${inline_file}" || \
die "Failed to restore: ${inline_file}"
fi
# Always die
die "Failed to update inline-index"
die "inline_share_fingerprint - inline_index_update del"
fi

else
Expand Down Expand Up @@ -4906,13 +4859,7 @@ inline_share_fingerprint ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_share_fingerprint - inline_index_update add"
fi
fi

Expand Down Expand Up @@ -4940,24 +4887,7 @@ inline_share_fingerprint ()
if inline_index_update del; then
: # OK
else
# Restore original inline-index
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}" || \
die "remove_inline - Restore original inline-index"
fi

# Undo move
if [ -z "${force_remove}" ]; then
"${EASYTLS_MV}" "${inline_file}-deleted" "${inline_file}" || \
die "Failed to restore: ${inline_file}"
else
"${EASYTLS_MV}" "${inline_file}-badhash" "${inline_file}" || \
die "Failed to restore: ${inline_file}"
fi
# Always die
die "Failed to update inline-index"
die "inline_share_fingerprint - inline_index_update del"
fi

else
Expand Down Expand Up @@ -5013,13 +4943,7 @@ inline_share_fingerprint ()
if inline_index_update add; then
: # OK
else
if [ -f "${EASYTLS_INLINE_INDEX}-deleted" ]; then
# Restore original inline-index
"${EASYTLS_RM}" -f "${EASYTLS_INLINE_INDEX}"
"${EASYTLS_MV}" "${EASYTLS_INLINE_INDEX}-deleted" \
"${EASYTLS_INLINE_INDEX}"
die "Failed to update inline-index"
fi
die "inline_share_fingerprint - inline_index_update add"
fi
fi

Expand Down

1 comment on commit 10fcbd1

@TinCanTech
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.