spoolss: clear JobInfo on GetJob error
[obnox/samba/samba-obnox.git] / nsswitch / winbind_nss_solaris.c
index 4c85bd3621b57275300e7551090348ffac520024..6d3c8a964fdc98271562fb3cac8e6e5366b6d44a 100644 (file)
 
 #undef DEVELOPER
 
+
 #include "winbind_client.h"
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/param.h>
 #include <string.h>
 #include <pwd.h>
-#include "includes.h"
 #include <syslog.h>
+
 #if !defined(HPUX)
 #include <sys/syslog.h>
 #endif /*hpux*/
 #define NSS_DEBUG(str) ;
 #endif
 
+#if !defined(SMB_MALLOC_P)
+#define SMB_MALLOC_P(type) (type *)malloc(sizeof(type))
+#endif
+
 #define NSS_ARGS(args) ((nss_XbyY_args_t *)args)
 
 #ifdef HPUX
@@ -281,17 +286,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