mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-09 13:29:59 -05:00
core-util: Call fchown() only when necessary
This reportedly fixes some cases where the home directory is on NFS. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=45656
This commit is contained in:
parent
48420b660a
commit
5610d41482
1 changed files with 1 additions and 1 deletions
|
|
@ -336,7 +336,7 @@ again:
|
||||||
uid = getuid();
|
uid = getuid();
|
||||||
if (gid == (gid_t) -1)
|
if (gid == (gid_t) -1)
|
||||||
gid = getgid();
|
gid = getgid();
|
||||||
if (fchown(fd, uid, gid) < 0) {
|
if (((st.st_uid != uid) || (st.st_gid != gid)) && fchown(fd, uid, gid) < 0) {
|
||||||
pa_assert_se(pa_close(fd) >= 0);
|
pa_assert_se(pa_close(fd) >= 0);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue