Open porg opened 2 years ago
fanotify() does not support this directly, but we could read the source pid's current euid.
I'm not Linux savvy enough to know what's the correct way to determine this (fanotify et al), but anything which gives me a clue about the user from which the activity comes from would be appreciated. 😉
Any plans for implementation?
Alright I tried to implement this in pull request #27. Does that meet your requirements, @porg?
Hi @gabrielkulp , thanks for contributing! 1) I cannot test this myself as I do not know how to pull your commit and built fatrace (for other feature tests, @martinpitt was so kind and built the binaries for me) 2) But I can give you feedback on the basis of your textual description for pull request #27:
u
means usernameU
is the numerical user idg
group-name or G
group-ID, but in sight of these your news added it to #15
--output-argument
outputs its "maximum or default representation" and can be further tweaked by --columns
. So please make sure that your code has 4 separate variables $io-group-name, $io-group-id, $io-user-name, $io-user-id
and the corresponding single-letter-code to be used for --columns
plus its "composite representation" as a variable like $io-user-and-group
which is used for the default output.
$io-user-name:$io-group-name
which is the default representation and order as Unix ls -l
outputs file ownership.
Feature Request
-u
,--user
argument there's an additional column which shows from which user the file event originatedRelated