Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfsd: Fix sort_pacl in fs/nfsd/nf4acl.c to actually sort groups
@ 2009-10-21 23:45 Frank Filz
  2009-10-27 23:32 ` J. Bruce Fields
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Filz @ 2009-10-21 23:45 UTC (permalink / raw)
  To: NFS List, NFS V4 Mailing List; +Cc: Frank S Filz, Trond Myklebust

We have been doing some extensive testing of Linux support for ACLs on
NFDS v4. We have noticed that the server rejects ACLs where the groups
are out of order, for example, the following ACL is rejected:

A::OWNER@:rwaxtTcCy
A::user101@domain:rwaxtcy
A::GROUP@:rwaxtcy
A:g:group102@domain:rwaxtcy
A:g:group101@domain:rwaxtcy
A::EVERYONE@:rwaxtcy

Examining the server code, I found that after converting an NFS v4 ACL
to POSIX, sort_pacl is called to sort the user ACEs and group ACEs.
Unfortunately, a minor bug causes the group sort to be skipped.

Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
---
 fs/nfsd/nfs4acl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c
index 725d02f..6d9c6aa 100644
--- a/fs/nfsd/nfs4acl.c
+++ b/fs/nfsd/nfs4acl.c
@@ -389,7 +389,7 @@ sort_pacl(struct posix_acl *pacl)
 	sort_pacl_range(pacl, 1, i-1);
 
 	BUG_ON(pacl->a_entries[i].e_tag != ACL_GROUP_OBJ);
-	j = i++;
+	j = ++i;
 	while (pacl->a_entries[j].e_tag == ACL_GROUP)
 		j++;
 	sort_pacl_range(pacl, i, j-1);
-- 
1.5.2.2




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

end of thread, other threads:[~2009-10-28  3:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-21 23:45 [PATCH] nfsd: Fix sort_pacl in fs/nfsd/nf4acl.c to actually sort groups Frank Filz
2009-10-27 23:32 ` J. Bruce Fields
2009-10-28  3:12   ` Frank Filz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox