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

Replace non-POSIX mktemp with POSIX mkdir and mv #541

Merged
merged 1 commit into from
Apr 17, 2022
Merged

Replace non-POSIX mktemp with POSIX mkdir and mv #541

merged 1 commit into from
Apr 17, 2022

Conversation

TinCanTech
Copy link
Collaborator

mktemp was used to create temp-files but it is not POSIX and
the version shipped for Windows has known bugs.

Replace mktemp with atomic directory and file creation using mkdir
and mv, both of which are atomic.

The temporary directory "session" directory is created using mkdir
with a 32bit random number for the name.

eg: /tmp/easyrsa-temp/b01dface

The temporary file is created by moving another file into the place
of the temp-file, with a 32bit random number for the name.

eg: /tmp/easyrsa-temp/b01dface/c01dface

Signed-off-by: Richard T Bonhomme tincantech@protonmail.com

mktemp was used to create temp-files but it is not POSIX and
the version shipped for Windows has known bugs.

Replace mktemp with atomic directory and file creation using mkdir
and mv, both of which are atomic.

The temporary directory "session" directory is created using mkdir
with a 32bit random number for the name.

eg: /tmp/easyrsa-temp/b01dface

The temporary file is created by moving another file into the place
of the temp-file, with a 32bit random number for the name.

eg: /tmp/easyrsa-temp/b01dface/c01dface

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
@TinCanTech TinCanTech self-assigned this Apr 16, 2022
@TinCanTech TinCanTech added Full-Approval Merge is imminent Priority Acknowledged priority labels Apr 16, 2022
@TinCanTech TinCanTech added this to the v3.1.0 milestone Apr 16, 2022
@TinCanTech TinCanTech merged commit 01faf60 into OpenVPN:master Apr 17, 2022
@TinCanTech TinCanTech deleted the secure-session branch April 17, 2022 12:58
@TinCanTech TinCanTech added enhancement Applicable to v3.0.x PRs welcome and removed Full-Approval Merge is imminent Priority Acknowledged priority labels Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant