-
Notifications
You must be signed in to change notification settings - Fork 25
/
nss_test.h
72 lines (66 loc) · 3.28 KB
/
nss_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* Copyright 2009 Google Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA
*/
#include <grp.h>
#include <pwd.h>
#include <stdlib.h>
#include <sys/param.h>
#include <unistd.h>
#ifndef BSD
#include <gshadow.h>
#include <shadow.h>
#endif // ifndef BSD
#ifndef NSS_TEST_H
#define NSS_TEST_H
const char *PASSWD_FILE = ".testdata/passwd.cache";
const char *GROUP_FILE = ".testdata/group.cache";
#ifndef BSD
const char *SHADOW_FILE = ".testdata/shadow.cache";
const char *GSHADOW_FILE = ".testdata/gshadow.cache";
#endif // ifndef BSD
extern enum nss_status _nss_cache_getpwent_r(struct passwd *result,
char *buffer, size_t buflen,
int *errnop);
extern enum nss_status _nss_cache_getpwnam_r(const char *name,
struct passwd *result,
char *buffer, size_t buflen,
int *errnop);
extern enum nss_status _nss_cache_getpwuid_r(uid_t uid, struct passwd *result,
char *buffer, size_t buflen,
int *errnop);
extern enum nss_status _nss_cache_getgrent_r(struct group *result, char *buffer,
size_t buflen, int *errnop);
extern enum nss_status _nss_cache_getgrnam_r(const char *name,
struct group *result, char *buffer,
size_t buflen, int *errnop);
extern enum nss_status _nss_cache_getgrgid_r(gid_t gid, struct group *result,
char *buffer, size_t buflen,
int *errnop);
#ifndef BSD
extern enum nss_status _nss_cache_getspnam_r(const char *name,
struct spwd *result, char *buffer,
size_t buflen, int *errnop);
extern enum nss_status _nss_cache_getspent_r(struct spwd *result, char *buffer,
size_t buflen, int *errnop);
extern enum nss_status _nss_cache_getsgnam_r(const char *name,
struct sgrp *result, char *buffer,
size_t buflen, int *errnop);
extern enum nss_status _nss_cache_getsgent_r(struct sgrp *result, char *buffer,
size_t buflen, int *errnop);
extern char *_nss_cache_setpwent_path(const char *path);
#endif // ifndef BSD
#endif /* NSS_TEST_H */