From owner-freebsd-current@FreeBSD.ORG Wed Feb 9 02:51:22 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999DA106564A for ; Wed, 9 Feb 2011 02:51:22 +0000 (UTC) (envelope-from lattera@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7938FC0A for ; Wed, 9 Feb 2011 02:51:21 +0000 (UTC) Received: by wyf19 with SMTP id 19so6606080wyf.13 for ; Tue, 08 Feb 2011 18:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YCtSEPGs8TjyoKkzE8y+kuqqskhEvA9O6A9p33AAOc8=; b=qG6nhR/zdtrCrGpLVTOSciWVcNyEVKzDbvEpZffaeUTP+1pdvKt8POUkL7WKtwhq28 QGXrGIOT20TOetpamWF5q4Pi7b5ZnT/b7CP8WnWhBI5NToRJyf3lKzjxN3aHJ+TKMttM 9ELmwkf+kQpQX5YUQdmM5A3RgObnkoXCbqvkw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=nMy5S01MgkQxsEfo95Jc7SDQMWh9M04IYMjhlwNKPkkvk/FyMd6JRLEdCqqj9WbUJI RI3ib+DLu4ojnQh3ZnreNiCZUd730D/kzu2oM/dLea7yjIZJ06cxs6hEOhQ7XNvUs98Q LyZcF2CnlJtAhK8KSzTFTjjjjVEtQdZixGJtY= MIME-Version: 1.0 Received: by 10.227.201.5 with SMTP id ey5mr1214281wbb.182.1297219880831; Tue, 08 Feb 2011 18:51:20 -0800 (PST) Received: by 10.227.68.204 with HTTP; Tue, 8 Feb 2011 18:51:20 -0800 (PST) In-Reply-To: <80373F51-25C7-48A0-8920-3444A98D857F@kientzle.com> References: <80373F51-25C7-48A0-8920-3444A98D857F@kientzle.com> Date: Tue, 8 Feb 2011 19:51:20 -0700 Message-ID: From: Shawn Webb To: Tim Kientzle Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD-current Subject: Re: setfacl Recursive Functionality X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Feb 2011 02:51:22 -0000 On Tue, Feb 8, 2011 at 7:35 PM, Tim Kientzle wrote: > On Feb 8, 2011, at 9:58 AM, Shawn Webb wrote: > > I've just finished a patch to add recursive functionality to setfacl. > Before > > I officially submit it, I'd like a few suggestions on how to improve the > > patch. > > > > The part I'm worried about involves the #define directive at top. I'm not > > sure what ramifications using that define might have. I needed it for my > > remove_invalid_inherit() function to work. > > You should certainly not need > #define _ACL_PRIVATE > for any user-space utilities. What exactly is the > problem without that? > > Your approach to directory walking here > is a little simplistic. In particular, you're storing > every filename for the entire tree in memory, > which is a problem for large filesystems. > > It would be much better to refactor the code so that > the actual ACL update was in a function and then > recurse_directory should call that function for > each filename as it visited it. That will reduce > the memory requirements significantly. > > You should also take a look at fts(3). In particular, > you'll want to implement the BSD-standard > -L/-P/-H options, and fts(3) makes that much easier. > (-L always follows symlinks, -P never follows symlinks, > -H follows symlinks on the command line). > > Tim > > Great suggestions. I'll definitely look at implementing that functionality. As a side note, it looks like my setfacl patch segfaults on freebsd-current r218075 with the zpool v28 patchset applied. I wrote it on freebsd 8.2-RC3 with zpool v15. Thanks, Shawn