From a1f4fe7e08ca4fb0441869e73e3cc1af607e8d8b Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Mon, 10 Oct 2011 21:45:42 +0200 Subject: [PATCH] s3-passdb: split out passdb/pdb_ldap.h. Guenther --- source3/include/smbldap.h | 11 ---------- source3/passdb/pdb_ipa.c | 1 + source3/passdb/pdb_ldap.c | 1 + source3/passdb/pdb_ldap.h | 42 +++++++++++++++++++++++++++++++++++++++ source3/passdb/pdb_nds.c | 1 + source3/passdb/proto.h | 7 ------- 6 files changed, 45 insertions(+), 18 deletions(-) create mode 100644 source3/passdb/pdb_ldap.h diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index c84a9acead7..cce3e1eae9e 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -216,17 +216,6 @@ struct ldapsam_privates { } search_cache; }; -/* Functions shared between pdb_ldap.c and pdb_nds.c. */ -struct pdb_methods; -NTSTATUS pdb_init_ldapsam_compat( struct pdb_methods **pdb_method, const char *location); -int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state, - const char *user, - LDAPMessage ** result, - const char **attr); -NTSTATUS pdb_init_ldapsam( struct pdb_methods **pdb_method, const char *location); -const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver ); -LDAP *priv2ld(struct ldapsam_privates *priv); - /* The following definitions come from lib/smbldap.c */ int smb_ldap_start_tls(LDAP *ldap_struct, int version); diff --git a/source3/passdb/pdb_ipa.c b/source3/passdb/pdb_ipa.c index 15e65e0c224..619cac18f57 100644 --- a/source3/passdb/pdb_ipa.c +++ b/source3/passdb/pdb_ipa.c @@ -26,6 +26,7 @@ #include "secrets.h" #include "smbldap.h" +#include "passdb/pdb_ldap.h" #define IPA_KEYTAB_SET_OID "2.16.840.1.113730.3.8.3.1" #define IPA_MAGIC_ID_STR "999" diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 8b6f07c025c..b1f5a620e80 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -60,6 +60,7 @@ #include "smbldap.h" +#include "passdb/pdb_ldap.h" /********************************************************************** Simple helper function to make stuff better readable diff --git a/source3/passdb/pdb_ldap.h b/source3/passdb/pdb_ldap.h new file mode 100644 index 00000000000..244945d9336 --- /dev/null +++ b/source3/passdb/pdb_ldap.h @@ -0,0 +1,42 @@ +/* + Unix SMB/CIFS implementation. + LDAP protocol helper functions for SAMBA + Copyright (C) Jean François Micouleau 1998 + Copyright (C) Gerald Carter 2001-2003 + Copyright (C) Shahms King 2001 + Copyright (C) Andrew Bartlett 2002-2003 + Copyright (C) Stefan (metze) Metzmacher 2002-2003 + Copyright (C) Simo Sorce 2006 + + 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 . + +*/ + +#ifndef _PASSDB_PDB_LDAP_H_ +#define _PASSDB_PDB_LDAP_H_ + +/* The following definitions come from passdb/pdb_ldap.c */ + +const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver ); +NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *location); +NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location); +NTSTATUS pdb_ldap_init(void); +int ldapsam_search_suffix_by_name(struct ldapsam_privates *ldap_state, + const char *user, + LDAPMessage ** result, + const char **attr); +const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver ); +LDAP *priv2ld(struct ldapsam_privates *priv); + +#endif /* _PASSDB_PDB_LDAP_H_ */ diff --git a/source3/passdb/pdb_nds.c b/source3/passdb/pdb_nds.c index 56375a813f6..1bb47783062 100644 --- a/source3/passdb/pdb_nds.c +++ b/source3/passdb/pdb_nds.c @@ -26,6 +26,7 @@ #include #include "smbldap.h" +#include "passdb/pdb_ldap.h" #define NMASLDAP_GET_LOGIN_CONFIG_REQUEST "2.16.840.1.113719.1.39.42.100.3" #define NMASLDAP_GET_LOGIN_CONFIG_RESPONSE "2.16.840.1.113719.1.39.42.100.4" diff --git a/source3/passdb/proto.h b/source3/passdb/proto.h index 6a95454a0b6..2cb84766048 100644 --- a/source3/passdb/proto.h +++ b/source3/passdb/proto.h @@ -314,13 +314,6 @@ NTSTATUS pdb_set_secret(const char *secret_name, struct security_descriptor *sd); NTSTATUS pdb_delete_secret(const char *secret_name); -/* The following definitions come from passdb/pdb_ldap.c */ - -const char** get_userattr_list( TALLOC_CTX *mem_ctx, int schema_ver ); -NTSTATUS pdb_init_ldapsam_compat(struct pdb_methods **pdb_method, const char *location); -NTSTATUS pdb_init_ldapsam(struct pdb_methods **pdb_method, const char *location); -NTSTATUS pdb_ldap_init(void); - /* The following definitions come from passdb/pdb_nds.c */ struct smbldap_state; -- 2.34.1