[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Findutils-patches] xattr and capability support

From: KillBoy PowerHed
Subject: Re: [Findutils-patches] xattr and capability support
Date: Thu, 11 Dec 2014 22:19:20 +0000 (UTC)

Hi list,

Now that the FSF legals are out of the way I've started working on $subject
again, I've implemented a couple of Dale's suggestions already :-

>> My understanding is that all regexes in find are controlled by
>> -regextype, so the regex handling in any new predicates should work
>> the same way.  The particular syntax for the regex is set by
>> -regextype, but whether the regex is case-sensitive is determined by
>> whether the predicate starts with "i".  (E.g., -iname vs. -name,
>> -ilname vs. -lname)

The pattern is now interpreted according to '-regextype', I've also added
a case-insensitive '-ixattr'

> >- If the current file name is a symbolic link, does -xattr test the
> >  symbolic link itself, or the file it points to?  (It's possible that
> >  symbolic links can never have extended attributes, in which case
> >  looking at the file that is pointed to would always make sense.)  Is
> >  this behavior affected by the -L option?  Or do we need a "-lxattr"
> >  test?
>I would expect it to work like -name vs. -lname.  And the meaning of
>both of these is modified by the -P, -L, -H, and deprecated --follow

Next on the TODO list

> >- Is there any way to test whether a particular attribute has a
> >  particular value, or matches a regex?  Is there any need for this?
> >  If there is:  It appears to me that the values can be binary
> >  strings; what do we have to do to allow comparison values to be
> >  specified (especially given that 0 bytes cannot appear in command
> >  arguments).  If the values can be binary strings, is there a need to
> >  provide a mask-and-test operation?

Will defer until demand can be determined, seems like a little effort may
be required.

So my question for today is about test cases, is there a complexity
tipping point after which it's not worth it?

i.e. for '-xattr'
- Ensure the filesystem supports extended attributes
- create a test file
- set an etended attribute
- check that the file matches the pattern

For the '-cap' option, creating the test case would be even more complex
as you need root permissions to set capabilities on files, need to ensure
sample files are cleaned up etc

... thoughts?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]