2 nss sample code for extended winbindd functionality
4 Copyright (C) Andrew Tridgell (tridge@samba.org)
5 Copyright (C) Volker Lendecke (vl@samba.org)
7 you are free to use this code in any way you see fit, including
8 without restriction, using this code in your own products. You do
9 not need to give any attribution.
24 establish a link to the nss library
25 Return 0 on success and -1 on error
27 int nss_open(struct nss_state *nss, const char *nss_path);
30 close and cleanup a nss state
32 void nss_close(struct nss_state *nss);
36 Return 0 on success and -1 on error
38 int nss_getpwent(struct nss_state *nss, struct passwd *pwd);
42 Return 0 on success and -1 on error
44 int nss_setpwent(struct nss_state *nss);
48 Return 0 on success and -1 on error
50 int nss_endpwent(struct nss_state *nss);
53 convert a name to a SID
55 Return 0 on success and -1 on error
57 int nss_nametosid(struct nss_state *nss, const char *name, char **sid);
60 convert a SID to a name
62 Return 0 on success and -1 on error
64 int nss_sidtoname(struct nss_state *nss, const char *sid, char **name);
67 return a list of group SIDs for a user SID
68 the returned list is NULL terminated
69 Return 0 on success and -1 on error
71 int nss_getusersids(struct nss_state *nss, const char *user_sid, char ***sids);
74 convert a sid to a uid
75 Return 0 on success and -1 on error
77 int nss_sidtouid(struct nss_state *nss, const char *sid, uid_t *uid);
80 convert a sid to a gid
81 Return 0 on success and -1 on error
83 int nss_sidtogid(struct nss_state *nss, const char *sid, gid_t *gid);
86 convert a uid to a sid
88 Return 0 on success and -1 on error
90 int nss_uidtosid(struct nss_state *nss, uid_t uid, char **sid);
93 convert a gid to a sid
95 Return 0 on success and -1 on error
97 int nss_gidtosid(struct nss_state *nss, gid_t gid, char **sid);