Skip to content

Commit

Permalink
Merge branch 'jb54265_fix_privileged_sandboxed_apps' into 'master'
Browse files Browse the repository at this point in the history
Don't try to change owner group if it doesn't matter

See merge request mer-core/pulseaudio!41
  • Loading branch information
jusa committed May 26, 2021
2 parents 4e2f123 + 579ded4 commit 0fecd5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pulsecore/core-util.c
Expand Up @@ -326,9 +326,9 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid, bool upd
#ifdef HAVE_FCHOWN
if (uid == (uid_t) -1)
uid = getuid();
if (gid == (gid_t) -1)
if ((gid == (gid_t) -1) && (m & 0070))
gid = getgid();
if (((st.st_uid != uid) || (st.st_gid != gid)) && fchown(fd, uid, gid) < 0) {
if (((st.st_uid != uid) || ((gid != (gid_t) -1) && (st.st_gid != gid))) && fchown(fd, uid, gid) < 0) {
pa_assert_se(pa_close(fd) >= 0);
goto fail;
}
Expand Down

0 comments on commit 0fecd5d

Please sign in to comment.