From 256fd1841f42d5e61e286e1c6835ab8425e25a91 Mon Sep 17 00:00:00 2001 From: Jason Nader Date: Mon, 1 Nov 2021 02:27:41 +0900 Subject: [PATCH] core-util: allow symbolic links for user dirs --- src/pulsecore/core-util.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index c383a61c0..7cfe979fa 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; };