X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/846ee6a4a27b3178b23b551e333750133da39d27..7d8b3f45f98773ba02057b81b90c31a12320c09e:/l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/internals/tempname.c diff --git a/l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/internals/tempname.c b/l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/internals/tempname.c index cbd4ced7a..4145c9478 100644 --- a/l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/internals/tempname.c +++ b/l4/pkg/uclibc/lib/contrib/uclibc/libc/misc/internals/tempname.c @@ -168,14 +168,14 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len) KIND may be one of: __GT_NOCREATE: simply verify that the name does not exist - at the time of the call. + at the time of the call. mode argument is ignored. __GT_FILE: create the file using open(O_CREAT|O_EXCL) - and return a read-write fd. The file is mode 0600. + and return a read-write fd with given mode. __GT_BIGFILE: same as __GT_FILE but use open64(). - __GT_DIR: create a directory, which will be mode 0700. + __GT_DIR: create a directory with given mode. */ -int attribute_hidden __gen_tempname (char *tmpl, int kind) +int __gen_tempname (char *tmpl, int kind, mode_t mode) { char *XXXXXX; unsigned int i; @@ -217,15 +217,15 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind) fd = 0; } case __GT_FILE: - fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, mode); break; #if defined __UCLIBC_HAS_LFS__ case __GT_BIGFILE: - fd = open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + fd = open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, mode); break; #endif case __GT_DIR: - fd = mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR); + fd = mkdir (tmpl, mode); break; default: fd = -1;