This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [1.7] bugs in faccessat


On Thu, Sep 03, 2009 at 11:04:38PM +0200, Corinna Vinschen wrote:
>On Sep  3 15:18, Christopher Faylor wrote:
>> On Thu, Sep 03, 2009 at 01:08:57PM -0600, Eric Blake wrote:
>> >-----BEGIN PGP SIGNED MESSAGE-----
>> >Hash: SHA1
>> >
>> >According to Eric Blake on 9/3/2009 9:58 AM:
>> >> faccessat has at least two, and probably three bugs.
>> >
>> >Here's a fix for 1 (typo) and 3 (check for EINVAL in more places), but not
>> >for 2 (euidaccess, and the followup request of lchmod).
>> >
>> >2009-09-03  Eric Blake  <ebb9@byu.net>
>> >
>> >	* syscalls.cc (faccessat): Fix typo, reject bad flags.
>> >	(fchmodat, fchownat, fstatat, utimensat, linkat, unlinkat): Reject
>> >	bad flags.
>> >
>> >diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
>> >index 3798587..6dee7d3 100644
>> >--- a/winsup/cygwin/syscalls.cc
>> >+++ b/winsup/cygwin/syscalls.cc
>> >@@ -3825,7 +3825,8 @@ faccessat (int dirfd, const char *pathname, int mode, int flags)
>> >   char *path = tp.c_get ();
>> >   if (!gen_full_path_at (path, dirfd, pathname))
>> >     {
>> >-      if (flags & ~(F_OK|R_OK|W_OK|X_OK))
>> >+      if ((mode & ~(F_OK|R_OK|W_OK|X_OK))
>> >+	  || (flags & ~(AT_SYMLINK_NOFOLLOW|AT_EACCESS)))
>> 
>> It's hard to tell from the patch.  Is this properly aligned?  The || should be under the
>> (mode.
>> 
>> With that minor comment please check in.
>
>Thanks for the patches Eric, but, here's a problem.  We still have no
>copyright assignment in place from you.  The fcntl patch is barely
>trivial, but the faccessat patch certainly isn't anymore.  Would it
>be a big problem for you to send the filled out copyright assignemnt form
>from http://cygwin.com/assign.txt to Red Hat ASAP?  With any luck it
>will have arrived and will be signed before I'm back from vacation.

I don't understand why this isn't considered trivial but a basically
equivalent change to fix other errnos is:

http://cygwin.com/ml/cygwin/2009-09/msg00178.html

The criteria that I have used is 1) how many lines is it and 2) would
there be multiple ways to do the same thing, i.e., how "creative" is
the patch.  If there are not too many lines and there is really only
one way to do it, then it seems like it should be considered trivial.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]