Skip to content

Commit

Permalink
Make remove_group_inline() only backup the inline-file to be removed
Browse files Browse the repository at this point in the history
Remove unset -v inline_hash; easy-tls no longer supports inline_renew()

Signed-off-by: Richard T Bonhomme <[email protected]>
  • Loading branch information
TinCanTech committed Mar 8, 2022
1 parent 59d057d commit 352f867
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions easytls
Original file line number Diff line number Diff line change
Expand Up @@ -3158,12 +3158,6 @@ remove_inline ()
die "Failed to update inline-index"
fi

# Inline file and record deleted - Forget the HASH
# Otherwise 'inline_renew add' still has the HASH
# Logically, this *cannot* be removed -- tct
# Improve this! please..
unset -v inline_hash

if [ -z "${force_remove}" ]; then
notice "Inline file removed: ${inline_file}"
else
Expand Down Expand Up @@ -3221,7 +3215,7 @@ remove_group_inline ()

# Move
if [ -z "${force_remove}" ]; then
"${EASYTLS_MV}" "${inline_file}" "${inline_file}-deleted" || \
"${EASYTLS_MV}" "${inline_file}" "${EASYTLS_TEMP_DELETED}" || \
die "Failed to move: ${inline_file}"
else
"${EASYTLS_MV}" "${inline_file}" "${inline_file}-badhash" || \
Expand All @@ -3232,21 +3226,13 @@ remove_group_inline ()
if inline_index_update del; then
# Remove
if [ -z "${force_remove}" ]; then
"${EASYTLS_RM}" "${inline_file}-deleted" || \
"${EASYTLS_RM}" "${EASYTLS_TEMP_DELETED}" || \
die "Failed to remove: ${inline_file}"
fi
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}" || \
"${EASYTLS_MV}" "${EASYTLS_TEMP_DELETED}" "${inline_file}" || \
die "Failed to restore: ${inline_file}"
else
"${EASYTLS_MV}" "${inline_file}-badhash" "${inline_file}" || \
Expand All @@ -3256,12 +3242,6 @@ remove_group_inline ()
die "Failed to update inline-index"
fi

# Inline file and record deleted - Forget the HASH
# Otherwise 'inline_renew add' still has the HASH
# Logically, this *cannot* be removed -- tct
# Improve this! please..
unset -v inline_hash

if [ -z "${force_remove}" ]; then
notice "Inline file removed: ${inline_file}"
else
Expand Down

1 comment on commit 352f867

@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.