From owner-freebsd-questions@FreeBSD.ORG Sat Feb 13 22:40:57 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9440D1065670 for ; Sat, 13 Feb 2010 22:40:57 +0000 (UTC) (envelope-from vogelke@hcst.com) Received: from beta.hcst.com (beta.hcst.com [192.52.183.241]) by mx1.freebsd.org (Postfix) with ESMTP id 3C54A8FC14 for ; Sat, 13 Feb 2010 22:40:56 +0000 (UTC) Received: from beta.hcst.com (localhost [127.0.0.1]) by beta.hcst.com (8.13.8/8.13.8/Debian-3) with ESMTP id o1DMetms014605 for ; Sat, 13 Feb 2010 17:40:55 -0500 Received: (from vogelke@localhost) by beta.hcst.com (8.13.8/8.13.8/Submit) id o1DMetPL014604; Sat, 13 Feb 2010 17:40:55 -0500 Received: by kev.msw.wpafb.af.mil (Postfix, from userid 32768) id 4F268BF16; Sat, 13 Feb 2010 17:39:31 -0500 (EST) To: freebsd-questions@freebsd.org In-reply-to: (message from Doug Sampson on Fri, 12 Feb 2010 21:08:43 -0800) Organization: Oasis Systems Inc. X-Disclaimer: I don't speak for the USAF or Oasis. X-GPG-ID: 1024D/711752A0 2006-06-27 Karl Vogel X-GPG-Fingerprint: 56EB 6DBF 4224 C953 F417 CC99 4C7C 7D46 7117 52A0 References: Message-Id: <20100213223932.4F268BF16@kev.msw.wpafb.af.mil> Date: Sat, 13 Feb 2010 17:39:31 -0500 (EST) From: vogelke+unix@pobox.com (Karl Vogel) Subject: Re: setting default directory ACLs using xargs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vogelke+unix@pobox.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 22:40:57 -0000 >> On Fri, 12 Feb 2010 21:08:43 -0800, >> Doug Sampson said: D> This is what led me to the workaround of: D> $ getfacl /aclTest/ | setfacl -d -b -n -M - /aclTest/ D> which actually works for me. I do dread the idea of having to manually D> apply this to all existing directories in the /data filesystem. If all else fails, abuse nawk: #!/bin/sh cd /data find . -type d -print | nawk '{printf "getfacl %s | setfacl -d -b -n -M - %s\n",$1,$1}' | sh -x exit 0 If you have spaces in your filenames, you'll either have to use perl or do something dopey like this: #!/bin/sh cd /data find . -type d -print | nawk -v sq=\' '{ printf "getfacl %s%s%s | setfacl -d -b -n -M - %s%s%s\n", sq, $0, sq, sq, $0, sq}' | sh -x exit 0 -- Karl Vogel I don't speak for the USAF or my company Yeah, yo mama dresses you funny and you need a mouse to delete files. --Markus Stumpf