|
@@ -168,14 +168,14 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len)
|
|
|
|
|
|
KIND may be one of:
|
|
KIND may be one of:
|
|
__GT_NOCREATE: simply verify that the name does not exist
|
|
__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)
|
|
__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_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 attribute_hidden __gen_tempname (char *tmpl, int kind, mode_t mode)
|
|
{
|
|
{
|
|
char *XXXXXX;
|
|
char *XXXXXX;
|
|
unsigned int i;
|
|
unsigned int i;
|
|
@@ -217,15 +217,15 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
|
|
fd = 0;
|
|
fd = 0;
|
|
}
|
|
}
|
|
case __GT_FILE:
|
|
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;
|
|
break;
|
|
#if defined __UCLIBC_HAS_LFS__
|
|
#if defined __UCLIBC_HAS_LFS__
|
|
case __GT_BIGFILE:
|
|
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;
|
|
break;
|
|
#endif
|
|
#endif
|
|
case __GT_DIR:
|
|
case __GT_DIR:
|
|
- fd = mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
|
|
+ fd = mkdir (tmpl, mode);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
fd = -1;
|
|
fd = -1;
|