[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Mar 6 05:38:01 MST 2011
The branch, master has been updated
via 233c8bc s3: Remove close_fn from idmap_methods
via 8278595 s3-idmap-hash: Make "hashed_domains" properly talloced
via 4daf01f s3: Replace idmap_ad_close by a destructor
via 41c8565 s3-idmap-ad: Make ad_schema properly talloced
via 6e57263 s3-idmap-tdb: private_data is a talloc child of dom
via 1bf29c7 s3-idmap-ldap: private_data is a talloc child of dom
via 9c5802b s3-idmap-rid: private_data is a talloc child of dom
via bc940ed s3: Remove an unnecessary if-statement
via 4fd4303 s3: Remove an obsolete comment
via d76b3fd s3: Remove some unused code
via d3ba16a s3: Remove unused args from nss_get_info_cached
via fff6fa75 s3: Remove unused args from nss_get_info
via 99d98e3 s3: Remove unused args from get_nss_info
from f6f8ec8 s3: Move EXOP definitions to smbldap.h
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 233c8bca3bfda4d09d458b842873621a7ffe5e91
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 6 12:02:05 2011 +0100
s3: Remove close_fn from idmap_methods
Autobuild-User: Volker Lendecke <vlendec at samba.org>
Autobuild-Date: Sun Mar 6 13:37:13 CET 2011 on sn-devel-104
commit 82785957f0eca5722914ac0607ba2b3a53198d58
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 6 12:16:00 2011 +0100
s3-idmap-hash: Make "hashed_domains" properly talloced
commit 4daf01f38b85580f60d459491ef2131f918996d1
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 6 11:53:49 2011 +0100
s3: Replace idmap_ad_close by a destructor
commit 41c85650c98d1e130036cec160afdf1312b11d71
Author: Volker Lendecke <vl at samba.org>
Date: Sun Mar 6 11:47:19 2011 +0100
s3-idmap-ad: Make ad_schema properly talloced
commit 6e5726310f26d21d862ba9311bc308aa6c0bfeb3
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 13:55:41 2011 +0100
s3-idmap-tdb: private_data is a talloc child of dom
commit 1bf29c7acf74945e4613ead446c12b344a50705e
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 13:53:12 2011 +0100
s3-idmap-ldap: private_data is a talloc child of dom
commit 9c5802b84143fdc8167f9f5996c69b56ecd27e9a
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 13:49:37 2011 +0100
s3-idmap-rid: private_data is a talloc child of dom
commit bc940ed4c8377c6af3f23a81d0e32a0c9114832d
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 13:43:55 2011 +0100
s3: Remove an unnecessary if-statement
commit 4fd4303c644853946d6c84875dd55531c7e67f73
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 12:59:53 2011 +0100
s3: Remove an obsolete comment
commit d76b3fd0a88aeedca42d1d29690c455951a6e975
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 12:55:34 2011 +0100
s3: Remove some unused code
commit d3ba16a5000dca0a270298057ce0eaf10d84f2b8
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 12:54:26 2011 +0100
s3: Remove unused args from nss_get_info_cached
commit fff6fa7576d69a3498f831ee99763b4b04f00e52
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 12:52:20 2011 +0100
s3: Remove unused args from nss_get_info
commit 99d98e31bc8e03cbec97bcea377c6c4da0b837b7
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 26 12:50:46 2011 +0100
s3: Remove unused args from get_nss_info
-----------------------------------------------------------------------
Summary of changes:
source3/include/idmap.h | 3 -
source3/include/nss_info.h | 2 -
source3/winbindd/idmap.c | 14 ------
source3/winbindd/idmap_ad.c | 75 ++++++------------------------
source3/winbindd/idmap_adex/idmap_adex.c | 14 ------
source3/winbindd/idmap_autorid.c | 7 ---
source3/winbindd/idmap_hash/idmap_hash.c | 25 +++-------
source3/winbindd/idmap_ldap.c | 16 ------
source3/winbindd/idmap_nss.c | 6 --
source3/winbindd/idmap_passdb.c | 6 --
source3/winbindd/idmap_rid.c | 9 ----
source3/winbindd/idmap_tdb.c | 13 -----
source3/winbindd/nss_info.c | 3 +-
source3/winbindd/nss_info_template.c | 2 -
source3/winbindd/winbindd_ads.c | 14 ++----
source3/winbindd/winbindd_cache.c | 3 +-
source3/winbindd/winbindd_proto.h | 1 -
17 files changed, 27 insertions(+), 186 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/idmap.h b/source3/include/idmap.h
index 2f95740..7b3d6de 100644
--- a/source3/include/idmap.h
+++ b/source3/include/idmap.h
@@ -57,9 +57,6 @@ struct idmap_methods {
/* Allocate a Unix-ID. */
NTSTATUS (*allocate_id)(struct idmap_domain *dom, struct unixid *id);
-
- /* Called when backend is unloaded */
- NTSTATUS (*close_fn)(struct idmap_domain *dom);
};
#include "winbindd/idmap_proto.h"
diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h
index 9b910ca..bf66ef0 100644
--- a/source3/include/nss_info.h
+++ b/source3/include/nss_info.h
@@ -64,7 +64,6 @@ struct nss_info_methods {
NTSTATUS (*get_nss_info)( struct nss_domain_entry *e,
const struct dom_sid *sid,
TALLOC_CTX *ctx,
- ADS_STRUCT *ads, LDAPMessage *msg,
const char **homedir, const char **shell,
const char **gecos, gid_t *p_gid);
NTSTATUS (*map_to_alias)(TALLOC_CTX *mem_ctx,
@@ -85,7 +84,6 @@ NTSTATUS smb_register_idmap_nss(int version,
NTSTATUS nss_get_info( const char *domain, const struct dom_sid *user_sid,
TALLOC_CTX *ctx,
- ADS_STRUCT *ads, LDAPMessage *msg,
const char **homedir, const char **shell,
const char **gecos, gid_t *p_gid);
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index 76310e0..a2a727c 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -153,18 +153,6 @@ NTSTATUS smb_register_idmap(int version, const char *name,
return NT_STATUS_OK;
}
-static int close_domain_destructor(struct idmap_domain *dom)
-{
- NTSTATUS ret;
-
- ret = dom->methods->close_fn(dom);
- if (!NT_STATUS_IS_OK(ret)) {
- DEBUG(3, ("Failed to close idmap domain [%s]!\n", dom->name));
- }
-
- return 0;
-}
-
static bool parse_idmap_module(TALLOC_CTX *mem_ctx, const char *param,
char **pmodulename, char **pargs)
{
@@ -343,8 +331,6 @@ static struct idmap_domain *idmap_init_domain(TALLOC_CTX *mem_ctx,
goto fail;
}
- talloc_set_destructor(result, close_domain_destructor);
-
return result;
fail:
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c
index 4ca3248..1984844 100644
--- a/source3/winbindd/idmap_ad.c
+++ b/source3/winbindd/idmap_ad.c
@@ -100,7 +100,6 @@ static ADS_STATUS ad_idmap_cached_connection_internal(struct idmap_domain *dom)
ads_destroy( &ads );
ads_kdestroy(WINBIND_CCACHE_NAME);
ctx->ads = NULL;
- TALLOC_FREE( ctx->ad_schema );
}
}
@@ -187,7 +186,8 @@ static ADS_STATUS ad_idmap_cached_connection(struct idmap_domain *dom)
(ctx->ad_map_type == WB_POSIX_MAP_SFU20) ||
(ctx->ad_map_type == WB_POSIX_MAP_RFC2307) )
{
- status = ads_check_posix_schema_mapping(NULL, ctx->ads, ctx->ad_map_type, &ctx->ad_schema);
+ status = ads_check_posix_schema_mapping(
+ ctx, ctx->ads, ctx->ad_map_type, &ctx->ad_schema);
if ( !ADS_ERR_OK(status) ) {
DEBUG(2,("ad_idmap_cached_connection: Failed to obtain schema details!\n"));
}
@@ -196,6 +196,17 @@ static ADS_STATUS ad_idmap_cached_connection(struct idmap_domain *dom)
return status;
}
+static int idmap_ad_context_destructor(struct idmap_ad_context *ctx)
+{
+ if (ctx->ads != NULL) {
+ /* we own this ADS_STRUCT so make sure it goes away */
+ ctx->ads->is_mine = True;
+ ads_destroy( &ctx->ads );
+ ctx->ads = NULL;
+ }
+ return 0;
+}
+
/************************************************************************
***********************************************************************/
@@ -211,6 +222,7 @@ static NTSTATUS idmap_ad_initialize(struct idmap_domain *dom,
DEBUG(0, ("Out of memory!\n"));
return NT_STATUS_NO_MEMORY;
}
+ talloc_set_destructor(ctx, idmap_ad_context_destructor);
config_option = talloc_asprintf(ctx, "idmap config %s", dom->name);
if (config_option == NULL) {
@@ -683,27 +695,6 @@ done:
return ret;
}
-/************************************************************************
- ***********************************************************************/
-
-static NTSTATUS idmap_ad_close(struct idmap_domain *dom)
-{
- struct idmap_ad_context * ctx;
-
- ctx = talloc_get_type(dom->private_data, struct idmap_ad_context);
-
- if (ctx->ads != NULL) {
- /* we own this ADS_STRUCT so make sure it goes away */
- ctx->ads->is_mine = True;
- ads_destroy( &ctx->ads );
- ctx->ads = NULL;
- }
-
- TALLOC_FREE( ctx->ad_schema );
-
- return NT_STATUS_OK;
-}
-
/*
* nss_info_{sfu,sfu20,rfc2307}
*/
@@ -813,8 +804,6 @@ static NTSTATUS nss_rfc2307_init( struct nss_domain_entry *e )
static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
const struct dom_sid *sid,
TALLOC_CTX *mem_ctx,
- ADS_STRUCT *ads,
- LDAPMessage *msg,
const char **homedir,
const char **shell,
const char **gecos,
@@ -858,27 +847,6 @@ static NTSTATUS nss_ad_get_info( struct nss_domain_entry *e,
return NT_STATUS_INVALID_PARAMETER;
}
- /* See if we can use the ADS connection struct swe were given */
-
-#if 0
- if (ads) {
- DEBUG(10, ("nss_ad_get_info: using given ads connection and "
- "LDAP message (%p)\n", msg));
-
- *homedir = ads_pull_string( ads, mem_ctx, msg, ctx->ad_schema->posix_homedir_attr );
- *shell = ads_pull_string( ads, mem_ctx, msg, ctx->ad_schema->posix_shell_attr );
- *gecos = ads_pull_string( ads, mem_ctx, msg, ctx->ad_schema->posix_gecos_attr );
-
- if (gid) {
- if ( !ads_pull_uint32(ads, msg, ctx->ad_schema->posix_gidnumber_attr, gid ) )
- *gid = (uint32)-1;
- }
-
- nt_status = NT_STATUS_OK;
- goto done;
- }
-#endif
-
/* Have to do our own query */
DEBUG(10, ("nss_ad_get_info: no ads connection given, doing our "
@@ -1089,17 +1057,6 @@ done:
return nt_status;
}
-
-/************************************************************************
- ***********************************************************************/
-
-static NTSTATUS nss_ad_close( void )
-{
- /* nothing to do. All memory is free()'d by the idmap close_fn() */
-
- return NT_STATUS_OK;
-}
-
/************************************************************************
Function dispatch tables for the idmap and nss plugins
***********************************************************************/
@@ -1108,7 +1065,6 @@ static struct idmap_methods ad_methods = {
.init = idmap_ad_initialize,
.unixids_to_sids = idmap_ad_unixids_to_sids,
.sids_to_unixids = idmap_ad_sids_to_unixids,
- .close_fn = idmap_ad_close
};
/* The SFU and RFC2307 NSS plugins share everything but the init
@@ -1119,7 +1075,6 @@ static struct nss_info_methods nss_rfc2307_methods = {
.get_nss_info = nss_ad_get_info,
.map_to_alias = nss_ad_map_to_alias,
.map_from_alias = nss_ad_map_from_alias,
- .close_fn = nss_ad_close
};
static struct nss_info_methods nss_sfu_methods = {
@@ -1127,7 +1082,6 @@ static struct nss_info_methods nss_sfu_methods = {
.get_nss_info = nss_ad_get_info,
.map_to_alias = nss_ad_map_to_alias,
.map_from_alias = nss_ad_map_from_alias,
- .close_fn = nss_ad_close
};
static struct nss_info_methods nss_sfu20_methods = {
@@ -1135,7 +1089,6 @@ static struct nss_info_methods nss_sfu20_methods = {
.get_nss_info = nss_ad_get_info,
.map_to_alias = nss_ad_map_to_alias,
.map_from_alias = nss_ad_map_from_alias,
- .close_fn = nss_ad_close
};
diff --git a/source3/winbindd/idmap_adex/idmap_adex.c b/source3/winbindd/idmap_adex/idmap_adex.c
index c21e2fd..c8d616b 100644
--- a/source3/winbindd/idmap_adex/idmap_adex.c
+++ b/source3/winbindd/idmap_adex/idmap_adex.c
@@ -254,17 +254,6 @@ static NTSTATUS _idmap_adex_get_id_from_sid(struct
return NT_STATUS_OK;
}
-/**********************************************************************
- *********************************************************************/
-
-static NTSTATUS _idmap_adex_close(struct idmap_domain
- *dom)
-{
- /* FIXME! need to do cleanup here */
-
- return NT_STATUS_OK;
-}
-
/*
* IdMap NSS plugin
*/
@@ -285,8 +274,6 @@ static NTSTATUS _nss_adex_get_info(struct
nss_domain_entry *e,
const struct dom_sid * sid,
TALLOC_CTX * ctx,
- ADS_STRUCT * ads,
- LDAPMessage * msg,
const char **homedir,
const char **shell,
const char **gecos, gid_t * p_gid)
@@ -385,7 +372,6 @@ static struct idmap_methods adex_idmap_methods = {
.init = _idmap_adex_init,
.unixids_to_sids = _idmap_adex_get_sid_from_id,
.sids_to_unixids = _idmap_adex_get_id_from_sid,
- .close_fn = _idmap_adex_close
};
static struct nss_info_methods adex_nss_methods = {
.init = _nss_adex_init,
diff --git a/source3/winbindd/idmap_autorid.c b/source3/winbindd/idmap_autorid.c
index ae65647..f720a46 100644
--- a/source3/winbindd/idmap_autorid.c
+++ b/source3/winbindd/idmap_autorid.c
@@ -567,17 +567,10 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom,
/*
Close the idmap tdb instance
*/
-static NTSTATUS idmap_autorid_close(struct idmap_domain *dom)
-{
- /* don't do anything */
- return NT_STATUS_OK;
-}
-
static struct idmap_methods autorid_methods = {
.init = idmap_autorid_initialize,
.unixids_to_sids = idmap_autorid_unixids_to_sids,
.sids_to_unixids = idmap_autorid_sids_to_unixids,
- .close_fn = idmap_autorid_close
};
NTSTATUS idmap_autorid_init(void)
diff --git a/source3/winbindd/idmap_hash/idmap_hash.c b/source3/winbindd/idmap_hash/idmap_hash.c
index da5c4e3..61ae13a 100644
--- a/source3/winbindd/idmap_hash/idmap_hash.c
+++ b/source3/winbindd/idmap_hash/idmap_hash.c
@@ -33,8 +33,6 @@ struct sid_hash_table {
struct dom_sid *sid;
};
-struct sid_hash_table *hashed_domains = NULL;
-
/*********************************************************************
Hash a domain SID (S-1-5-12-aaa-bbb-ccc) to a 12bit number
********************************************************************/
@@ -109,6 +107,7 @@ static void separate_hashes(uint32_t id,
static NTSTATUS be_init(struct idmap_domain *dom,
const char *params)
{
+ struct sid_hash_table *hashed_domains;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
struct winbindd_tdc_domain *dom_list = NULL;
size_t num_domains = 0;
@@ -117,7 +116,7 @@ static NTSTATUS be_init(struct idmap_domain *dom,
/* If the domain SID hash table has been initialized, assume
that we completed this function previously */
- if ( hashed_domains ) {
+ if (dom->private_data != NULL) {
nt_status = NT_STATUS_OK;
goto done;
}
@@ -129,7 +128,7 @@ static NTSTATUS be_init(struct idmap_domain *dom,
/* Create the hash table of domain SIDs */
- hashed_domains = TALLOC_ZERO_ARRAY(NULL, struct sid_hash_table, 4096);
+ hashed_domains = TALLOC_ZERO_ARRAY(dom, struct sid_hash_table, 4096);
BAIL_ON_PTR_NT_ERROR(hashed_domains, nt_status);
/* create the hash table of domain SIDs */
@@ -151,6 +150,8 @@ static NTSTATUS be_init(struct idmap_domain *dom,
sid_copy(hashed_domains[hash].sid, &dom_list[i].sid);
}
+ dom->private_data = hashed_domains;
+
done:
return nt_status;
}
@@ -161,6 +162,8 @@ done:
static NTSTATUS unixids_to_sids(struct idmap_domain *dom,
struct id_map **ids)
{
+ struct sid_hash_table *hashed_domains = talloc_get_type_abort(
+ dom->private_data, struct sid_hash_table);
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
int i;
@@ -255,17 +258,6 @@ done:
/*********************************************************************
********************************************************************/
-static NTSTATUS be_close(struct idmap_domain *dom)
-{
- if (hashed_domains)
- talloc_free(hashed_domains);
-
- return NT_STATUS_OK;
-}
-
-/*********************************************************************
- ********************************************************************/
-
static NTSTATUS nss_hash_init(struct nss_domain_entry *e )
{
return be_init(NULL, NULL);
@@ -277,8 +269,6 @@ static NTSTATUS nss_hash_init(struct nss_domain_entry *e )
static NTSTATUS nss_hash_get_info(struct nss_domain_entry *e,
const struct dom_sid *sid,
TALLOC_CTX *ctx,
- ADS_STRUCT *ads,
- LDAPMessage *msg,
const char **homedir,
const char **shell,
const char **gecos,
@@ -361,7 +351,6 @@ static struct idmap_methods hash_idmap_methods = {
.init = be_init,
.unixids_to_sids = unixids_to_sids,
.sids_to_unixids = sids_to_unixids,
- .close_fn = be_close
};
static struct nss_info_methods hash_nss_methods = {
diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c
index aea5d6a..8444d01 100644
--- a/source3/winbindd/idmap_ldap.c
+++ b/source3/winbindd/idmap_ldap.c
@@ -1149,28 +1149,12 @@ done:
Close the idmap ldap instance
**********************************/
-static NTSTATUS idmap_ldap_close(struct idmap_domain *dom)
-{
- struct idmap_ldap_context *ctx;
-
- if (dom->private_data) {
- ctx = talloc_get_type(dom->private_data,
- struct idmap_ldap_context);
-
- talloc_free(ctx);
- dom->private_data = NULL;
- }
-
- return NT_STATUS_OK;
-}
-
static struct idmap_methods idmap_ldap_methods = {
.init = idmap_ldap_db_init,
.unixids_to_sids = idmap_ldap_unixids_to_sids,
.sids_to_unixids = idmap_ldap_sids_to_unixids,
.allocate_id = idmap_ldap_get_new_id,
- .close_fn = idmap_ldap_close
};
NTSTATUS idmap_ldap_init(void);
diff --git a/source3/winbindd/idmap_nss.c b/source3/winbindd/idmap_nss.c
index e802288..5d5bd8c 100644
--- a/source3/winbindd/idmap_nss.c
+++ b/source3/winbindd/idmap_nss.c
@@ -210,17 +210,11 @@ static NTSTATUS idmap_nss_sids_to_unixids(struct idmap_domain *dom, struct id_ma
Close the idmap tdb instance
**********************************/
-static NTSTATUS idmap_nss_close(struct idmap_domain *dom)
-{
- return NT_STATUS_OK;
-}
-
static struct idmap_methods nss_methods = {
.init = idmap_nss_int_init,
.unixids_to_sids = idmap_nss_unixids_to_sids,
.sids_to_unixids = idmap_nss_sids_to_unixids,
- .close_fn = idmap_nss_close
};
NTSTATUS idmap_nss_init(void)
diff --git a/source3/winbindd/idmap_passdb.c b/source3/winbindd/idmap_passdb.c
index 7f14b6b..ba179c3 100644
--- a/source3/winbindd/idmap_passdb.c
+++ b/source3/winbindd/idmap_passdb.c
@@ -112,17 +112,11 @@ static NTSTATUS idmap_pdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma
Close the idmap tdb instance
**********************************/
-static NTSTATUS idmap_pdb_close(struct idmap_domain *dom)
-{
- return NT_STATUS_OK;
-}
-
static struct idmap_methods passdb_methods = {
.init = idmap_pdb_init,
.unixids_to_sids = idmap_pdb_unixids_to_sids,
.sids_to_unixids = idmap_pdb_sids_to_unixids,
- .close_fn =idmap_pdb_close
};
NTSTATUS idmap_passdb_init(void)
diff --git a/source3/winbindd/idmap_rid.c b/source3/winbindd/idmap_rid.c
index ae54475..935d753 100644
--- a/source3/winbindd/idmap_rid.c
+++ b/source3/winbindd/idmap_rid.c
@@ -182,19 +182,10 @@ static NTSTATUS idmap_rid_sids_to_unixids(struct idmap_domain *dom, struct id_ma
return NT_STATUS_OK;
}
-static NTSTATUS idmap_rid_close(struct idmap_domain *dom)
-{
- if (dom->private_data) {
- TALLOC_FREE(dom->private_data);
- }
- return NT_STATUS_OK;
-}
-
static struct idmap_methods rid_methods = {
.init = idmap_rid_initialize,
.unixids_to_sids = idmap_rid_unixids_to_sids,
.sids_to_unixids = idmap_rid_sids_to_unixids,
- .close_fn = idmap_rid_close
};
NTSTATUS idmap_rid_init(void)
diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c
index aeb4f20..537f6cf 100644
--- a/source3/winbindd/idmap_tdb.c
+++ b/source3/winbindd/idmap_tdb.c
@@ -936,24 +936,11 @@ static NTSTATUS idmap_tdb_sids_to_unixids(struct idmap_domain *dom, struct id_ma
Close the idmap tdb instance
**********************************/
-static NTSTATUS idmap_tdb_close(struct idmap_domain *dom)
-{
- struct idmap_tdb_context *ctx;
-
- if (dom->private_data) {
- ctx = talloc_get_type(dom->private_data, struct idmap_tdb_context);
-
- TALLOC_FREE(ctx->db);
- }
--
Samba Shared Repository
More information about the samba-cvs
mailing list