From 19aeb28e73c20a9ded183676c6080dc37515513c Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Tue, 10 Jan 2017 17:21:56 +0100 Subject: 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 > Reviewed-on: https://review.gluster.org/16417 > Smoke: Gluster Build System > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Raghavendra Bhat > Reviewed-by: Kaleb KEITHLEY Change-Id: Icaf46ebb440a3a722fd2fd771dd9d2f765b35ef4 BUG: 1424974 Signed-off-by: Xavier Hernandez Reviewed-on: https://review.gluster.org/16687 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- xlators/mgmt/glusterd/src/glusterd.c | 2 +- xlators/storage/posix/src/posix.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 7d396373f46..26cd0fc4f25 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -876,7 +876,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 2c51d1967a8..aa5a526423f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1994,7 +1994,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; @@ -2856,7 +2856,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; @@ -3017,7 +3017,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; -- cgit