The branch, master has been updated
       via  cc93469 lib: Fix CID 1128553 Unchecked return value from library
       via  0db470d lib: Fix CID 1325733 Uninitialized scalar variable
       via  70dbba9 s3:ctdbd_conn: make sure we destroy tevent_fd before 
closing the socket
      from  97bb100 lib: Pass sockname and timeout to ctdbd_probe()

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit cc93469a047ef92036c3e0eed24933d3e2c1b353
Author: Volker Lendecke <[email protected]>
Date:   Tue Oct 6 09:57:59 2015 +0200

    lib: Fix CID 1128553 Unchecked return value from library
    
    At the same time, avoid chmod in favor of fchmod
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>
    
    Autobuild-User(master): Stefan Metzmacher <[email protected]>
    Autobuild-Date(master): Tue Oct  6 13:12:48 CEST 2015 on sn-devel-104

commit 0db470df9172bb855409f4ba51dfc95e87e90c55
Author: Volker Lendecke <[email protected]>
Date:   Tue Oct 6 09:54:19 2015 +0200

    lib: Fix CID 1325733 Uninitialized scalar variable
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Stefan Metzmacher <[email protected]>

commit 70dbba96e311449575f571db68710584fc991234
Author: Stefan Metzmacher <[email protected]>
Date:   Mon Oct 5 15:57:42 2015 +0200

    s3:ctdbd_conn: make sure we destroy tevent_fd before closing the socket
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11316
    
    Signed-off-by: Stefan Metzmacher <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Günther Deschner <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/ctdbd_conn.c         |  7 ++++++-
 source3/lib/dbwrap/dbwrap_ctdb.c | 18 +++++++++++++-----
 2 files changed, 19 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c
index da2c3a9..c743356 100644
--- a/source3/lib/ctdbd_conn.c
+++ b/source3/lib/ctdbd_conn.c
@@ -405,7 +405,11 @@ static int ctdb_read_req(struct ctdbd_connection *conn, 
uint32_t reqid,
 
 static int ctdbd_connection_destructor(struct ctdbd_connection *c)
 {
-       close(c->fd);
+       TALLOC_FREE(c->fde);
+       if (c->fd != -1) {
+               close(c->fd);
+               c->fd = -1;
+       }
        return 0;
 }
 /*
@@ -690,6 +694,7 @@ static NTSTATUS ctdbd_control(struct ctdbd_connection *conn,
 
        if (hdr->operation != CTDB_REPLY_CONTROL) {
                DEBUG(0, ("received invalid reply\n"));
+               status = NT_STATUS_INVALID_NETWORK_RESPONSE;
                goto fail;
        }
        reply = (struct ctdb_reply_control *)hdr;
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 9852bc7..9402bdd 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1597,11 +1597,6 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
        tdb_flags &= TDB_SEQNUM|TDB_VOLATILE|
                TDB_MUTEX_LOCKING|TDB_CLEAR_IF_FIRST;
 
-       /* honor permissions if user has specified O_CREAT */
-       if (open_flags & O_CREAT) {
-               chmod(db_path, mode);
-       }
-
        prio.db_id = db_ctdb->db_id;
        prio.priority = lock_order;
 
@@ -1653,6 +1648,19 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
        }
        talloc_free(db_path);
 
+       /* honor permissions if user has specified O_CREAT */
+       if (open_flags & O_CREAT) {
+               int fd, ret;
+               fd = tdb_fd(db_ctdb->wtdb->tdb);
+               ret = fchmod(fd, mode);
+               if (ret == -1) {
+                       DBG_WARNING("%s: fchmod failed: %s\n", __func__,
+                                   strerror(errno));
+                       TALLOC_FREE(result);
+                       return NULL;
+               }
+       }
+
        if (result->persistent) {
                db_ctdb->lock_ctx = g_lock_ctx_init(db_ctdb,
                                                    ctdb_conn_msg_ctx(conn));


-- 
Samba Shared Repository

Reply via email to