summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-04-07 15:12:51 -0700
committerRalph Boehme <slow@samba.org>2017-04-08 12:30:08 +0200
commit513eb8b8d397a9d6a5b7f029590b2e7dc0c1b743 (patch)
treeb6e249764b61bd6eb5ae5810c35c6f9a3d00c06e /source4/smbd
parentc97714319bdd0c3d54fb3ba64798c3aa674bb60b (diff)
downloadsamba-513eb8b8d397a9d6a5b7f029590b2e7dc0c1b743.tar.gz
s4: process_standard: Add return checking for tevent_add_fd() to standard_accept_connection() and standard_new_task().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/process_standard.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index 766b99617d0..39edbfb8f43 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -212,6 +212,7 @@ static void standard_accept_connection(struct tevent_context *ev,
pid_t pid;
struct socket_address *c, *s;
struct standard_child_state *state;
+ struct tevent_fd *fde = NULL;
state = setup_standard_child_pipe(ev, NULL);
if (state == NULL) {
@@ -278,8 +279,12 @@ static void standard_accept_connection(struct tevent_context *ev,
smb_panic("Failed to re-initialise imessaging after fork");
}
- tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
+ fde = tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
standard_pipe_handler, NULL);
+ if (fde == NULL) {
+ smb_panic("Failed to add fd handler after fork");
+ }
+
if (child_pipe[1] != -1) {
close(child_pipe[1]);
child_pipe[1] = -1;
@@ -319,6 +324,7 @@ static void standard_new_task(struct tevent_context *ev,
pid_t pid;
NTSTATUS status;
struct standard_child_state *state;
+ struct tevent_fd *fde = NULL;
state = setup_standard_child_pipe(ev, service_name);
if (state == NULL) {
@@ -361,8 +367,11 @@ static void standard_new_task(struct tevent_context *ev,
smb_panic("Failed to re-initialise imessaging after fork");
}
- tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
+ fde = tevent_add_fd(ev, ev, child_pipe[0], TEVENT_FD_READ,
standard_pipe_handler, NULL);
+ if (fde == NULL) {
+ smb_panic("Failed to add fd handler after fork");
+ }
if (child_pipe[1] != -1) {
close(child_pipe[1]);
child_pipe[1] = -1;