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

cdh:storage: Add -u flag to mktemp to avoid file creation #622

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ChengyuZhu6
Copy link
Member

Added the -u flag to the mktemp command to generate a random name without creating a file in the luks-encrypt-storage script. This change ensures that mktemp only produces a unique name, which can be used as an opened device name without the side effect of file creation.

Example usage:
opened_device_name=$(mktemp -u "encrypted_disk_XXXXX")

This update improves the script by preventing unnecessary file creation and potential errors related to file system permissions or read-only states.

Added the -u flag to the mktemp command to generate a random name without creating a file in the `luks-encrypt-storage` script.
This change ensures that mktemp only produces a unique name, which can be used as an opened device name without the side effect of file creation.

Example usage:
opened_device_name=$(mktemp -u "encrypted_disk_XXXXX")

This update improves the script by preventing unnecessary file creation and potential errors related to file system permissions or read-only states.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
@ChengyuZhu6 ChengyuZhu6 marked this pull request as ready for review July 22, 2024 05:54
@ChengyuZhu6 ChengyuZhu6 requested a review from sameo as a code owner July 22, 2024 05:54
@Xynnn007 Xynnn007 merged commit 0d81463 into confidential-containers:main Jul 22, 2024
5 checks passed
@ChengyuZhu6 ChengyuZhu6 deleted the storage-fix branch July 23, 2024 01:50
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.

2 participants