diff options
Diffstat (limited to 'ports')
-rw-r--r-- | ports/darwin/guts/open.c | 1 | ||||
-rw-r--r-- | ports/linux/guts/fopen64.c | 1 | ||||
-rw-r--r-- | ports/linux/guts/freopen64.c | 1 | ||||
-rw-r--r-- | ports/linux/guts/mkstemp64.c | 1 | ||||
-rw-r--r-- | ports/linux/guts/openat.c | 1 | ||||
-rw-r--r-- | ports/unix/guts/fopen.c | 1 | ||||
-rw-r--r-- | ports/unix/guts/freopen.c | 1 | ||||
-rw-r--r-- | ports/unix/guts/mkstemp.c | 1 |
8 files changed, 8 insertions, 0 deletions
diff --git a/ports/darwin/guts/open.c b/ports/darwin/guts/open.c index afe19a2..0979c54 100644 --- a/ports/darwin/guts/open.c +++ b/ports/darwin/guts/open.c @@ -41,6 +41,7 @@ if (stat_rc != -1) { buf.st_mode = PSEUDO_DB_MODE(buf.st_mode, mode); if (!existed) { + real_fchmod(rc, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, PSEUDO_ACCESS(flags), rc, -1, path, &buf); diff --git a/ports/linux/guts/fopen64.c b/ports/linux/guts/fopen64.c index ac3fde1..32539ea 100644 --- a/ports/linux/guts/fopen64.c +++ b/ports/linux/guts/fopen64.c @@ -20,6 +20,7 @@ pseudo_debug(PDBGF_FILE, "fopen64 '%s': fd %d <FILE %p>\n", path, fd, (void *) rc); if (real___fxstat64(_STAT_VER, fd, &buf) != -1) { if (!existed) { + real_fchmod(fd, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf); diff --git a/ports/linux/guts/freopen64.c b/ports/linux/guts/freopen64.c index bb69b34..b6ff0a6 100644 --- a/ports/linux/guts/freopen64.c +++ b/ports/linux/guts/freopen64.c @@ -19,6 +19,7 @@ pseudo_debug(PDBGF_FILE, "freopen64 '%s': fd %d\n", path, fd); if (real___fxstat64(_STAT_VER, fd, &buf) != -1) { if (!existed) { + real_fchmod(fd, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf); diff --git a/ports/linux/guts/mkstemp64.c b/ports/linux/guts/mkstemp64.c index cbeda0e..48be612 100644 --- a/ports/linux/guts/mkstemp64.c +++ b/ports/linux/guts/mkstemp64.c @@ -30,6 +30,7 @@ save_errno = errno; if (real___fxstat64(_STAT_VER, rc, &buf) != -1) { + real_fchmod(rc, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, tmp_template, &buf); pseudo_client_op(OP_OPEN, PSA_READ | PSA_WRITE, rc, -1, tmp_template, &buf); } else { diff --git a/ports/linux/guts/openat.c b/ports/linux/guts/openat.c index 87fa466..338bd45 100644 --- a/ports/linux/guts/openat.c +++ b/ports/linux/guts/openat.c @@ -75,6 +75,7 @@ if (stat_rc != -1) { buf.st_mode = PSEUDO_DB_MODE(buf.st_mode, mode); if (!existed) { + real_fchmod(rc, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, dirfd, path, &buf); } pseudo_client_op(OP_OPEN, PSEUDO_ACCESS(flags), rc, dirfd, path, &buf); diff --git a/ports/unix/guts/fopen.c b/ports/unix/guts/fopen.c index de940f5..4214980 100644 --- a/ports/unix/guts/fopen.c +++ b/ports/unix/guts/fopen.c @@ -19,6 +19,7 @@ pseudo_debug(PDBGF_OP, "fopen '%s': fd %d <FILE %p>\n", path, fd, (void *) rc); if (base_fstat(fd, &buf) != -1) { if (!existed) { + real_fchmod(fd, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf); diff --git a/ports/unix/guts/freopen.c b/ports/unix/guts/freopen.c index 45ca135..09219be 100644 --- a/ports/unix/guts/freopen.c +++ b/ports/unix/guts/freopen.c @@ -19,6 +19,7 @@ pseudo_debug(PDBGF_OP, "freopen '%s': fd %d\n", path, fd); if (base_fstat(fd, &buf) != -1) { if (!existed) { + real_fchmod(fd, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, path, &buf); } pseudo_client_op(OP_OPEN, pseudo_access_fopen(mode), fd, -1, path, &buf); diff --git a/ports/unix/guts/mkstemp.c b/ports/unix/guts/mkstemp.c index 315bec8..1e2b026 100644 --- a/ports/unix/guts/mkstemp.c +++ b/ports/unix/guts/mkstemp.c @@ -30,6 +30,7 @@ save_errno = errno; if (base_fstat(rc, &buf) != -1) { + real_fchmod(rc, PSEUDO_FS_MODE(0600, 0)); pseudo_client_op(OP_CREAT, 0, -1, -1, tmp_template, &buf); pseudo_client_op(OP_OPEN, PSA_READ | PSA_WRITE, rc, -1, tmp_template, &buf); } else { |