Skip to content
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

Please use thread-safe (_r) versions of getpwent #34

Closed
fabianfreyer opened this issue Dec 23, 2018 · 1 comment
Closed

Please use thread-safe (_r) versions of getpwent #34

fabianfreyer opened this issue Dec 23, 2018 · 1 comment

Comments

@fabianfreyer
Copy link

Please use getpwnam_r, getpwuid_r, getgrgid_r and getgrnam_r etc. instead of the non-threadsafe versions. The non-threadsafe versions can cause issues such as fubarnetes/rctl#1 (See e.g. fubarnetes/rctl#5 for an example how to use the threadsafe functions).

@ogham
Copy link
Owner

ogham commented Mar 16, 2019

Thanks for pointing this out. In commits 12b5172...5bda684 I change all the functions to use the _r variants.

(With the exception of all_users, which doesn’t use getpwent_r because only one instance of that function should be running at a time anyway.)

@ogham ogham closed this as completed Mar 16, 2019
fabianfreyer added a commit to fubarnetes/rctl that referenced this issue Mar 28, 2019
This reverts commit 24a017c.

Since ogham/rust-users#34, we can use the
Users crate again, as this resolves #5.

Additionally, update the users crate to v0.9.1.

Closes #7.
fabianfreyer added a commit to fubarnetes/rctl that referenced this issue Mar 30, 2019
This reverts commit 24a017c.

Since ogham/rust-users#34, we can use the
Users crate again, as this resolves #5.

Additionally, update the users crate to v0.9.1.

Closes #7.
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

No branches or pull requests

2 participants