summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-27 17:57:20 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:30:16 -0500
commitc70a3f6706c9f7ec45ec805052687dd70eb89c6b (patch)
treefcd1355e57ce638e72795634a043433c479f0ce3
parent3c20e210de357e4f7b6dd54880110a56ae1d7eb0 (diff)
downloadsamba-c70a3f6706c9f7ec45ec805052687dd70eb89c6b.tar.gz
samba-c70a3f6706c9f7ec45ec805052687dd70eb89c6b.tar.bz2
samba-c70a3f6706c9f7ec45ec805052687dd70eb89c6b.zip
r20359: level -1 of DsGetDomainControllerInfo gives back a list
of all active connections to the Directory Service Agent (DSA) (This can be LDAP or DRSUAPI connections) abartlet: you had just luck by using flag(BIG_ENDIAN) as BIG_ENDIAN is defined in <endian.h>, it should be flag(NDR_BIG_ENDIAN)... metze (This used to be commit c7e639763de1f8ddccfb954227feeaddb7386edc)
-rw-r--r--source4/librpc/idl/drsuapi.idl29
-rw-r--r--source4/torture/rpc/drsuapi.c4
2 files changed, 23 insertions, 10 deletions
diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl
index 02cafb64c1..3df247a3ef 100644
--- a/source4/librpc/idl/drsuapi.idl
+++ b/source4/librpc/idl/drsuapi.idl
@@ -1064,31 +1064,44 @@ interface drsuapi
[size_is(count)] drsuapi_DsGetDCInfo2 *array;
} drsuapi_DsGetDCInfoCtr2;
+ /*
+ * this represents an active connection to the
+ * Directory System Agent (DSA)
+ * this can be via LDAP or DRSUAPI
+ */
typedef struct {
- [flag(BIG_ENDIAN)] ipv4address last_logon_ipv4_ip;
+ [flag(NDR_BIG_ENDIAN)] ipv4address client_ip_address;
uint32 unknown2;
- uint32 unknown3;
+ uint32 connection_time; /* in seconds */
uint32 unknown4;
uint32 unknown5;
uint32 unknown6;
- [charset(UTF16),string] uint16 *nt4_account;
- } drsuapi_DsGetDCInfo01;
+ /*
+ * client_account can be the following:
+ * "W2K3\Administrator"
+ * "Administrator@W2K3"
+ * "cn=Administrator,cn=Users,DC=w2k3,DC=vmnet1,DC=vm,DC=base"
+ * ""
+ * or NULL
+ */
+ [charset(UTF16),string] uint16 *client_account;
+ } drsuapi_DsGetDCConnection01;
typedef struct {
[range(0,10000)] uint32 count;
- [size_is(count)] drsuapi_DsGetDCInfo01 *array;
- } drsuapi_DsGetDCInfoCtr01;
+ [size_is(count)] drsuapi_DsGetDCConnection01 *array;
+ } drsuapi_DsGetDCConnectionCtr01;
typedef [v1_enum] enum {
DRSUAPI_DC_INFO_CTR_1 = 1,
DRSUAPI_DC_INFO_CTR_2 = 2,
- DRSUAPI_DC_INFO_CTR_01 = -1
+ DRSUAPI_DC_CONNECTION_CTR_01 = -1
} drsuapi_DsGetDCInfoCtrLevels;
typedef [switch_type(int32)] union {
[case(DRSUAPI_DC_INFO_CTR_1)] drsuapi_DsGetDCInfoCtr1 ctr1;
[case(DRSUAPI_DC_INFO_CTR_2)] drsuapi_DsGetDCInfoCtr2 ctr2;
- [case(DRSUAPI_DC_INFO_CTR_01)] drsuapi_DsGetDCInfoCtr01 ctr01;
+ [case(DRSUAPI_DC_CONNECTION_CTR_01)] drsuapi_DsGetDCConnectionCtr01 ctr01;
} drsuapi_DsGetDCInfoCtr;
WERROR drsuapi_DsGetDomainControllerInfo(
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index 3ce1d1053a..9a306e7392 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -200,8 +200,8 @@ static BOOL test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, TALLOC_CTX *me
const char *dc_account = talloc_asprintf(mem_ctx, "%s\\%s$",
torture_join_dom_netbios_name(priv->join),
priv->dcinfo.netbios_name);
- for (k=0; k < r.out.ctr.ctr1.count; k++) {
- if (strcasecmp_m(r.out.ctr.ctr01.array[k].nt4_account,
+ for (k=0; k < r.out.ctr.ctr01.count; k++) {
+ if (strcasecmp_m(r.out.ctr.ctr01.array[k].client_account,
dc_account)) {
found = True;
}