]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
nss_winbind: Solaris 64-bit fix and...
authorSATOH Fumiyasu <fumiyas@osstech.jp>
Tue, 16 Dec 2008 15:59:07 +0000 (16:59 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 2 Jan 2009 11:44:18 +0000 (12:44 +0100)
PATCH 1:
Fix gmem->numgids and gmem->maxgids breakage on Solaris 64-bit
because sizeof(int) != sizeof(long int).

PATCH 2:
This patch fixes a compile-time warning
"warning: implicit function declaration: _nss_winbind_initgroups_dyn".
(cherry picked from commit cb036772d09227f870c2fec3ecd8c3f53787dfbc)
(cherry picked from commit 085f4cdb90b12d60804001fd60659a4aa4a174fd)

source/nsswitch/winbind_nss_solaris.c
source/nsswitch/winbind_nss_solaris.h

index 865b6ebbb068d6d3597a442a99dc7f6441ceaf55..05e037f0e8ab195d89d9dec5474badb6f1915b68 100644 (file)
@@ -281,17 +281,22 @@ _nss_winbind_getgroupsbymember_solwrap(nss_backend_t* be, void* args)
 {
        int errnop;
        struct nss_groupsbymem *gmem = (struct nss_groupsbymem *)args;
+       long int numgids = gmem->numgids;
+       long int maxgids = gmem->maxgids;
 
        NSS_DEBUG("_nss_winbind_getgroupsbymember");
 
        _nss_winbind_initgroups_dyn(gmem->username,
                gmem->gid_array[0], /* Primary Group */
-               &gmem->numgids,
-               &gmem->maxgids,
+               &numgids,
+               &maxgids,
                &gmem->gid_array,
                gmem->maxgids,
                &errnop);
 
+       gmem->numgids = numgids;
+       gmem->maxgids = maxgids;
+
        /*
         * If the maximum number of gids have been found, return
         * SUCCESS so the switch engine will stop searching. Otherwise
index 84062dbab4a3d0dae99f1d2c5a17ed0a0bfec0f8..497ece952239c40f091f30800849520a9bef1cbc 100644 (file)
@@ -81,5 +81,8 @@ NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
 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);
 
 #endif /* _WINBIND_NSS_SOLARIS_H */