diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 5d2bae92f..e218ca093 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -310,9 +310,6 @@ again: #endif #ifdef O_NOCTTY O_NOCTTY| -#endif -#ifdef O_NOFOLLOW - O_NOFOLLOW| #endif O_RDONLY)) < 0) goto fail; @@ -345,7 +342,7 @@ again: #endif #ifdef HAVE_FCHMOD - if ((st.st_mode & 07777) != m && fchmod(fd, m) < 0) { + if ((st.st_gid != gid && (st.st_mode & 070) != 0) || (st.st_mode & 07777) != m && fchmod(fd, m) < 0) { pa_assert_se(pa_close(fd) >= 0); goto fail; };