Reorder arguments to ldb_search() to match what is in Samba 4.
[kai/samba-autobuild/.git] / source3 / lib / ldb / nssldb / ldb-pwd.c
index e4bafdcf7c3a78e0ac0a37cf7a66346e6fd67781..0af7af998187c209ace868350267260c1f7074b4 100644 (file)
@@ -4,19 +4,17 @@
    Copyright (C) Simo Sorce 2006
    
    This library is free software; you can redistribute it and/or
    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
    License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   version 3 of the License, or (at your option) any later version.
    
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
    
    
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    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 along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA  02111-1307, USA.   
+   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/>.
 */
 
 #include "ldb-nss.h"
 */
 
 #include "ldb-nss.h"
@@ -48,12 +46,12 @@ NSS_STATUS _nss_ldb_setpwent(void)
                _ldb_nss_ctx->pw_res = NULL;
        }
 
                _ldb_nss_ctx->pw_res = NULL;
        }
 
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, 
+                                        &_ldb_nss_ctx->pw_res,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        _LDB_NSS_PWENT_FILTER,
                         _ldb_nss_pw_attrs,
                         _ldb_nss_pw_attrs,
-                        &_ldb_nss_ctx->pw_res);
+                        _LDB_NSS_PWENT_FILTER);
        if (ret != LDB_SUCCESS) {
                return NSS_STATUS_UNAVAIL;
        }
        if (ret != LDB_SUCCESS) {
                return NSS_STATUS_UNAVAIL;
        }
@@ -138,12 +136,12 @@ NSS_STATUS _nss_ldb_getpwuid_r(uid_t uid, struct passwd *result_buf, char *buffe
        }
 
        /* search the entry */
        }
 
        /* search the entry */
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, &res, 
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        filter,
                         _ldb_nss_pw_attrs,
                         _ldb_nss_pw_attrs,
-                        &res);
+                        filter
+                        );
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;
@@ -199,12 +197,11 @@ NSS_STATUS _nss_ldb_getpwnam_r(const char *name, struct passwd *result_buf, char
        }
 
        /* search the entry */
        }
 
        /* search the entry */
-       ret = ldb_search(_ldb_nss_ctx->ldb,
+       ret = ldb_search(_ldb_nss_ctx->ldb, _ldb_nss_ctx->ldb, &res,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
                         _ldb_nss_ctx->base,
                         LDB_SCOPE_SUBTREE,
-                        filter,
                         _ldb_nss_pw_attrs,
                         _ldb_nss_pw_attrs,
-                        &res);
+                        filter);
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;
        if (ret != LDB_SUCCESS) {
                /* this is a fatal error */
                *errnop = errno = ENOENT;