linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] vfs: POSIX-compliant version of fchmodat with flag argument
@ 2011-12-31  0:26 Andrew Ayer
  2011-12-31  0:26 ` [PATCH 1/2] vfs: Add POSIX-compliant version of fchmodat syscall Andrew Ayer
  2011-12-31  0:26 ` [PATCH 2/2] x86: Hook up new fchmodat4 syscall Andrew Ayer
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Ayer @ 2011-12-31  0:26 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel

Hi,

The below patches implement a 4 argument version of fchmodat (fchmodat4)
that supports a flag argument, as specified by POSIX.  Currently, the
glibc wrapper has a flag argument, but fails with EOPNOTSUPP if you
specify AT_SYMLINK_NOFOLLOW. POSIX says that fchmodat should only fail
with EOPNOTSUPP if you specify AT_SYMLINK_NOFOLLOW and the path actually
refers to a symbolic link (and the system doesn't support changing the
mode of symbolic links).  Unfortunately glibc can't do better because
the current syscall doesn't have a flag argument.

In addition to supporting AT_SYMLINK_NOFOLLOW, this also supports the
AT_EMPTY_PATH flag, just like fchownat.

Besides the POSIX-compliance, this patch will make it possible to
ensure, in a race-free way, that you do not follow symlinks when
chmodding. Previously, you could open a file with O_NOFOLLOW and fchmod
it, but this only worked if you had read or write permissions on the
file.  Now you can open the file with O_PATH|O_NOFOLLOW and do fchmodat
with AT_EMPTY_PATH.

Any feedback is welcome.

Cheers, 
Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH 0/2 RESEND] POSIX-compliant version of fchmodat with flag argument
@ 2012-01-13  1:53 Andrew Ayer
  2012-01-13  1:53 ` [PATCH 2/2] x86: Hook up new fchmodat4 syscall Andrew Ayer
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Ayer @ 2012-01-13  1:53 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel

Hi,

The below patches implement a 4 argument version of fchmodat (fchmodat4)
that has a flag argument, as specified by POSIX.  This is needed to
implement a proper glibc wrapper.

fchmodat4 supports the same two flags as fchownat: AT_SYMLINK_NOFOLLOW
and AT_EMPTY_PATH.

Besides the POSIX-compliance, this patch will make it possible to
ensure, in a race-free way, that you do not follow symlinks when
chmodding. Previously, you could open a file with O_NOFOLLOW and fchmod
it, but this only worked if you had read or write permissions on the
file.  Now you can open the file with O_PATH|O_NOFOLLOW and do fchmodat
with AT_EMPTY_PATH.

Could this patch be applied?  Any feedback is welcome.

Cheers, 
Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-13  1:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-31  0:26 [PATCH 0/2] vfs: POSIX-compliant version of fchmodat with flag argument Andrew Ayer
2011-12-31  0:26 ` [PATCH 1/2] vfs: Add POSIX-compliant version of fchmodat syscall Andrew Ayer
2011-12-31  0:26 ` [PATCH 2/2] x86: Hook up new fchmodat4 syscall Andrew Ayer
  -- strict thread matches above, loose matches on Subject: below --
2012-01-13  1:53 [PATCH 0/2 RESEND] POSIX-compliant version of fchmodat with flag argument Andrew Ayer
2012-01-13  1:53 ` [PATCH 2/2] x86: Hook up new fchmodat4 syscall Andrew Ayer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).