]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_server: Check return code of set_blocking()
authorAndreas Schneider <asn@samba.org>
Wed, 10 Jun 2020 15:38:36 +0000 (17:38 +0200)
committerIsaac Boukris <iboukris@sn-devel-184>
Tue, 16 Jun 2020 09:08:34 +0000 (09:08 +0000)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
source3/rpc_server/rpc_server.c

index 4037c81cfc8cb3154c69fd20473568a38cf3cfcb..9e57bc345595ce77c6834fe8660de9819865b43d 100644 (file)
@@ -382,7 +382,11 @@ NTSTATUS dcesrv_setup_ncacn_ip_tcp_socket(struct tevent_context *ev_ctx,
        set_socket_options(state->fd, lp_socket_options());
 
        /* Set server socket to non-blocking for the accept. */
-       set_blocking(state->fd, false);
+       rc = set_blocking(state->fd, false);
+       if (rc < 0) {
+               status = map_nt_error_from_unix_common(errno);
+               goto out;
+       }
 
        rc = listen(state->fd, SMBD_LISTEN_BACKLOG);
        if (rc == -1) {
@@ -612,7 +616,11 @@ NTSTATUS dcesrv_setup_ncalrpc_socket(struct tevent_context *ev_ctx,
        }
 
        /* Set server socket to non-blocking for the accept. */
-       set_blocking(state->fd, false);
+       rc = set_blocking(state->fd, false);
+       if (rc < 0) {
+               status = map_nt_error_from_unix_common(errno);
+               goto out;
+       }
 
        errno = 0;
        fde = tevent_add_fd(state->ev_ctx,