1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 eab9ca7e7d)
This commit is contained in:
Gerald Carter 2007-04-06 18:52:30 +00:00 committed by Gerald (Jerry) Carter
parent ab8bbffd65
commit a1e72969d5
4 changed files with 34 additions and 40 deletions

View File

@ -44,6 +44,7 @@
/* machine role */
#define DSROLE_DOMAIN_MEMBER_WKS 1
#define DSROLE_STANDALONE_SRV 2
#define DSROLE_DOMAIN_MEMBER_SRV 3
#define DSROLE_BDC 4
@ -60,18 +61,13 @@
typedef struct
{
uint16 machine_role;
uint16 unknown; /* 0x6173 -- maybe just alignment? */
uint32 flags;
uint32 flags;
uint32 netbios_ptr;
uint32 dnsname_ptr;
uint32 forestname_ptr;
struct GUID domain_guid;
struct GUID domain_guid;
UNISTR2 netbios_domain;
UNISTR2 dns_domain; /* our dns domain */
UNISTR2 forest_domain; /* root domain of the forest to which we belong */
} DSROLE_PRIMARY_DOMAIN_INFO_BASIC;

View File

@ -37,7 +37,7 @@ static BOOL ds_io_dominfobasic(const char *desc, DSROLE_PRIMARY_DOMAIN_INFO_BASI
if ( !prs_uint16("machine_role", ps, depth, &p->machine_role) )
return False;
if ( !prs_uint16("unknown", ps, depth, &p->unknown) )
if ( !prs_align(ps) )
return False;
if ( !prs_uint32("flags", ps, depth, &p->flags) )

View File

@ -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
};

View File

@ -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;