bugfindutils - Bugs: bug #58941, wishlist: Support for -xattr...

 
 

bug #58941: wishlist: Support for -xattr -xattrname

Submitter:  Kevin Locke <kevinoid>
Submitted:  Wed 12 Aug 2020 02:34:14 PM UTC
Votes: 101
 
Category:  find Severity:  1 - Wish
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  None Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 27 May 2024 06:24:11 PM UTC, comment #7: 

comment #5:

> bug #64088 specifically concerned the attributes append-only, immutable, nodump, fscrypt, verity, dax, projinherit


Those are not technically extended attributes.  getxattr(2) and friends don't return them.  They are inode flags, queried/set by ioctl_iflags(2) on Linux.

comment #6:

> By now, probably several find implementations have this or similar features.  We should try to avoid introducing gratuitous incompatibilities.   That could mean more than one new test could be needed.


BSD find uses -flags for something similar.  I think GNU find should also use -flags for inode flags on Linux.  It could use the same syntax as chattr(1), much like how -perm uses the same syntax as chmod(1).

On BSD it should use st_flags and strtofflags(3) to be compatible with the system find(1).

Tavian Barnes <tavianator>
Sun 26 May 2024 10:49:35 AM UTC, comment #6: 

By now, probably several find implementations have this or similar features.  We should try to avoid introducing gratuitous incompatibilities.   That could mean more than one new test could be needed.

James Youngman <jay>
Group administrator
Sun 26 May 2024 10:46:47 AM UTC, comment #5: 

bug #64088 specifically concerned the attributes append-only, immutable, nodump, fscrypt, verity, dax, projinherit

James Youngman <jay>
Group administrator
Sun 26 May 2024 10:46:00 AM UTC, comment #4: 

bug #64088 is a duplicate of this one.

James Youngman <jay>
Group administrator
Sun 26 May 2024 10:39:26 AM UTC, comment #3: 

bug #49574 is a duplicate of this bug (though that one predates this one).

James Youngman <jay>
Group administrator
Sun 23 Apr 2023 12:20:42 AM UTC, comment #2: 

original submission:

> It would be great if find could support searching for files based on the presence/absence of extended attributes (xattrs).


Until this functionality is included in GNU find, you could use my "rawhide" program which can search by extended attributes (EA) (names and/or contents) and also by the contents of access control lists (ACL). It's available from https://raf.org/rawhide as well as https://codeberg.org/raforg/rawhide.

raf <raf>
Thu 13 Aug 2020 03:18:39 AM UTC, comment #1: 

As mentioned in a post to the bug-findutils mailing list, Morgan Weetman graciously made available his previous work implementing -xattr (and -cap for capabilities) in https://gitlab.com/mweetman/findutils .  This should make an excellent starting place for future work.  See Pavel Raiskup's feedback and Bernhard Voelker's feedback for remaining issues.

[Note: This is being added as a comment to the bug tracker for others who may find this issue there.]

Kevin Locke <kevinoid>
Wed 12 Aug 2020 02:34:14 PM UTC, original submission:  

It would be great if find could support searching for files based on the presence/absence of extended attributes (xattrs).

The only way I could find to do this currently is via -exec, as suggested in https://unix.stackexchange.com/q/162359 and https://unix.stackexchange.com/q/132795

For reference, OS X find supports xattr search with the tests:

-xattr
True if the file has any extended attributes.

-xattrname name
True if the file has an extended attribute with the specified name.

per https://opensource.apple.com/source/shell_cmds/shell_cmds-203/find/find.1.auto.html

Thanks for considering,
Kevin

Kevin Locke <kevinoid>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tavianator (Posted a comment)
  • -email is unavailable- added by jay (Updated the item)
  • -email is unavailable- added by calestyo (Voted in favor of this item)
  • -email is unavailable- added by raf (Posted a comment)
  • -email is unavailable- added by vt_alt (Voted in favor of this item)
  • -email is unavailable- added by rnhmjoj (xattrs support in find)
  • -email is unavailable- added by kevinoid (Submitted the item)
  •  

    There are 101 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-19 jay Severity3 - Normal 1 - Wish
    2023-10-26 calestyo Carbon-Copy- Added calestyo
    2022-01-18 vt_alt Carbon-Copy- Added vt_alt
    2021-07-01 rnhmjoj Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code