winbind_nss_netbsd: use WBFLAG_FROM_NSS
[garming/samba-autobuild/.git] / nsswitch / winbind_nss_netbsd.c
index eb843ee37f6790be969f4d5746f2adaa75db258b..94552639b7b463b50947105b1e3637663a79b74d 100644 (file)
 static struct group    _winbind_group;
 static char            _winbind_groupbuf[1024];
 
-/*
- * We need a proper prototype for this :-)
- */
-
-NSS_STATUS _nss_winbind_setpwent(void);
-NSS_STATUS _nss_winbind_endpwent(void);
-NSS_STATUS _nss_winbind_getpwent_r(struct passwd *result, char *buffer,
-                                  size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result,
-                                  char *buffer, size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_getpwnam_r(const char *name, struct passwd *result,
-                                  char *buffer, size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_setgrent(void);
-NSS_STATUS _nss_winbind_endgrent(void);
-NSS_STATUS _nss_winbind_getgrent_r(struct group *result, char *buffer,
-                                  size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_getgrlst_r(struct group *result, char *buffer,
-                                  size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_getgrnam_r(const char *name, struct group *result,
-                                  char *buffer, size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group *result, char *buffer,
-                                  size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
-                                      long int *size, gid_t **groups,
-                                      long int limit, int *errnop);
-NSS_STATUS _nss_winbind_getusersids(const char *user_sid, char **group_sids,
-                                   int *num_groups, char *buffer, size_t buf_size,
-                                   int *errnop);
-NSS_STATUS _nss_winbind_nametosid(const char *name, char **sid, char *buffer,
-                                 size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_sidtoname(const char *sid, char **name, char *buffer,
-                                 size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_sidtouid(const char *sid, uid_t *uid, int *errnop);
-NSS_STATUS _nss_winbind_sidtogid(const char *sid, gid_t *gid, int *errnop);
-NSS_STATUS _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer,
-                                size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer,
-                                size_t buflen, int *errnop);
-
 int
 netbsdwinbind_endgrent(void *nsrv, void *nscb, va_list ap)
 {
@@ -219,13 +180,15 @@ netbsdwinbind_getgroupmembership(void *nsrv, void *nscb, va_list ap)
        int              maxgrp = va_arg(ap, int);
        int             *groupc = va_arg(ap, int *);
 
-       struct winbindd_request request;
-       struct winbindd_response response;
+       struct winbindd_request request = {
+               .wb_flags = WBFLAG_FROM_NSS,
+       };
+       struct winbindd_response response = {
+               .length = 0,
+       }
        gid_t   *wblistv;
        int     wblistc, i, isdup, dupc;
 
-       ZERO_STRUCT(request);
-       ZERO_STRUCT(response);
        strncpy(request.data.username, uname,
                                sizeof(request.data.username) - 1);
        i = winbindd_request_response(NULL, WINBINDD_GETGROUPS,