Получение пользователя, но не 100%
This commit is contained in:
parent
bc02ac8518
commit
2876a45a85
3 changed files with 159 additions and 1 deletions
16
source/app.d
16
source/app.d
|
@ -2,6 +2,7 @@ module app;
|
|||
|
||||
import dfanotify; // твой модуль сверху
|
||||
import depoll; // новый модуль для epoll
|
||||
import event_actor;
|
||||
|
||||
import core.sys.posix.fcntl : O_RDONLY, O_LARGEFILE;
|
||||
import core.stdc.errno : errno;
|
||||
|
@ -277,7 +278,16 @@ void main(string[] args)
|
|||
foreach (ev; events)
|
||||
{
|
||||
auto pname = eventProcessName(ev.pid);
|
||||
writeln("pid = ", ev.pid, "\tproc = ", pname, "\tmask = ", maskToStr(ev.mask));
|
||||
// writeln("pid = ", ev.pid, "\tproc = ", pname, "\tmask = ", maskToStr(ev.mask));
|
||||
writefln("[%s] pid = %s proc = %s mask = %s",
|
||||
(tag == TAG_PRE) ? "PRE" : "NOTIF",
|
||||
ev.pid, pname,
|
||||
maskToStr(ev.mask)
|
||||
);
|
||||
auto actor = eventActorFromPid(ev.pid);
|
||||
writeln("user=", actor.user, " uid=", actor.uid,
|
||||
" ruid=", actor.ruid, "(", actor.ruser, ")",
|
||||
" euid=", actor.euid, "(", actor.euser, ")");
|
||||
|
||||
if (tag == TAG_PRE && (ev.isOpenPerm || ev.isAccessPerm))
|
||||
{
|
||||
|
@ -329,6 +339,10 @@ void main(string[] args)
|
|||
// snag --config ... create --comment "CLOSE_WRITE - <name>" ...
|
||||
writefln(" -> HANDLE CLOSE_WRITE for: %s", ev.name);
|
||||
}
|
||||
else if (ev.isMoved)
|
||||
{
|
||||
writefln(" -> HANDLE MOVED for: %s", ev.name);
|
||||
}
|
||||
else if (ev.isModify)
|
||||
{
|
||||
writefln(" -> HANDLE MODIFY for: %s", ev.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue