Project

General

Profile

Feature #25970

Add devel/py-xattr to base install

Added by Andrew Walker almost 2 years ago. Updated about 1 year ago.

Status:
Done
Priority:
Important
Assignee:
Timur Bakeyev
Category:
OS
Target version:
Estimated time:
Severity:
New
Reason for Closing:
Reason for Blocked:
Dependant on a related task to be completed
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Related projects 1 project

Description

Make our tools for working with xattrs suck less by adding devel/py-xattr to the base install.

Associated revisions

Revision d97a1213 (diff)
Added by Dru Lavigne about 1 year ago

Mention xattr.
Ticket: #25970

History

#1 Updated by Timur Bakeyev almost 2 years ago

Andrew, can you summarize what do we expect from such tool(s) to provide us? I'm not certain that py-xattr is the best tool, although it's better than none.

#2 Updated by Timur Bakeyev almost 2 years ago

Ok, now I see why it triggered my attention.

In my work dir:

-PORTVERSION=   0.7.8
+PORTVERSION=   0.9.2

But, looking into the code I found that the tool operates only on EXTATTR_NAMESPACE_USER namespace. Samba uses EXTATTR_NAMESPACE_SYSTEM also. That mainly related to AD provisioning, but could be smth. else I'm not aware of.

So, again, what is the usage pattern for that tool?

#3 Updated by Andrew Walker almost 2 years ago

Timur Bakeyev wrote:

Andrew, can you summarize what do we expect from such tool(s) to provide us? I'm not certain that py-xattr is the best tool, although it's better than none.

I guess "suck less" is probably not very detailed. The main thing that I was using it for was being able to output the contents of all xattrs on a file via "py-xattr -l <filename>". This is less annoying than having to "lsextattr user <filename>" then "getextattr user <xattr name> <filename>" for each file (especially when you have xattr names containing crazy weird unicode characters that aren't displayed properly.

What would be even better is to have a tool that can do this and also nuke all xattrs on a file with a single command, and also be able to clone xattrs from one file to another (because "getextattr | setextattr" doesn't work well when you have crazy Apple unicode xattr names).

Basically, I'd like to have a full set of tools to manipulate these things. Right now I have a couple of sticks (lsextattr, getextattr, rmextattr), and I'd like to have a rock to go with them (py-xattr). It's not the best, but it's better than what we have, and is trivially easy to add.

#4 Updated by Andrew Walker almost 2 years ago

Timur Bakeyev wrote:

Ok, now I see why it triggered my attention.

In my work dir:
[...]

But, looking into the code I found that the tool operates only on EXTATTR_NAMESPACE_USER namespace. Samba uses EXTATTR_NAMESPACE_SYSTEM also. That mainly related to AD provisioning, but could be smth. else I'm not aware of.

So, again, what is the usage pattern for that tool?

vfs_acl_xattr uses the system namespace, but we typically don't use that (unless it's part of the provisioning code for Samba4 DC on FreeNAS/TrueNAS). If I recall correctly, John worked on the provision code in FreeNAS Samba to make it understand ZFS ACLs.

#5 Updated by Dru Lavigne almost 2 years ago

  • Status changed from Untriaged to Unscreened

#6 Avatar?id=14398&size=24x24 Updated by Kris Moore almost 2 years ago

  • Assignee changed from Kris Moore to Timur Bakeyev
  • Priority changed from No priority to Important
  • Target version set to TrueNAS 11.1-U1

Timur, going to throw this your way, since it sounds like you and Andrew can figure out if this is needed, or if a better solution may present itself.

#7 Updated by Timur Bakeyev almost 2 years ago

  • Status changed from Unscreened to Screened

#8 Updated by Dru Lavigne almost 2 years ago

  • Project changed from TrueNAS to FreeNAS
  • Category changed from 162 to 129
  • Target version deleted (TrueNAS 11.1-U1)

#9 Updated by Timur Bakeyev almost 2 years ago

  • Status changed from Screened to Fix In Progress

I think to split this request into 4 steps:

1. I've added devel/py-xattr to the MASTER
2. I've send request to upstream to update port to the 0.92 and, possibly, take it over. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222888
3. Extend getextattr/lsextattr to use libxo for output, so it would be possible to get JSON/XML output as well, which, presumably, easier to program around.
4. Try to come up with universal enough handling of extended attributes for Samba and other XATTR manipulating tools.
5. Write new API for XATTR :)?

#10 Updated by Timur Bakeyev almost 2 years ago

Oh, and as a side note, weird characters we addressed by using vfs_catia and option:

        catia:mappings =
        0x01:0xf001,0x02:0xf002,0x03:0xf003,0x04:0xf004,0x05:0xf005,0x06:0xf006,0x07:0xf007,0x08:0xf008,0x09:0xf009,0x0a:0xf00a,
        0x0b:0xf00b,0x0c:0xf00c,0x0d:0xf00d,0x0e:0xf00e,0x0f:0xf00f,0x10:0xf010,0x11:0xf011,0x12:0xf012,0x13:0xf013,0x14:0xf014,
        0x15:0xf015,0x16:0xf016,0x17:0xf017,0x18:0xf018,0x19:0xf019,0x1a:0xf01a,0x1b:0xf01b,0x1c:0xf01c,0x1d:0xf01d,0x1e:0xf01e,
        0x1f:0xf01f,0x22:0xf020,0x2a:0xf021,0x3a:0xf022,0x3c:0xf023,0x3e:0xf024,0x3f:0xf025,0x5c:0xf026,0x7c:0xf027

#11 Updated by Andrew Walker almost 2 years ago

Timur Bakeyev wrote:

I think to split this request into 4 steps:

1. I've added devel/py-xattr to the MASTER
2. I've send request to upstream to update port to the 0.92 and, possibly, take it over. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222888
3. Extend getextattr/lsextattr to use libxo for output, so it would be possible to get JSON/XML output as well, which, presumably, easier to program around.
4. Try to come up with universal enough handling of extended attributes for Samba and other XATTR manipulating tools.
5. Write new API for XATTR :)?

While you're at it, can you also write a new version of mount_smbfs that supports SMB2/3. ;-)

#12 Updated by Dru Lavigne over 1 year ago

  • Target version set to 11.2-BETA1

#13 Updated by Timur Bakeyev over 1 year ago

The py-xattr is in the 11-master and, I guess, also in 11.1-stable. So, direct request is fulfilled.

The rest of the fixes are, possibly, shifted to 11.2.

#14 Updated by Timur Bakeyev over 1 year ago

Need to look into the vfs_freebsd module.

#15 Updated by Timur Bakeyev over 1 year ago

Still need to write vfs_freebsd. That should address new issues with provisioning in 4.7.4.

#16 Updated by Timur Bakeyev over 1 year ago

Ping

#17 Updated by Dru Lavigne over 1 year ago

  • Status changed from Fix In Progress to Blocked
  • Reason for Blocked set to Dependant on a related task to be completed

#18 Updated by Dru Lavigne over 1 year ago

  • Status changed from Blocked to Done
  • Needs Merging changed from Yes to No

Marking as done as the request covered by this ticket is taken care of. Timur will create tickets for future work as needed.

#19 Updated by Dru Lavigne about 1 year ago

  • Status changed from Done to Ready for Testing

#20 Updated by Dru Lavigne about 1 year ago

  • Status changed from Ready for Testing to Done
  • Severity set to New
  • Needs QA changed from Yes to No
  • Needs Doc changed from Yes to No

Doc commit: https://github.com/freenas/freenas-docs/commit/d97a1213638556dfb32f3f092f36b2468188d3d7.

xattr -h and xattr -lz work on FreeNAS-11.2-MASTER-201805071504.

Also available in: Atom PDF