[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri May 10 02:27:04 UTC 2019


The branch, master has been updated
       via  5733f678c8e s3/rpcclient: Fix bad (and illegal) func cast
       via  09c4611b01b s3/registry: fix various 'cast between incompatible function' warnings
       via  61dd7d6f06e s3/registry: Fix incompatible func casts
       via  658128e2b9a s3/registry: Fix func cast error (diff in params size_t vs uint32)
       via  3d0f9491131 s4/lib/policy/gp_ldap: use ldb API to find messages
       via  93d6307185d dsdb mod/linked_attributes: fix_link_slow(): clarify a comment.
       via  9c254572dd4 dsdb/mod/extended_dn_out: use faster removal filters
       via  06a02cb88c8 ldb_msg: remove_element() checks element array bounds
       via  652a4015e6b ldb_kv: use ldb_msg_remove_element()
       via  85b6674aebd ldb/tools/ldbtest: initialise msg object
       via  ce2bf5c72b6 ldb_ldap: use ldb_msg API to add elements
       via  2a144ea70ed ldb_ldap: trust db_msg_new() to return empty message
       via  4e47d5dfa25 dsdb/replmd: use ldb_msg_remove_element()
       via  14db3072433 dsdb mods/extended_dn_out: remove element using ldb_msg api
       via  1e61b17106c dsdb/mod/extended_dn_out: zero whole fake_msg struct
       via  4624957d42f s4: use ldb_msg_new(), not talloc/talloc_zero
       via  8f081b7f78b ldb: use ldb_msg_new(), not talloc/talloc_zero
       via  18966b6eeea kdb_kv_search: spell 'linearized'
       via  49048b245df dsdb/util: spell "equivalence"!
       via  985a4b78710 ldb.h: spelling of 'means'
       via  c2e882b25f3 ldb.h: improve comment for LDB_ATTR_FLAG_INDEXED
       via  79629b42cde s4/policy/gp_filesys: avoid SIZE_MAX smbcli write (CID 1034779)
       via  597709aac99 s4/messaging: do not deref NULL state (CID 1437973)
       via  a82f924179e s4/ldap_bind: notice backend init failure
       via  858e9eee558 read_smb_length: Use correct function name in debug message
       via  2f0c49e654a gitlab-ci: Install libtasn1-tools on Fedora based distributions
      from  667db8e8c78 s3: SMB1: Don't allow recvfile on stream fsp's.

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


- Log -----------------------------------------------------------------
commit 5733f678c8ef364f52ca6a144097ae2af275b0ec
Author: Noel Power <noel.power at suse.com>
Date:   Fri May 3 11:51:47 2019 +0100

    s3/rpcclient: Fix bad (and illegal) func cast
    
    ../../source3/rpcclient/cmd_samr.c: In function ‘cmd_samr_get_usrdom_pwinfo’:
    ../../librpc/ndr/libndr.h:219:76: error: cast between incompatible function types from ‘void (*)(struct ndr_print *, const char *, uint32_t)’ {aka ‘void (*)(struct ndr_print *, const char *, unsigned int)’} to ‘void (*)(struct ndr_print *, const char *, const void *)’ [-Werror=cast-function-type]
     #define NDR_PRINT_STRUCT_STRING(ctx, type, p) ndr_print_struct_string(ctx, (ndr_print_fn_t)ndr_print_ ##type, #p, p)
                                                                                ^
    ../../source3/rpcclient/cmd_samr.c:2646:4: note: in expansion of macro ‘NDR_PRINT_STRUCT_STRING’
        NDR_PRINT_STRUCT_STRING(mem_ctx,
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri May 10 02:26:02 UTC 2019 on sn-devel-184

commit 09c4611b01bb7716b81ab8a594f6dcbe66cda1db
Author: Noel Power <noel.power at suse.com>
Date:   Fri May 3 12:53:27 2019 +0100

    s3/registry: fix various 'cast between incompatible function' warnings
    
    [3395/3524] Compiling source3/registry/reg_import.c
    ../../source3/registry/reg_import.c: In function ‘reg_import_adapter’:
    ../../source3/registry/reg_import.c:237:16: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘WERROR (*)(void *, void *, const char *, void **)’ {aka ‘struct <anonymous> (*)(void *, void *, const char *, void **)’} [-Werror=cast-function-type]
       cb.openkey = (reg_import_callback_openkey_t)&nop;
                    ^
    ../../source3/registry/reg_import.c:240:17: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘WERROR (*)(void *, void *)’ {aka ‘struct <anonymous> (*)(void *, void *)’} [-Werror=cast-function-type]
       cb.closekey = (reg_import_callback_closekey_t)&nop;
                     ^
    ../../source3/registry/reg_import.c:243:18: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘WERROR (*)(void *, void *, const char *, void **, _Bool *)’ {aka ‘struct <anonymous> (*)(void *, void *, const char *, void **, _Bool *)’} [-Werror=cast-function-type]
       cb.createkey = (reg_import_callback_createkey_t)&nop;
                      ^
    ../../source3/registry/reg_import.c:246:18: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘WERROR (*)(void *, void *, const char *)’ {aka ‘struct <anonymous> (*)(void *, void *, const char *)’} [-Werror=cast-function-type]
       cb.deletekey = (reg_import_callback_deletekey_t)&nop;
                      ^
    ../../source3/registry/reg_import.c:249:18: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘WERROR (*)(void *, void *, const char *)’ {aka ‘struct <anonymous> (*)(void *, void *, const char *)’} [-Werror=cast-function-type]
       cb.deleteval = (reg_import_callback_deleteval_t)&nop;
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 61dd7d6f06e45a101a304bf4a11aab624e5d744c
Author: Noel Power <noel.power at suse.com>
Date:   Fri May 3 12:06:45 2019 +0100

    s3/registry: Fix incompatible func casts
    
    [3425/3524] Compiling source3/registry/reg_parse.c
    ../../source3/registry/reg_parse.c: In function ‘reg_parse_new’:
    ../../source3/registry/reg_parse.c:223:12: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char **, size_t,  _Bool)’ {aka ‘int (*)(void *, const char **, long unsigned int,  _Bool)’} [-Werror=cast-function-type]
       cb.key = (reg_parse_callback_key_t)&nop;
                ^
    ../../source3/registry/reg_parse.c:226:12: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char *, uint32_t,  const uint8_t *, uint32_t)’ {aka ‘int (*)(void *, const char *, unsigned int,  const unsigned char *, unsigned int)’} [-Werror=cast-function-type]
       cb.val = (reg_parse_callback_val_t)&nop;
                ^
    ../../source3/registry/reg_parse.c:229:16: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char *)’ [-Werror=cast-function-type]
       cb.val_del = (reg_parse_callback_val_del_t)&nop;
                    ^
    ../../source3/registry/reg_parse.c:232:16: error: cast between incompatible function types from ‘int (*)(void *)’ to ‘int (*)(void *, const char *)’ [-Werror=cast-function-type]
       cb.comment = (reg_parse_callback_comment_t)&nop;
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 658128e2b9acaf859b4533b300c84d28267b1de8
Author: Noel Power <noel.power at suse.com>
Date:   Fri May 3 12:21:07 2019 +0100

    s3/registry: Fix func cast error (diff in params size_t vs uint32)
    
    reg_parse_callback_key_t alread has size_t for number of elemens in key
    but
    reg_parse_callback_val_t uses uint32_t for length of value data.
    
    Many internal function seem to take size_t as data len (see reg_format_value
    etc.) It seems changing the signature of the callback aligns it more closely
    with the existing api.
    
    ../../source3/registry/reg_format.c:438:10: error: cast between incompatible function types from ‘int (*)(reg_format *, const char *, uint32_t,  const uint8_t *, size_t)’ {aka ‘int (*)(struct reg_format *, const char *, unsigned int,  const unsigned char *, long unsigned int)’} to ‘int (*)(void *, const char *, uint32_t,  const uint8_t *, uint32_t)’ {aka ‘int (*)(void *, const char *, unsigned int,  const unsigned char *, unsigned int)’} [-Werror=cast-function-type]
       .val = (reg_parse_callback_val_t)&reg_format_value,
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3d0f9491131e03cd33dc8a2161b86ceb22c678ab
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Apr 10 16:43:10 2019 +1200

    s4/lib/policy/gp_ldap: use ldb API to find messages
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 93d6307185d85535e4902d46a2f7e99e82f782a2
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Apr 10 16:38:52 2019 +1200

    dsdb mod/linked_attributes: fix_link_slow(): clarify a comment.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 9c254572dd42147d1e215ef5144c6c7583b1f835
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Apr 11 13:14:24 2019 +1200

    dsdb/mod/extended_dn_out: use faster removal filters
    
    When filtering out multiple elements, we end up memmove()ing the same
    elements many times over. It is simpler to not do that by keeping track
    of how many elements we are keeping.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 06a02cb88c88c0ba9af5a2eeba722c0b5878cccd
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Mon Apr 8 10:33:07 2019 +1200

    ldb_msg: remove_element() checks element array bounds
    
    Previously we half-heartedly checked one end.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 652a4015e6b4c1da27a0529f577ce6b6d6035a1a
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Mon Apr 8 10:16:38 2019 +1200

    ldb_kv: use ldb_msg_remove_element()
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 85b6674aebda32ac6c343c0fe70dde92fd263169
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sun Apr 7 10:13:11 2019 +1200

    ldb/tools/ldbtest: initialise msg object
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit ce2bf5c72b6423fff680b3d6a9042103a6cdda55
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Tue Apr 9 20:29:59 2019 +1200

    ldb_ldap: use ldb_msg API to add elements
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2a144ea70ed218bd649b9c5ec49e04dbad4b9d71
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sun Apr 7 10:12:02 2019 +1200

    ldb_ldap: trust db_msg_new() to return empty message
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4e47d5dfa258f4de72163c393bb400d7c7207aa7
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Apr 10 16:40:34 2019 +1200

    dsdb/replmd: use ldb_msg_remove_element()
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 14db30724334e090f126ec75718b24af8127ad49
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Apr 10 16:37:23 2019 +1200

    dsdb mods/extended_dn_out: remove element using ldb_msg api
    
    The bare memmove is not strictly safe at the end of the list.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 1e61b17106c10ac9af85cd1de5727d6ed49a7144
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sat Apr 6 14:20:25 2019 +1300

    dsdb/mod/extended_dn_out: zero whole fake_msg struct
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4624957d42fdd0cbefd0f1e8298b7a19439fe004
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Mon Apr 15 23:20:46 2019 +1200

    s4: use ldb_msg_new(), not talloc/talloc_zero
    
    ldb_msg_new() is currently the same as talloc_zero(), but it might
    not always be.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 8f081b7f78bc2c6e60f869423bae15aa0adfa800
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sat Apr 6 13:55:06 2019 +1300

    ldb: use ldb_msg_new(), not talloc/talloc_zero
    
    ldb_msg_new() is currently the same as talloc_zero(), but it might
    not always be.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 18966b6eeea3a386fc4faaaa3b46bf9e1918f609
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Fri Apr 5 16:29:14 2019 +1300

    kdb_kv_search: spell 'linearized'
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 49048b245dff59bbf70fc959693772613fec1053
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Sun Apr 7 22:59:24 2019 +1200

    dsdb/util: spell "equivalence"!
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 985a4b78710a416bf7a64ac6cec5bd2e97ccc9d2
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Mon Apr 8 17:00:57 2019 +1200

    ldb.h: spelling of 'means'
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c2e882b25f35c786ceebe069787607b1b141db47
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Mon Apr 15 13:13:13 2019 +1200

    ldb.h: improve comment for LDB_ATTR_FLAG_INDEXED
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 79629b42cde3fd1e932677d6388cff90a2cc3cd2
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed May 8 16:46:33 2019 +1200

    s4/policy/gp_filesys: avoid SIZE_MAX smbcli write (CID 1034779)
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 597709aac99d2bccb015806f02049918b1ba79bd
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed May 8 15:58:08 2019 +1200

    s4/messaging: do not deref NULL state (CID 1437973)
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a82f924179ec39f5a6fcd443ffc2f23736cd3a6a
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed May 8 15:52:31 2019 +1200

    s4/ldap_bind: notice backend init failure
    
    This should silence CID 1418508 and CID 1418512
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 858e9eee55882f073532660f1eb533bfa2166c0b
Author: Michael Hanselmann <public at hansmi.ch>
Date:   Thu May 9 00:32:41 2019 +0200

    read_smb_length: Use correct function name in debug message
    
    Signed-off-by: Michael Hanselmann <public at hansmi.ch>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2f0c49e654a857cc43ba3b1e4b47a95078e01750
Author: Andreas Schneider <asn at samba.org>
Date:   Thu May 9 18:21:24 2019 +0200

    gitlab-ci: Install libtasn1-tools on Fedora based distributions
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 .gitlab-ci.yml                                     |  2 +-
 bootstrap/config.py                                |  3 +-
 bootstrap/generated-dists/centos6/bootstrap.sh     |  1 +
 bootstrap/generated-dists/centos6/packages.yml     |  1 +
 bootstrap/generated-dists/centos7/bootstrap.sh     |  1 +
 bootstrap/generated-dists/centos7/packages.yml     |  1 +
 bootstrap/generated-dists/fedora28/bootstrap.sh    |  1 +
 bootstrap/generated-dists/fedora28/packages.yml    |  1 +
 bootstrap/generated-dists/fedora29/bootstrap.sh    |  1 +
 bootstrap/generated-dists/fedora29/packages.yml    |  1 +
 bootstrap/sha1sum.txt                              |  2 +-
 lib/ldb/common/ldb_ldif.c                          |  6 +--
 lib/ldb/common/ldb_msg.c                           | 10 ++--
 lib/ldb/include/ldb.h                              |  4 +-
 lib/ldb/ldb_key_value/ldb_kv.c                     |  7 +--
 lib/ldb/ldb_key_value/ldb_kv_search.c              | 10 ++--
 lib/ldb/ldb_ldap/ldb_ldap.c                        | 25 ++-------
 lib/ldb/tools/ldbdump.c                            |  2 +-
 lib/ldb/tools/ldbtest.c                            |  4 +-
 source3/registry/reg_import.c                      | 61 ++++++++++++++++------
 source3/registry/reg_parse.c                       | 27 ++++++++--
 source3/registry/reg_parse.h                       |  2 +-
 source3/rpcclient/cmd_samr.c                       |  3 +-
 source3/smbd/reply.c                               |  2 +-
 source4/dsdb/common/util.c                         |  2 +-
 source4/dsdb/samdb/ldb_modules/dirsync.c           |  2 +-
 source4/dsdb/samdb/ldb_modules/extended_dn_out.c   | 55 ++++++++-----------
 source4/dsdb/samdb/ldb_modules/linked_attributes.c |  3 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c    |  3 +-
 source4/ldap_server/ldap_backend.c                 |  4 +-
 source4/ldap_server/ldap_bind.c                    |  1 +
 source4/lib/messaging/messaging.c                  |  8 +--
 source4/lib/policy/gp_filesys.c                    |  6 +++
 source4/lib/policy/gp_ldap.c                       | 24 ++++-----
 source4/lib/registry/ldb.c                         |  4 +-
 35 files changed, 157 insertions(+), 133 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3d01f8fc376..a69db94ff36 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,7 +19,7 @@ variables:
   # Set this to the contents of bootstrap/sha1sum.txt
   # which is generated by bootstrap/template.py --render
   #
-  SAMBA_CI_CONTAINER_TAG: 93278680b4e7086c0bec11a58bc3533f9971c08e
+  SAMBA_CI_CONTAINER_TAG: 1185fa2a316b3bb7e0c24e9fb8279d4c17450809
   # We use the ubuntu1804 image as default as
   # it matches what we have on sn-devel-184.
   SAMBA_CI_CONTAINER_IMAGE: ubuntu1804
diff --git a/bootstrap/config.py b/bootstrap/config.py
index 6d3fb2e5c9c..bd651e28597 100644
--- a/bootstrap/config.py
+++ b/bootstrap/config.py
@@ -90,7 +90,7 @@ PKGS = [
     ('libgpgme11-dev', 'gpgme-devel'),
     # NOTE: Debian 8+ and Ubuntu 14.04+
     ('libgnutls28-dev', 'gnutls-devel'),
-    ('libtasn1-bin', ''),
+    ('libtasn1-bin', 'libtasn1-tools'),
     ('libtasn1-dev', 'libtasn1-devel'),
     ('', 'quota-devel'),
     ('uuid-dev', 'libuuid-devel'),
@@ -524,6 +524,7 @@ RPM_DISTS = {
             'python3-markdown': 'python3-Markdown',
             'quota-devel': '',
             'glusterfs-api-devel': '',
+            'libtasn1-tools': '', # asn1Parser is part of libtasn1
         }
     }
 }
diff --git a/bootstrap/generated-dists/centos6/bootstrap.sh b/bootstrap/generated-dists/centos6/bootstrap.sh
index 203386bf447..1279bbce7b9 100755
--- a/bootstrap/generated-dists/centos6/bootstrap.sh
+++ b/bootstrap/generated-dists/centos6/bootstrap.sh
@@ -54,6 +54,7 @@ yum install -y \
     libpcap-devel \
     libsemanage-python \
     libtasn1-devel \
+    libtasn1-tools \
     libtirpc-devel \
     libunwind-devel \
     libuuid-devel \
diff --git a/bootstrap/generated-dists/centos6/packages.yml b/bootstrap/generated-dists/centos6/packages.yml
index 98a89a844f9..cb60034d299 100644
--- a/bootstrap/generated-dists/centos6/packages.yml
+++ b/bootstrap/generated-dists/centos6/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libpcap-devel
   - libsemanage-python
   - libtasn1-devel
+  - libtasn1-tools
   - libtirpc-devel
   - libunwind-devel
   - libuuid-devel
diff --git a/bootstrap/generated-dists/centos7/bootstrap.sh b/bootstrap/generated-dists/centos7/bootstrap.sh
index c3ccc4bb0b9..81786a80bea 100755
--- a/bootstrap/generated-dists/centos7/bootstrap.sh
+++ b/bootstrap/generated-dists/centos7/bootstrap.sh
@@ -54,6 +54,7 @@ yum install -y \
     libpcap-devel \
     libsemanage-python \
     libtasn1-devel \
+    libtasn1-tools \
     libtirpc-devel \
     libunwind-devel \
     libuuid-devel \
diff --git a/bootstrap/generated-dists/centos7/packages.yml b/bootstrap/generated-dists/centos7/packages.yml
index 40c5513d72c..7f10cd38f1c 100644
--- a/bootstrap/generated-dists/centos7/packages.yml
+++ b/bootstrap/generated-dists/centos7/packages.yml
@@ -42,6 +42,7 @@ packages:
   - libpcap-devel
   - libsemanage-python
   - libtasn1-devel
+  - libtasn1-tools
   - libtirpc-devel
   - libunwind-devel
   - libuuid-devel
diff --git a/bootstrap/generated-dists/fedora28/bootstrap.sh b/bootstrap/generated-dists/fedora28/bootstrap.sh
index 2c365247e6a..85b328cc711 100755
--- a/bootstrap/generated-dists/fedora28/bootstrap.sh
+++ b/bootstrap/generated-dists/fedora28/bootstrap.sh
@@ -57,6 +57,7 @@ dnf install -y \
     libpcap-devel \
     libsemanage-python \
     libtasn1-devel \
+    libtasn1-tools \
     libtirpc-devel \
     libunwind-devel \
     libuuid-devel \
diff --git a/bootstrap/generated-dists/fedora28/packages.yml b/bootstrap/generated-dists/fedora28/packages.yml
index 2961e4c0a50..3655cdbd278 100644
--- a/bootstrap/generated-dists/fedora28/packages.yml
+++ b/bootstrap/generated-dists/fedora28/packages.yml
@@ -46,6 +46,7 @@ packages:
   - libpcap-devel
   - libsemanage-python
   - libtasn1-devel
+  - libtasn1-tools
   - libtirpc-devel
   - libunwind-devel
   - libuuid-devel
diff --git a/bootstrap/generated-dists/fedora29/bootstrap.sh b/bootstrap/generated-dists/fedora29/bootstrap.sh
index 2c365247e6a..85b328cc711 100755
--- a/bootstrap/generated-dists/fedora29/bootstrap.sh
+++ b/bootstrap/generated-dists/fedora29/bootstrap.sh
@@ -57,6 +57,7 @@ dnf install -y \
     libpcap-devel \
     libsemanage-python \
     libtasn1-devel \
+    libtasn1-tools \
     libtirpc-devel \
     libunwind-devel \
     libuuid-devel \
diff --git a/bootstrap/generated-dists/fedora29/packages.yml b/bootstrap/generated-dists/fedora29/packages.yml
index 2961e4c0a50..3655cdbd278 100644
--- a/bootstrap/generated-dists/fedora29/packages.yml
+++ b/bootstrap/generated-dists/fedora29/packages.yml
@@ -46,6 +46,7 @@ packages:
   - libpcap-devel
   - libsemanage-python
   - libtasn1-devel
+  - libtasn1-tools
   - libtirpc-devel
   - libunwind-devel
   - libuuid-devel
diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt
index a5d74e48a7e..02229d245ac 100644
--- a/bootstrap/sha1sum.txt
+++ b/bootstrap/sha1sum.txt
@@ -1 +1 @@
-93278680b4e7086c0bec11a58bc3533f9971c08e
+1185fa2a316b3bb7e0c24e9fb8279d4c17450809
diff --git a/lib/ldb/common/ldb_ldif.c b/lib/ldb/common/ldb_ldif.c
index 2bd02663f09..c2f1cb7c970 100644
--- a/lib/ldb/common/ldb_ldif.c
+++ b/lib/ldb/common/ldb_ldif.c
@@ -772,7 +772,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
 	ldif = talloc(ldb, struct ldb_ldif);
 	if (!ldif) return NULL;
 
-	ldif->msg = talloc(ldif, struct ldb_message);
+	ldif->msg = ldb_msg_new(ldif);
 	if (ldif->msg == NULL) {
 		talloc_free(ldif);
 		return NULL;
@@ -781,10 +781,6 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
 	ldif->changetype = LDB_CHANGETYPE_NONE;
 	msg = ldif->msg;
 
-	msg->dn = NULL;
-	msg->elements = NULL;
-	msg->num_elements = 0;
-
 	chunk = next_chunk(ldb, ldif, fgetc_fn, private_data);
 	if (!chunk) {
 		goto failed;
diff --git a/lib/ldb/common/ldb_msg.c b/lib/ldb/common/ldb_msg.c
index b51e4b1059e..2346e66ec39 100644
--- a/lib/ldb/common/ldb_msg.c
+++ b/lib/ldb/common/ldb_msg.c
@@ -1222,14 +1222,14 @@ int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *rep
 void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element *el)
 {
 	ptrdiff_t n = (el - msg->elements);
-	if (n >= msg->num_elements) {
-		/* should we abort() here? */
+	if (n >= msg->num_elements || n < 0) {
+		/* the element is not in the list. the caller is crazy. */
 		return;
 	}
-	if (n != msg->num_elements-1) {
-		memmove(el, el+1, ((msg->num_elements-1) - n)*sizeof(*el));
-	}
 	msg->num_elements--;
+	if (n != msg->num_elements) {
+		memmove(el, el+1, (msg->num_elements - n)*sizeof(*el));
+	}
 }
 
 
diff --git a/lib/ldb/include/ldb.h b/lib/ldb/include/ldb.h
index 7ee6a44dd5e..75bfbe33bf6 100644
--- a/lib/ldb/include/ldb.h
+++ b/lib/ldb/include/ldb.h
@@ -446,7 +446,7 @@ const struct ldb_dn_extended_syntax *ldb_dn_extended_syntax_by_name(struct ldb_c
 #define LDB_ATTR_FLAG_FROM_DB      (1<<6)
 
 /*
- * The attribute was loaded from a DB, rather than via the C API
+ * The attribute is indexed
  */
 #define LDB_ATTR_FLAG_INDEXED      (1<<7)
 
@@ -1539,7 +1539,7 @@ int ldb_transaction_cancel_noerr(struct ldb_context *ldb);
 const char *ldb_errstring(struct ldb_context *ldb);
 
 /**
-  return a string explaining what a ldb error constant meancs
+  return a string explaining what a ldb error constant means
 */
 const char *ldb_strerror(int ldb_err);
 
diff --git a/lib/ldb/ldb_key_value/ldb_kv.c b/lib/ldb/ldb_key_value/ldb_kv.c
index 0a81524d87f..c0846ba1b6a 100644
--- a/lib/ldb/ldb_key_value/ldb_kv.c
+++ b/lib/ldb/ldb_key_value/ldb_kv.c
@@ -766,7 +766,6 @@ static int ldb_kv_msg_delete_attribute(struct ldb_module *module,
 				       struct ldb_message *msg,
 				       const char *name)
 {
-	unsigned int i;
 	int ret;
 	struct ldb_message_element *el;
 	bool is_special = ldb_dn_is_special(msg->dn);
@@ -785,7 +784,6 @@ static int ldb_kv_msg_delete_attribute(struct ldb_module *module,
 	if (el == NULL) {
 		return LDB_ERR_NO_SUCH_ATTRIBUTE;
 	}
-	i = el - msg->elements;
 
 	ret = ldb_kv_index_del_element(module, ldb_kv, msg, el);
 	if (ret != LDB_SUCCESS) {
@@ -793,10 +791,7 @@ static int ldb_kv_msg_delete_attribute(struct ldb_module *module,
 	}
 
 	talloc_free(el->values);
-	if (msg->num_elements > (i+1)) {
-		memmove(el, el+1, sizeof(*el) * (msg->num_elements - (i+1)));
-	}
-	msg->num_elements--;
+	ldb_msg_remove_element(msg, el);
 	msg->elements = talloc_realloc(msg, msg->elements,
 				       struct ldb_message_element,
 				       msg->num_elements);
diff --git a/lib/ldb/ldb_key_value/ldb_kv_search.c b/lib/ldb/ldb_key_value/ldb_kv_search.c
index a7e532e41ac..67dd37eec87 100644
--- a/lib/ldb/ldb_key_value/ldb_kv_search.c
+++ b/lib/ldb/ldb_key_value/ldb_kv_search.c
@@ -144,10 +144,10 @@ int ldb_kv_search_base(struct ldb_module *module,
 	if (ret == LDB_SUCCESS) {
 		const char *dn_linearized
 			= ldb_dn_get_linearized(dn);
-		const char *msg_dn_linearlized
+		const char *msg_dn_linearized
 			= ldb_dn_get_linearized(msg->dn);
 
-		if (strcmp(dn_linearized, msg_dn_linearlized) == 0) {
+		if (strcmp(dn_linearized, msg_dn_linearized) == 0) {
 			/*
 			 * Re-use the full incoming DN for
 			 * subtree checks
@@ -647,7 +647,7 @@ static int ldb_kv_search_and_return_base(struct ldb_kv_private *ldb_kv,
 	struct ldb_message *msg, *filtered_msg;
 	struct ldb_context *ldb = ldb_module_get_ctx(ctx->module);
 	const char *dn_linearized;
-	const char *msg_dn_linearlized;
+	const char *msg_dn_linearized;
 	int ret;
 	bool matched;
 
@@ -701,9 +701,9 @@ static int ldb_kv_search_and_return_base(struct ldb_kv_private *ldb_kv,
 	}
 
 	dn_linearized = ldb_dn_get_linearized(ctx->base);
-	msg_dn_linearlized = ldb_dn_get_linearized(msg->dn);
+	msg_dn_linearized = ldb_dn_get_linearized(msg->dn);
 
-	if (strcmp(dn_linearized, msg_dn_linearlized) == 0) {
+	if (strcmp(dn_linearized, msg_dn_linearized) == 0) {
 		/*
 		 * If the DN is exactly the same string, then
 		 * re-use the full incoming DN for the
diff --git a/lib/ldb/ldb_ldap/ldb_ldap.c b/lib/ldb/ldb_ldap/ldb_ldap.c
index 29f89388c5f..d7222997732 100644
--- a/lib/ldb/ldb_ldap/ldb_ldap.c
+++ b/lib/ldb/ldb_ldap/ldb_ldap.c
@@ -141,7 +141,7 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 			     struct ldb_message *msg, 
 			     const char *attr, struct berval **bval)
 {
-	int count, i;
+	int count, i, ret;
 	struct ldb_message_element *el;
 
 	count = ldap_count_values_len(bval);
@@ -150,25 +150,12 @@ static int lldb_add_msg_attr(struct ldb_context *ldb,
 		return -1;
 	}
 
-	el = talloc_realloc(msg, msg->elements, struct ldb_message_element, 
-			      msg->num_elements + 1);
-	if (!el) {
-		errno = ENOMEM;
-		return -1;
-	}
-
-	msg->elements = el;
-
-	el = &msg->elements[msg->num_elements];
-
-	el->name = talloc_strdup(msg->elements, attr);
-	if (!el->name) {
+	ret = ldb_msg_add_empty(msg, attr, 0, &el);
+	if (ret != LDB_SUCCESS) {
 		errno = ENOMEM;
 		return -1;
 	}
-	el->flags = 0;
 
-	el->num_values = 0;
 	el->values = talloc_array(msg->elements, struct ldb_val, count);
 	if (!el->values) {
 		errno = ENOMEM;
@@ -492,7 +479,7 @@ static bool lldb_parse_result(struct lldb_context *ac, LDAPMessage *result)
 	char *errmsgp = NULL;
 	LDAPMessage *msg;
 	int type;
-	struct ldb_message *ldbmsg;
+	struct ldb_message *ldbmsg = NULL;
 	char *referral;
 	bool callback_failed;
 	bool request_done;
@@ -537,10 +524,6 @@ static bool lldb_parse_result(struct lldb_context *ac, LDAPMessage *result)
 				break;
 			}
 			ldap_memfree(dn);
-
-			ldbmsg->num_elements = 0;
-			ldbmsg->elements = NULL;
-
 			/* loop over all attributes */
 			for (attr=ldap_first_attribute(lldb->ldap, msg, &berptr);
 			     attr;
diff --git a/lib/ldb/tools/ldbdump.c b/lib/ldb/tools/ldbdump.c
index a466e4916db..eb237e89b44 100644
--- a/lib/ldb/tools/ldbdump.c
+++ b/lib/ldb/tools/ldbdump.c
@@ -40,7 +40,7 @@ static int traverse_fn(TDB_CONTEXT *tdb, TDB_DATA key, TDB_DATA _dbuf, void *sta
 {
 	int ret, i, j;
 	struct ldb_dn *dn = state;
-	struct ldb_message *msg = talloc_zero(NULL, struct ldb_message);
+	struct ldb_message *msg = ldb_msg_new(NULL);
 	struct ldb_val dbuf = {
 		.data = _dbuf.dptr,
 		.length = _dbuf.dsize,
diff --git a/lib/ldb/tools/ldbtest.c b/lib/ldb/tools/ldbtest.c
index 384624ca553..64b6baa1842 100644
--- a/lib/ldb/tools/ldbtest.c
+++ b/lib/ldb/tools/ldbtest.c
@@ -60,7 +60,7 @@ static void add_records(struct ldb_context *ldb,
 			struct ldb_dn *basedn,
 			unsigned int count)
 {
-	struct ldb_message msg;
+	struct ldb_message msg = {0};
 	unsigned int i;
 
 #if 0
@@ -149,7 +149,7 @@ static void modify_records(struct ldb_context *ldb,
 			   struct ldb_dn *basedn,
 			   unsigned int count)
 {
-	struct ldb_message msg;
+	struct ldb_message msg = {0};
 	unsigned int i;
 
 	for (i=0;i<count;i++) {
diff --git a/source3/registry/reg_import.c b/source3/registry/reg_import.c
index 01d85af4e87..aef8645ed9e 100644
--- a/source3/registry/reg_import.c
+++ b/source3/registry/reg_import.c
@@ -39,18 +39,18 @@ static int reg_parse_callback_key(struct reg_import *cb_private,
 
 static int reg_parse_callback_val(struct reg_import *cb_private,
 				  const char *name, uint32_t type,
-				  const uint8_t *data, uint32_t len);
+				  const uint8_t *data, size_t len);
 
 static int reg_parse_callback_val_registry_value(struct reg_import *cb_private,
 						 const char *name,
 						 uint32_t type,
 						 const uint8_t *data,
-						 uint32_t len);
+						 size_t len);
 
 static int reg_parse_callback_val_regval_blob(struct reg_import *cb_private,
 					      const char *name, uint32_t type,
 					      const uint8_t *data,
-					      uint32_t len);
+					      size_t len);
 
 static int reg_parse_callback_val_del(struct reg_import *cb_private,
 				      const char *name);
@@ -118,11 +118,11 @@ int reg_parse_callback_key(struct reg_import *p,
 /*----------------------------------------------------------------------------*/
 int reg_parse_callback_val(struct reg_import *p,
 			   const char *name, uint32_t type,
-			   const uint8_t *data, uint32_t len)
+			   const uint8_t *data, size_t len)
 {
 	WERROR werr = WERR_OK;
 
-	DEBUG(TL, ("%s(%x): >%s< = [%x]\n",  __FUNCTION__, type, name, len));
+	DEBUG(TL, ("%s(%x): >%s< = [%zx]\n",  __FUNCTION__, type, name, len));
 	DEBUG_ADD_HEX(TL, data, len);
 
 	werr = p->call.setval.blob(p->call.data, p->open_key, name, type,
@@ -138,7 +138,7 @@ int reg_parse_callback_val(struct reg_import *p,
 /*----------------------------------------------------------------------------*/
 int reg_parse_callback_val_registry_value(struct reg_import *p,
 					  const char *name, uint32_t type,
-					  const uint8_t *data, uint32_t len)
+					  const uint8_t *data, size_t len)
 {
 	WERROR werr = WERR_OK;
 	struct registry_value val = {
@@ -146,7 +146,7 @@ int reg_parse_callback_val_registry_value(struct reg_import *p,
 		.data = data_blob_talloc(p, data, len),
 	};
 
-	DEBUG(TL, ("%s(%x): >%s< = [%x]\n", __FUNCTION__, type, name, len));
+	DEBUG(TL, ("%s(%x): >%s< = [%zx]\n", __FUNCTION__, type, name, len));
 	DEBUG_ADD_HEX(TL, data, len);
 
 	werr = p->call.setval.registry_value(p->call.data, p->open_key,
@@ -163,13 +163,13 @@ int reg_parse_callback_val_registry_value(struct reg_import *p,
 /*----------------------------------------------------------------------------*/
 int reg_parse_callback_val_regval_blob(struct reg_import *p,
 				       const char *name, uint32_t type,
-				       const uint8_t *data, uint32_t len)
+				       const uint8_t *data, size_t len)
 {
 	WERROR werr = WERR_OK;
 	void* mem_ctx = talloc_new(p);
 	struct regval_blob *v = NULL;
 
-	DEBUG(TL, ("%s(%x): >%s< = [%x]\n", __FUNCTION__, type, name, len));
+	DEBUG(TL, ("%s(%x): >%s< = [%zx]\n", __FUNCTION__, type, name, len));
 	DEBUG_ADD_HEX(TL, data, len);
 
 	v = regval_compose(mem_ctx, name, type, data, len);
@@ -219,11 +219,35 @@ int reg_parse_callback_comment(struct reg_import *cb_private,
 }
 
 /******************************************************************************/
-static int nop(void *data)
+static WERROR nop_callback_open(void* private_data,
+		void* parent,
+		const char* name,
+		void** key)
 {
-	return 0;
+	return WERR_OK;
+}
+
+static WERROR nop_callback_close(void* private_data, void* key)
+{
+	return WERR_OK;
 }
 
+static WERROR nop_callback_create(void* private_data,
+		void* parent,
+		const char* name,
+		void** key,
+		bool* existing)
+{
+	return WERR_OK;
+}
+
+
+static WERROR nop_callback_del(void* private_data,
+		void* parent,
+		const char* name)
+{
+	return WERR_OK;
+}
 
 struct reg_parse_callback *reg_import_adapter(TALLOC_CTX *talloc_ctx,
 					      struct reg_import_callback cb)
@@ -234,19 +258,24 @@ struct reg_parse_callback *reg_import_adapter(TALLOC_CTX *talloc_ctx,
 		goto fail;
 	}
 	if (cb.openkey == NULL) {
-		cb.openkey = (reg_import_callback_openkey_t)&nop;
+		cb.openkey = (reg_import_callback_openkey_t)&nop_callback_open;
 	}
 	if (cb.closekey == NULL) {
-		cb.closekey = (reg_import_callback_closekey_t)&nop;
+		cb.closekey =
+			(reg_import_callback_closekey_t)&nop_callback_close;
 	}
 	if (cb.createkey == NULL) {
-		cb.createkey = (reg_import_callback_createkey_t)&nop;
+		cb.createkey =


-- 
Samba Shared Repository



More information about the samba-cvs mailing list