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

Preserve even more stunnel certs on upgrade #164

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ydirson
Copy link
Contributor

@ydirson ydirson commented Aug 8, 2024

It happens #154 missed a few things:

  • an empty /etc/stunnel/certs dir would not be restored
  • the bundle of /etc/stunnel/certs dir would not be restored either

ydirson added 3 commits August 8, 2024 10:47
9a09a4d preserves the certs themselves,
but for some reason the bundle is not necessarily regenerated from them,
(especially when the dir was empty and is "thus" not preserved?) so
preserve the bundle as well - as was done for the pool bundle.

Signed-off-by: Yann Dirson <[email protected]>
…e go

If the specified dir exists but is empty (as can happen for
/etc/stunnel/certs), the current code would not restore it, as in fact
it restores not the dir, but its immediate children matching the pattern.

When no pattern is given, avoid complications by using the fact that
restore_file perfectly works with directories too.

Note this makes it prominent that the 're' handling is only ever applied
to immediate children of the dir; we may simplify further by moving the
pattern-matching code down to restore_file, but then do we want to keep
the current behavior?

Signed-off-by: Yann Dirson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants