summaryrefslogtreecommitdiff
path: root/src/libnsss/nsss_switch_getpwnam.c
blob: 722e55649ae633b2ad75bd594f219058d7d4a1ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

#include <nsss/config.h>
#include <nsss/pwd-switch.h>
#include <nsss/nsss-switch.h>
#include "nsss-internal.h"
#include "nsss-switch-internal.h"

struct passwd *nsss_switch_getpwnam (char const *name)
{
  if (!nsss_switch_query_start(NSSS_NSSSD_PATH, NSSS_SWITCH_PWD, 30000, 0, 0)) return 0 ;
  nsss_pwd_sa_here.len = 0 ;
  return nsss_switch_pwd_getbyname(&nsss_switch_query, &nsss_pwd_here, &nsss_pwd_sa_here, name, 0, 0) ? &nsss_pwd_here : 0 ;
}