Closed fabianfreyer closed 5 years ago
Thanks for pointing this out. In commits https://github.com/ogham/rust-users/compare/12b517283cd57e42d9d79160cae7b5a40612c974...5bda684ad2911d0f05823b293ba93251c01ba527 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.)
Please use
getpwnam_r
,getpwuid_r
,getgrgid_r
andgetgrnam_r
etc. instead of the non-threadsafe versions. The non-threadsafe versions can cause issues such as https://github.com/fubarnetes/rctl/issues/1 (See e.g. https://github.com/fubarnetes/rctl/pull/5 for an example how to use the threadsafe functions).