From owner-p4-projects@FreeBSD.ORG Mon Aug 25 09:41:29 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C74871065674; Mon, 25 Aug 2008 09:41:28 +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 72FCF106568D for ; Mon, 25 Aug 2008 09:41:28 +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 6EADF8FC32 for ; Mon, 25 Aug 2008 09:41:28 +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 m7P9fSpE083577 for ; Mon, 25 Aug 2008 09:41:28 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7P9fSLl083575 for perforce@freebsd.org; Mon, 25 Aug 2008 09:41:28 GMT (envelope-from trasz@freebsd.org) Date: Mon, 25 Aug 2008 09:41:28 GMT Message-Id: <200808250941.m7P9fSLl083575@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 148368 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: Mon, 25 Aug 2008 09:41:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=148368 Change 148368 by trasz@trasz_traszkan on 2008/08/25 09:40:54 Tests for passing multiple file names to setfacl(1). Affected files ... .. //depot/projects/soc2008/trasz_nfs4acl/TODO#45 edit .. //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-nfs4.test#7 edit .. //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#4 edit Differences ... ==== //depot/projects/soc2008/trasz_nfs4acl/TODO#45 (text+ko) ==== @@ -2,9 +2,6 @@ - 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/tools/regression/acltools/tools-nfs4.test#7 (text+ko) ==== @@ -150,8 +150,6 @@ $ rm yyy -# XXX: Test mv. Need more than one filesystem for that. - # Test removing entries by... by example? $ setfacl -x everyone@::deny xxx $ getfacl -n xxx @@ -177,8 +175,67 @@ > everyone@:-wxp---A-W-Co-:------:deny > everyone@:r-----a-R-c--s:------:allow +$ ls -l xxx | cut -d' ' -f1 +> -rw-r--r-- + +# Check setfacl(1) and getfacl(1) with multiple files. +$ touch xxx yyy zzz + +$ ls -l xxx yyy zzz | cut -d' ' -f1 +> -rw-r--r-- +> -rw-r--r-- +> -rw-r--r-- + +$ setfacl -m u:42:x:allow,g:43:w:allow nnn xxx yyy zzz +> setfacl: nnn: acl_get_file() failed: No such file or directory + +$ ls -l nnn xxx yyy zzz | cut -d' ' -f1 +> ls: nnn: No such file or directory +> -rw-r--r--+ +> -rw-r--r--+ +> -rw-r--r--+ + +$ getfacl -nq nnn xxx yyy zzz +> getfacl: nnn: stat() failed: No such file or directory +> user:42:--x-----------:------:allow +> group:43:-w------------:------:allow +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow +> +> user:42:--x-----------:------:allow +> group:43:-w------------:------:allow +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow +> +> user:42:--x-----------:------:allow +> group:43:-w------------:------:allow +> owner@:--x-----------:------:deny +> owner@:rw-p---A-W-Co-:------:allow +> group@:-wxp----------:------:deny +> group@:r-------------:------:allow +> everyone@:-wxp---A-W-Co-:------:deny +> everyone@:r-----a-R-c--s:------:allow + +$ setfacl -b nnn xxx yyy zzz +> setfacl: nnn: acl_get_file() failed: No such file or directory + +$ ls -l nnn xxx yyy zzz | cut -d' ' -f1 +> ls: nnn: No such file or directory +> -rw-r--r-- +> -rw-r--r-- +> -rw-r--r-- + +$ rm xxx yyy zzz + # Test applying mode to an ACL. -$ rm xxx $ touch xxx $ setfacl -a0 user:42:r:allow,user:43:w:deny,user:43:w:allow,user:44:x:allow -x everyone@::allow xxx $ chmod 600 xxx ==== //depot/projects/soc2008/trasz_nfs4acl/tools/regression/acltools/tools-posix.test#4 (text+ko) ==== @@ -83,8 +83,6 @@ $ rm yyy -# XXX: Test mv. Need more than one filesystem for that. - # Test removing entries by... by example? $ setfacl -m u:42:r,g:43:w xxx $ setfacl -x u:42: xxx @@ -124,7 +122,59 @@ $ ls -l xxx | cut -d' ' -f1 > -rw-r--r-- +# Check setfacl(1) and getfacl(1) with multiple files. +$ touch xxx yyy zzz + +$ ls -l xxx yyy zzz | cut -d' ' -f1 +> -rw-r--r-- +> -rw-r--r-- +> -rw-r--r-- + +$ setfacl -m u:42:x,g:43:w nnn xxx yyy zzz +> setfacl: nnn: acl_get_file() failed: No such file or directory + +$ ls -l nnn xxx yyy zzz | cut -d' ' -f1 +> ls: nnn: No such file or directory +> -rw-rwxr--+ +> -rw-rwxr--+ +> -rw-rwxr--+ + +$ getfacl -nq nnn xxx yyy zzz +> getfacl: nnn: stat() failed: No such file or directory +> user::rw- +> user:42:--x +> group::r-- +> group:43:-w- +> mask::rwx +> other::r-- +> +> user::rw- +> user:42:--x +> group::r-- +> group:43:-w- +> mask::rwx +> other::r-- +> +> user::rw- +> user:42:--x +> group::r-- +> group:43:-w- +> mask::rwx +> other::r-- + +$ setfacl -b nnn xxx yyy zzz +> setfacl: nnn: acl_get_file() failed: No such file or directory + +$ ls -l nnn xxx yyy zzz | cut -d' ' -f1 +> ls: nnn: No such file or directory +> -rw-r--r--+ +> -rw-r--r--+ +> -rw-r--r--+ + +$ rm xxx yyy zzz + # Check whether chmod actually does what it should do. +$ touch xxx $ setfacl -m u:42:rwx,g:43:rwx xxx $ chmod 600 xxx $ getfacl -n xxx