The branch, master has been updated
       via  0b04258 winbind: Remove an unused struct declaration
       via  27e6e45 dbwrap: Remove dependency on samba-hostconfig
       via  1aeac2f dbwrap: Remove calls to loadparm
       via  812312c libcli: Call dbwrap_local_open with the correct tdb flags
       via  807cb59 libcli: Call dbwrap_local_open with the correct hash size
       via  91bb8b8 dbwrap3: Call dbwrap_local_open with the correct tdb flags
       via  247563e dbwrap3: Call dbwrap_local_open with the correct hash size
       via  f542552 cluster4: Call dbwrap_local_open with the correct tdb_flags
       via  281822a cluster4: Call dbwrap_local_open with the correct hash size
       via  7f09fd2 credentials: Call dbwrap_local_open with the correct 
tdb_flags
       via  7e183a2 credentials: Call dbwrap_local_open with the correct hash 
size
       via  ca6efa9 libcli: Call dbwrap_local_open with the correct tdb_flags
       via  f092ee2 libcli: Call dbwrap_local_open with the correct hash size
      from  b5a34e6 s3:vfs_aio_pthread: make use of pthreadpool_tevent instead 
of pthreadpool_pipe

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


- Log -----------------------------------------------------------------
commit 0b042589819caa364a4f8518931b5b7a3b22f708
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Apr 19 06:30:42 2018 +0200

    winbind: Remove an unused struct declaration
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Tue Apr 24 04:44:30 CEST 2018 on sn-devel-144

commit 27e6e45164b1eda8b96701b609a09bda631db6e7
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:46:00 2018 +0200

    dbwrap: Remove dependency on samba-hostconfig
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 1aeac2f85db045d565e30d8b94334366e39222e9
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:45:45 2018 +0200

    dbwrap: Remove calls to loadparm
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 812312ca170e9da876044846a35b28ea3ce30de6
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:39:46 2018 +0200

    libcli: Call dbwrap_local_open with the correct tdb flags
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 807cb593ec00d07a5a0328db516960add2ba0336
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:38:27 2018 +0200

    libcli: Call dbwrap_local_open with the correct hash size
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 91bb8b8ec6389f69608b6e2dcd09aca407ef05d2
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:32:20 2018 +0200

    dbwrap3: Call dbwrap_local_open with the correct tdb flags
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 247563e10b22797f4a8110861a9e7623971e4b81
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:31:28 2018 +0200

    dbwrap3: Call dbwrap_local_open with the correct hash size
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit f542552e1d104fa7cc738401c8b224e06ebb478a
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:26:27 2018 +0200

    cluster4: Call dbwrap_local_open with the correct tdb_flags
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 281822ac8e5ea3a23257d60f5bd9611e63faff0e
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:25:19 2018 +0200

    cluster4: Call dbwrap_local_open with the correct hash size
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7f09fd2b4c07fcf0e0d132d1fb487f1c1e040ad4
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:23:03 2018 +0200

    credentials: Call dbwrap_local_open with the correct tdb_flags
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7e183a22a7995db09c9bed561ab0de71dbdfdbcb
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:22:08 2018 +0200

    credentials: Call dbwrap_local_open with the correct hash size
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit ca6efa96f769a2106f754e332c347ee41d3fc447
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:20:02 2018 +0200

    libcli: Call dbwrap_local_open with the correct tdb_flags
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit f092ee2a5f02637f9ed55253a83d4132e0e4831d
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Apr 17 16:18:50 2018 +0200

    libcli: Call dbwrap_local_open with the correct hash size
    
    Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

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

Summary of changes:
 auth/credentials/credentials_secrets.c | 17 +++++++++++++----
 lib/dbwrap/dbwrap.h                    |  2 --
 lib/dbwrap/dbwrap_local_open.c         | 19 +++++++++----------
 lib/dbwrap/wscript_build               |  2 +-
 libcli/auth/netlogon_creds_cli.c       | 21 +++++++++++++++------
 libcli/auth/schannel_state_tdb.c       | 17 +++++++++++++----
 source3/lib/dbwrap/dbwrap_open.c       | 18 +++++++++++++++---
 source3/winbindd/winbindd.h            |  8 --------
 source4/cluster/local.c                | 16 ++++++++++++++--
 9 files changed, 80 insertions(+), 40 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/credentials_secrets.c 
b/auth/credentials/credentials_secrets.c
index 8d2a3b7..54f3ce2 100644
--- a/auth/credentials/credentials_secrets.c
+++ b/auth/credentials/credentials_secrets.c
@@ -238,16 +238,25 @@ _PUBLIC_ NTSTATUS 
cli_credentials_set_machine_account(struct cli_credentials *cr
 {
        struct db_context *db_ctx;
        char *secrets_tdb_path;
+       int hash_size, tdb_flags;
 
        secrets_tdb_path = lpcfg_private_db_path(cred, lp_ctx, "secrets");
        if (secrets_tdb_path == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       db_ctx = dbwrap_local_open(cred, lp_ctx, secrets_tdb_path, 0,
-                                  TDB_DEFAULT, O_RDWR, 0600,
-                                  DBWRAP_LOCK_ORDER_1,
-                                  DBWRAP_FLAG_NONE);
+       hash_size = lpcfg_tdb_hash_size(lp_ctx, secrets_tdb_path);
+       tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT);
+
+       db_ctx = dbwrap_local_open(
+               cred,
+               secrets_tdb_path,
+               hash_size,
+               tdb_flags,
+               O_RDWR,
+               0600,
+               DBWRAP_LOCK_ORDER_1,
+               DBWRAP_FLAG_NONE);
        TALLOC_FREE(secrets_tdb_path);
 
        /*
diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h
index 1161bf0..6a0f7b1 100644
--- a/lib/dbwrap/dbwrap.h
+++ b/lib/dbwrap/dbwrap.h
@@ -25,7 +25,6 @@
 #include <tevent.h>
 #include "libcli/util/ntstatus.h"
 #include "tdb.h"
-#include "lib/param/loadparm.h"
 
 struct db_record;
 struct db_context;
@@ -231,7 +230,6 @@ TDB_DATA dbwrap_merge_dbufs(TALLOC_CTX *mem_ctx,
  * This opens a tdb file
  */
 struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
-                                    struct loadparm_context *lp_ctx,
                                     const char *name,
                                     int hash_size, int tdb_flags,
                                     int open_flags, mode_t mode,
diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c
index c350fd3e..20c5fa0 100644
--- a/lib/dbwrap/dbwrap_local_open.c
+++ b/lib/dbwrap/dbwrap_local_open.c
@@ -22,10 +22,8 @@
 #include "dbwrap/dbwrap.h"
 #include "dbwrap/dbwrap_tdb.h"
 #include "tdb.h"
-#include "lib/param/param.h"
 
 struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
-                                    struct loadparm_context *lp_ctx,
                                     const char *name,
                                     int hash_size, int tdb_flags,
                                     int open_flags, mode_t mode,
@@ -34,14 +32,15 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
 {
        struct db_context *db = NULL;
 
-       if (hash_size == 0) {
-               hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
-       }
-
-       db = db_open_tdb(mem_ctx, name, hash_size,
-                        lpcfg_tdb_flags(lp_ctx, tdb_flags),
-                        open_flags, mode,
-                        lock_order, dbwrap_flags);
+       db = db_open_tdb(
+               mem_ctx,
+               name,
+               hash_size,
+               tdb_flags,
+               open_flags,
+               mode,
+               lock_order,
+               dbwrap_flags);
 
        return db;
 }
diff --git a/lib/dbwrap/wscript_build b/lib/dbwrap/wscript_build
index e6e9d5e..0e5f961 100644
--- a/lib/dbwrap/wscript_build
+++ b/lib/dbwrap/wscript_build
@@ -1,6 +1,6 @@
 SRC = '''dbwrap.c dbwrap_util.c dbwrap_rbt.c dbwrap_tdb.c
          dbwrap_local_open.c'''
-DEPS= '''samba-util util_tdb samba-errors tdb tdb-wrap samba-hostconfig tevent 
tevent-util'''
+DEPS= '''samba-util util_tdb samba-errors tdb tdb-wrap tevent tevent-util'''
 
 bld.SAMBA_LIBRARY('dbwrap',
                   source=SRC,
diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c
index fdd1195..817d2cd 100644
--- a/libcli/auth/netlogon_creds_cli.c
+++ b/libcli/auth/netlogon_creds_cli.c
@@ -215,6 +215,7 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct 
loadparm_context *lp_ctx)
 {
        char *fname;
        struct db_context *global_db;
+       int hash_size, tdb_flags;
 
        if (netlogon_creds_cli_global_db != NULL) {
                return NT_STATUS_OK;
@@ -225,12 +226,20 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct 
loadparm_context *lp_ctx)
                return NT_STATUS_NO_MEMORY;
        }
 
-       global_db = dbwrap_local_open(NULL, lp_ctx,
-                                     fname, 0,
-                                     TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
-                                     O_RDWR|O_CREAT,
-                                     0600, DBWRAP_LOCK_ORDER_2,
-                                     DBWRAP_FLAG_NONE);
+       hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
+       tdb_flags = lpcfg_tdb_flags(
+               lp_ctx,
+               TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH);
+
+       global_db = dbwrap_local_open(
+               NULL,
+               fname,
+               hash_size,
+               tdb_flags,
+               O_RDWR|O_CREAT,
+               0600,
+               DBWRAP_LOCK_ORDER_2,
+               DBWRAP_FLAG_NONE);
        if (global_db == NULL) {
                DEBUG(0,("netlogon_creds_cli_open_global_db: Failed to open %s 
- %s\n",
                         fname, strerror(errno)));
diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c
index 6a19823..ce20012 100644
--- a/libcli/auth/schannel_state_tdb.c
+++ b/libcli/auth/schannel_state_tdb.c
@@ -42,15 +42,24 @@ struct db_context *open_schannel_session_store(TALLOC_CTX 
*mem_ctx,
 {
        struct db_context *db_sc = NULL;
        char *fname = lpcfg_private_db_path(mem_ctx, lp_ctx, "schannel_store");
+       int hash_size, tdb_flags;
 
        if (!fname) {
                return NULL;
        }
 
-       db_sc = dbwrap_local_open(mem_ctx, lp_ctx, fname, 0,
-                                 TDB_CLEAR_IF_FIRST|TDB_NOSYNC, O_RDWR|O_CREAT,
-                                 0600, DBWRAP_LOCK_ORDER_NONE,
-                                 DBWRAP_FLAG_NONE);
+       hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
+       tdb_flags = lpcfg_tdb_flags(lp_ctx, TDB_CLEAR_IF_FIRST|TDB_NOSYNC);
+
+       db_sc = dbwrap_local_open(
+               mem_ctx,
+               fname,
+               hash_size,
+               tdb_flags,
+               O_RDWR|O_CREAT,
+               0600,
+               DBWRAP_LOCK_ORDER_NONE,
+               DBWRAP_FLAG_NONE);
 
        if (!db_sc) {
                DEBUG(0,("open_schannel_session_store: Failed to open %s - 
%s\n",
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 658ccb6..a4d5184 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -182,9 +182,21 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 
        if (result == NULL) {
                struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, 
loadparm_s3_helpers());
-               result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
-                                          tdb_flags, open_flags, mode,
-                                          lock_order, dbwrap_flags);
+
+               if (hash_size == 0) {
+                       hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
+               }
+               tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);
+
+               result = dbwrap_local_open(
+                       mem_ctx,
+                       name,
+                       hash_size,
+                       tdb_flags,
+                       open_flags,
+                       mode,
+                       lock_order,
+                       dbwrap_flags);
                talloc_unlink(mem_ctx, lp_ctx);
        }
        return result;
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index f496c41..5737176 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -43,14 +43,6 @@
 
 #define WB_REPLACE_CHAR                '_'
 
-struct sid_ctr {
-       struct dom_sid *sid;
-       bool finished;
-       const char *domain;
-       const char *name;
-       enum lsa_SidType type;
-};
-
 struct winbindd_cli_state {
        struct winbindd_cli_state *prev, *next;   /* Linked list pointers */
        int sock;                                 /* Open socket from client */
diff --git a/source4/cluster/local.c b/source4/cluster/local.c
index 5ef58c9..ea36663 100644
--- a/source4/cluster/local.c
+++ b/source4/cluster/local.c
@@ -55,12 +55,24 @@ static struct db_context *local_db_tmp_open(struct 
cluster_ops *ops,
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
        char *path, *dbname;
        struct db_context *db;
+       int hash_size, tdb_flags;
 
        dbname = talloc_asprintf(mem_ctx, "%s.tdb", dbbase);
 
        path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
-       db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
-                              0600, DBWRAP_LOCK_ORDER_NONE, DBWRAP_FLAG_NONE);
+
+       hash_size = lpcfg_tdb_hash_size(lp_ctx, path);
+       tdb_flags = lpcfg_tdb_flags(lp_ctx, flags);
+
+       db = dbwrap_local_open(
+               mem_ctx,
+               path,
+               hash_size,
+               tdb_flags,
+               O_RDWR|O_CREAT,
+               0600,
+               DBWRAP_LOCK_ORDER_NONE,
+               DBWRAP_FLAG_NONE);
        talloc_free(tmp_ctx);
        return db;
 }


-- 
Samba Shared Repository

Reply via email to