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 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.

cgf


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