From owner-freebsd-hackers@freebsd.org Wed Mar 9 15:17:16 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE6B6AC8A42 for ; Wed, 9 Mar 2016 15:17:16 +0000 (UTC) (envelope-from vbatts@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76866795 for ; Wed, 9 Mar 2016 15:17:16 +0000 (UTC) (envelope-from vbatts@gmail.com) Received: by mail-ob0-x230.google.com with SMTP id ts10so49697723obc.1 for ; Wed, 09 Mar 2016 07:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to; bh=pyhMJmq76Vyzs8wdiq9DDqW5LEX3bo1KxhNb3hVL0qo=; b=I8Ph8WZbYSPcWjwbbisw3X4ZVWgCgJAbEBesqjptZrrxbm4nav1e7/oZwQE0YXuGHf 9lZ9McPAK9CsZ984gvFdeZpy+nlBLHVPWdocIxPThyNg+Lpjd/rQL9/Gu7RYVnyFllz4 V9zN3DrFlz/N1ki9mah3DtepE9tIt+qXNTqrJ5WBr/Jgk4m+DcrzFcsE70PQXUhlDweV PPBe3I64dbOjiDeoljU7cbgXEFFumJrWHaW0Y1N302G6m4djJbye2H+U39KrAvTejjj2 urkgpBIo1r6sOmT6jdbhBivHc3SxdVJbNN03N9ff0lyf6O2tR2OdxfSgfYE6C4AqRxEa zs/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to; bh=pyhMJmq76Vyzs8wdiq9DDqW5LEX3bo1KxhNb3hVL0qo=; b=kgW3FrtChaNKYnb+PuDYwF7QjAKgeoSM778ebs8H5hoXncdQNdFWzr+S9P11qZq2iP GUdF+MLa8B6bmJ+tXkZbT9gEXbgE/okzPCcrbPNu9xMoH/kT3rXDG6TJBkqFOpvBnAur /KX3G3YENuNW3BbxSQ3mAyPcaDOppjnRFGKQmVZKfRDUF2TSMxbSh+5JM06NGPLbJYJE wpFOnv+wazpVIsCzXrivmJ6kw6hub/0L/iDkjxXOt2fBrPL7HMpFVfeeeXVZOrvL+vpE zBnOkvt8/FW89kIXsmkTDCkqstSB6ZcBl7QnVcFPOhSK1bK/3UbIBDQPPwHmWkpkCAMO M55A== X-Gm-Message-State: AD7BkJKqLQV3jGdI8KUoM54+gvGes1Iq40z6k/T6WMC2hzokXNkPGlCUwV/zYT2D+fLRMBzwQtuEvHT1YSJx4A== MIME-Version: 1.0 X-Received: by 10.60.96.164 with SMTP id dt4mr20640137oeb.74.1457536635768; Wed, 09 Mar 2016 07:17:15 -0800 (PST) Sender: vbatts@gmail.com Received: by 10.182.109.228 with HTTP; Wed, 9 Mar 2016 07:17:15 -0800 (PST) In-Reply-To: References: Date: Wed, 9 Mar 2016 10:17:15 -0500 X-Google-Sender-Auth: COdvbBTjdx7kokw7SA6Q5rFsGrY Message-ID: Subject: Fwd: [RFE] mtree support for extattr? From: Vincent Batts To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2016 15:17:16 -0000 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! vb