From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oN18MvUNuV4QBgAA0tVLHw (envelope-from ) for ; Mon, 11 May 2020 08:33:57 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KH1sKgMOuV6cXQAA1q6Kng (envelope-from ) for ; Mon, 11 May 2020 08:34:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 58F809411B0 for ; Mon, 11 May 2020 08:34:09 +0000 (UTC) Received: from localhost ([::1]:49672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY3t4-0007n1-3q for larch@yhetil.org; Mon, 11 May 2020 04:34:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jY3ss-0007k3-Kb; Mon, 11 May 2020 04:33:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59410) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jY3sr-0007CU-Ig; Mon, 11 May 2020 04:33:57 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=35730 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jY3sq-0006YK-KI; Mon, 11 May 2020 04:33:57 -0400 From: Jan Nieuwenhuizen To: bug-hurd@gnu.org Subject: Re: Feeble attempt at using xattr gnu.translator Organization: AvatarAcademy.nl References: <873687po5m.fsf@gnu.org> <20200510200555.2yrvifu73emzk44s@function> X-Url: http://AvatarAcademy.nl Date: Mon, 11 May 2020 10:33:53 +0200 In-Reply-To: <20200510200555.2yrvifu73emzk44s@function> (Samuel Thibault's message of "Sun, 10 May 2020 22:05:55 +0200") Message-ID: <87zhaej2fi.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53951074850735]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.07), country: US(-0.00), ip: 209.51.188.17(-0.54)]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; FROM_NEQ_ENVFROM(0.00)[janneke@gnu.org,guix-devel-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[avataracademy.com:url,joyofsource.com:url,gnu.org:email,lilypond.org:url]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; MIME_TRACE(0.00)[0:+]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: EdrtrFzAFcfQ Samuel Thibault writes: Hello Samuel, > Did you have a look at Shengyu Zhang's work on xattr? That's about > summer 2016. Ah, that's a helpful pointer. What I notice is that Shengyu's last message says "not merged yet", to which Richard Braun responds https://lists.gnu.org/archive/html/bug-hurd/2016-08/msg00095.html "we'll have more time in September to really dive into the code, finish the review and merge it." It got merged, but I'm not sure about the "finish" bit; Justus Winter disabled it by default (not a great sign), and GSoC 2017 mentions: "finishing the xattr work" https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00016.html I cannot find any more meta data, documentation or tests... > Also see glibc/sysdeps/mach/hurd/setxattr.c which > translates gnu attributes into RPC calls, and then again in the > translators's diskfs_set_translator. See for instance in > hurd/ext2fs/inode.c's diskfs_set_translator, it looks at > > if (EXT2_HAS_COMPAT_FEATURE (sblock, EXT2_FEATURE_COMPAT_EXT_ATTR) > && use_xattr_translator_records) I noticed the --x-xattr-translator-records before but after reading some more code, I got a little bit further glibc/hurd/xattr.c has gnu.translator empty if no passive translator translator and arguments: "/hurd/foo\0arg1\0arg2\0" ah...so there's a nice hack (way??) to also pass arguments...and then hurd/libdiskfs/file-set-trans.c has diskfs_S_file_set_translator (struct protid *cred, [...] if (passivelen && passive[passivelen - 1]) return EINVAL; hmm; so even when there are no arguments, VALUE must end with 0?! Okay... --8<---------------cut here---------------start------------->8--- root@debian:~# touch 1 root@debian:~# setfattr --name=3Dgnu.translator --value=3D/hurd/pflocal 1 setfattr: 1: Invalid argument root@debian:~# setfattr --name=3Dgnu.translator --value=3D'/hurd/pflocal\0'= 1 root@debian:~# showtrans 1 /hurd/pflocal --8<---------------cut here---------------end--------------->8--- ...so "something" works. Sadly, this trick does not work on GNU/Linux. I'm afraid this hasn't been upstreamed and we would have to debug linux and/or create a patch for setxattr to accept "gnu." on "Hurd" type file systems. Thoughts? Also, some other things also don't work --8<---------------cut here---------------start------------->8--- root@debian:~# getfattr --name=3Dgnu.translator 1 1: gnu.translator: Operation not supported root@debian:~# setfattr --name=3Dgnu.translator --value=3D'/geert/pflocal\0= ' 1 setfattr: 1: Operation not supported root@debian:~# setfattr --remove=3Dgnu.translator 1 setfattr: 1: Operation not supported --8<---------------cut here---------------end--------------->8--- Greetings, janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com