Skip to content

net: replace getlogin_r with getpwuid#458

Merged
AltraMayor merged 1 commit intoAltraMayor:masterfrom
andrenth:replace-getlogin
Mar 1, 2021
Merged

net: replace getlogin_r with getpwuid#458
AltraMayor merged 1 commit intoAltraMayor:masterfrom
andrenth:replace-getlogin

Conversation

@andrenth
Copy link
Collaborator

@andrenth andrenth commented Mar 1, 2021

getlogin_r() was used to obtain a user name to be used as the first argument for the subsequent initgroups() call. However, getlogin_r() returns the user name of the logged in user which started Gatekeeper (that is, root), while the correct argument to initgroups() is the name of the unprivileged user defined in net.lua.

Furthermore, getlogin_r() doesn't work when the process has no controlling terminal, as is the case for processes started from an init system such as systemd.

@AltraMayor AltraMayor added this to the First deployment milestone Mar 1, 2021
@AltraMayor AltraMayor merged commit 59770f9 into AltraMayor:master Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants