On a Linux system it is possible to find files that are owned by a uid that does not have a user name assigned with "find -nouser". I have been looking for an equivalent that will search the POSIX ACL lists for non-existent users, but have had no luck. Does anyone know of a method or utility to do this?
-
If find -exec getfacl results in an output distinctive to non-existent users (like a number instead of the user name), the results could be piped into a regular expression searching for this pattern. I would try it but I'm not about to create non-existent users just to find out.– kmarshMar 5, 2014 at 17:05
-
Something like: find . -name '*.ext' -exec getfacl {} \; | grep "owner: [0-9]" If that works I'll make it an answer. :)– kmarshMar 5, 2014 at 17:09
-
Using grep on the output of getfacl doesn't actually return the file name. It only returns the line with the uid instead of the name.– William StockallMar 5, 2014 at 17:18
-
More on that grep "owner: " line. The "owner: " section of getfacl is the same as the owner find will see. I need to match the "user: " lines.– William StockallMar 5, 2014 at 17:29
-
On my Linux system, "user:" lines show permissions like "rwx". The following can be used to combine lines (thanks to stackoverflow.com/questions/8545538/…): find . -name '*.jpg' -exec getfacl {} \; | egrep 'file|owner' | sed -rn 'N;s/\n/ /;p'– kmarshMar 5, 2014 at 18:55
|
Show 3 more comments