[RFE] mtree support for extattr?
Vincent Batts
vbatts at hashbangbash.com
Wed Mar 30 21:03:28 UTC 2016
On Wed, Mar 9, 2016 at 10:17 AM, Vincent Batts <vbatts at 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
More information about the freebsd-hackers
mailing list