From owner-p4-projects@FreeBSD.ORG Sun Aug 24 18:51:28 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DFC8A1065677; Sun, 24 Aug 2008 18:51:27 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3D011065687 for ; Sun, 24 Aug 2008 18:51:27 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 588668FC15 for ; Sun, 24 Aug 2008 18:51:27 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7OIpRqr043037 for ; Sun, 24 Aug 2008 18:51:27 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7OIpRjH043035 for perforce@freebsd.org; Sun, 24 Aug 2008 18:51:27 GMT (envelope-from trasz@freebsd.org) Date: Sun, 24 Aug 2008 18:51:27 GMT Message-Id: <200808241851.m7OIpRjH043035@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Cc: Subject: PERFORCE change 148266 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Aug 2008 18:51:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=148266 Change 148266 by trasz@trasz_traszkan on 2008/08/24 18:51:01 Fix a case when there is more than one file name given in the setfacl(1) command line. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/TODO#44 edit .. //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#13 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/TODO#44 (text+ko) ==== @@ -2,6 +2,9 @@ - Add support for NFS4 ACLs to tar(1). +- Add unit test to verify correct operation if several file names + are given to getfacl(1) and setfacl(1). + - Clean up #defines. For example, make VREAD_NAMED_ATTRS equal to ACL_READ_NAMED_ATTRS, so there is no need for translation between the two in kern/subr_acl_nfs4.c. ==== //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#13 (text+ko) ==== @@ -65,16 +65,6 @@ acl_t acl = NULL; struct stat sb; - if (pathconf(filename, _PC_EXTENDED_SECURITY_NP)) { - if (type == ACL_TYPE_ACCESS) { - type = ACL_TYPE_NFS4; - } else { - warnx("%s: there are no default entries in NFS4 ACLs", - filename); - return (NULL); - } - } - switch (type) { case ACL_TYPE_ACCESS: case ACL_TYPE_NFS4: @@ -252,15 +242,24 @@ /* cycle through each file */ TAILQ_FOREACH(file, &filelist, next) { + local_error = 0; + + if (pathconf(file->filename, _PC_EXTENDED_SECURITY_NP)) { + if (acl_type == ACL_TYPE_DEFAULT) { + warnx("%s: there are no default entries " + "in NFS4 ACLs", file->filename); + continue; + } + + acl_type = ACL_TYPE_NFS4; + + } else if (acl_type == ACL_TYPE_NFS4) + acl_type = ACL_TYPE_ACCESS; + acl = get_file_acl(file->filename, acl_type, h_flag); if (acl == NULL) continue; - local_error = 0; - - if (acl_type != ACL_TYPE_DEFAULT && pathconf(file->filename, _PC_EXTENDED_SECURITY_NP)) - acl_type = ACL_TYPE_NFS4; - /* cycle through each option */ TAILQ_FOREACH(entry, &entrylist, next) { if (local_error)