mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
netr_DatabaseSync() now works fully for database 0
(This used to be commit 360d03bb56
)
This commit is contained in:
parent
f9419900d3
commit
9632db5a19
@ -55,7 +55,7 @@
|
|||||||
/******************/
|
/******************/
|
||||||
/* Function: 0x03 */
|
/* Function: 0x03 */
|
||||||
|
|
||||||
typedef struct {
|
typedef [public] struct {
|
||||||
uint32 size;
|
uint32 size;
|
||||||
[subcontext(4)] security_descriptor *sd;
|
[subcontext(4)] security_descriptor *sd;
|
||||||
} sec_desc_buf;
|
} sec_desc_buf;
|
||||||
@ -216,7 +216,7 @@
|
|||||||
dom_sid2 *sid;
|
dom_sid2 *sid;
|
||||||
} lsa_SidPtr;
|
} lsa_SidPtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef [public] struct {
|
||||||
uint32 num_sids;
|
uint32 num_sids;
|
||||||
[size_is(num_sids)] lsa_SidPtr *sids;
|
[size_is(num_sids)] lsa_SidPtr *sids;
|
||||||
} lsa_SidArray;
|
} lsa_SidArray;
|
||||||
|
@ -336,7 +336,7 @@ interface netlogon
|
|||||||
uint16 CodePage;
|
uint16 CodePage;
|
||||||
USER_PRIVATE_INFO user_private_info;
|
USER_PRIVATE_INFO user_private_info;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -358,7 +358,7 @@ interface netlogon
|
|||||||
NTTIME domain_modify_time;
|
NTTIME domain_modify_time;
|
||||||
NTTIME domain_create_time;
|
NTTIME domain_create_time;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -374,7 +374,7 @@ interface netlogon
|
|||||||
netr_GroupMembership group_membership;
|
netr_GroupMembership group_membership;
|
||||||
netr_String comment;
|
netr_String comment;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -412,7 +412,7 @@ interface netlogon
|
|||||||
netr_String alias_name;
|
netr_String alias_name;
|
||||||
uint32 rid;
|
uint32 rid;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -424,12 +424,7 @@ interface netlogon
|
|||||||
} DELTA_ALIAS;
|
} DELTA_ALIAS;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32 count;
|
lsa_SidArray sids;
|
||||||
[size_is(count)] dom_sid2 *sids;
|
|
||||||
} netr_SidArray;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
netr_SidArray sids;
|
|
||||||
uint32 unknown1;
|
uint32 unknown1;
|
||||||
uint32 unknown2;
|
uint32 unknown2;
|
||||||
uint32 unknown3;
|
uint32 unknown3;
|
||||||
@ -457,7 +452,7 @@ interface netlogon
|
|||||||
NTTIME db_modify_time;
|
NTTIME db_modify_time;
|
||||||
NTTIME db_create_time;
|
NTTIME db_create_time;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -473,7 +468,7 @@ interface netlogon
|
|||||||
uint32 num_controllers;
|
uint32 num_controllers;
|
||||||
[size_is(num_controllers)] netr_String *controller_names;
|
[size_is(num_controllers)] netr_String *controller_names;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -491,7 +486,7 @@ interface netlogon
|
|||||||
[size_is(privilege_entries)] netr_String *privilege_name;
|
[size_is(privilege_entries)] netr_String *privilege_name;
|
||||||
QUOTA_LIMITS quotalimits;
|
QUOTA_LIMITS quotalimits;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
@ -514,7 +509,7 @@ interface netlogon
|
|||||||
CIPHER_VALUE old_cipher;
|
CIPHER_VALUE old_cipher;
|
||||||
NTTIME old_cipher_set_time;
|
NTTIME old_cipher_set_time;
|
||||||
uint32 SecurityInformation;
|
uint32 SecurityInformation;
|
||||||
security_descriptor sec_desc;
|
sec_desc_buf sdbuf;
|
||||||
netr_String unknown1;
|
netr_String unknown1;
|
||||||
netr_String unknown2;
|
netr_String unknown2;
|
||||||
netr_String unknown3;
|
netr_String unknown3;
|
||||||
|
@ -248,33 +248,45 @@ static BOOL test_DatabaseSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
|
|||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
struct netr_DatabaseSync r;
|
struct netr_DatabaseSync r;
|
||||||
struct netr_CredentialState creds;
|
struct netr_CredentialState creds;
|
||||||
|
const uint32 database_ids[] = {0, 1, 2};
|
||||||
|
int i;
|
||||||
|
BOOL ret = True;
|
||||||
|
|
||||||
if (!test_SetupCredentials(p, mem_ctx, &creds)) {
|
if (!test_SetupCredentials(p, mem_ctx, &creds)) {
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
creds_client_authenticator(&creds, &r.in.credential);
|
|
||||||
ZERO_STRUCT(r.in.return_authenticator);
|
|
||||||
|
|
||||||
r.in.logonserver = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
|
r.in.logonserver = talloc_asprintf(mem_ctx, "\\\\%s", dcerpc_server_name(p));
|
||||||
r.in.computername = lp_netbios_name();
|
r.in.computername = lp_netbios_name();
|
||||||
r.in.database_id = 1;
|
|
||||||
r.in.sync_context = 0;
|
r.in.sync_context = 0;
|
||||||
r.in.preferredmaximumlength = (uint32)-1;
|
r.in.preferredmaximumlength = (uint32)-1;
|
||||||
|
ZERO_STRUCT(r.in.return_authenticator);
|
||||||
|
|
||||||
printf("Testing DatabaseSync\n");
|
for (i=0;i<ARRAY_SIZE(database_ids);i++) {
|
||||||
|
r.in.database_id = database_ids[i];
|
||||||
|
|
||||||
status = dcerpc_netr_DatabaseSync(p, mem_ctx, &r);
|
printf("Testing DatabaseSync of id %d\n", r.in.database_id);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
|
||||||
printf("DatabaseSync - %s\n", nt_errstr(status));
|
do {
|
||||||
return False;
|
creds_client_authenticator(&creds, &r.in.credential);
|
||||||
|
|
||||||
|
status = dcerpc_netr_DatabaseSync(p, mem_ctx, &r);
|
||||||
|
if (!NT_STATUS_IS_OK(status) &&
|
||||||
|
!NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
|
||||||
|
printf("DatabaseSync - %s\n", nt_errstr(status));
|
||||||
|
ret = False;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!creds_client_check(&creds, &r.out.return_authenticator.cred)) {
|
||||||
|
printf("Credential chaining failed\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
r.in.sync_context = r.out.sync_context;
|
||||||
|
} while (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!creds_client_check(&creds, &r.out.return_authenticator.cred)) {
|
return ret;
|
||||||
printf("Credential chaining failed\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
return True;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user