From owner-p4-projects@FreeBSD.ORG Fri Aug 15 09:41:25 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0B5951065677; Fri, 15 Aug 2008 09:41:25 +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 C3BBC106566C for ; Fri, 15 Aug 2008 09:41:24 +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 A3F4F8FC1A for ; Fri, 15 Aug 2008 09:41:24 +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 m7F9fOxv056947 for ; Fri, 15 Aug 2008 09:41:24 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7F9fOAY056945 for perforce@freebsd.org; Fri, 15 Aug 2008 09:41:24 GMT (envelope-from trasz@freebsd.org) Date: Fri, 15 Aug 2008 09:41:24 GMT Message-Id: <200808150941.m7F9fOAY056945@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 147430 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: Fri, 15 Aug 2008 09:41:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=147430 Change 147430 by trasz@trasz_traszkan on 2008/08/15 09:40:37 Fix default ACL support. Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#12 edit .. //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#3 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/bin/setfacl/setfacl.c#12 (text+ko) ==== @@ -90,8 +90,11 @@ return (NULL); } - if (S_ISDIR(sb.st_mode) == 0) + if (S_ISDIR(sb.st_mode) == 0) { + warnx("%s: default ACL may only be set on a directory", + filename); return (NULL); + } if (h_flag) acl = acl_get_link_np(filename, ACL_TYPE_DEFAULT); @@ -257,8 +260,6 @@ if (acl_type != ACL_TYPE_DEFAULT && pathconf(file->filename, _PC_EXTENDED_SECURITY_NP)) acl_type = ACL_TYPE_NFS4; - else - acl_type = ACL_TYPE_ACCESS; /* cycle through each option */ TAILQ_FOREACH(entry, &entrylist, next) { ==== //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#3 (text+ko) ==== @@ -63,7 +63,7 @@ > mask::r-- > other::r-- -# Make sure cp without any flags does not copy copy the ACL. +# Make sure cp without any flags does not copy the ACL. $ cp xxx yyy $ ls -l yyy | cut -d' ' -f1 > -rw-r--r-- @@ -150,8 +150,42 @@ > mask::rw- > other::--- -# XXX: Test default ACLs. -# XXX: Test inheritance. +# Test default ACLs. +$ umask 022 +$ mkdir ddd +$ getfacl -qn ddd +> user::rwx +> group::r-x +> other::r-x + +$ getfacl -dqn ddd +$ setfacl -d -m u::rwx,g::rx,o::rx,mask::rwx ddd +$ getfacl -dqn ddd +> user::rwx +> group::r-x +> mask::rwx +> other::r-x + +$ setfacl -dm g:42:rwx,u:42:r ddd +$ setfacl -dm g::w ddd +$ getfacl -dqn ddd +> user::rwx +> user:42:r-- +> group::-w- +> group:42:rwx +> mask::rwx +> other::r-x + +$ setfacl -dx group:42: ddd +$ getfacl -dqn ddd +> user::rwx +> user:42:r-- +> group::-w- +> mask::rw- +> other::r-x + +> # XXX: Test inheritance. +$ rmdir ddd $ rm xxx