Closed jacek-kurlit closed 2 months ago
I tried to debug where this error comes from and I have found this place
helpers::build_inode_proc_map()
linie 17
let dir_fd = rustix::fs::openat(
I have found some solution by filtering error_kind == PermissionDenied
let dir_fd = match dir_fd {
Ok(fd) => fd,
Err(e) if e.kind() == ErrorKind::PermissionDenied => {
continue;
}
Err(e) => return Err(Box::new(e)),
};
I can create PR with fix if you are interested
Hey @jacek-kurlit thank you so much for this ticket and for your solution, you can feel free to open a PR and I'll be happy to merge. As you've said, this error is generated from the fact that some processes are run with privileges and cannot be seen by regular users. I used to run this library as sudo on Linux, but if we can improve this aspect by letting normal users see standard processes, that's actually a good idea.
Actually you can skip all kind of errors... a change I should apply also in other places of the code is to ignore all the errors that are related to a specific process but that don't compromise other processes.
Hi!
I have created PR https://github.com/GyulyVGC/listeners/pull/10
I didn't go as far to ignore all errors as I wasn't sure if this is good idea to swallow error without any info for lib user. Also I have changed code by simply checking user permissions to read fd before opening it.
Hello,
When I try to use this create I receive error
{ code: 13, kind: PermissionDenied, message: "Permission denied" }
All I do is callinglet ports = listeners::get_all();
I'm using fedora 40, is there any limitation on linux systems? I want to use this create in my tool but I cannot force user to run as root