s3: move smbldap_util to pdb_ldap_util.
authorGünther Deschner <gd@samba.org>
Mon, 17 Oct 2011 16:00:01 +0000 (18:00 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 16 Nov 2011 11:26:26 +0000 (12:26 +0100)
Guenther

source3/Makefile.in
source3/configure.in
source3/passdb/pdb_ldap.c
source3/passdb/pdb_ldap_util.c [moved from source3/lib/smbldap_util.c with 98% similarity]
source3/passdb/pdb_ldap_util.h [new file with mode: 0644]
source3/passdb/wscript_build
source3/utils/net_sam.c
source3/wscript_build

index fbf17105d45151b5fe08c9dfb499fde323eb5002..688062e1b87820cafd9b8940e261b2c4b2f37661 100644 (file)
@@ -271,7 +271,7 @@ TDB_LIB_OBJ = lib/util_tdb.o ../lib/util/util_tdb.o \
 
 TDB_VALIDATE_OBJ = lib/tdb_validate.o
 
-SMBLDAP_OBJ = @SMBLDAP@ @SMBLDAPUTIL@
+SMBLDAP_OBJ = @SMBLDAP@
 
 VERSION_OBJ = lib/version.o
 
@@ -2842,10 +2842,10 @@ bin/sam.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_SAM_OBJ)
        @$(SHLD_MODULE) $(AUTH_SAM_OBJ)
 
 bin/ldapsam.@SHLIBEXT@: $(BINARY_PREREQS) passdb/pdb_ldap.o passdb/pdb_nds.o \
-                       passdb/pdb_ipa.o
+                       passdb/pdb_ipa.o passdb/pdb_ldap_util.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o \
-                       $(LDAP_LIBS)
+                       passdb/pdb_ldap_util.o $(LDAP_LIBS)
 
 bin/ads.@SHLIBEXT@: $(BINARY_PREREQS) passdb/pdb_ads.o
        @echo "Building plugin $@"
index a41590087bd7a7d02b49ce5b728c98d026e064e3..e939491dc808ad545382c9376a272b6abfbb5efa 100644 (file)
@@ -3433,8 +3433,6 @@ AC_MSG_RESULT($with_ldap_support)
 
 SMBLDAP=""
 AC_SUBST(SMBLDAP)
-SMBLDAPUTIL=""
-AC_SUBST(SMBLDAPUTIL)
 
 if test x"$with_ldap_support" != x"no"; then
 
@@ -3545,7 +3543,6 @@ if test x"$with_ldap_support" != x"no"; then
     default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
     default_shared_modules="$default_shared_modules";
     SMBLDAP="lib/smbldap.o"
-    SMBLDAPUTIL="lib/smbldap_util.o"
     with_ldap_support=yes
     AC_MSG_CHECKING(whether LDAP support is used)
     AC_MSG_RESULT(yes)
@@ -6856,7 +6853,7 @@ if test x"$MODULE_DEFAULT_vfs_notify_fam" = xSTATIC -o \
        AC_SUBST(SMBD_FAM_LIBS)
 fi
 
-SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o,
+SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o passdb/pdb_ldap_util.o,
                   "bin/ldapsam.$SHLIBEXT", PDB,
                   [ PASSDB_LIBS="$PASSDB_LIBS $LDAP_LIBS" ] )
 SMB_MODULE(pdb_ads, passdb/pdb_ads.o \$(TLDAP_OBJ), "bin/ads.$SHLIBEXT", PDB)
index a89af8051b6e635e9556ea5fa41cf3e8825ed6b4..03242b8b9716db3044c101c02c84b60eee42690e 100644 (file)
@@ -63,6 +63,7 @@
 #include "passdb/pdb_ldap.h"
 #include "passdb/pdb_nds.h"
 #include "passdb/pdb_ipa.h"
+#include "passdb/pdb_ldap_util.h"
 
 /**********************************************************************
  Simple helper function to make stuff better readable
similarity index 98%
rename from source3/lib/smbldap_util.c
rename to source3/passdb/pdb_ldap_util.c
index f1f0ff613f31f7775ae9cc2ccafcd79d50b40a09..048cbe64937dd7b53743fe526311f2766dc7916f 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
    Unix SMB/CIFS mplementation.
    LDAP protocol helper functions for SAMBA
    Copyright (C) Jean François Micouleau       1998
@@ -6,20 +6,20 @@
    Copyright (C) Shahms King                   2001
    Copyright (C) Andrew Bartlett               2002-2003
    Copyright (C) Stefan (metze) Metzmacher     2002-2003
-    
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-   
+
 */
 
 #include "includes.h"
 #include "passdb.h"
 
 /**********************************************************************
- Add the account-policies below the sambaDomain object to LDAP, 
+ Add the account-policies below the sambaDomain object to LDAP,
 *********************************************************************/
 
 static NTSTATUS add_new_domain_account_policies(struct smbldap_state *ldap_state,
-                                               const char *domain_name)
+                                               const char *domain_name)
 {
        NTSTATUS ntstatus = NT_STATUS_UNSUCCESSFUL;
        int i, rc;
@@ -307,24 +307,24 @@ NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
 
                status = add_new_domain_info(ldap_state, domain_name);
                if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(0, ("smbldap_search_domain_info: Adding domain info for %s failed with %s\n", 
+                       DEBUG(0, ("smbldap_search_domain_info: Adding domain info for %s failed with %s\n",
                                domain_name, nt_errstr(status)));
                        goto failed;
                }
 
                status = add_new_domain_account_policies(ldap_state, domain_name);
                if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(0, ("smbldap_search_domain_info: Adding domain account policies for %s failed with %s\n", 
+                       DEBUG(0, ("smbldap_search_domain_info: Adding domain account policies for %s failed with %s\n",
                                domain_name, nt_errstr(status)));
                        goto failed;
                }
 
                return smbldap_search_domain_info(ldap_state, result, domain_name, False);
 
-       } 
-       
+       }
+
        if (count > 1 ) {
-       
+
                DEBUG(0, ("smbldap_search_domain_info: Got too many (%d) domain info entries for domain %s\n",
                          count, domain_name));
                goto failed;
diff --git a/source3/passdb/pdb_ldap_util.h b/source3/passdb/pdb_ldap_util.h
new file mode 100644 (file)
index 0000000..fa1e96c
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+   Unix SMB/CIFS mplementation.
+   LDAP protocol helper functions for SAMBA
+   Copyright (C) Gerald Carter                 2001-2003
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program 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 General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef _PASSDB_PDB_LDAP_UTIL_H_
+#define _PASSDB_PDB_LDAP_UTIL_H_
+
+/* The following definitions come from passdb/pdb_ldap_util.c  */
+
+#ifdef HAVE_LDAP
+NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
+                                    LDAPMessage ** result, const char *domain_name,
+                                    bool try_add);
+#endif /* HAVE_LDAP */
+
+#endif /* _PASSDB_PDB_LDAP_UTIL_H_ */
index b18d87308332e6829acdedac899206c74065437a..24acf1afc5c5cfc660e25577d77f6d0a2faad895 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 PDB_TDBSAM_SRC =    'pdb_tdb.c'
-PDB_LDAP_SRC =      'pdb_ldap.c pdb_nds.c pdb_ipa.c'
+PDB_LDAP_SRC =      'pdb_ldap.c pdb_nds.c pdb_ipa.c pdb_ldap_util.c'
 PDB_ADS_SRC =       'pdb_ads.c'
 PDB_SMBPASSWD_SRC = 'pdb_smbpasswd.c'
 PDB_WBC_SAM_SRC =   'pdb_wbc_sam.c'
index 4ebd8a9e69dedebd5d4608cdb656a965e1dba408..ff8f8c0977b37c1a8f1b08c4b9b6894f0e5ff1b8 100644 (file)
@@ -26,6 +26,7 @@
 #include "../libcli/security/security.h"
 #include "lib/winbind_util.h"
 #include "passdb.h"
+#include "passdb/pdb_ldap_util.h"
 #include "lib/privileges.h"
 
 /*
index 129313424a2d103132d6c50b7dfdab3ddcb95d93..d91bcffd1f4e2cb04065e7c1eb887ebea661bbbf 100755 (executable)
@@ -11,7 +11,7 @@ TDB_LIB_SRC = '''
 
 TDB_VALIDATE_SRC = '''lib/tdb_validate.c'''
 
-SMBLDAP_SRC = '''lib/smbldap.c lib/smbldap_util.c'''
+SMBLDAP_SRC = '''lib/smbldap.c'''
 
 VERSION_SRC = '''lib/version.c'''