Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Mar 2016 17:03:27 -0400
From:      Vincent Batts <vbatts@hashbangbash.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: [RFE] mtree support for extattr?
Message-ID:  <CAN6Zp5y%2BpPK%2Bi-FJY5wfMtujM9-f7m=pXMFcmZd7rWmRcFGn0g@mail.gmail.com>
In-Reply-To: <CAN6Zp5zfQd47n4xZ66wfKWJvnL_-eVrB=r9MMgY2_7VuiCN0oA@mail.gmail.com>
References:  <CAN6Zp5zej%2BEZi7U3L2AXR9CLbBhJsNBiG9SbP55vmqAhTPO_gQ@mail.gmail.com> <CAN6Zp5zfQd47n4xZ66wfKWJvnL_-eVrB=r9MMgY2_7VuiCN0oA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 9, 2016 at 10:17 AM, Vincent Batts <vbatts@hashbangbash.com> wrote:
> Hello all,
>
> This is a first post from me. The `mtree` utility (./contrib/mtree/)
> and the specs that it produces and validates has found it's way into
> projects that I am involved in. While the projects are initially very
> Linux  focused, they are not limited to such. There is an mtree-port
> that has been started for Linux, but is not widely packaged yet. Also,
> libarchive has support for parsing and creating mtree specs.
>
> On most Linux filesystems, extend attributes are used commonly for
> storing ACLs, capabilities, etc. These attributes are something that
> most definitely would be interesting keywords to include in the spec
> of a directory hierarchy.
> From my researching, it seems that extattr support for mtree on
> freebsd is not present, while the sys/extattr.h and UFS could support
> it.
>
> It seems this is a valuable feature to add and would be widely useful.
> Some of the mechanics would be interesting to handle the collation of
> the extattr data into the keywords for files in the mtree spec. As the
> key/values are namespaced, perhaps the mtree keyword would use the
> namespace.key and prefix it with 'extattr.' or 'xattr' or similar.
> Such that the entry in the mtree spec looks like
> ```
>     my.file \
>                 mode=0644 size=24542 time=1455996582.000000000 \
>                 extattr.system.mykey=myvalue \
>
> sha512digest=f758e6d04b527cc024aa70ffaaa75b4899429498d246f41a057753dc51b7d49e0f6b512c1f1920435585067209863c529b2038101ce0576138c7eee7ca359b7c
> ```
> Some issues that I have with this is the information leak of the
> values of the extended attributes. Also, on Linux xattrs are expected
> to be ascii strings, it is not uncommon to find binary content in the
> value.
> For these two cases, it seems nicer to just include a checksum of the
> value of each extended attribute. This then requires an election to
> which hash to use for the checksum digest.
>
> I look forward to your response and next steps!

Hello all,

In update, I have recently opened the project "go-mtree" (
https://github.com/vbatts/go-mtree ). It is a go programming language
library for interacting with the mtree specification. It has a simple
cli, which is largely for testing and not intended to replace the
`mtree` executable.

I did include the xattr support as I mentioned. It's design ought to
be consistent with how FreeBSD extattr work. It would be great to here
from anyone on extended attribute support making its way into the
FreeBSD mtree and specification.

Thoughts?

vb



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6Zp5y%2BpPK%2Bi-FJY5wfMtujM9-f7m=pXMFcmZd7rWmRcFGn0g>