Merge branch 'master' of ssh://git.samba.org/data/git/samba
authorJelmer Vernooij <jelmer@samba.org>
Tue, 16 Dec 2008 18:51:35 +0000 (19:51 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Tue, 16 Dec 2008 18:51:35 +0000 (19:51 +0100)
lib/tdb/tools/tdbtool.c
nsswitch/winbind_nss_solaris.c
nsswitch/winbind_nss_solaris.h
source3/include/libsmb_internal.h
source3/libsmb/libsmb_dir.c

index 1ecad62a3deeb2dc3ad780fd1ef8cfebb822fda7..2a11cdaef3d0e22ab9a8739ac2d3c59637a32882 100644 (file)
@@ -455,7 +455,7 @@ static void next_record(TDB_CONTEXT *the_tdb, TDB_DATA *pkey)
                print_rec(the_tdb, *pkey, dbuf, NULL);
 }
 
-static int test_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
+static int test_fn(TDB_CONTEXT *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state)
 {
        return 0;
 }
index 4c85bd3621b57275300e7551090348ffac520024..5fb37643ce2c92cfe55a87d96f9bf114f4fba954 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 c6cadefc38a81c9c3d01ed01d502386aa5191888..f805542f7535265ea5c861f2cf207c65f064d5db 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 */
index 3b909d13b95e25744434493464b55220fb403374..b4881169396fa7e8aed3558ba834e073eab5ab96 100644 (file)
@@ -113,18 +113,19 @@ struct SMBC_internal_data {
        /* True when this handle is initialized */
        bool                                    initialized;
 
-        /* dirent pointer location
-         *
+        /* dirent pointer location */
+       struct smbc_dirent                      dirent;
+       /*
          * Leave room for any urlencoded filename and the comment field.
          *
-         * We really should use sizeof(struct smbc_dirent) plus (NAME_MAX * 3)
-         * plus whatever the max length of a comment is, plus a couple of null
-         * terminators (one after the filename, one after the comment).
+        * We use (NAME_MAX * 3) plus whatever the max length of a comment is,
+        * plus a couple of null terminators (one after the filename,
+        * one after the comment).
          *
          * According to <linux/limits.h>, NAME_MAX is 255.  Is it longer
          * anyplace else?
          */
-       char                                    dirent[1024];
+       char                                    _dirent_name[1024];
 
        /*
          * server connection list
index d12e7487f6325cc85faaccfbc71a65a8b5b73390..770014b6f62350632a16fef274bdf37277ea4572 100644 (file)
@@ -976,9 +976,8 @@ SMBC_readdir_ctx(SMBCCTX *context,
 
         }
 
-        dirp = (struct smbc_dirent *)context->internal->dirent;
-        maxlen = (sizeof(context->internal->dirent) -
-                  sizeof(struct smbc_dirent));
+        dirp = &context->internal->dirent;
+        maxlen = sizeof(context->internal->_dirent_name);
 
         smbc_readdir_internal(context, dirp, dirent, maxlen);
 
@@ -1049,9 +1048,8 @@ SMBC_getdents_ctx(SMBCCTX *context,
                }
 
                 /* Do urlencoding of next entry, if so selected */
-                dirent = (struct smbc_dirent *)context->internal->dirent;
-                maxlen = (sizeof(context->internal->dirent) -
-                          sizeof(struct smbc_dirent));
+                dirent = &context->internal->dirent;
+                maxlen = sizeof(context->internal->_dirent_name);
                 smbc_readdir_internal(context, dirent,
                                       dirlist->dirent, maxlen);