[PATCH 002 of 9] knfsd: nfsd4: relax checking of ACL inheritance bits




From: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
The rfc allows us to be more permissive about the ACL inheritance bits we
accept:

"If the server supports a single "inherit ACE" flag that applies to
both files and directories, the server may reject the request
(i.e., requiring the client to set both the file and directory
inheritance flags). The server may also accept the request and
silently turn on the ACE4_DIRECTORY_INHERIT_ACE flag."

Let's take the latter option--the ACL is a complex attribute that could be
rejected for a wide variety of reasons, and the protocol gives us little
ability to explain the reason for the rejection, so erroring out is a
user-unfriendly last resort.

Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
Signed-off-by: Neil Brown <neilb@xxxxxxx>

### Diffstat output
./fs/nfsd/nfs4acl.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff .prev/fs/nfsd/nfs4acl.c ./fs/nfsd/nfs4acl.c
--- .prev/fs/nfsd/nfs4acl.c 2007-02-13 09:50:26.000000000 +1100
+++ ./fs/nfsd/nfs4acl.c 2007-02-13 10:01:42.000000000 +1100
@@ -61,9 +61,11 @@

/* flags used to simulate posix default ACLs */
#define NFS4_INHERITANCE_FLAGS (NFS4_ACE_FILE_INHERIT_ACE \
- | NFS4_ACE_DIRECTORY_INHERIT_ACE | NFS4_ACE_INHERIT_ONLY_ACE)
+ | NFS4_ACE_DIRECTORY_INHERIT_ACE)

-#define NFS4_SUPPORTED_FLAGS (NFS4_INHERITANCE_FLAGS | NFS4_ACE_IDENTIFIER_GROUP)
+#define NFS4_SUPPORTED_FLAGS (NFS4_INHERITANCE_FLAGS \
+ | NFS4_ACE_INHERIT_ONLY_ACE \
+ | NFS4_ACE_IDENTIFIER_GROUP)

#define MASK_EQUAL(mask1, mask2) \
( ((mask1) & NFS4_ACE_MASK_ALL) == ((mask2) & NFS4_ACE_MASK_ALL) )
@@ -707,11 +709,16 @@ nfs4_acl_split(struct nfs4_acl *acl, str
if (ace->flag & ~NFS4_SUPPORTED_FLAGS)
return -EINVAL;

- switch (ace->flag & NFS4_INHERITANCE_FLAGS) {
- case 0:
+ if ((ace->flag & NFS4_INHERITANCE_FLAGS) == 0) {
/* Leave this ace in the effective acl: */
continue;
- case NFS4_INHERITANCE_FLAGS:
+ }
+ /*
+ * Note that when only one of FILE_INHERIT or DIRECTORY_INHERIT
+ * is set, we're effectively turning on the other. That's OK,
+ * according to rfc 3530.
+ */
+ if (ace->flag & NFS4_ACE_INHERIT_ONLY_ACE) {
/* Add this ace to the default acl and remove it
* from the effective acl: */
error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
@@ -721,17 +728,13 @@ nfs4_acl_split(struct nfs4_acl *acl, str
list_del(h);
kfree(ace);
acl->naces--;
- break;
- case NFS4_INHERITANCE_FLAGS & ~NFS4_ACE_INHERIT_ONLY_ACE:
+ } else {
/* Add this ace to the default, but leave it in
* the effective acl as well: */
error = nfs4_acl_add_ace(dacl, ace->type, ace->flag,
ace->access_mask, ace->whotype, ace->who);
if (error)
return error;
- break;
- default:
- return -EINVAL;
}
}
return 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Dynamic DNS and failed journal
    ... changed control clause to be updated by localhost and server ... i thought it was odd too....but in retrospect, it means to listen on 127.0.0.1 and any other NICS using 192.168.10.0/24 netowrk that may be in the box ... ... I would have thought allow-wuery would have been ok with an acl ... ... had to be done outside of the subnet clauses. ...
    (Fedora)
  • Re: Permissions resetting in Blocked Inheritance OUs
    ... If the ACL that is on the AdminSDHolder object is ... Delegated permissions are not available and inheritance is automatically ... "You do not have sufficient permissions in the Domain" error message occurs ... This user account is in an OU that has Blocked ...
    (microsoft.public.windows.server.active_directory)
  • Re: SMTP/destination name is the same
    ... Wow, okay Ace, things have changed on this, mostly for the good, so here ... They are running Win2003 server and for a ... The qube is a POP/SMTP server and the domain ... KB's and looked at some of the returned emails and found that they didn't ...
    (microsoft.public.exchange2000.admin)
  • Re: Re-Post: 550 - Sender Not Allowed
    ... > I don't believe that any router ACL or routing issue could cause this problem. ... > server that has ACLs setup to allow and deny mail flow. ... > directed to the newsgroup/thread from which they originated. ... > as a mail hub for all of those domains. ...
    (microsoft.public.exchange2000.protocols)
  • RE: files from w2k t w2k3
    ... the ACL entries from both the source and the target domains. ... >>will be in the new forest.. ... >>ie using FSMT the ACL on the the mirgrated file on the new file server ...
    (microsoft.public.windows.server.migration)