Skip to content

Conversation

@helen-fornazier
Copy link

fgetpwent is not part of POSIX and it is not available in FreeBSD.
Also, getpwent() already reads from the local database, use it instead
and remove fgetpwent()

fgetpwent is not part of POSIX and it is not available in FreeBSD.
Also, getpwent() already reads from the local database, use it instead
and remove fgetpwent()
@google-oss-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: helen-fornazier
To complete the pull request process, please assign hopkiw
You can assign the PR to them by writing /assign @hopkiw in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot
Copy link
Collaborator

Hi @helen-fornazier. Thanks for your PR.

I'm waiting for a GoogleCloudPlatform member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@hopkiw
Copy link
Contributor

hopkiw commented Oct 24, 2019

on linux at least, getpwent will resolve through the passwd database - meaning whatever you have configured in nsswitch.conf. It is not the same as fgetpwent(/etc/passwd) and can't be used as a drop-in replacement.

@helen-fornazier
Copy link
Author

I see. So maybe we should implement fgetpwent() under #ifdef __FreeBSD__.
Or we could always add the files service in the passwd database in nsswitch.conf when OsLogin gets activated.
What do you think?

@hopkiw
Copy link
Contributor

hopkiw commented Oct 28, 2019

I see. So maybe we should implement fgetpwent() under #ifdef __FreeBSD__.
Or we could always add the files service in the passwd database in nsswitch.conf when OsLogin gets activated.
What do you think?

The first option will work, but it may be a somewhat lengthy implementation. What function does the existing files implementation in FreeBSD use? We want to match the normal lookup behavior.

This second option I think will not work. This function is invoked by nss, so we would have a kind of recursive lookup, then. The purpose of this check is to find out whether this is a 'local' user by isolating our search to the files DB, whereas the NSS methods are meant to return the results of all configured databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants