[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Apr 25 21:08:03 UTC 2017
The branch, master has been updated
via 04b2a18 lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)
via f5c3904 lib/util: fix a Coverity finding in tfork
from a9fc25f s3-libgpo: Fix the build of the group policy CSEs
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 04b2a18a1166872d8bb74e1d3e04376ebbecf6b9
Author: Volker Lendecke <vl at samba.org>
Date: Tue Apr 25 17:32:43 2017 +0200
lib: Fix CID 1405493 Error handling issues (CHECKED_RETURN)
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Apr 25 23:07:25 CEST 2017 on sn-devel-144
commit f5c3904f356c6f98e464a908ad2b76e44b9e2023
Author: Ralph Boehme <slow at samba.org>
Date: Tue Apr 25 17:47:57 2017 +0200
lib/util: fix a Coverity finding in tfork
If dup2() fails, fd is -1 and is later used in sys_write().
Signed-off-by: Ralph Boehme <slow at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
lib/util/tfork.c | 23 ++++++++++++++++++-----
source3/lib/ctdbd_conn.c | 7 ++++++-
2 files changed, 24 insertions(+), 6 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/tfork.c b/lib/util/tfork.c
index 27b6cc0..37c00e6 100644
--- a/lib/util/tfork.c
+++ b/lib/util/tfork.c
@@ -131,11 +131,24 @@ static pid_t level2_fork_and_wait(int child_ready_fd)
* We're going to stay around until child3 exits, so lets close all fds
* other then the pipe fd we may have inherited from the caller.
*/
- fd = dup2(tfork_global->status_pipe[1], 0);
- if (fd == -1) {
- status = errno;
- kill(tfork_global->level3_pid, SIGKILL);
- wait = false;
+ while (true) {
+ fd = dup2(tfork_global->status_pipe[1], 0);
+ if (fd == -1) {
+ if (errno == EINTR) {
+ continue;
+ }
+ status = errno;
+
+ kill(tfork_global->level3_pid, SIGKILL);
+
+ written = sys_write(tfork_global->status_pipe[1],
+ &status, sizeof(status));
+ if (written != sizeof(status)) {
+ abort();
+ }
+ _exit(0);
+ }
+ break;
}
closefrom(1);
diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index c629d3c..053d1b5 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -440,7 +440,12 @@ static int ctdb_read_req(struct ctdbd_connection *conn, uint32_t reqid,
**/
int ctdbd_setup_fde(struct ctdbd_connection *conn, struct tevent_context *ev)
{
- set_blocking(conn->fd, false);
+ int ret;
+
+ ret = set_blocking(conn->fd, false);
+ if (ret == -1) {
+ return errno;
+ }
conn->fde = tevent_add_fd(ev,
conn,
--
Samba Shared Repository
More information about the samba-cvs
mailing list