From: Sumit Bose Date: Wed, 14 Jul 2010 13:08:02 +0000 (+0200) Subject: s3-passdb: Add minimal stub for IPA passdb backend X-Git-Tag: tevent-0.9.11~638 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=4fa210d76a6fb1a9392653c8313c8ffac1f41bb7;p=samba.git s3-passdb: Add minimal stub for IPA passdb backend Signed-off-by: Günther Deschner --- diff --git a/source3/Makefile.in b/source3/Makefile.in index 7dbb012b6df..eb6d4a721f9 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -2756,9 +2756,11 @@ bin/sam.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_SAM_OBJ) @echo "Building plugin $@" @$(SHLD_MODULE) $(AUTH_SAM_OBJ) -bin/ldapsam.@SHLIBEXT@: $(BINARY_PREREQS) passdb/pdb_ldap.o passdb/pdb_nds.o +bin/ldapsam.@SHLIBEXT@: $(BINARY_PREREQS) passdb/pdb_ldap.o passdb/pdb_nds.o \ + passdb/pdb_ipa.o @echo "Building plugin $@" - @$(SHLD_MODULE) passdb/pdb_ldap.o passdb/pdb_nds.o $(LDAP_LIBS) + @$(SHLD_MODULE) passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.o \ + $(LDAP_LIBS) bin/ads.@SHLIBEXT@: $(BINARY_PREREQS) passdb/pdb_ads.o @echo "Building plugin $@" diff --git a/source3/configure.in b/source3/configure.in index d102ea58bbd..31ba9f68cea 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -6759,7 +6759,8 @@ 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, "bin/ldapsam.$SHLIBEXT", PDB, +SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o passdb/pdb_nds.o passdb/pdb_ipa.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) SMB_MODULE(pdb_smbpasswd, passdb/pdb_smbpasswd.o, "bin/smbpasswd.$SHLIBEXT", PDB) diff --git a/source3/include/proto.h b/source3/include/proto.h index 83ac33ac236..6f0dbae5612 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3899,6 +3899,10 @@ int pdb_nds_set_password( const char *pwd ); NTSTATUS pdb_nds_init(void); +/* The following definitions come from passdb/pdb_nds.c */ + +NTSTATUS pdb_ipa_init(void); + /* The following definitions come from passdb/pdb_smbpasswd.c */ NTSTATUS pdb_smbpasswd_init(void) ; diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h index ffe618d4f7b..e651182e31a 100644 --- a/source3/include/smbldap.h +++ b/source3/include/smbldap.h @@ -194,6 +194,9 @@ struct ldapsam_privates { /* Is this NDS ldap? */ int is_nds_ldap; + /* Is this IPA ldap? */ + int is_ipa_ldap; + /* ldap server location parameter */ char *location; diff --git a/source3/passdb/pdb_ipa.c b/source3/passdb/pdb_ipa.c new file mode 100644 index 00000000000..c0dbd00e0ae --- /dev/null +++ b/source3/passdb/pdb_ipa.c @@ -0,0 +1,47 @@ +/* + Unix SMB/CIFS implementation. + IPA helper functions for SAMBA + Copyright (C) Sumit Bose 2010 + + 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 . + +*/ + +#include "includes.h" + +#include "smbldap.h" + +static NTSTATUS pdb_init_IPA_ldapsam(struct pdb_methods **pdb_method, const char *location) +{ + struct ldapsam_privates *ldap_state; + + NTSTATUS nt_status = pdb_init_ldapsam(pdb_method, location); + + (*pdb_method)->name = "IPA_ldapsam"; + + ldap_state = (struct ldapsam_privates *)((*pdb_method)->private_data); + ldap_state->is_ipa_ldap = true; + + return nt_status; +} + +NTSTATUS pdb_ipa_init(void) +{ + NTSTATUS nt_status; + + if (!NT_STATUS_IS_OK(nt_status = smb_register_passdb(PASSDB_INTERFACE_VERSION, "IPA_ldapsam", pdb_init_IPA_ldapsam))) + return nt_status; + + return NT_STATUS_OK; +} diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 942fd7fc564..514db36eb83 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -6722,5 +6722,7 @@ NTSTATUS pdb_ldap_init(void) /* Let pdb_nds register backends */ pdb_nds_init(); + pdb_ipa_init(); + return NT_STATUS_OK; } diff --git a/source3/passdb/wscript_build b/source3/passdb/wscript_build index 5a0b0961e23..fc53ee5a380 100644 --- a/source3/passdb/wscript_build +++ b/source3/passdb/wscript_build @@ -1,7 +1,7 @@ #!/usr/bin/env python PDB_TDBSAM_SRC = 'pdb_tdb.c' -PDB_LDAP_SRC = 'pdb_ldap.c pdb_nds.c' +PDB_LDAP_SRC = 'pdb_ldap.c pdb_nds.c pdb_ipa.c' PDB_ADS_SRC = 'pdb_ads.c' PDB_SMBPASSWD_SRC = 'pdb_smbpasswd.c' PDB_WBC_SAM_SRC = 'pdb_wbc_sam.c'