summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2017-01-10 17:21:56 +0100
committerKaleb KEITHLEY <kkeithle@redhat.com>2017-02-18 12:22:29 -0500
commit621fedf8aeb3e972db33b3eefa6cbdbef104d6a6 (patch)
treeaf15bcd0f4c927c1bcc271bc441c90fea7a39f54 /xlators
parent3cda64115596f0501bb58209f819655bced22c18 (diff)
posix: Fix creation of files with S_ISVTX on FreeBSD
On FreeBSD the S_ISVTX flag is completely ignored when creating a regular file. Since gluster needs to create files with this flag set, specialy for DHT link files, it's necessary to force the flag. This fix does this by calling fchmod() after creating a file that must have this flag set. Change-Id: I51eecfe4642974df6106b9084a0b144835a4997a BUG: 1411228 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: https://review.gluster.org/16417 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ec/src/ec-code.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c2
-rw-r--r--xlators/storage/posix/src/posix.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/xlators/cluster/ec/src/ec-code.c b/xlators/cluster/ec/src/ec-code.c
index 9647a08287c..25a501e61b7 100644
--- a/xlators/cluster/ec/src/ec-code.c
+++ b/xlators/cluster/ec/src/ec-code.c
@@ -963,7 +963,7 @@ ec_code_detect(xlator_t *xl, const char *def)
return NULL;
}
- file.fd = sys_openat(AT_FDCWD, PROC_CPUINFO, O_RDONLY);
+ file.fd = sys_open(PROC_CPUINFO, O_RDONLY, 0);
if (file.fd < 0) {
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 88361877efe..11d4b8bc79f 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -947,7 +947,7 @@ check_prepare_mountbroker_root (char *mountbroker_root)
dfd0 = dup (dfd);
for (;;) {
- ret = sys_openat (dfd, "..", O_RDONLY);
+ ret = sys_openat (dfd, "..", O_RDONLY, 0);
if (ret != -1) {
dfd2 = ret;
ret = sys_fstat (dfd2, &st2);
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index c989d5527a1..aa7e7404099 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -2006,7 +2006,7 @@ posix_unlink (call_frame_t *frame, xlator_t *this,
if (fdstat_requested ||
(priv->background_unlink && IA_ISREG (loc->inode->ia_type))) {
- fd = open (real_path, O_RDONLY);
+ fd = sys_open (real_path, O_RDONLY, 0);
if (fd == -1) {
op_ret = -1;
op_errno = errno;
@@ -2867,7 +2867,7 @@ posix_create (call_frame_t *frame, xlator_t *this,
if (priv->o_direct)
_flags |= O_DIRECT;
- _fd = open (real_path, _flags, mode);
+ _fd = sys_open (real_path, _flags, mode);
if (_fd == -1) {
op_errno = errno;
@@ -3028,7 +3028,7 @@ posix_open (call_frame_t *frame, xlator_t *this,
if (priv->o_direct)
flags |= O_DIRECT;
- _fd = open (real_path, flags, 0);
+ _fd = sys_open (real_path, flags, 0);
if (_fd == -1) {
op_ret = -1;
op_errno = errno;