Reorder arguments to ldb_search() to match what is in Samba 4.
[kai/samba-autobuild/.git] / source3 / lib / ldb / nssldb / ldb-grp.c
index f8121b25ca417da73889f733f0920c9bead34e5c..842a668d2f2c1eb29fdaa80d1322f5f1f49fcd89 100644 (file)
@@ -4,7 +4,7 @@
    Copyright (C) Simo Sorce 2006
    
    This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
+   modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 3 of the License, or (at your option) any later version.
    
@@ -13,7 +13,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
    
-   You should have received a copy of the GNU Library General Public License
+   You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
@@ -59,12 +59,12 @@ NSS_STATUS _nss_ldb_setgrent(void)
                _ldb_nss_ctx->gr_res = NULL;
        }
 
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb,
+                        &_ldb_nss_ctx->gr_res,
                         _ldb_nss_ctx->base,
-                        LDB_SCOPE_SUBTREE,
-                        _LDB_NSS_GRENT_FILTER,
+                        LDB_SCOPE_SUBTREE, 
                         _ldb_nss_gr_attrs,
-                        &_ldb_nss_ctx->gr_res);
+                        _LDB_NSS_GRENT_FILTER);
        if (ret != LDB_SUCCESS) {
                return NSS_STATUS_UNAVAIL;
        }
@@ -177,12 +177,11 @@ NSS_STATUS _nss_ldb_getgrnam_r(const char *name, struct group *result_buf, char
        }
 
        /* search the entry */
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, &gr_res,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        filter,
                         _ldb_nss_gr_attrs,
-                        &gr_res);
+                        filter);
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;
@@ -274,12 +273,11 @@ NSS_STATUS _nss_ldb_getgrgid_r(gid_t gid, struct group *result_buf, char *buffer
        }
 
        /* search the entry */
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, &gr_res,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        filter,
                         _ldb_nss_gr_attrs,
-                        &gr_res);
+                        filter);
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;
@@ -366,12 +364,11 @@ NSS_STATUS _nss_ldb_initgroups_dyn(const char *user, gid_t group, long int *star
        }
 
        /* search the entry */
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, &uid_res,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        filter,
                         attrs,
-                        &uid_res);
+                        filter);
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;