bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: [PATCH] trans/fakeroot.c


From: Samuel Thibault
Subject: Re: RFC: [PATCH] trans/fakeroot.c
Date: Fri, 15 May 2015 20:31:37 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Svante Signell, le Tue 12 May 2015 09:15:46 +0200, a écrit :
> +  /* XXX: Limit openmodes */
> +  if (openmodes > O_ALLOWED)
> +    openmodes &= O_ALLOWED; /* works */

More precisely, which openmode posed problem here?  Perhaps this is not
the best place to exclude them.  At the very least we need to know what
exactly was posing problem before patching the source code.

Also, use if (openmodes & ~O_ALLOWED) rather than openmodes > O_ALLOWED.
It happens that O_ALLOWED contains contiguous bits from bit #0, and thus
> O_ALLOWED happens to produce the expected result, but that's only by
luck.

> +       /* XXX: Change nn->openmodes selectively */
> +       //if (newmodes > nn->openmodes)
> +         nn->openmodes = newmodes;

Ditto.

> -      if (file != MACH_PORT_NULL && (nn->openmodes & ~newmodes))
> +      if (file != MACH_PORT_NULL && (nn->openmodes & newmodes )) /* works */

This change needs to be motivated and explained.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]