Subject: [nfsv4] mode bits

From: "Yoder, Alan" <[email-masked]>
Date: Mon, 7 Nov 2005 22:05:01 -0800

In section 5.11.5 RFC 3530 says

"The remaining bits are not defined by this protocol 
and MUST NOT be used.  The minor version mechanism 
must be used to define further bit usage."

I surmise that this refers to the bits MODE4_SUID, 
MODE4_SGID and MODE4_SVTX, which are not mentioned 
in the immediately foregoing paragraphs.

However, in section 5.11.6 it says

"Because the mode attribute includes bits (e.g., 
MODE4_SVTX) that have nothing to do with ACL semantics, 
it is permitted for clients to specify both the ACL 
attribute and mode in the same SETATTR operation...."

What am I to make of this?  Is specifying these three
bits in the mode allowed or not?

Thanks,

Alan

===============================================================
Alan G. Yoder                                    [email-masked]
Technical Staff                           
Network Appliance, Inc.                            408-822-6919
===============================================================

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4

---

From: Mike Eisler <[email-masked]>
Date: Tue, 8 Nov 2005 11:48:24 -0800 (PST)

> in the immediately foregoing paragraphs.

They are mentioned after the first paragraph of 5.11.5.

5.11.5 has:

5.11.5.  Mode Attribute

   The NFS version 4 mode attribute is based on the UNIX mode bits.  The
   following bits are defined:

      const MODE4_SUID = 0x800;  /* set user id on execution */
      const MODE4_SGID = 0x400;  /* set group id on execution */
      const MODE4_SVTX = 0x200;  /* save text even after use */
      const MODE4_RUSR = 0x100;  /* read permission: owner */
      const MODE4_WUSR = 0x080;  /* write permission: owner */
      const MODE4_XUSR = 0x040;  /* execute permission: owner */
      const MODE4_RGRP = 0x020;  /* read permission: group */
      const MODE4_WGRP = 0x010;  /* write permission: group */
      const MODE4_XGRP = 0x008;  /* execute permission: group */
      const MODE4_ROTH = 0x004;  /* read permission: other */
      const MODE4_WOTH = 0x002;  /* write permission: other */
      const MODE4_XOTH = 0x001;  /* execute permission: other */

   Bits MODE4_RUSR, MODE4_WUSR, and MODE4_XUSR apply to the principal
   identified in the owner attribute.  Bits MODE4_RGRP, MODE4_WGRP, and

   MODE4_XGRP apply to the principals identified in the owner_group
   attribute.  Bits MODE4_ROTH, MODE4_WOTH, MODE4_XOTH apply to any
   principal that does not match that in the owner group, and does not
   have a group matching that of the owner_group attribute.

   The remaining bits are not defined by this protocol and MUST NOT be
   used.  The minor version mechanism must be used to define further bit
   usage.

> bits in the mode allowed or not?

Yes it is allowed.

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 11 Nov 2005 01:47:26 -0600

> > bits in the mode allowed or not?

Would it make sense for the protocol to allow for a client
to set just
       const MODE4_SUID = 0x800;  /* set user id on execution */
       const MODE4_SGID = 0x400;  /* set group id on execution */
       const MODE4_SVTX = 0x200;  /* save text even after use */

To satisfy API requests that only twiddle these bits and nothing
else in the mode (to avoid issue with changes in ACL settings)

Spencer

---

From: Trond Myklebust <[email-masked]>
Date: Mon, 07 Nov 2005 22:23:49 -0800

> in the immediately foregoing paragraphs.

No. Doesn't it just refer to bits > 0x800?

MODE4_SUID, MODE4_SGID and MODE4_SVTX are definitely defined...

Cheers,
  Trond