[PATCH] Solaris auxiliary groups

Klinger, John (N-CSC) john.klinger at lmco.com
Tue Feb 3 16:23:00 GMT 2004


Minor change to the last patch to winbind_nss_solaris.c that I
sent. The change here is to align with Solaris guidelines and
to return NSS_STATUS_SUCCESS if the maximum number of gids has
been found.

Diff based off of 3.0.1 release.

======================

--- 3.0.1/nsswitch/winbind_nss_solaris.c        Sat Jun  7 17:57:34 2003
+++ 3.0.1+/nsswitch/winbind_nss_solaris.c       Thu Jan 22 00:27:00 2004
@@ -256,8 +256,27 @@
 static NSS_STATUS
 _nss_winbind_getgroupsbymember_solwrap(nss_backend_t* be, void* args)
 {
+       int errnop;
+       struct nss_groupsbymem *gmem = (struct nss_groupsbymem *)args;
+
        NSS_DEBUG("_nss_winbind_getgroupsbymember");
-       return NSS_STATUS_NOTFOUND;
+
+       _nss_winbind_initgroups_dyn(gmem->username,
+                                   gmem->gid_array[0], /* Primary Group */
+                                   &gmem->numgids,
+                                   &gmem->maxgids,
+                                   &gmem->gid_array,
+                                   gmem->maxgids,
+                                   &errnop);
+
+       /*
+        * If the maximum number of gids have been found, return
+        * SUCCESS so the switch engine will stop searching. Otherwise
+        * return NOTFOUND so nsswitch will continue to get groups
+        * from the remaining database backends specified in the
+        * nsswitch.conf file.
+        */
+       return (gmem->numgids == gmem->maxgids ? NSS_STATUS_SUCCESS : NSS_STATUS_NOTFOUND);
 }

 static NSS_STATUS

-------------- next part --------------
A non-text attachment was scrubbed...
Name: solaris_aux_groups.zip
Type: application/x-zip-compressed
Size: 672 bytes
Desc: solaris_aux_groups.zip
Url : http://lists.samba.org/archive/samba-technical/attachments/20040203/fc291fc3/solaris_aux_groups.bin


More information about the samba-technical mailing list