[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu May 19 18:51:02 UTC 2022


The branch, master has been updated
       via  9bacf7529dd s3:winbind: Remove struct winbindd_child_dispatch_table
       via  95698da905f examples: Update winbind.stp
       via  e9286b06cf8 s3:winbind: Convert InitConnection from struct based to NDR based
       via  39005d4437d s3:winbind: Create a binding handle for each child
       via  5827a4f9ae1 s3:winbind: Fix code format and use newer debug macros
       via  574c3ed9269 s3:winbind: Move winbindd_dual_init_connection() function
       via  7575e4ef5c7 examples: Update winbind.stp
       via  cc0ef447cdc s3:winbind: Convert winbindd_dual_pam_chauthtok() from struct based to NDR based
       via  ba40aad05b7 s3:winbind: Split getting and filling the password policy info
       via  57d7720080e examples: Update winbind.stp
       via  0f3b1d5c1d4 s3:winbind: Convert winbindd_dual_pam_chng_pswd_auth_crap() from struct based to NDR based
       via  5f213285b69 examples: Update winbind.stp
       via  ce0be638b4c s3:winbind: Convert PamLogOff from struct based to ndr based
       via  c27135adc74 librpc:idl: Add NDR_SECRET flag for ntlm and challenge blobs
       via  35ca7a17143 examples: Update winbind.stp, delete removed functions
      from  04e0e02c695 srvsvc: Announce [username] in NetShareEnum

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 9bacf7529dd74b0307215b3ff00d8de20bf77a57
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Tue Jun 22 10:44:53 2021 +0200

    s3:winbind: Remove struct winbindd_child_dispatch_table
    
    All parent-child communication is based in NDR and dispatched as a local
    RPC call.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu May 19 18:50:24 UTC 2022 on sn-devel-184

commit 95698da905ffd8f18f5a6b1ae51c7194da02bac1
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 17:31:53 2022 +0200

    examples: Update winbind.stp
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit e9286b06cf807bc6e308aa1398c03588d00dc2f5
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon Feb 28 17:16:23 2022 +0100

    s3:winbind: Convert InitConnection from struct based to NDR based
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 39005d4437d57602aca88e51387d69a0480e4972
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Thu Jun 3 20:05:48 2021 +0200

    s3:winbind: Create a binding handle for each child
    
    Next commits will convert InitConnection from struct based to NDR based
    and this call will be directly issued to a domain child so create a 'wbint'
    binding handle for domain childs too.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 5827a4f9ae113414dc85621c09215163064b5c71
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:59:21 2022 +0200

    s3:winbind: Fix code format and use newer debug macros
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 574c3ed9269789e11041d08a5d4eefee4c196dd3
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:56:18 2022 +0200

    s3:winbind: Move winbindd_dual_init_connection() function
    
    It will be converted later to a local RPC call handler so it must be in
    the file including ndr_winbind_scompat.c
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7575e4ef5c77b355de9892c864ab1ff492ea1dd8
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:46:35 2022 +0200

    examples: Update winbind.stp
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cc0ef447cdc1c5f77162e52f44852aaaf6047d12
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Tue Jun 22 10:23:04 2021 +0200

    s3:winbind: Convert winbindd_dual_pam_chauthtok() from struct based to NDR based
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ba40aad05b7ee5f55b85434fe872fbb0b9cda5da
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon Jun 21 17:25:50 2021 +0200

    s3:winbind: Split getting and filling the password policy info
    
    Next commits will convert from struct based to NDR based. The
    samr_DomInfo1 struct will be returned by the child to the parent inside
    the 'r' struct and the parent will just fill the winbindd_respone.
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 57d7720080ec65cee230d9d3731b6c1884a2c06b
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:22:33 2022 +0200

    examples: Update winbind.stp
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0f3b1d5c1d46cb2859bd21a5e3c8933c81ed0f57
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon Jun 21 13:51:53 2021 +0200

    s3:winbind: Convert winbindd_dual_pam_chng_pswd_auth_crap() from struct based to NDR based
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 5f213285b697554b6c3a5b9f9e5a325abdacd7eb
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:12:41 2022 +0200

    examples: Update winbind.stp
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit ce0be638b4ceb6474f967500d3ec68c67c36cfd3
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Wed Jun 16 17:39:02 2021 +0200

    s3:winbind: Convert PamLogOff from struct based to ndr based
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit c27135adc74978e52d7c346ffb99d2f3d8ba9c0b
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Tue May 17 18:25:38 2022 +0200

    librpc:idl: Add NDR_SECRET flag for ntlm and challenge blobs
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 35ca7a1714338fbcc35c7b6ad9a1203d774de760
Author: Samuel Cabrero <scabrero at samba.org>
Date:   Mon May 9 16:27:13 2022 +0200

    examples: Update winbind.stp, delete removed functions
    
    Signed-off-by: Samuel Cabrero <scabrero at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 examples/systemtap/generate-winbindd.stp.sh        |   9 +-
 examples/systemtap/winbindd.stp                    | 134 ++++------
 librpc/idl/samr.idl                                |   2 +-
 librpc/idl/winbind.idl                             |  55 +++-
 nsswitch/winbind_struct_protocol.h                 |   4 +-
 source3/winbindd/winbindd.h                        |   9 -
 source3/winbindd/winbindd_domain.c                 |  27 --
 source3/winbindd/winbindd_dual.c                   |  86 +++----
 source3/winbindd/winbindd_dual_srv.c               |  58 +++++
 source3/winbindd/winbindd_idmap.c                  |  14 +-
 source3/winbindd/winbindd_locator.c                |  14 +-
 source3/winbindd/winbindd_ndr.c                    |   1 -
 source3/winbindd/winbindd_pam.c                    | 286 +++++++++++----------
 source3/winbindd/winbindd_pam_chauthtok.c          |  79 ++++--
 .../winbindd/winbindd_pam_chng_pswd_auth_crap.c    |  78 +++++-
 source3/winbindd/winbindd_pam_logoff.c             |  52 ++--
 source3/winbindd/winbindd_proto.h                  |  14 +-
 source3/winbindd/winbindd_util.c                   |  44 ----
 18 files changed, 522 insertions(+), 444 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/systemtap/generate-winbindd.stp.sh b/examples/systemtap/generate-winbindd.stp.sh
index 18695232f43..3a4d2d87eb1 100755
--- a/examples/systemtap/generate-winbindd.stp.sh
+++ b/examples/systemtap/generate-winbindd.stp.sh
@@ -3,14 +3,13 @@
 outfile="$(dirname $0)/winbindd.stp"
 
 child_funcs="winbindd_dual_init_connection
-winbindd_dual_pam_auth
-winbindd_dual_pam_auth_crap
-winbindd_dual_pam_logoff
-winbindd_dual_pam_chng_pswd_auth_crap
-winbindd_dual_pam_chauthtok
+_wbint_InitConnection
 _wbint_Ping
 _wbint_PamAuth
 _wbint_PamAuthCrap
+_wbint_PamLogOff
+_wbint_PamAuthChangePassword
+_wbint_PamAuthCrapChangePassword
 _wbint_ListTrustedDomains
 _wbint_LookupSid
 _wbint_LookupSids
diff --git a/examples/systemtap/winbindd.stp b/examples/systemtap/winbindd.stp
index 5b8e72fea6c..635784a5b13 100644
--- a/examples/systemtap/winbindd.stp
+++ b/examples/systemtap/winbindd.stp
@@ -2,7 +2,7 @@
 #
 # Systemtap script to instrument winbindd
 #
-# Generated by examples/systemtap/generate-winbindd.stp.sh on vie 01 abr 2022 16:21:52 CEST, do not edit
+# Generated by examples/systemtap/generate-winbindd.stp.sh on lun 09 may 2022 17:31:44 CEST, do not edit
 #
 # Usage:
 #
@@ -44,163 +44,143 @@ probe process("winbindd").function("winbindd_dual_init_connection").return {
 }
 
 #
-# winbind domain child function winbindd_dual_pam_auth
+# winbind domain child function _wbint_InitConnection
 #
 
-probe process("winbindd").function("winbindd_dual_pam_auth") {
-	dc_running[tid(), "winbindd_dual_pam_auth"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_InitConnection") {
+	dc_running[tid(), "_wbint_InitConnection"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("winbindd_dual_pam_auth").return {
-	if (!([tid(), "winbindd_dual_pam_auth"] in dc_running))
+probe process("winbindd").function("_wbint_InitConnection").return {
+	if (!([tid(), "_wbint_InitConnection"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "winbindd_dual_pam_auth"]
-	delete dc_running[tid(), "winbindd_dual_pam_auth"]
+	begin = dc_running[tid(), "_wbint_InitConnection"]
+	delete dc_running[tid(), "_wbint_InitConnection"]
 
 	duration = end - begin
-	dc_svctime["winbindd_dual_pam_auth"] <<< duration
+	dc_svctime["_wbint_InitConnection"] <<< duration
 }
 
 #
-# winbind domain child function winbindd_dual_pam_auth_crap
-#
-
-probe process("winbindd").function("winbindd_dual_pam_auth_crap") {
-	dc_running[tid(), "winbindd_dual_pam_auth_crap"] = gettimeofday_us()
-}
-
-probe process("winbindd").function("winbindd_dual_pam_auth_crap").return {
-	if (!([tid(), "winbindd_dual_pam_auth_crap"] in dc_running))
-		next
-
-	end = gettimeofday_us()
-	begin = dc_running[tid(), "winbindd_dual_pam_auth_crap"]
-	delete dc_running[tid(), "winbindd_dual_pam_auth_crap"]
-
-	duration = end - begin
-	dc_svctime["winbindd_dual_pam_auth_crap"] <<< duration
-}
-
-#
-# winbind domain child function winbindd_dual_pam_logoff
+# winbind domain child function _wbint_Ping
 #
 
-probe process("winbindd").function("winbindd_dual_pam_logoff") {
-	dc_running[tid(), "winbindd_dual_pam_logoff"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_Ping") {
+	dc_running[tid(), "_wbint_Ping"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("winbindd_dual_pam_logoff").return {
-	if (!([tid(), "winbindd_dual_pam_logoff"] in dc_running))
+probe process("winbindd").function("_wbint_Ping").return {
+	if (!([tid(), "_wbint_Ping"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "winbindd_dual_pam_logoff"]
-	delete dc_running[tid(), "winbindd_dual_pam_logoff"]
+	begin = dc_running[tid(), "_wbint_Ping"]
+	delete dc_running[tid(), "_wbint_Ping"]
 
 	duration = end - begin
-	dc_svctime["winbindd_dual_pam_logoff"] <<< duration
+	dc_svctime["_wbint_Ping"] <<< duration
 }
 
 #
-# winbind domain child function winbindd_dual_pam_chng_pswd_auth_crap
+# winbind domain child function _wbint_PamAuth
 #
 
-probe process("winbindd").function("winbindd_dual_pam_chng_pswd_auth_crap") {
-	dc_running[tid(), "winbindd_dual_pam_chng_pswd_auth_crap"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_PamAuth") {
+	dc_running[tid(), "_wbint_PamAuth"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("winbindd_dual_pam_chng_pswd_auth_crap").return {
-	if (!([tid(), "winbindd_dual_pam_chng_pswd_auth_crap"] in dc_running))
+probe process("winbindd").function("_wbint_PamAuth").return {
+	if (!([tid(), "_wbint_PamAuth"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "winbindd_dual_pam_chng_pswd_auth_crap"]
-	delete dc_running[tid(), "winbindd_dual_pam_chng_pswd_auth_crap"]
+	begin = dc_running[tid(), "_wbint_PamAuth"]
+	delete dc_running[tid(), "_wbint_PamAuth"]
 
 	duration = end - begin
-	dc_svctime["winbindd_dual_pam_chng_pswd_auth_crap"] <<< duration
+	dc_svctime["_wbint_PamAuth"] <<< duration
 }
 
 #
-# winbind domain child function winbindd_dual_pam_chauthtok
+# winbind domain child function _wbint_PamAuthCrap
 #
 
-probe process("winbindd").function("winbindd_dual_pam_chauthtok") {
-	dc_running[tid(), "winbindd_dual_pam_chauthtok"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_PamAuthCrap") {
+	dc_running[tid(), "_wbint_PamAuthCrap"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("winbindd_dual_pam_chauthtok").return {
-	if (!([tid(), "winbindd_dual_pam_chauthtok"] in dc_running))
+probe process("winbindd").function("_wbint_PamAuthCrap").return {
+	if (!([tid(), "_wbint_PamAuthCrap"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "winbindd_dual_pam_chauthtok"]
-	delete dc_running[tid(), "winbindd_dual_pam_chauthtok"]
+	begin = dc_running[tid(), "_wbint_PamAuthCrap"]
+	delete dc_running[tid(), "_wbint_PamAuthCrap"]
 
 	duration = end - begin
-	dc_svctime["winbindd_dual_pam_chauthtok"] <<< duration
+	dc_svctime["_wbint_PamAuthCrap"] <<< duration
 }
 
 #
-# winbind domain child function _wbint_Ping
+# winbind domain child function _wbint_PamLogOff
 #
 
-probe process("winbindd").function("_wbint_Ping") {
-	dc_running[tid(), "_wbint_Ping"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_PamLogOff") {
+	dc_running[tid(), "_wbint_PamLogOff"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("_wbint_Ping").return {
-	if (!([tid(), "_wbint_Ping"] in dc_running))
+probe process("winbindd").function("_wbint_PamLogOff").return {
+	if (!([tid(), "_wbint_PamLogOff"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "_wbint_Ping"]
-	delete dc_running[tid(), "_wbint_Ping"]
+	begin = dc_running[tid(), "_wbint_PamLogOff"]
+	delete dc_running[tid(), "_wbint_PamLogOff"]
 
 	duration = end - begin
-	dc_svctime["_wbint_Ping"] <<< duration
+	dc_svctime["_wbint_PamLogOff"] <<< duration
 }
 
 #
-# winbind domain child function _wbint_PamAuth
+# winbind domain child function _wbint_PamAuthChangePassword
 #
 
-probe process("winbindd").function("_wbint_PamAuth") {
-	dc_running[tid(), "_wbint_PamAuth"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_PamAuthChangePassword") {
+	dc_running[tid(), "_wbint_PamAuthChangePassword"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("_wbint_PamAuth").return {
-	if (!([tid(), "_wbint_PamAuth"] in dc_running))
+probe process("winbindd").function("_wbint_PamAuthChangePassword").return {
+	if (!([tid(), "_wbint_PamAuthChangePassword"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "_wbint_PamAuth"]
-	delete dc_running[tid(), "_wbint_PamAuth"]
+	begin = dc_running[tid(), "_wbint_PamAuthChangePassword"]
+	delete dc_running[tid(), "_wbint_PamAuthChangePassword"]
 
 	duration = end - begin
-	dc_svctime["_wbint_PamAuth"] <<< duration
+	dc_svctime["_wbint_PamAuthChangePassword"] <<< duration
 }
 
 #
-# winbind domain child function _wbint_PamAuthCrap
+# winbind domain child function _wbint_PamAuthCrapChangePassword
 #
 
-probe process("winbindd").function("_wbint_PamAuthCrap") {
-	dc_running[tid(), "_wbint_PamAuthCrap"] = gettimeofday_us()
+probe process("winbindd").function("_wbint_PamAuthCrapChangePassword") {
+	dc_running[tid(), "_wbint_PamAuthCrapChangePassword"] = gettimeofday_us()
 }
 
-probe process("winbindd").function("_wbint_PamAuthCrap").return {
-	if (!([tid(), "_wbint_PamAuthCrap"] in dc_running))
+probe process("winbindd").function("_wbint_PamAuthCrapChangePassword").return {
+	if (!([tid(), "_wbint_PamAuthCrapChangePassword"] in dc_running))
 		next
 
 	end = gettimeofday_us()
-	begin = dc_running[tid(), "_wbint_PamAuthCrap"]
-	delete dc_running[tid(), "_wbint_PamAuthCrap"]
+	begin = dc_running[tid(), "_wbint_PamAuthCrapChangePassword"]
+	delete dc_running[tid(), "_wbint_PamAuthCrapChangePassword"]
 
 	duration = end - begin
-	dc_svctime["_wbint_PamAuthCrap"] <<< duration
+	dc_svctime["_wbint_PamAuthCrapChangePassword"] <<< duration
 }
 
 #
diff --git a/librpc/idl/samr.idl b/librpc/idl/samr.idl
index 867862dcd5c..fffa853ce3f 100644
--- a/librpc/idl/samr.idl
+++ b/librpc/idl/samr.idl
@@ -347,7 +347,7 @@ import "misc.idl", "lsa.idl", "security.idl";
 		DOMAIN_SERVER_DISABLED = 2
 	} samr_DomainServerState;
 
-	typedef struct {
+	typedef [public] struct {
 		uint16 min_password_length;
 		uint16 password_history_length;
 		samr_PasswordProperties password_properties;
diff --git a/librpc/idl/winbind.idl b/librpc/idl/winbind.idl
index 8a50a53eea1..2adfc853835 100644
--- a/librpc/idl/winbind.idl
+++ b/librpc/idl/winbind.idl
@@ -1,5 +1,5 @@
 #include "idl_types.h"
-import "lsa.idl", "netlogon.idl", "misc.idl", "security.idl", "idmap.idl";
+import "lsa.idl", "netlogon.idl", "samr.idl", "misc.idl", "security.idl", "idmap.idl";
 
 [
     uuid("bf09192c-ed60-4928-9dff-d0d7bcb03ed8"),
@@ -208,15 +208,62 @@ interface winbind
         [in, string,charset(UTF8)] char *user,
         [in, string,charset(UTF8)] char *domain,
         [in, string,charset(UTF8)] char *workstation,
-        [in] DATA_BLOB lm_resp,
-        [in] DATA_BLOB nt_resp,
-        [in] DATA_BLOB chal,
+        [in,flag(NDR_SECRET)] DATA_BLOB lm_resp,
+        [in,flag(NDR_SECRET)] DATA_BLOB nt_resp,
+        [in,flag(NDR_SECRET)] DATA_BLOB chal,
         [in] uint32 logon_parameters,
         [in] wbint_SidArray *require_membership_of_sid,
         [out,ref] uint8 *authoritative,
         [out,ref] wbint_PamAuthCrapValidation *validation
         );
 
+    NTSTATUS wbint_PamLogOff(
+        [in,string,charset(UTF8)] char *client_name,
+        [in] hyper client_pid,
+        [in] uint32 flags,
+        [in,string,charset(UTF8)] char *user,
+        [in,string,charset(UTF8)] char *krb5ccname,
+        [in] hyper uid
+        );
+
+    NTSTATUS wbint_PamAuthCrapChangePassword(
+        [in,string,charset(UTF8)] char *client_name,
+        [in] hyper client_pid,
+        [in,string,charset(UTF8)] char *user,
+        [in,string,charset(UTF8)] char *domain,
+        [in,flag(NDR_SECRET)] DATA_BLOB new_nt_pswd,
+        [in,flag(NDR_SECRET)] DATA_BLOB old_nt_hash_enc,
+        [in,flag(NDR_SECRET)] DATA_BLOB new_lm_pswd,
+        [in,flag(NDR_SECRET)] DATA_BLOB old_lm_hash_enc
+        );
+
+    NTSTATUS wbint_PamAuthChangePassword(
+        [in,string,charset(UTF8)] char *client_name,
+        [in] hyper client_pid,
+        [in] uint32 flags,
+        [in,string,charset(UTF8)] char *user,
+        [in,string,charset(UTF8),flag(NDR_SECRET)] char *old_password,
+        [in,string,charset(UTF8),flag(NDR_SECRET)] char *new_password,
+        [out,ref] samr_DomInfo1 **dominfo,
+        [out,ref] samPwdChangeReason *reject_reason
+        );
+
+    typedef [enum16bit] enum {
+        WB_DOMINFO_DOMAIN_UNKNOWN = 0x0000,
+        WB_DOMINFO_DOMAIN_NATIVE  = 0x0001,
+        WB_DOMINFO_DOMAIN_AD      = 0x0002,
+        WB_DOMINFO_DOMAIN_PRIMARY = 0x0004,
+        WB_DOMINFO_DOMAIN_OFFLINE = 0x0008
+    } DomainInfoFlags;
+
+    NTSTATUS wbint_InitConnection(
+        [in,string,charset(UTF8)] char *dcname,
+        [out,string,charset(UTF8)] char **name,
+        [out,string,charset(UTF8)] char **alt_name,
+        [out,ref] dom_sid *sid,
+        [out,ref] DomainInfoFlags *flags
+        );
+
   /* Public methods available via IRPC */
 
     typedef [switch_type(uint16)] union netr_LogonLevel netr_LogonLevel;
diff --git a/nsswitch/winbind_struct_protocol.h b/nsswitch/winbind_struct_protocol.h
index ac0558c87c5..9365b312e30 100644
--- a/nsswitch/winbind_struct_protocol.h
+++ b/nsswitch/winbind_struct_protocol.h
@@ -62,6 +62,7 @@ typedef char fstring[FSTRING_LEN];
  * 30: added "validation_level" and "info6" to response.data.auth
  * 31: added "client_name" to the request
  * 32: added "traceid" to the request
+ *     removed WINBINDD_INIT_CONNECTION
  */
 #define WINBIND_INTERFACE_VERSION 32
 
@@ -164,9 +165,6 @@ enum winbindd_cmd {
 	/* lookup local groups */
 	WINBINDD_GETSIDALIASES,
 
-	/* Initialize connection in a child */
-	WINBINDD_INIT_CONNECTION,
-
 	/* Blocking calls that are not allowed on the main winbind pipe, only
 	 * between parent and children */
 	WINBINDD_DUAL_SID2UID,
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index fe286a9a686..ea5c1c0d834 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -103,13 +103,6 @@ struct winbindd_cm_conn {
 
 struct winbindd_domain;
 
-struct winbindd_child_dispatch_table {
-	const char *name;
-	enum winbindd_cmd struct_cmd;
-	enum winbindd_result (*struct_fn)(struct winbindd_domain *domain,
-					  struct winbindd_cli_state *state);
-};
-
 struct winbindd_child {
 	pid_t pid;
 	struct winbindd_domain *domain;
@@ -122,8 +115,6 @@ struct winbindd_child {
 
 	struct tevent_timer *lockout_policy_event;
 	struct tevent_timer *machine_password_change_event;
-
-	const struct winbindd_child_dispatch_table *table;
 };
 
 /* Structures to hold per domain information */
diff --git a/source3/winbindd/winbindd_domain.c b/source3/winbindd/winbindd_domain.c
index 80df55a5819..b1027735c8a 100644
--- a/source3/winbindd/winbindd_domain.c
+++ b/source3/winbindd/winbindd_domain.c
@@ -25,39 +25,12 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
 
-static const struct winbindd_child_dispatch_table domain_dispatch_table[] = {
-	{
-		.name		= "INIT_CONNECTION",
-		.struct_cmd	= WINBINDD_INIT_CONNECTION,
-		.struct_fn	= winbindd_dual_init_connection,
-	},{
-		.name		= "PAM_LOGOFF",
-		.struct_cmd	= WINBINDD_PAM_LOGOFF,
-		.struct_fn	= winbindd_dual_pam_logoff,
-	},{
-		.name		= "CHNG_PSWD_AUTH_CRAP",
-		.struct_cmd	= WINBINDD_PAM_CHNG_PSWD_AUTH_CRAP,
-		.struct_fn	= winbindd_dual_pam_chng_pswd_auth_crap,
-	},{
-		.name		= "PAM_CHAUTHTOK",
-		.struct_cmd	= WINBINDD_PAM_CHAUTHTOK,
-		.struct_fn	= winbindd_dual_pam_chauthtok,
-	},{
-		.name		= "NDRCMD",
-		.struct_cmd	= WINBINDD_DUAL_NDRCMD,
-		.struct_fn	= winbindd_dual_ndrcmd,
-	},{
-		.name		= NULL,
-	}
-};
-
 void setup_domain_child(struct winbindd_domain *domain)
 {
 	int i;
 
         for (i=0; i<lp_winbind_max_domain_connections(); i++) {
                 setup_child(domain, &domain->children[i],
-			    domain_dispatch_table,
                             "log.wb", domain->name);
 		domain->children[i].domain = domain;
 	}
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index b880feaac13..75ecdf53968 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -47,6 +47,7 @@
 #include "idmap.h"
 #include "libcli/auth/netlogon_creds_cli.h"
 #include "../lib/util/pidfile.h"
+#include "librpc/gen_ndr/ndr_winbind_c.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND
@@ -467,6 +468,7 @@ struct wb_domain_request_state {
 	struct winbindd_request *init_req;
 	struct winbindd_response *response;
 	struct tevent_req *pending_subreq;
+	struct wbint_InitConnection r;
 };
 
 static void wb_domain_request_cleanup(struct tevent_req *req,
@@ -575,13 +577,15 @@ static void wb_domain_request_trigger(struct tevent_req *req,
 
 	if (IS_DC || domain->primary || domain->internal) {
 		/* The primary domain has to find the DC name itself */
-		state->init_req->cmd = WINBINDD_INIT_CONNECTION;
-		fstrcpy(state->init_req->domain_name, domain->name);
-		state->init_req->data.init_conn.is_primary = domain->primary;
-		fstrcpy(state->init_req->data.init_conn.dcname, "");
+		state->r.in.dcname = talloc_strdup(state, "");
+		if (tevent_req_nomem(state->r.in.dcname, req)) {
+			return;
+		}
 
-		subreq = wb_child_request_send(state, state->ev, state->child,
-					       state->init_req);
+		subreq = dcerpc_wbint_InitConnection_r_send(state,
+						state->ev,
+						state->child->binding_handle,
+						&state->r);
 		if (tevent_req_nomem(subreq, req)) {
 			return;
 		}
@@ -633,16 +637,18 @@ static void wb_domain_request_gotdc(struct tevent_req *subreq)
 	while (dcname != NULL && *dcname == '\\') {
 		dcname++;
 	}
-	state->init_req->cmd = WINBINDD_INIT_CONNECTION;
-	fstrcpy(state->init_req->domain_name, state->domain->name);
-	state->init_req->data.init_conn.is_primary = False;
-	fstrcpy(state->init_req->data.init_conn.dcname,
-		dcname);
+
+	state->r.in.dcname = talloc_strdup(state, dcname);
+	if (tevent_req_nomem(state->r.in.dcname, req)) {
+		return;
+	}
 
 	TALLOC_FREE(dcinfo);
 
-	subreq = wb_child_request_send(state, state->ev, state->child,
-				       state->init_req);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list