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

fix mkdir command that enables clobbering tmp identity in container #801

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

qrkourier
Copy link
Member

No description provided.

@qrkourier qrkourier requested a review from a team as a code owner February 19, 2024 18:56
@@ -61,7 +61,8 @@ fi
# if identity env var is defined then do not look for mounted identities
if [[ -n "${ZITI_IDENTITY_JSON:-}" ]]; then
IDENTITIES_DIR="/tmp/openziti"
mkdir -m0700 "${IDENTITIES_DIR}"
# shellcheck disable=SC2174
mkdir -pm0700 "${IDENTITIES_DIR}"
Copy link
Member

Choose a reason for hiding this comment

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

What's this fixing? Is the /tmp directory actually missing sometimes? If so, how does that happen? We should prevent that if possible because /tmp is an important directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

The problem is that /tmp/openziti already exists if a container is resumed, so mkdir always fails in that case with an error like "file exists."

The fix is to tolerate the existing directory because the goal of this hunk is to clobber /tmp/openizti/${ZITI_IDENTITY_BASENAME}.json with the value of $ZITI_IDENTITY_JSON.

@qrkourier qrkourier merged commit 69816ab into main Feb 22, 2024
15 checks passed
@qrkourier qrkourier deleted the clobber-identity-in-container branch February 22, 2024 15:47
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.

None yet

2 participants