diff options
author | Gerald Carter <jerry@samba.org> | 2007-04-06 18:52:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:12 -0500 |
commit | a1e72969d571d6b12f4cfa8c6dc16d7d982daa51 (patch) | |
tree | 1480d62d492099bb9c455688eeb1ea01e79286d7 /source3/rpc_server | |
parent | ab8bbffd653f327fc8dcf561bbe8b9ad71f91268 (diff) | |
download | samba-a1e72969d571d6b12f4cfa8c6dc16d7d982daa51.tar.gz samba-a1e72969d571d6b12f4cfa8c6dc16d7d982daa51.tar.bz2 samba-a1e72969d571d6b12f4cfa8c6dc16d7d982daa51.zip |
r22104: BUG 4439: Fix the object picket on x64 WIndopws XP/2003.
Enable the DsRoleGetPrimaryDomainInfo() server code.
Tested by Win2000/XP/2003/Vista (x86) and WinXP (x64)
(This used to be commit eab9ca7e7d8d7dc3e705720f8bc5dff5c8ec5f5f)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_lsa_ds.c | 13 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_ds_nt.c | 49 |
2 files changed, 30 insertions, 32 deletions
diff --git a/source3/rpc_server/srv_lsa_ds.c b/source3/rpc_server/srv_lsa_ds.c index 1e75175c2c..db741a1b64 100644 --- a/source3/rpc_server/srv_lsa_ds.c +++ b/source3/rpc_server/srv_lsa_ds.c @@ -25,9 +25,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV -#if 0 /* disabled */ /******************************************************************* - api_reg_open_entry ********************************************************************/ static BOOL api_dsrole_get_primary_dominfo(pipes_struct *p) @@ -41,18 +39,17 @@ static BOOL api_dsrole_get_primary_dominfo(pipes_struct *p) ZERO_STRUCT(r_u); /* grab the request */ - if ( !ds_io_q_getprimdominfo("", data, 0, &q_u) ) + if ( !ds_io_q_getprimdominfo("", &q_u, data, 0) ) return False; /* construct reply. */ r_u.status = _dsrole_get_primary_dominfo( p, &q_u, &r_u ); - if ( !ds_io_r_getprimdominfo("", rdata, 0, &r_u) ) + if ( !ds_io_r_getprimdominfo("", &r_u, rdata, 0) ) return False; return True; } -#endif /******************************************************************* stub functions for unimplemented RPC @@ -70,12 +67,8 @@ static BOOL api_dsrole_stub( pipes_struct *p ) array of \PIPE\lsass (new windows 2000 UUID) operations ********************************************************************/ static struct api_struct api_lsa_ds_cmds[] = { - { "DS_NOP", DS_NOP, api_dsrole_stub } - -#if 0 /* disabled due to breakage with viewing domain users and groups - on a Samba PDC from win2k clients --jerry CIFS 2003 */ + { "DS_NOP", DS_NOP, api_dsrole_stub }, { "DS_GETPRIMDOMINFO", DS_GETPRIMDOMINFO, api_dsrole_get_primary_dominfo } -#endif }; diff --git a/source3/rpc_server/srv_lsa_ds_nt.c b/source3/rpc_server/srv_lsa_ds_nt.c index b410af8ded..844a20eed4 100644 --- a/source3/rpc_server/srv_lsa_ds_nt.c +++ b/source3/rpc_server/srv_lsa_ds_nt.c @@ -46,49 +46,54 @@ static NTSTATUS fill_dsrole_dominfo_basic(TALLOC_CTX *ctx, DSROLE_PRIMARY_DOMAIN return NT_STATUS_NO_MEMORY; } - get_mydnsdomname(dnsdomain); - strlower_m(dnsdomain); - switch ( lp_server_role() ) { case ROLE_STANDALONE: basic->machine_role = DSROLE_STANDALONE_SRV; + basic->netbios_ptr = 1; + netbios_domain = get_global_sam_name(); break; case ROLE_DOMAIN_MEMBER: + basic->netbios_ptr = 1; + netbios_domain = lp_workgroup(); basic->machine_role = DSROLE_DOMAIN_MEMBER_SRV; break; case ROLE_DOMAIN_BDC: + basic->netbios_ptr = 1; + netbios_domain = get_global_sam_name(); basic->machine_role = DSROLE_BDC; - basic->flags = DSROLE_PRIMARY_DS_RUNNING|DSROLE_PRIMARY_DS_MIXED_MODE; - if ( secrets_fetch_domain_guid( lp_workgroup(), &basic->domain_guid ) ) - basic->flags |= DSROLE_PRIMARY_DOMAIN_GUID_PRESENT; break; case ROLE_DOMAIN_PDC: + basic->netbios_ptr = 1; + netbios_domain = get_global_sam_name(); basic->machine_role = DSROLE_PDC; - basic->flags = DSROLE_PRIMARY_DS_RUNNING|DSROLE_PRIMARY_DS_MIXED_MODE; - if ( secrets_fetch_domain_guid( lp_workgroup(), &basic->domain_guid ) ) - basic->flags |= DSROLE_PRIMARY_DOMAIN_GUID_PRESENT; break; } - basic->unknown = 0x6173; /* seen on the wire; maybe padding */ - /* always set netbios name */ - basic->netbios_ptr = 1; - netbios_domain = get_global_sam_name(); - init_unistr2( &basic->netbios_domain, netbios_domain, UNI_FLAGS_NONE); + init_unistr2( &basic->netbios_domain, netbios_domain, UNI_STR_TERMINATE); - basic->dnsname_ptr = 1; - init_unistr2( &basic->dns_domain, dnsdomain, UNI_FLAGS_NONE); - basic->forestname_ptr = 1; - init_unistr2( &basic->forest_domain, dnsdomain, UNI_FLAGS_NONE); - + if ( secrets_fetch_domain_guid( lp_workgroup(), &basic->domain_guid ) ) + basic->flags |= DSROLE_PRIMARY_DOMAIN_GUID_PRESENT; /* fill in some additional fields if we are a member of an AD domain */ - if ( lp_security() == SEC_ADS ) { - /* TODO */ - ;; + if ( lp_security() == SEC_ADS ) { + fstrcpy( dnsdomain, lp_realm() ); + strlower_m( dnsdomain ); + + basic->dnsname_ptr = 1; + init_unistr2( &basic->dns_domain, dnsdomain, UNI_STR_TERMINATE); + basic->forestname_ptr = 1; + init_unistr2( &basic->forest_domain, dnsdomain, UNI_STR_TERMINATE); + } else { + get_mydnsdomname(dnsdomain); + strlower_m(dnsdomain); + + basic->dnsname_ptr = 1; + init_unistr2( &basic->dns_domain, dnsdomain, UNI_FLAGS_NONE); + basic->forestname_ptr = 1; + init_unistr2( &basic->forest_domain, dnsdomain, UNI_FLAGS_NONE); } *info = basic; |