test-nss-users: add new nss test that resolves users and groups

Inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1929936.
This is similar to test-nss-hosts, but does users, groups, uid, gids.

Functions tested are:
_nss_*_getpwnam_r
_nss_*_getgrnam_r
_nss_*_getpwgid_r
_nss_*_getgrgid_r

Other entry points should be tested too, but it's not relevant to the bug
I was investigating, so I'm leaving that for later ;)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-03-23 14:14:08 +01:00
parent 3f9721fef0
commit f0d1266821
6 changed files with 346 additions and 42 deletions
+22
View File
@@ -213,3 +213,25 @@ typedef enum nss_status (*_nss_gethostbyaddr_r_t)(
struct hostent *host,
char *buffer, size_t buflen,
int *errnop, int *h_errnop);
typedef enum nss_status (*_nss_getpwnam_r_t)(
const char *name,
struct passwd *pwd,
char *buffer, size_t buflen,
int *errnop);
typedef enum nss_status (*_nss_getpwuid_r_t)(
uid_t uid,
struct passwd *pwd,
char *buffer, size_t buflen,
int *errnop);
typedef enum nss_status (*_nss_getgrnam_r_t)(
const char *name,
struct group *gr,
char *buffer, size_t buflen,
int *errnop);
typedef enum nss_status (*_nss_getgrgid_r_t)(
gid_t gid,
struct group *gr,
char *buffer, size_t buflen,
int *errnop);