-
Notifications
You must be signed in to change notification settings - Fork 6
/
nss_debug-shadow.c
45 lines (35 loc) · 1.14 KB
/
nss_debug-shadow.c
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
#include <nss.h>
#include <shadow.h>
#include <stdio.h>
/*************************************
* Functions for the shadow database. *
*************************************/
// Called to open the shadow file
enum nss_status
_nss_debug_setspent(int stayopen)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (stayopen: %d)\n", __FUNCTION__, stayopen);
// Must be marked as success otherwise getpwent_r won't be called.
return NSS_STATUS_SUCCESS;
}
// Called to close the shadow file
enum nss_status
_nss_debug_endspent(void)
{
fprintf(stderr, "NSS DEBUG: Called %s\n", __FUNCTION__);
return NSS_STATUS_NOTFOUND;
}
// Called to look up next entry in the shadow file
enum nss_status
_nss_debug_getspent_r(struct spwd *result, char *buffer, size_t buflen, int *errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s\n", __FUNCTION__);
return NSS_STATUS_NOTFOUND;
}
// Find a shadow entry by name
enum nss_status
_nss_debug_getspnam_r(const char *name, struct spwd *result, char *buffer, size_t buflen, int *errnop)
{
fprintf(stderr, "NSS DEBUG: Called %s with args (name: %s)\n", __FUNCTION__, name);
return NSS_STATUS_NOTFOUND;
}