[pulseaudio-discuss] [PATCH 1/2] pa_make_secure_dir: avoid calling fchmod if already right mode

Julien Isorce julien.isorce at gmail.com
Mon Oct 19 00:43:28 PDT 2015


Thx for review and changes, looks better indeed. I also confirm it still
works.
Cheers, Julien

On 19 October 2015 at 04:23, Arun Raghavan <arun at accosted.net> wrote:

> On Sat, 2015-10-10 at 20:11 +0100, Julien Isorce wrote:
> > fchmod is denied in chromium sandbox.
> > ---
> >  src/pulsecore/core-util.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
> > index 278ad63..f694347 100644
> > --- a/src/pulsecore/core-util.c
> > +++ b/src/pulsecore/core-util.c
> > @@ -343,7 +343,7 @@ again:
> >  #endif
> >
> >  #ifdef HAVE_FCHMOD
> > -    if (fchmod(fd, m) < 0) {
> > +    if ((st.st_mode & 0x0FFF) != m && fchmod(fd, m) < 0) {
> >          pa_assert_se(pa_close(fd) >= 0);
> >          goto fail;
> >      };
>
> I'm pushing this out with some minor changes. The commit log is made to
> be more consistent with previous commits.
>
> I also switched 0xFFFF to 07777 since that's the more common convention
> with mode-related variables (this really is a nitpick, though!)
>
> -- Arun
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20151019/133cf153/attachment.html>


More information about the pulseaudio-discuss mailing list