From a84270ce115e7fa0674c163de708333816184dca Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 16 Jul 2003 02:20:53 +0000 Subject: fixes for 'net rpc vampire'. I can now take a blank Samba host and migrate an NT4 domain and still logon from domain members (tested logon scripts, system policies, profiles, & home directories) (passdb backend = tdbsam) removed call to idmap_init_wellknown_sids() from winbindd.c since the local domain should be handled by the guest passdb backend (and you don't really always want the Administrator account to be root) ...and we didn't pay attention to this anyways now. (This used to be commit 837d7c54d3ca780160aa0d6a2f0a109bb691948e) --- source3/nsswitch/wb_client.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'source3/nsswitch/wb_client.c') diff --git a/source3/nsswitch/wb_client.c b/source3/nsswitch/wb_client.c index 49a48074fa..7c5a8dd054 100644 --- a/source3/nsswitch/wb_client.c +++ b/source3/nsswitch/wb_client.c @@ -315,6 +315,9 @@ BOOL winbind_create_user( const char *name, uint32 *rid ) DEBUG(10,("winbind_create_user: %s\n", name)); + ZERO_STRUCT(request); + ZERO_STRUCT(response); + /* see if the caller wants a new RID returned */ if ( rid ) @@ -323,8 +326,6 @@ BOOL winbind_create_user( const char *name, uint32 *rid ) fstrcpy( request.data.acct_mgt.username, name ); fstrcpy( request.data.acct_mgt.groupname, "" ); - ZERO_STRUCT(response); - result = winbindd_request( WINBINDD_CREATE_USER, &request, &response); if ( rid ) @@ -351,6 +352,9 @@ BOOL winbind_create_group( const char *name, uint32 *rid ) DEBUG(10,("winbind_create_group: %s\n", name)); + ZERO_STRUCT(request); + ZERO_STRUCT(response); + /* see if the caller wants a new RID returned */ if ( rid ) @@ -358,7 +362,6 @@ BOOL winbind_create_group( const char *name, uint32 *rid ) fstrcpy( request.data.acct_mgt.groupname, name ); - ZERO_STRUCT(response); result = winbindd_request( WINBINDD_CREATE_GROUP, &request, &response); @@ -384,14 +387,15 @@ BOOL winbind_add_user_to_group( const char *user, const char *group ) if ( !user || !group ) return False; + ZERO_STRUCT(request); + ZERO_STRUCT(response); + DEBUG(10,("winbind_add_user_to_group: user(%s), group(%s) \n", user, group)); fstrcpy( request.data.acct_mgt.username, user ); fstrcpy( request.data.acct_mgt.groupname, group ); - ZERO_STRUCT(response); - result = winbindd_request( WINBINDD_ADD_USER_TO_GROUP, &request, &response); return result == NSS_STATUS_SUCCESS; @@ -413,12 +417,12 @@ BOOL winbind_remove_user_from_group( const char *user, const char *group ) if ( !user || !group ) return False; + ZERO_STRUCT(request); + ZERO_STRUCT(response); + DEBUG(10,("winbind_remove_user_from_group: user(%s), group(%s) \n", user, group)); - fstrcpy( request.data.acct_mgt.username, user ); - fstrcpy( request.data.acct_mgt.groupname, group ); - ZERO_STRUCT(response); result = winbindd_request( WINBINDD_REMOVE_USER_FROM_GROUP, &request, &response); @@ -442,14 +446,15 @@ BOOL winbind_set_user_primary_group( const char *user, const char *group ) if ( !user || !group ) return False; + ZERO_STRUCT(request); + ZERO_STRUCT(response); + DEBUG(10,("winbind_set_user_primary_group: user(%s), group(%s) \n", user, group)); fstrcpy( request.data.acct_mgt.username, user ); fstrcpy( request.data.acct_mgt.groupname, group ); - ZERO_STRUCT(response); - result = winbindd_request( WINBINDD_SET_USER_PRIMARY_GROUP, &request, &response); return result == NSS_STATUS_SUCCESS; @@ -472,12 +477,13 @@ BOOL winbind_delete_user( const char *user ) if ( !user ) return False; + ZERO_STRUCT(request); + ZERO_STRUCT(response); + DEBUG(10,("winbind_delete_user: user (%s)\n", user)); fstrcpy( request.data.acct_mgt.username, user ); - ZERO_STRUCT(response); - result = winbindd_request( WINBINDD_DELETE_USER, &request, &response); return result == NSS_STATUS_SUCCESS; @@ -499,12 +505,13 @@ BOOL winbind_delete_group( const char *group ) if ( !group ) return False; + ZERO_STRUCT(request); + ZERO_STRUCT(response); + DEBUG(10,("winbind_delete_group: group (%s)\n", group)); fstrcpy( request.data.acct_mgt.groupname, group ); - ZERO_STRUCT(response); - result = winbindd_request( WINBINDD_DELETE_GROUP, &request, &response); return result == NSS_STATUS_SUCCESS; -- cgit