diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-30 10:41:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:23 -0500 |
commit | 37449657a8d335097b3f3559f8b5bf084b50b85a (patch) | |
tree | 4801ffe9f50f78d205fbb299d583ff07a15b4934 /source4 | |
parent | c7ded5ab0accc54a28df4d43cb923e6c808ff347 (diff) | |
download | samba-37449657a8d335097b3f3559f8b5bf084b50b85a.tar.gz samba-37449657a8d335097b3f3559f8b5bf084b50b85a.tar.bz2 samba-37449657a8d335097b3f3559f8b5bf084b50b85a.zip |
r5109: - fixed handling of zero-length subcontexts in the ndr library
- added error checking on socket startup in nbtd
(This used to be commit 5707ebc9ecdce5c195a2788ab1e4214788a086ea)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/ndr/ndr.c | 3 | ||||
-rw-r--r-- | source4/nbt_server/nbt_server.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c index 032c743bef..f76bb7c48c 100644 --- a/source4/librpc/ndr/ndr.c +++ b/source4/librpc/ndr/ndr.c @@ -441,7 +441,6 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *ndr, switch (sub_size) { case 0: { uint32_t size = ndr->data_size - ndr->offset; - if (size == 0) return NT_STATUS_OK; NDR_CHECK(ndr_pull_subcontext(ndr, ndr2, size)); break; } @@ -449,7 +448,6 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *ndr, case 2: { uint16_t size; NDR_CHECK(ndr_pull_uint16(ndr, &size)); - if (size == 0) return NT_STATUS_OK; NDR_CHECK(ndr_pull_subcontext(ndr, ndr2, size)); break; } @@ -457,7 +455,6 @@ static NTSTATUS ndr_pull_subcontext_header(struct ndr_pull *ndr, case 4: { uint32_t size; NDR_CHECK(ndr_pull_uint32(ndr, &size)); - if (size == 0) return NT_STATUS_OK; NDR_CHECK(ndr_pull_subcontext(ndr, ndr2, size)); break; } diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c index 19dabdfa51..d05a31e421 100644 --- a/source4/nbt_server/nbt_server.c +++ b/source4/nbt_server/nbt_server.c @@ -49,6 +49,7 @@ static void nbtd_task_init(struct task_server *task) { struct nbt_server *nbtsrv; struct nbt_interface *iface; + NTSTATUS status; nbtsrv = talloc(task, struct nbt_server); if (nbtsrv == NULL) { @@ -59,8 +60,14 @@ static void nbtd_task_init(struct task_server *task) nbtsrv->task = task; nbtsrv->interfaces = NULL; - nbt_startup_interfaces(nbtsrv); + /* start listening on the configured network interfaces */ + status = nbt_startup_interfaces(nbtsrv); + if (!NT_STATUS_IS_OK(status)) { + task_terminate(task, "nbtd failed to setup interfaces"); + return; + } + /* setup the incoming request handler for all our interfaces */ for (iface=nbtsrv->interfaces;iface;iface=iface->next) { nbt_set_incoming_handler(iface->nbtsock, nbt_request_handler, iface); } |