svn commit: samba r13702 - in trunk/source/passdb: .

tpot at samba.org tpot at samba.org
Mon Feb 27 01:57:37 GMT 2006


Author: tpot
Date: 2006-02-27 01:57:35 +0000 (Mon, 27 Feb 2006)
New Revision: 13702

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13702

Log:
Slightly smaller version of pdb_get_methods() patch.  Turns out that
callers to initialize_password_db() use the reload parameter so this
has turned in to a smaller cleanup than I thought.

Modified:
   trunk/source/passdb/pdb_interface.c


Changeset:
Modified: trunk/source/passdb/pdb_interface.c
===================================================================
--- trunk/source/passdb/pdb_interface.c	2006-02-27 01:03:21 UTC (rev 13701)
+++ trunk/source/passdb/pdb_interface.c	2006-02-27 01:57:35 UTC (rev 13702)
@@ -193,7 +193,7 @@
  Return an already initialised pdn_methods structure
 *******************************************************************/
 
-static struct pdb_methods *pdb_get_methods( BOOL reload ) 
+static struct pdb_methods *pdb_get_methods_reload( BOOL reload ) 
 {
 	static struct pdb_methods *pdb = NULL;
 
@@ -213,13 +213,18 @@
 	return pdb;
 }
 
+static struct pdb_methods *pdb_get_methods()
+{
+	return pdb_get_methods_reload(False);
+}
+
 /******************************************************************
  Backward compatibility functions for the original passdb interface
 *******************************************************************/
 
 BOOL pdb_setsampwent(BOOL update, uint16 acb_mask) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -230,7 +235,7 @@
 
 void pdb_endsampwent(void) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return;
@@ -241,7 +246,7 @@
 
 BOOL pdb_getsampwent(struct samu *user) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -258,7 +263,7 @@
 
 BOOL pdb_getsampwnam(struct samu *sam_acct, const char *username) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -311,7 +316,7 @@
 	struct pdb_methods *pdb;
 	uint32 rid;
 
-	if ( !(pdb = pdb_get_methods(False)) ) {
+	if ( !(pdb = pdb_get_methods()) ) {
 		return False;
 	}
 
@@ -399,7 +404,7 @@
 NTSTATUS pdb_create_user(TALLOC_CTX *mem_ctx, const char *name, uint32 flags,
 			 uint32 *rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -452,7 +457,7 @@
 
 NTSTATUS pdb_delete_user(TALLOC_CTX *mem_ctx, struct samu *sam_acct)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -463,7 +468,7 @@
 
 NTSTATUS pdb_add_sam_account(struct samu *sam_acct) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -474,7 +479,7 @@
 
 NTSTATUS pdb_update_sam_account(struct samu *sam_acct) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -490,7 +495,7 @@
 
 NTSTATUS pdb_delete_sam_account(struct samu *sam_acct) 
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -506,7 +511,7 @@
 
 NTSTATUS pdb_rename_sam_account(struct samu *oldname, const char *newname)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -522,7 +527,7 @@
 
 NTSTATUS pdb_update_login_attempts(struct samu *sam_acct, BOOL success)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -533,7 +538,7 @@
 
 BOOL pdb_getgrsid(GROUP_MAP *map, DOM_SID sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -544,7 +549,7 @@
 
 BOOL pdb_getgrgid(GROUP_MAP *map, gid_t gid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -555,7 +560,7 @@
 
 BOOL pdb_getgrnam(GROUP_MAP *map, const char *name)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -605,7 +610,7 @@
 NTSTATUS pdb_create_dom_group(TALLOC_CTX *mem_ctx, const char *name,
 			      uint32 *rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -664,7 +669,7 @@
 
 NTSTATUS pdb_delete_dom_group(TALLOC_CTX *mem_ctx, uint32 rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -675,7 +680,7 @@
 
 NTSTATUS pdb_add_group_mapping_entry(GROUP_MAP *map)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -686,7 +691,7 @@
 
 NTSTATUS pdb_update_group_mapping_entry(GROUP_MAP *map)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -697,7 +702,7 @@
 
 NTSTATUS pdb_delete_group_mapping_entry(DOM_SID sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -709,7 +714,7 @@
 BOOL pdb_enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **pp_rmap,
 			    size_t *p_num_entries, BOOL unix_only)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -724,7 +729,7 @@
 				uint32 **pp_member_rids,
 				size_t *p_num_members)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -738,7 +743,7 @@
 				    DOM_SID **pp_sids, gid_t **pp_gids,
 				    size_t *p_num_groups)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -771,7 +776,7 @@
 
 NTSTATUS pdb_set_unix_primary_group(TALLOC_CTX *mem_ctx, struct samu *user)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -865,7 +870,7 @@
 NTSTATUS pdb_add_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
 			  uint32 member_rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -932,7 +937,7 @@
 NTSTATUS pdb_del_groupmem(TALLOC_CTX *mem_ctx, uint32 group_rid,
 			  uint32 member_rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -943,7 +948,7 @@
 
 BOOL pdb_find_alias(const char *name, DOM_SID *sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -955,7 +960,7 @@
 
 NTSTATUS pdb_create_alias(const char *name, uint32 *rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -966,7 +971,7 @@
 
 BOOL pdb_delete_alias(const DOM_SID *sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -979,7 +984,7 @@
 
 BOOL pdb_get_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -991,7 +996,7 @@
 
 BOOL pdb_set_aliasinfo(const DOM_SID *sid, struct acct_info *info)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1003,7 +1008,7 @@
 
 NTSTATUS pdb_add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -1014,7 +1019,7 @@
 
 NTSTATUS pdb_del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -1026,7 +1031,7 @@
 NTSTATUS pdb_enum_aliasmem(const DOM_SID *alias,
 			   DOM_SID **pp_members, size_t *p_num_members)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_UNSUCCESSFUL;
@@ -1042,7 +1047,7 @@
 				    uint32 **pp_alias_rids,
 				    size_t *p_num_alias_rids)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -1061,7 +1066,7 @@
 			 const char **names,
 			 uint32 *attrs)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -1077,7 +1082,7 @@
 			  uint32 *rids,
 			  uint32 *attrs)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return NT_STATUS_NOT_IMPLEMENTED;
@@ -1089,7 +1094,7 @@
 
 BOOL pdb_get_account_policy(int policy_index, uint32 *value)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1100,7 +1105,7 @@
 
 BOOL pdb_set_account_policy(int policy_index, uint32 value)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1111,7 +1116,7 @@
 
 BOOL pdb_get_seq_num(time_t *seq_num)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1122,7 +1127,7 @@
 
 BOOL pdb_uid_to_rid(uid_t uid, uint32 *rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1133,7 +1138,7 @@
 
 BOOL pdb_gid_to_sid(gid_t gid, DOM_SID *sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1145,7 +1150,7 @@
 BOOL pdb_sid_to_id(const DOM_SID *sid, union unid_t *id,
 		   enum SID_NAME_USE *type)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1156,7 +1161,7 @@
 
 BOOL pdb_rid_algorithm(void)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1167,7 +1172,7 @@
 
 BOOL pdb_new_rid(uint32 *rid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 
 	if ( !pdb ) {
 		return False;
@@ -1199,7 +1204,7 @@
 
 BOOL initialize_password_db(BOOL reload)
 {	
-	return (pdb_get_methods(reload) != NULL);
+	return (pdb_get_methods_reload(reload) != NULL);
 }
 
 
@@ -1982,7 +1987,7 @@
 
 struct pdb_search *pdb_search_users(uint16 acct_flags)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 	struct pdb_search *result;
 
 	if (pdb == NULL) return NULL;
@@ -1999,7 +2004,7 @@
 
 struct pdb_search *pdb_search_groups(void)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 	struct pdb_search *result;
 
 	if (pdb == NULL) return NULL;
@@ -2016,7 +2021,7 @@
 
 struct pdb_search *pdb_search_aliases(const DOM_SID *sid)
 {
-	struct pdb_methods *pdb = pdb_get_methods(False);
+	struct pdb_methods *pdb = pdb_get_methods();
 	struct pdb_search *result;
 
 	if (pdb == NULL) return NULL;



More information about the samba-cvs mailing list