linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Constructing a NFSv4 ACL from POSIX mode bits
@ 2012-07-24 19:33 Haynes, Tom
  2012-07-24 19:53 ` J. Bruce Fields
  2012-07-24 20:00 ` [nfsv4] " Nico Williams
  0 siblings, 2 replies; 6+ messages in thread
From: Haynes, Tom @ 2012-07-24 19:33 UTC (permalink / raw)
  To: bfields, linux-nfs, nfsv4

Bruce,

In looking at http://tools.ietf.org/html/draft-ietf-nfsv4-acl-mapping-05, it
states that when mapping the write bit, only for the owner do we set
ACE4_WRITE_ACL.

Back in version 00, it is open as to whether we can also set it for the
group and other if they have the write bit set.

I looked back at the NFSv4 WG aliases and I see some discussion from Lisa
on how Solaris only ever sets it for the owner due to POSIX restrictions
via chmod(). So, now I know how another server does it.

What does the Linux server do in this case?

Thanks,
Tom

-- 
thomas@netapp.com, ex-cfb

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

* Re: Constructing a NFSv4 ACL from POSIX mode bits
  2012-07-24 19:33 Constructing a NFSv4 ACL from POSIX mode bits Haynes, Tom
@ 2012-07-24 19:53 ` J. Bruce Fields
  2012-07-24 20:00 ` [nfsv4] " Nico Williams
  1 sibling, 0 replies; 6+ messages in thread
From: J. Bruce Fields @ 2012-07-24 19:53 UTC (permalink / raw)
  To: Haynes, Tom; +Cc: linux-nfs, nfsv4

On Tue, Jul 24, 2012 at 12:33:49PM -0700, Haynes, Tom wrote:
> In looking at http://tools.ietf.org/html/draft-ietf-nfsv4-acl-mapping-05, it
> states that when mapping the write bit, only for the owner do we set
> ACE4_WRITE_ACL.
> 
> Back in version 00, it is open as to whether we can also set it for the
> group and other if they have the write bit set.
> 
> I looked back at the NFSv4 WG aliases and I see some discussion from Lisa
> on how Solaris only ever sets it for the owner due to POSIX restrictions
> via chmod(). So, now I know how another server does it.
> 
> What does the Linux server do in this case?

The Linux server does what's described in the above draft:
unconditionally sets NFS4_ACE_WRITE_ATTRIBUTES | NFS4_ACE_WRITE_ACL on
an OWNER@ ALLOW ACE, and nowhere else.

--b.

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

* Re: [nfsv4] Constructing a NFSv4 ACL from POSIX mode bits
  2012-07-24 19:33 Constructing a NFSv4 ACL from POSIX mode bits Haynes, Tom
  2012-07-24 19:53 ` J. Bruce Fields
@ 2012-07-24 20:00 ` Nico Williams
  2012-07-24 20:09   ` J. Bruce Fields
  1 sibling, 1 reply; 6+ messages in thread
From: Nico Williams @ 2012-07-24 20:00 UTC (permalink / raw)
  To: Haynes, Tom; +Cc: bfields, linux-nfs, nfsv4

On Tue, Jul 24, 2012 at 2:33 PM, Haynes, Tom <thomas@netapp.com> wrote:
> Bruce,
>
> In looking at http://tools.ietf.org/html/draft-ietf-nfsv4-acl-mapping-05, it
> states that when mapping the write bit, only for the owner do we set
> ACE4_WRITE_ACL.
>
> Back in version 00, it is open as to whether we can also set it for the
> group and other if they have the write bit set.
>
> I looked back at the NFSv4 WG aliases and I see some discussion from Lisa
> on how Solaris only ever sets it for the owner due to POSIX restrictions
> via chmod(). So, now I know how another server does it.

This has changed.  I wrote this up here:

http://cryptonector.com/2011/11/zfs-aclchmod-interactions-in-solaris-11/

IIRC all ACEs for anything other than OWNER@ (or a user of the same
name/ID) contribute to the group bits of the mode, the EVERYONE@ entry
contributes to the world bits of the mode, and the OWNER@ and/or user
ACEs for the owner name/ID contribute to the owner bits of the mode.

The new scheme is really much simpler and more natural than everything
else tried before.

Nico
--

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

* Re: [nfsv4] Constructing a NFSv4 ACL from POSIX mode bits
  2012-07-24 20:00 ` [nfsv4] " Nico Williams
@ 2012-07-24 20:09   ` J. Bruce Fields
  2012-07-24 20:29     ` Nico Williams
  0 siblings, 1 reply; 6+ messages in thread
From: J. Bruce Fields @ 2012-07-24 20:09 UTC (permalink / raw)
  To: Nico Williams; +Cc: Haynes, Tom, linux-nfs, nfsv4

On Tue, Jul 24, 2012 at 03:00:57PM -0500, Nico Williams wrote:
> On Tue, Jul 24, 2012 at 2:33 PM, Haynes, Tom <thomas@netapp.com> wrote:
> > Bruce,
> >
> > In looking at http://tools.ietf.org/html/draft-ietf-nfsv4-acl-mapping-05, it
> > states that when mapping the write bit, only for the owner do we set
> > ACE4_WRITE_ACL.
> >
> > Back in version 00, it is open as to whether we can also set it for the
> > group and other if they have the write bit set.
> >
> > I looked back at the NFSv4 WG aliases and I see some discussion from Lisa
> > on how Solaris only ever sets it for the owner due to POSIX restrictions
> > via chmod(). So, now I know how another server does it.
> 
> This has changed.  I wrote this up here:
> 
> http://cryptonector.com/2011/11/zfs-aclchmod-interactions-in-solaris-11/
> 
> IIRC all ACEs for anything other than OWNER@ (or a user of the same
> name/ID) contribute to the group bits of the mode, the EVERYONE@ entry
> contributes to the world bits of the mode, and the OWNER@ and/or user
> ACEs for the owner name/ID contribute to the owner bits of the mode.
> 
> The new scheme is really much simpler and more natural than everything
> else tried before.

Sounds reasonable.

But Tom was asking above only about ACE4_WRITE_ACL.  And possibly only
in the legacy case.  (Does ZFS have a real ACE4_WRITE_ACL bit?)

--b.

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

* Re: [nfsv4] Constructing a NFSv4 ACL from POSIX mode bits
  2012-07-24 20:09   ` J. Bruce Fields
@ 2012-07-24 20:29     ` Nico Williams
  2012-07-25 13:29       ` J. Bruce Fields
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Williams @ 2012-07-24 20:29 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Haynes, Tom, linux-nfs, nfsv4

On Tue, Jul 24, 2012 at 3:09 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> But Tom was asking above only about ACE4_WRITE_ACL.  And possibly only
> in the legacy case.  (Does ZFS have a real ACE4_WRITE_ACL bit?)

Ah, oops.  That's trickier.  The examples don't say (or I'm not seeing
it).  IMO the most reasonable thing to do is to make chmod mask away
the ACE4_WRITE_ACL bits of non-OWNER@/non-owner-user ACEs, but
subsequent ACL writes can restore ACE4_WRITE_ACL without contributing
to the w group or world bits of mode.

That is: to make aclmode=mask most natural and usable a chmod must
have the expected POSIX behavior of taking away or granting access,
but never granting anything like ACE4_WRITE_ACL to non-owners, while
an ACL write should should be able to grant much more access than
chmod and it should compute a new mode that is as close as possible to
the new ACL.  This requires storing a mode, an ACL, and one bit to
indicate whether the ACL was set after the mode or the mode after the
ACL.

Nico
--

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

* Re: [nfsv4] Constructing a NFSv4 ACL from POSIX mode bits
  2012-07-24 20:29     ` Nico Williams
@ 2012-07-25 13:29       ` J. Bruce Fields
  0 siblings, 0 replies; 6+ messages in thread
From: J. Bruce Fields @ 2012-07-25 13:29 UTC (permalink / raw)
  To: Nico Williams; +Cc: Haynes, Tom, linux-nfs, nfsv4

On Tue, Jul 24, 2012 at 03:29:07PM -0500, Nico Williams wrote:
> On Tue, Jul 24, 2012 at 3:09 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> > But Tom was asking above only about ACE4_WRITE_ACL.  And possibly only
> > in the legacy case.  (Does ZFS have a real ACE4_WRITE_ACL bit?)
> 
> Ah, oops.  That's trickier.  The examples don't say (or I'm not seeing
> it).  IMO the most reasonable thing to do is to make chmod mask away
> the ACE4_WRITE_ACL bits of non-OWNER@/non-owner-user ACEs, but
> subsequent ACL writes can restore ACE4_WRITE_ACL without contributing
> to the w group or world bits of mode.
> 
> That is: to make aclmode=mask most natural and usable a chmod must
> have the expected POSIX behavior of taking away or granting access,
> but never granting anything like ACE4_WRITE_ACL to non-owners, while
> an ACL write should should be able to grant much more access than
> chmod and it should compute a new mode that is as close as possible to
> the new ACL.  This requires storing a mode, an ACL, and one bit to
> indicate whether the ACL was set after the mode or the mode after the
> ACL.

I was with you up to the "one bit to indicate...".  That doesn't sound
necessary to implement the behavior you describe.

--b.

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

end of thread, other threads:[~2012-07-25 13:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-24 19:33 Constructing a NFSv4 ACL from POSIX mode bits Haynes, Tom
2012-07-24 19:53 ` J. Bruce Fields
2012-07-24 20:00 ` [nfsv4] " Nico Williams
2012-07-24 20:09   ` J. Bruce Fields
2012-07-24 20:29     ` Nico Williams
2012-07-25 13:29       ` J. Bruce Fields

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