aboutsummaryrefslogtreecommitdiffstats
path: root/ports/unix/guts
diff options
context:
space:
mode:
Diffstat (limited to 'ports/unix/guts')
-rw-r--r--ports/unix/guts/mkdirat.c5
-rw-r--r--ports/unix/guts/mkfifoat.c2
-rw-r--r--ports/unix/guts/mknodat.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/ports/unix/guts/mkdirat.c b/ports/unix/guts/mkdirat.c
index 5f80b50..668d6ac 100644
--- a/ports/unix/guts/mkdirat.c
+++ b/ports/unix/guts/mkdirat.c
@@ -30,6 +30,11 @@
if (stat_rc != -1) {
buf.st_mode = PSEUDO_DB_MODE(buf.st_mode, mode);
pseudo_client_op(OP_MKDIR, 0, -1, dirfd, path, &buf);
+#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
+ real_fchmod(path, PSEUDO_FS_MODE(mode, 1));
+#else
+ real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 1), AT_SYMLINK_NOFOLLOW);
+#endif
} else {
pseudo_debug(PDBGF_OP, "mkdir of %s succeeded, but stat failed: %s\n",
path, strerror(errno));
diff --git a/ports/unix/guts/mkfifoat.c b/ports/unix/guts/mkfifoat.c
index 4101a72..4546ba3 100644
--- a/ports/unix/guts/mkfifoat.c
+++ b/ports/unix/guts/mkfifoat.c
@@ -34,12 +34,14 @@
return -1;
}
rc = base_stat(path, &buf);
+ real_chmod(path, PSEUDO_FS_MODE(mode, 0));
#else
rc = real_mkfifoat(dirfd, path, PSEUDO_FS_MODE(mode, 0));
if (rc == -1) {
return -1;
}
rc = base_fstatat(dirfd, path, &buf, AT_SYMLINK_NOFOLLOW);
+ real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, 0), AT_SYMLINK_NOFOLLOW);
#endif
/* if the stat failed, we are going to give up and nuke
* any file we may have created, and hope for the best.
diff --git a/ports/unix/guts/mknodat.c b/ports/unix/guts/mknodat.c
index 5d8d47c..76e4dd9 100644
--- a/ports/unix/guts/mknodat.c
+++ b/ports/unix/guts/mknodat.c
@@ -37,6 +37,7 @@
if (rc == -1) {
return -1;
}
+ real_fchmod(rc, PSEUDO_FS_MODE(mode, 0));
base_fstat(rc, &buf);
/* mknod does not really open the file. We don't have
* to use wrap_close because we've never exposed this file