]> code.delx.au - pulseaudio/commit
core-util: Remove redundant check of directory permissions
authorAlexander E. Patrakov <patrakov@gmail.com>
Sun, 20 Apr 2014 15:58:19 +0000 (21:58 +0600)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 25 Apr 2014 12:07:34 +0000 (15:07 +0300)
commitf2f5dffb1dcc4fd8481e58a686d088e4286441b0
tree441c4a913d17d6dd7ae0748f64a39f5e522551c0
parent5610d41482df995baaf510308e07ccbe04c9e18b
core-util: Remove redundant check of directory permissions

Initially (in commit ef422fa4ae626e9638ca70d1c56f27e701dd69c2),
pa_make_secure_dir followed a simple principle: "make a directory, or,
if it exists, check that it is suitable". Later this evolved into "make
a directory, or, if it exists, ensure that it is suitable". But the
check remained.

The check is now neither sufficient nor necessary. On POSIX-compliant
systems, the fstat results being checked are actually post-conditions of
fchmod and fchown. And on systems implementing POSIX ACLs, fstat only
reflects a part of the information relevant to the security of the
directory permissions, so PulseAudio could accept an existing insecure
directory anyway.

Also, the check still fires on non-POSIX-compliant filesystems like CIFS.
As a user cannot do anything to fix it, just accept insecure permissions
in this case.
src/pulsecore/core-util.c