Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I decided to give a try and fix #194, as author of #198 can't continue work. This is still work in progress as there are few problems. Both linux and macos
Userstructs seems to be strongly tied toutmpxlogin records and this makes really hard to fill all fields in struct. Matching user to stream of currently connected users to get all required information will not work as some users might not appear to be connected and still have some processes ( for example daemons like dbus ). I could probably get hostname from/proc/sys/kernel/hostnamebut not sure about any others without any nasty tricks( like looking in all processes for terminal that is used by user and extracting information and that for every user ). It would be great to separate user from user login session but that probably would be a breaking change. For now, I decided to get information aboutuidfrom/proc/<pid>/status(File is not fully parsed atm.) and recreate user from funcgetpwuid, similarly for macOS butuidis extracted from process struct. At this moment it works but process owner information are limited on both linux and macOS. Any other way to find out some information's related to user?