file_server: Use samba4 auth module for guest logins as well
[nivanova/samba-autobuild/.git] / nsswitch / winbind_nss_linux.c
index 4a7943278ea9f1b71730d0e8b75827956ddc3812..8d66a740a697d4582c6d5fea34d82c3034761f6c 100644 (file)
@@ -71,6 +71,31 @@ NSS_STATUS _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer,
 NSS_STATUS _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer,
                                 size_t buflen, int *errnop);
 
+/*************************************************************************
+ ************************************************************************/
+
+#ifdef DEBUG_NSS
+static const char *nss_err_str(NSS_STATUS ret)
+{
+       switch (ret) {
+               case NSS_STATUS_TRYAGAIN:
+                       return "NSS_STATUS_TRYAGAIN";
+               case NSS_STATUS_SUCCESS:
+                       return "NSS_STATUS_SUCCESS";
+               case NSS_STATUS_NOTFOUND:
+                       return "NSS_STATUS_NOTFOUND";
+               case NSS_STATUS_UNAVAIL:
+                       return "NSS_STATUS_UNAVAIL";
+#ifdef NSS_STATUS_RETURN
+               case NSS_STATUS_RETURN:
+                       return "NSS_STATUS_RETURN";
+#endif
+               default:
+                       return "UNKNOWN RETURN CODE!!!!!!!";
+       }
+}
+#endif
+
 /* Prototypes from wb_common.c */
 
 /* Allocate some space from the nss static buffer.  The buffer and buflen
@@ -297,7 +322,7 @@ static NSS_STATUS fill_grent(struct group *result, struct winbindd_gr *gr,
 
        /* Group membership */
 
-       if ((gr->num_gr_mem < 0) || !gr_mem) {
+       if (!gr_mem) {
                gr->num_gr_mem = 0;
        }