From: Jan Nieuwenhuizen <janneke@gnu.org>
To: bug-hurd@gnu.org
Cc: guix-devel@gnu.org
Subject: Re: Feeble attempt at using xattr gnu.translator
Date: Mon, 11 May 2020 10:33:53 +0200 [thread overview]
Message-ID: <87zhaej2fi.fsf@gnu.org> (raw)
In-Reply-To: <20200510200555.2yrvifu73emzk44s@function> (Samuel Thibault's message of "Sun, 10 May 2020 22:05:55 +0200")
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=gnu.translator --value=/hurd/pflocal 1
setfattr: 1: Invalid argument
root@debian:~# setfattr --name=gnu.translator --value='/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=gnu.translator 1
1: gnu.translator: Operation not supported
root@debian:~# setfattr --name=gnu.translator --value='/geert/pflocal\0' 1
setfattr: 1: Operation not supported
root@debian:~# setfattr --remove=gnu.translator 1
setfattr: 1: Operation not supported
--8<---------------cut here---------------end--------------->8---
Greetings,
janneke
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
next prev parent reply other threads:[~2020-05-11 8:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-10 19:48 Feeble attempt at using xattr gnu.translator Jan Nieuwenhuizen
2020-05-10 20:05 ` Samuel Thibault
2020-05-11 8:33 ` Jan Nieuwenhuizen [this message]
2020-05-11 8:42 ` Samuel Thibault
2020-05-11 8:46 ` Samuel Thibault
2020-05-11 8:53 ` Jan Nieuwenhuizen
2020-05-11 8:58 ` Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zhaej2fi.fsf@gnu.org \
--to=janneke@gnu.org \
--cc=bug-hurd@gnu.org \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).