1/*
2 * Test maximum number of file descriptors winbind daemon can handle
3 */
4
5#include <stdio.h>
6#include <string.h>
7#include <pwd.h>
8#include <sys/types.h>
9
10int main(int argc, char **argv)
11{
12    struct passwd *pw;
13    int i;
14
15    while(1) {
16
17        /* Start getpwent until we get an NT user.  This way we know we
18           have at least opened a connection to the winbind daemon */
19
20        setpwent();
21
22        while((pw = getpwent()) != NULL) {
23            if (strchr(pw->pw_name, '/') != NULL) {
24                break;
25            }
26        }
27
28        if (pw != NULL) {
29            i++;
30            printf("got pwent handle %d\n", i);
31        } else {
32            printf("winbind daemon not running?\n");
33            exit(1);
34        }
35
36        sleep(1);
37    }
38}
39