From owner-freebsd-questions@FreeBSD.ORG Sat Feb 13 05:08:51 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 46A0C106566B for ; Sat, 13 Feb 2010 05:08:51 +0000 (UTC) (envelope-from dougs@dawnsign.com) Received: from mailfilter.dawnsign.com (cetus.dawnsign.com [216.70.250.4]) by mx1.freebsd.org (Postfix) with ESMTP id 241408FC21 for ; Sat, 13 Feb 2010 05:08:51 +0000 (UTC) Received: from mailfilter.dawnsign.com (localhost [127.0.0.1]) by mailfilter.dawnsign.com (Postfix) with ESMTP id 86E509594A for ; Fri, 12 Feb 2010 21:08:50 -0800 (PST) Received: from cetus.dawnsign.com (cetus.dawnsign.com [192.168.101.5]) by mailfilter.dawnsign.com (Postfix) with ESMTP id 588C895926 for ; Fri, 12 Feb 2010 21:08:50 -0800 (PST) Received: by cetus.dawnsign.com with Internet Mail Service (5.5.2657.72) id <1W7SWYP8>; Fri, 12 Feb 2010 21:08:50 -0800 Message-ID: From: Doug Sampson To: "'freebsd-questions@freebsd.org'" Date: Fri, 12 Feb 2010 21:08:43 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" X-Virus-Scanned: ClamAV using ClamSMTP Subject: setting default directory ACLs using xargs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Feb 2010 05:08:51 -0000 I need to do this at the command prompt for all directories: root@aries:/data/Products# getfacl -d . # file: . # owner: DSP-alfredo # group: DSP-production root@aries:/data/Products# getfacl . | setfacl -d -b -n -M - . root@aries:/data/Products# getfacl -d . # file: . # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x root@aries:/data/Products# okay, it works. Now, I have thousands of subdirectories that I want to apply this to. When I attempt to use the xarg command with the above command modified to work with xargs, I end up with an error message: root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl | setfacl -d -b -n -M - setfacl: line too long in - root@aries:/data/Products/RSVP# Okay, that doesn't work. What is the output of... root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl # file: . # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x # file: ./.AppleDouble # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x # file: ./Design # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x # file: ./Design/Dev Heads # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x # file: ./Design/Dev Heads/Backup # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x [ ..snip..] # file: ./Design/need cleanup/head/OLD # owner: DSP-alfredo # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x # file: ./Manuscripts # owner: DSP-matte # group: DSP-production user::rwx user:DSP-doug:rwx user:DSP-alfredo:rwx group::rwx group:DSP-production:rwx mask::rwx other::r-x root@aries:/data/Products/RSVP# Seems there are approximately 10 lines of output for each 'getfacl' command. How do I feed each group of ten lines into the next command of 'setfacl'? The manpages of xargs are a bit cryptic for me. NOTE: There appears to be a known bug with the 'setfacl' utility when attempting to set default ACLs on directories. See http://lists.freebsd.org/pipermail/freebsd-fs/2005-May/001053.html for more details. This is what led me to the workaround of: $ getfacl /aclTest/ | setfacl -d -b -n -M - /aclTest/ which actually works for me. I do dread the idea of having to manually apply this to all existing directories in the /data filesystem. Thousands of them. Trying again: root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl . | setfacl -d -b -n -M - setfacl: line too long in - root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl . | setfacl -d -b -n -M - . setfacl: line too long in - root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl . | xargs -0 setfacl -d -b -n -M - . setfacl: illegal filename: Inappropriate ioctl for device root@aries:/data/Products/RSVP# find . -type d -print0 | xargs -0 getfacl . | setfacl -d -b -n -M - . setfacl: line too long in - root@aries:/data/Products/RSVP# Any ideas? ~Doug