From 7abefe1398fb2089a38a3a75f0dace1270de7a95 Mon Sep 17 00:00:00 2001 From: Steve Dickson Date: Nov 16 2009 19:12:43 +0000 Subject: Fixes segfaulting issues with ACEs that have empty mask fields --- diff --git a/nfs4-acl-tools.spec b/nfs4-acl-tools.spec index 303bccc..743a028 100644 --- a/nfs4-acl-tools.spec +++ b/nfs4-acl-tools.spec @@ -1,6 +1,6 @@ Name: nfs4-acl-tools Version: 0.3.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: The nfs4 ACL tools Group: Applications/System License: BSD @@ -12,6 +12,8 @@ Source0: http://www.citi.umich.edu/projects/nfsv4/linux/nfs4-acl-tools/%{ BuildRequires: libtool BuildRequires: libattr-devel +Patch001: nfs4acl-0.3.3-ace.patch + Patch100: nfs4acl-0.2.0-compile.patch %description @@ -21,6 +23,8 @@ NFSv4 client. %prep %setup -q +%patch001 -p1 + %patch100 -p1 %build @@ -52,6 +56,9 @@ rm -rf %{buildroot} %{_mandir}/man5/* %changelog +* Mon Nov 16 2009 Steve Dickson - 0.3.3-5 +- Fixes segfaulting issues with ACEs that have empty mask fields + * Thu Jul 30 2009 Steve Dickson - 0.3.3-4 - Change Group in spec file (bz 512580) diff --git a/nfs4acl-0.3.3-ace.patch b/nfs4acl-0.3.3-ace.patch new file mode 100644 index 0000000..cd5ae0a --- /dev/null +++ b/nfs4acl-0.3.3-ace.patch @@ -0,0 +1,34 @@ +commit 75053cc0be7c4d78ef0c6b5e9954ee30b85705bc +Author: Brian De Wolf +Date: Tue Sep 15 14:33:55 2009 -0700 + + allow parsing ACEs with empty masks + + After upgrading from 0.3.2 to 0.3.3 to fix some segfaulting issues we + had, 0.3.3 now rejects ACEs that have empty mask fields. This is + because the function parse_alloc_fields checks whether the three strings + are zero length. Having a zero length "type" or "who" definitely + doesn't make sense, but having an empty mask is entirely possible. It's + allowed in the old versions and the ZFS back-end in our setup allows + them too. Even nfs4_getfacl prints them out, producing the frustrating + situation where nfs4_getfacl can produce ACLs that you can't apply with + nfs4_setfacl. + + This patch modifies the function to not check if the mask is an empty + string. + + Signed-off-by: J. Bruce Fields + +diff --git a/libnfs4acl/nfs4_ace_from_string.c b/libnfs4acl/nfs4_ace_from_string.c +index 036d9b8..9d877fb 100644 +--- a/libnfs4acl/nfs4_ace_from_string.c ++++ b/libnfs4acl/nfs4_ace_from_string.c +@@ -120,7 +120,7 @@ parse_alloc_fields(char *buf, char *fields[NUMFIELDS]) + fields[i][len] = 0; + } + +- if (!fields[TYPE_INDEX][0] || !fields[WHO_INDEX][0] || !fields[MASK_INDEX][0]) ++ if (!fields[TYPE_INDEX][0] || !fields[WHO_INDEX][0]) + goto out_free; + + return 0;