OSDN Git Service

mkostemp: fix implementation master
authorAnthony G. Basile <blueness@gentoo.org>
Mon, 27 Oct 2014 20:13:34 +0000 (16:13 -0400)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Mon, 15 Dec 2014 16:53:06 +0000 (17:53 +0100)
commit638a23483b40c5b606ee323e6612e7e454e5154b
treedbc20f09001718352295af64091bbe0682a1f3ca
parentbff3a664e6a2a367bf159c3089df1fe6f093bfb1
mkostemp: fix implementation

mkostemp(char *template, int flags) generates a unique temporary
filename from a template.  The flags parameter accepts three of
the same flags as open(2): O_APPEND, O_CLOEXEC, and O_SYNC.  The
current implementation of mkostemp(3) does not respect the flags
and in fact confuses the flags with the file mode which should
always be S_IRUSR | S_IWUSR.  This patch corrects this issue.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
17 files changed:
libc/inet/getaddrinfo.c
libc/misc/internals/tempname.c
libc/misc/internals/tempname.h
libc/stdio/tempnam.c
libc/stdio/tmpfile.c
libc/stdio/tmpnam.c
libc/stdio/tmpnam_r.c
libc/stdlib/mkdtemp.c
libc/stdlib/mkostemp.c
libc/stdlib/mkostemp64.c
libc/stdlib/mkstemp.c
libc/stdlib/mkstemp64.c
libc/stdlib/mktemp.c
libpthread/nptl/sem_open.c
test/.gitignore
test/stdlib/test-mkostemp-O_CLOEXEC.c [new file with mode: 0644]
test/stdlib/test-mkostemp-child.c [new file with mode: 0644]