-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add user information to process #34
Conversation
types/process.go
Outdated
// On Linux and Darwin (macOS) this is the real user ID. | ||
// On Windows, this is the security identifier (SID) of the | ||
// user account of the process access token. | ||
Uid string `json:"uid"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
struct field Uid should be UID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fyi, I first had it as UID
but changed it to Uid
to be like Golang's User
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about going our own way and capitalizing each of these acronyms? Or do you have any insight why the os/user package doesn't follow this practice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can capitalize, that was my first instinct as well. I looked at the history of os/user - it has been Uid
/Gid
since when it was introduced some 8 years ago. So maybe back then the Go coding standards were not as consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
types/process.go
Outdated
// On Linux and Darwin (macOS) this is the real user ID. | ||
// On Windows, this is the security identifier (SID) of the | ||
// user account of the process access token. | ||
Uid string `json:"uid"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about going our own way and capitalizing each of these acronyms? Or do you have any insight why the os/user package doesn't follow this practice?
Adds a
User()
function toProcess
and implements it for all providers.For Linux and Darwin (macOS) this retrieves the real, effective, and saved user and group IDs.
For Windows, this retrieves the user and primary group SID.
It does not retrieve the Linux-specific filesystem UID and GID because its use has been deprecated for a long time (since 1995, I believe).
Closes #10.