blob: 4d60e8ccb9db0e3261e7237e43991eb4c70cfc8f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/* ISC license. */
#include <string.h>
#include <nsss/pwd-def.h>
#include <nsss/nsss-unix.h>
int nsss_unix_pwd_getbyname (nsss_unix_t *a, struct passwd *pw, stralloc *sa, char const *name)
{
struct passwd pw2 ;
for (;;)
{
size_t base = sa->len ;
if (!nsss_unix_pwd_get(a, &pw2, sa)) return 0 ;
if (!strcmp(name, pw2.pw_name)) break ;
sa->len = base ;
}
*pw = pw2 ;
return 1 ;
}
|