[Bug libc/19866] New: mkstempat and mkdtempat
dvw at phas dot ubc.ca
sourceware-bugzilla@sourceware.org
Thu Mar 24 23:50:00 GMT 2016
https://sourceware.org/bugzilla/show_bug.cgi?id=19866
Bug ID: 19866
Summary: mkstempat and mkdtempat
Product: glibc
Version: 2.23
Status: NEW
Severity: enhancement
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: dvw at phas dot ubc.ca
CC: drepper.fsp at gmail dot com
Target Milestone: ---
I maintain a library (unimaginatively called GetData) for accessing a
filesystem-based database for scientific data. It uses directory file
descriptors and openat() &c. where possible to help deal with the problems
those functions were meant to deal with.
Where we run into a snag is when required to create a temporary file in a
directory for which the library holds a descriptor. Then we're forced to use
mktemp() to generate a temporary filename and then use openat(... O_EXCL) to
create the file.
This works, but it presumably suffers from the deficiencies that mk[sd]temp
were designed to fix. So, it would be better if the system library provided
the analogous ..at() functionality for those functions:
int mkstempat(int dirfd, char *template);
char *mkdtempat(int dirfd, char *template);
which would perform the mktemp + openat/mkdir convolution. (These functions
would also reduce the amount of communication we get from concerned users
encountering the "the use of `mktemp' is dangerous" warning when compiling our
library.)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list