diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-04-13 03:43:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:31 -0500 |
commit | b6fd09d80504d55be98b167cd12b5507573d32db (patch) | |
tree | 3cc411dad0acc1fe3b32db1469c68d9b007bdd49 | |
parent | b3221032d23cfba45cb9007326725805a4d7bbab (diff) | |
download | samba-b6fd09d80504d55be98b167cd12b5507573d32db.tar.gz samba-b6fd09d80504d55be98b167cd12b5507573d32db.tar.bz2 samba-b6fd09d80504d55be98b167cd12b5507573d32db.zip |
r6320: some minor netlogon datagram fixes - NT4 can now join a Samba4 domain without
Samba3 nmbd
(This used to be commit 4507bdc339505e91118d403948946f4a98a4f562)
-rw-r--r-- | source4/libcli/dgram/mailslot.c | 4 | ||||
-rw-r--r-- | source4/libcli/dgram/netlogon.c | 7 | ||||
-rw-r--r-- | source4/librpc/idl/nbt.idl | 3 | ||||
-rw-r--r-- | source4/nbt_server/dgram/netlogon.c | 1 |
4 files changed, 10 insertions, 5 deletions
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c index 1035853240..ca9a66a729 100644 --- a/source4/libcli/dgram/mailslot.c +++ b/source4/libcli/dgram/mailslot.c @@ -159,7 +159,7 @@ NTSTATUS dgram_mailslot_send(struct nbt_dgram_socket *dgmsock, ZERO_STRUCT(packet); packet.msg_type = msg_type; - packet.flags = DGRAM_FLAG_FIRST; + packet.flags = DGRAM_FLAG_FIRST | DGRAM_NODE_NBDD; packet.dgram_id = generate_random() % UINT16_MAX; packet.source = socket_get_my_addr(dgmsock->sock, tmp_ctx); packet.src_port = socket_get_my_port(dgmsock->sock); @@ -179,7 +179,7 @@ NTSTATUS dgram_mailslot_send(struct nbt_dgram_socket *dgmsock, trans = &smb->body.trans; trans->total_data_count = request->length; - trans->timeout = (uint32_t)-1; + trans->timeout = 1000; trans->data_count = request->length; trans->data_offset = 70 + strlen(mailslot_name); trans->opcode = 1; /* write mail slot */ diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c index 138cc0d484..a030ca73c2 100644 --- a/source4/libcli/dgram/netlogon.c +++ b/source4/libcli/dgram/netlogon.c @@ -70,6 +70,7 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock, NTSTATUS status; DATA_BLOB blob; TALLOC_CTX *tmp_ctx = talloc_new(dgmsock); + struct nbt_name myname; status = ndr_push_struct_blob(&blob, tmp_ctx, reply, (ndr_push_flags_fn_t)ndr_push_nbt_netlogon_packet); @@ -78,11 +79,15 @@ NTSTATUS dgram_mailslot_netlogon_reply(struct nbt_dgram_socket *dgmsock, return status; } + myname.name = lp_netbios_name(); + myname.type = NBT_NAME_CLIENT; + myname.scope = NULL; + status = dgram_mailslot_send(dgmsock, DGRAM_DIRECT_UNIQUE, mailslot_name, &request->data.msg.source_name, request->source, request->src_port, - &request->data.msg.dest_name, &blob); + &myname, &blob); talloc_free(tmp_ctx); return status; } diff --git a/source4/librpc/idl/nbt.idl b/source4/librpc/idl/nbt.idl index 5876eb77ca..c03f30333e 100644 --- a/source4/librpc/idl/nbt.idl +++ b/source4/librpc/idl/nbt.idl @@ -327,7 +327,7 @@ /* \MAILSLOT\NET\NETLOGON mailslot requests */ - typedef [enum8bit] enum { + typedef enum { NETLOGON_QUERY_FOR_PDC = 0x7, NETLOGON_ANNOUNCE_UAS = 0xa, NETLOGON_RESPONSE_FROM_PDC = 0xc @@ -391,7 +391,6 @@ typedef [flag(NDR_NOALIGN),public] struct { nbt_netlogon_command command; - [value(0)] uint8 pad; [switch_is(command)] nbt_netlogon_request req; } nbt_netlogon_packet; } diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c index e013742f0a..91da11299a 100644 --- a/source4/nbt_server/dgram/netlogon.c +++ b/source4/nbt_server/dgram/netlogon.c @@ -44,6 +44,7 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot, } /* setup a GETDC reply */ + ZERO_STRUCT(reply); reply.command = NETLOGON_RESPONSE_FROM_PDC; pdc = &reply.req.response; |