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