[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Thu Jul 28 11:52:02 UTC 2016


The branch, master has been updated
       via  5462a1e VERSION: Bump version up to 4.6.0pre1
       via  955dec2 VERSION: Set version to 4.5.0rc1...
       via  b11697b WHATSNEW: add shadow:snapprefix and shadow:delimiter
       via  17a6a78 shadow_copy2: Fix error handling in shadow_copy2_get_shadow_copy_data
       via  57518cf shadow_copy2: update man pages for the newly introduced options
       via  8de11bd shadow_copy2: Add test case for snapprefix and delimiter
       via  71682e1 shadow_copy2: allow configurable prefix for snapshot name
       via  c9b6e99 shadow_copy2: create structure to store module specific information
       via  13f9224 shadow_copy2: Add test cases to cover shadow:format
       via  999ea7e shadow_copy2: Fix shadow_copy2_posix_gmt_string return type
       via  dbb243f ldb: version 1.1.27
       via  8818f2c ldb: Use ldb_unpack_data_only_attr_list_flags in re_index()
       via  5f815c8 ldb: fix compiler warnings on ldb_unpack_data() arguments
       via  e517d68 ldb: Add flags to ltdb_search_dn1() to control memory allocation
       via  b465161 ldb: Prepare for adding flags to ltdb_search_dn1() to control memory allocation
       via  f6e8718 ldb: Add ldb_unpack_data_only_attr_list_flags()
       via  ebdf6e0 ldb: Free empty index lists as talloc_realloc() fails in this case
       via  7a21e40 ldb_tdb index: fix whitespace
       via  00f77d1 torture: Add tests for ndr_push_struct_into_fixed_blob()
       via  eeb594c dsdb: Limit potential stack use when parsing extended DNs
       via  b8335f6 lib/ldb-samba: Avoid talloc() in ldif_read_objectSid() by parsing the SID string on the stack
       via  cb6395c lib/ldb-samba: Use ndr_push_struct_into_fixed_blob() in ldif_handlers.c
       via  1246904 librpc: Add ndr_push_struct_into_fixed_blob() and use it in GUID_to_ndr_blob()
       via  c07504f WHATSNEW: document new samba-tool drs replicate options
       via  d282527 tests:samba_tool_drs: test samba-tool drs replicate with --async-op
       via  47d9b0e tests:samba_tool_drs: test samba-tool drs replicate with implicit machine credentials
       via  cba7e94 samba-tool: add --async-rep option to 'samba-tool drs replicate'
       via  3cb3fc3 samba-tool: use a timeout of 5 minutes in 'samba-tool drs replicate'
       via  caa231a s4:pyrpc: correctly implement .request_timeout
       via  192e54c rpc_server/drsuapi: Don't set msDS_IntId as attid for linked attributes if schema
       via  dffe66e getncchanges: Set is_schema_nc when EXOP_OBJ
       via  0555443 msds_intid: Add test for schema linked attributes
       via  fa64116 replmd: Send replicated update OID for forward links
       via  2bb5f7d replmd: Remove data field on DSDB_CONTROL_REPLICATED_UPDATE_OID
       via  032fc27 rpc_server/drsuapi: Set msDS_IntId as attid for linked attributes if exists
       via  e0b6d6b msds_intid: Add test for (non-schema) linked attributes
       via  88a4d55 valgrind: Avoid a warning about uninitialized memory
       via  15e6217 replmd: Check dsdb_dn for syntax errors
      from  7b4c815 tevent: version 0.9.28

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


- Log -----------------------------------------------------------------
commit 5462a1e9cdd41497e5c7dac4dc855bd28adbbb0f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 27 15:07:03 2016 +0200

    VERSION: Bump version up to 4.6.0pre1
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Thu Jul 28 13:51:06 CEST 2016 on sn-devel-144

commit 955dec247e9fd01a7b67e967d911584cca7c09ff
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jul 27 07:16:37 2016 +0200

    VERSION: Set version to 4.5.0rc1...
    
    and disable git snapshots for 4.5.0rc1 release.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit b11697be1edf83a69d4d112ec53bf14fb115dc26
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 09:42:38 2016 +0200

    WHATSNEW: add shadow:snapprefix and shadow:delimiter
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 17a6a78e4cc1e1fc2b20006ca7104a72a7e3341c
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Thu Jul 21 09:58:43 2016 +0000

    shadow_copy2: Fix error handling in shadow_copy2_get_shadow_copy_data
    
    Memory was freed in most of the failure cases. It is always better
    to free the memory at the end of the function so that all exit path
    of the function will free the memory. Otherwise chances are that
    you might miss some cleanup.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 57518cf0d2960fa5ebe7b882a7cd5e6326ee72f7
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Tue Jul 12 11:01:32 2016 +0000

    shadow_copy2: update man pages for the newly introduced options
    
    shadow:snapprefix and shadow:delimiter are the two newly added options
    in shadow copy. Update man pages explaining the two options.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 8de11bd897afa1a0569d8e2609e9a7a486ba0504
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Wed Jul 13 16:15:27 2016 +0000

    shadow_copy2: Add test case for snapprefix and delimiter
    
    Add test case for the newly addded option shadow:snapprefix
    and shadow:delimiter
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 71682e125c840225a25b21810119e20c96fd85d8
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Wed Jul 13 18:59:18 2016 +0000

    shadow_copy2: allow configurable prefix for snapshot name
    
    With growing number of snapshots file-systems need some mechanism
    to differentiate one set of snapshots from other, e.g. monthly, weekly,
    manual, special events, etc. Therefore these file-systems provide
    different ways to tag snapshots, e.g. provide a configurable way to
    name snapshots, which is not just based on time. With only shadow:format
    it is very difficult to filter these snapshots.
    
    As part of this change added two new options, shadow:snapprefix and
    shadow:delimiter, in shadow_copy2 config. This option will accept regular
    expression (BRE) as input. With this optional parameter, one can specify a
    variable prefix component for names of the snapshot directories in the
    file-system. If this parameter is set, together with the shadow:format and
    shadow:delimiter parameters it determines the possible names of snapshot
    directories in the file-system.
    
    e.g.
    shadow:snapprefix = [a-z]*[0-9]
    
    When this option is provided then shadow:format option should always
    start with <delimiter> string. This delimiter is configurable via a new option,
    i.e. shadow:delimiter. Default value for this is "_GMT",
    e.g. _GMT-%Y.%m.%d-%H.%M.%S
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c9b6e99ee17427138524b0ce676d720459ed23c3
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Mon Jul 11 11:27:37 2016 +0000

    shadow_copy2: create structure to store module specific information
    
    Create a separate structure to store module specific information. Currently
    only config values are saved. As of now there is no cleaner way to store run-time
    information or other module specific information in shadow_copy2 module.
    
    Therefore created a new structure to store all module specific information
    including config.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 13f92249d73897b9f9245581a742135b3bffcd9c
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Tue Jul 12 09:33:29 2016 +0000

    shadow_copy2: Add test cases to cover shadow:format
    
    Added test cases which will filter snapshot names based
    on shadow:format option in smb.conf
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 999ea7ea4d7810ae9b2a2c7757d56d32b6c51c4e
Author: Rajesh Joseph <rjoseph at redhat.com>
Date:   Mon Jul 11 12:28:46 2016 +0000

    shadow_copy2: Fix shadow_copy2_posix_gmt_string return type
    
    This function returns -1 on error but the return type is
    size_t which is unsigned.
    
    Signed-off-by: Rajesh Joseph <rjoseph at redhat.com>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit dbb243fa69bb86c0e1b9ed7054a883bcd5723f61
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 26 20:30:04 2016 +0200

    ldb: version 1.1.27
    
    * performance improvements
    * VLV control improvements
    * build fixes
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 8818f2c507e717fa4d38336a5a47a35ac21771d8
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 27 11:21:43 2016 +1200

    ldb: Use ldb_unpack_data_only_attr_list_flags in re_index()
    
    This avoids allocation of every value during a re-index scan
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 5f815c8aa9dbf9e442255da2501d76207a705598
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jul 26 21:16:46 2016 +0200

    ldb: fix compiler warnings on ldb_unpack_data() arguments
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit e517d68a8f2772b863a7c072bd95d224b4ab8bf4
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 27 00:20:27 2016 +1200

    ldb: Add flags to ltdb_search_dn1() to control memory allocation
    
    This is used in the index code in particular to avoid an allocation per value
    (as there may be one value per DB object at times
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit b465161aaaf79d62a68193f09e4409e363df434f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 27 00:20:27 2016 +1200

    ldb: Prepare for adding flags to ltdb_search_dn1() to control memory allocation
    
    Because the memory layout will change in the next commit, we need to add
    a talloc_steal() of msg, which holds the memory on one big chunk.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit f6e87188b60bea7d15bc015a8617e7ed3f7fbeda
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 27 00:17:36 2016 +1200

    ldb: Add ldb_unpack_data_only_attr_list_flags()
    
    This function allows us to control allocation of memory during parse
    of the packed ldb data.
    
    This in turn can have an important performance impact as each
    small allocation can have a large overhead
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit ebdf6e079b758aeb750201c4989706c43af2420e
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Wed Jul 27 10:26:56 2016 +1200

    ldb: Free empty index lists as talloc_realloc() fails in this case
    
    talloc_realloc() requires that we know the correct parent to do the 0 -> free behaviour
    and we do not have the correct parent here, list->dn may be a child of the module->idxptr
    cache.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>

commit 7a21e40d7557328e3f836af5f289f966617774c1
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Wed Jul 20 13:35:58 2016 +1200

    ldb_tdb index: fix whitespace
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 00f77d10b6aa5ddf9704e12443093dab690d7a67
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jul 25 15:34:39 2016 +1200

    torture: Add tests for ndr_push_struct_into_fixed_blob()
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

commit eeb594ce935190551d7d71812edef8ba506cd5d6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jun 27 12:35:24 2016 +1200

    dsdb: Limit potential stack use when parsing extended DNs
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

commit b8335f6011fabe563cb238a17d6313068d39ce93
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jun 27 12:18:37 2016 +1200

    lib/ldb-samba: Avoid talloc() in ldif_read_objectSid() by parsing the SID string on the stack
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

commit cb6395c858001c6a807aa666860092024066a178
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Jun 27 10:52:55 2016 +1200

    lib/ldb-samba: Use ndr_push_struct_into_fixed_blob() in ldif_handlers.c
    
    This avoids a number of pointless and pointlessly-large allocations
    in inner loops.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

commit 1246904d41eebc3440636dd29a9dc9ba38b738f6
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Jun 17 13:29:51 2016 +1200

    librpc: Add ndr_push_struct_into_fixed_blob() and use it in GUID_to_ndr_blob()
    
    This allows us to allocate only the correct size, not a default of 1024 bytes
    per push.
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>

commit c07504f40dea1b850aa84dab6af5216b097217cc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 08:40:51 2016 +0200

    WHATSNEW: document new samba-tool drs replicate options
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit d28252765b6b2ba79913ce2bf92abc5e48d6738e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 08:29:39 2016 +0200

    tests:samba_tool_drs: test samba-tool drs replicate with --async-op
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit 47d9b0ed64a4e71c37782f5804bfe934e3b78358
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 08:29:39 2016 +0200

    tests:samba_tool_drs: test samba-tool drs replicate with implicit machine credentials
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit cba7e9452283794962080ff2e107a3f78f0ca1a9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 07:50:03 2016 +0200

    samba-tool: add --async-rep option to 'samba-tool drs replicate'
    
    We may not want to wait for the replication to finish.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit 3cb3fc36dd58d7bb5d8a5ba22e72aaa1bc37d3c3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 07:48:44 2016 +0200

    samba-tool: use a timeout of 5 minutes in 'samba-tool drs replicate'
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit caa231ac7621be117230c18906111d6b3f74afea
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Jul 28 06:36:05 2016 +0200

    s4:pyrpc: correctly implement .request_timeout
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Garming Sam <garming at samba.org>

commit 192e54c91d007268e127e4ce4f95972c9492b540
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Wed Jul 27 14:22:39 2016 +1200

    rpc_server/drsuapi: Don't set msDS_IntId as attid for linked attributes if schema
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dffe66e0995818c659351ccf1f0edc1eca964235
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Wed Jul 27 15:51:47 2016 +1200

    getncchanges: Set is_schema_nc when EXOP_OBJ
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 055544321389de5d5cea8e129e0923369e9f558b
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Tue Jul 26 16:57:24 2016 +1200

    msds_intid: Add test for schema linked attributes
    
    This test only covers the forward link case.
    
    NOTE: We can't confirm this against Windows because they prevent us from
    modifying the schema for the schema classes.
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit fa6411657fe3b544913fde613a61fd4f962d435a
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Wed Jul 27 13:06:09 2016 +1200

    replmd: Send replicated update OID for forward links
    
    (The backward link case needs to be tested)
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 2bb5f7d3ce86aca9b9e365b585027f72ca9691af
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Wed Jul 27 16:09:22 2016 +1200

    replmd: Remove data field on DSDB_CONTROL_REPLICATED_UPDATE_OID
    
    There were no users of the data, and it added additional complexity
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 032fc2762ea47df069e02a55ad8d586ec75ff73c
Author: Evgeny Sinelnikov <sin at altlinux.ru>
Date:   Tue Mar 29 18:37:40 2016 +0300

    rpc_server/drsuapi: Set msDS_IntId as attid for linked attributes if exists
    
    We got WERR_DS_DRA_SCHEMA_MISMATCH for linked attributes with 8418 error for
    extended attributes when using same attid as attribute object.
    
    Signed-off-by: Evgeny Sinelnikov <sin at altlinux.ru>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e0b6d6bb10479759905932ea5438fc57713f0a8f
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Tue Jul 26 16:12:05 2016 +1200

    msds_intid: Add test for (non-schema) linked attributes
    
    Prior to this, none of the linked attributes would be checked for their
    ids.
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 88a4d550ff3c8b515862ab9cded9b1f762307ab1
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Tue Jul 26 11:54:07 2016 +1200

    valgrind: Avoid a warning about uninitialized memory
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 15e621773d3b49febb4683365d2596b54daba31d
Author: Garming Sam <garming at catalyst.net.nz>
Date:   Wed Jul 27 09:50:33 2016 +1200

    replmd: Check dsdb_dn for syntax errors
    
    Signed-off-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |  35 ++
 docs-xml/manpages/vfs_shadow_copy2.8.xml           |  36 +-
 lib/ldb-samba/ldif_handlers.c                      |  33 +-
 lib/ldb/ABI/{ldb-1.1.26.sigs => ldb-1.1.27.sigs}   |   1 +
 ...ldb-util-1.1.10.sigs => pyldb-util-1.1.27.sigs} |   0
 ...util-1.1.10.sigs => pyldb-util.py3-1.1.27.sigs} |   0
 lib/ldb/common/ldb_pack.c                          |  83 ++--
 lib/ldb/include/ldb_module.h                       |  28 ++
 lib/ldb/ldb_tdb/ldb_cache.c                        |  10 +-
 lib/ldb/ldb_tdb/ldb_index.c                        |  88 +++--
 lib/ldb/ldb_tdb/ldb_search.c                       |  64 +++-
 lib/ldb/ldb_tdb/ldb_tdb.c                          |   7 +-
 lib/ldb/ldb_tdb/ldb_tdb.h                          |   3 +-
 lib/ldb/wscript                                    |   2 +-
 librpc/ABI/{ndr-0.0.7.sigs => ndr-0.0.8.sigs}      |   1 +
 librpc/ndr/libndr.h                                |   6 +-
 librpc/ndr/ndr.c                                   |  40 ++
 librpc/ndr/uuid.c                                  |   8 +-
 librpc/wscript_build                               |   2 +-
 python/samba/netcmd/drs.py                         |  18 +-
 python/samba/tests/blackbox/samba_tool_drs.py      |  36 +-
 selftest/target/Samba3.pm                          |  69 ++++
 source3/modules/vfs_shadow_copy2.c                 | 426 ++++++++++++++++++---
 source3/script/tests/test_shadow_copy.sh           |  41 ++
 source4/dsdb/common/util.c                         |  24 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c    |  67 +++-
 source4/dsdb/samdb/samdb.h                         |   3 -
 source4/libnet/libnet_vampire.c                    |   2 +-
 source4/librpc/rpc/pyrpc.c                         |  33 +-
 source4/rpc_server/drsuapi/getncchanges.c          |  17 +-
 source4/torture/drs/python/repl_schema.py          |  87 ++++-
 source4/torture/drs/rpc/msds_intid.c               |  35 +-
 source4/torture/ldb/ldb.c                          |  50 +++
 source4/torture/ndr/ndr.c                          | 110 ++++++
 35 files changed, 1281 insertions(+), 186 deletions(-)
 copy lib/ldb/ABI/{ldb-1.1.26.sigs => ldb-1.1.27.sigs} (99%)
 copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util-1.1.27.sigs} (100%)
 copy lib/ldb/ABI/{pyldb-util-1.1.10.sigs => pyldb-util.py3-1.1.27.sigs} (100%)
 copy librpc/ABI/{ndr-0.0.7.sigs => ndr-0.0.8.sigs} (99%)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 99a1f18..7252373 100644
--- a/VERSION
+++ b/VERSION
@@ -24,7 +24,7 @@
 #  ->  "3.0.0"                                         #
 ########################################################
 SAMBA_VERSION_MAJOR=4
-SAMBA_VERSION_MINOR=5
+SAMBA_VERSION_MINOR=6
 SAMBA_VERSION_RELEASE=0
 
 ########################################################
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 81cbef2..25da528 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -69,6 +69,17 @@ with the same name on different servers.
 
 Schema updates are also handled much more reliably.
 
+samba-tool drs replicate with new options
+-----------------------------------------
+
+samba-tool drs replicate got two new options:
+
+The option '--local-online' will do the DsReplicaSync() via IRPC
+to the local dreplsrv service.
+
+The option '--async-op' will add DRSUAPI_DRS_ASYNC_OP to the
+DsReplicaSync(), which won't wait for the replication result.
+
 replPropertyMetaData Changes
 ----------------------------
 
@@ -275,6 +286,28 @@ CTDB changes
 
 * Improved sample NFS Ganesha call-out
 
+New shadow_copy2 options
+------------------------
+
+shadow:snapprefix
+
+  With growing number of snapshots file-systems need some mechanism to
+  differentiate one set of snapshots from other, e.g. monthly, weekly, manual,
+  special events, etc. Therefore these file-systems provide different ways to tag
+  snapshots, e.g. provide a configurable way to name snapshots, which is not just
+  based on time.  With only shadow:format it is very difficult to filter these
+  snapshots. With this optional parameter, one can specify a variable prefix
+  component for names of the snapshot directories in the file-system. If this
+  parameter is set, together with the shadow:format and shadow:delimiter
+  parameters it determines the possible names of snapshot directories in the
+  file-system. The option only supports Basic Regular Expression (BRE).
+
+shadow:delimiter
+
+  This optional parameter is used as a delimiter between shadow:snapprefix and
+  shadow:format This parameter is used only when shadow:snapprefix is set.
+
+  Default: shadow:delimiter = "_GMT"
 
 
 REMOVED FEATURES
@@ -295,6 +328,8 @@ smb.conf changes
   ntlm auth                     Changed default         no
   only user                     Removed
   password hash gpg key ids     New
+  shadow:snapprefix             New
+  shadow:delimiter              New                     _GMT
   smb2 leases                   Changed default         yes
   username                      Removed
 
diff --git a/docs-xml/manpages/vfs_shadow_copy2.8.xml b/docs-xml/manpages/vfs_shadow_copy2.8.xml
index fbc0651..6097511 100644
--- a/docs-xml/manpages/vfs_shadow_copy2.8.xml
+++ b/docs-xml/manpages/vfs_shadow_copy2.8.xml
@@ -406,7 +406,41 @@
                 </listitem>
                 </varlistentry>
 
-		</variablelist>
+		<varlistentry>
+		<term>shadow:snapprefix
+		</term>
+		<listitem>
+		<para>
+		With growing number of snapshots file-systems need some mechanism
+		to differentiate one set of snapshots from other, e.g. monthly, weekly,
+		manual, special events, etc. Therefore these file-systems provide different
+		ways to tag snapshots, e.g. provide a configurable way to name snapshots,
+		which is not just based on time.  With only <command>shadow:format</command>
+		it is very difficult to filter these snapshots. With this optional parameter,
+		one can specify a variable prefix component for names of the snapshot
+		directories in the file-system. If this parameter is set, together with the
+		<command>shadow:format</command> and <command>shadow:delimiter</command>
+		parameters it determines the possible names of snapshot
+		directories in the file-system. The option only supports Basic
+		Regular Expression (BRE).
+		</para>
+		</listitem>
+		</varlistentry>
+
+		<varlistentry>
+		<term>shadow:delimiter
+		</term>
+		<listitem>
+		<para>
+		This optional parameter is used as a delimiter between
+		<command>shadow:snapprefix</command> and <command>shadow:format</command>.
+		This parameter is used only when <command>shadow:snapprefix</command>
+		is set.
+		</para>
+		<para>Default: shadow:delimiter = "_GMT"</para>
+		</listitem>
+		</varlistentry>
+	</variablelist>
 </refsect1>
 
 <refsect1>
diff --git a/lib/ldb-samba/ldif_handlers.c b/lib/ldb-samba/ldif_handlers.c
index c0972a4..591bd1e 100644
--- a/lib/ldb-samba/ldif_handlers.c
+++ b/lib/ldb-samba/ldif_handlers.c
@@ -85,17 +85,32 @@ static int ldif_write_NDR(struct ldb_context *ldb, void *mem_ctx,
 static int ldif_read_objectSid(struct ldb_context *ldb, void *mem_ctx,
 			       const struct ldb_val *in, struct ldb_val *out)
 {
+	bool ret;
 	enum ndr_err_code ndr_err;
-	struct dom_sid *sid;
-	sid = dom_sid_parse_length(mem_ctx, in);
-	if (sid == NULL) {
-		return -1;
-	}
-	ndr_err = ndr_push_struct_blob(out, mem_ctx, sid,
-				       (ndr_push_flags_fn_t)ndr_push_dom_sid);
-	talloc_free(sid);
-	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+	struct dom_sid sid;
+	if (in->length > DOM_SID_STR_BUFLEN) {
 		return -1;
+	} else {
+		char p[in->length+1];
+		memcpy(p, in->data, in->length);
+		p[in->length] = '\0';
+		
+		ret = dom_sid_parse(p, &sid);
+		if (ret == false) {
+			return -1;
+		}
+		
+		*out = data_blob_talloc(mem_ctx, NULL,
+					ndr_size_dom_sid(&sid, 0));
+		if (out->data == NULL) {
+			return -1;
+		}
+	
+		ndr_err = ndr_push_struct_into_fixed_blob(out, &sid,
+				(ndr_push_flags_fn_t)ndr_push_dom_sid);
+		if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
+			return -1;
+		}
 	}
 	return 0;
 }
diff --git a/lib/ldb/ABI/ldb-1.1.26.sigs b/lib/ldb/ABI/ldb-1.1.27.sigs
similarity index 99%
copy from lib/ldb/ABI/ldb-1.1.26.sigs
copy to lib/ldb/ABI/ldb-1.1.27.sigs
index 3f33df9..4fa30d8 100644
--- a/lib/ldb/ABI/ldb-1.1.26.sigs
+++ b/lib/ldb/ABI/ldb-1.1.27.sigs
@@ -254,6 +254,7 @@ ldb_transaction_prepare_commit: int (struct ldb_context *)
 ldb_transaction_start: int (struct ldb_context *)
 ldb_unpack_data: int (struct ldb_context *, const struct ldb_val *, struct ldb_message *)
 ldb_unpack_data_only_attr_list: int (struct ldb_context *, const struct ldb_val *, struct ldb_message *, const char * const *, unsigned int, unsigned int *)
+ldb_unpack_data_only_attr_list_flags: int (struct ldb_context *, const struct ldb_val *, struct ldb_message *, const char * const *, unsigned int, unsigned int, unsigned int *)
 ldb_val_dup: struct ldb_val (TALLOC_CTX *, const struct ldb_val *)
 ldb_val_equal_exact: int (const struct ldb_val *, const struct ldb_val *)
 ldb_val_map_local: struct ldb_val (struct ldb_module *, void *, const struct ldb_map_attribute *, const struct ldb_val *)
diff --git a/lib/ldb/ABI/pyldb-util-1.1.10.sigs b/lib/ldb/ABI/pyldb-util-1.1.27.sigs
similarity index 100%
copy from lib/ldb/ABI/pyldb-util-1.1.10.sigs
copy to lib/ldb/ABI/pyldb-util-1.1.27.sigs
diff --git a/lib/ldb/ABI/pyldb-util-1.1.10.sigs b/lib/ldb/ABI/pyldb-util.py3-1.1.27.sigs
similarity index 100%
copy from lib/ldb/ABI/pyldb-util-1.1.10.sigs
copy to lib/ldb/ABI/pyldb-util.py3-1.1.27.sigs
diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c
index 7970b9d..cc3a552 100644
--- a/lib/ldb/common/ldb_pack.c
+++ b/lib/ldb/common/ldb_pack.c
@@ -211,20 +211,20 @@ static bool ldb_consume_element_data(uint8_t **pp, size_t *premaining)
 	return true;
 }
 
+
 /*
  * Unpack a ldb message from a linear buffer in ldb_val
  *
  * Providing a list of attributes to this function allows selective unpacking.
  * Giving a NULL list (or a list_size of 0) unpacks all the attributes.
- *
- * Free with ldb_unpack_data_free()
  */
-int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
-				   const struct ldb_val *data,
-				   struct ldb_message *message,
-				   const char * const *list,
-				   unsigned int list_size,
-				   unsigned int *nb_elements_in_db)
+int ldb_unpack_data_only_attr_list_flags(struct ldb_context *ldb,
+					 const struct ldb_val *data,
+					 struct ldb_message *message,
+					 const char * const *list,
+					 unsigned int list_size,
+					 unsigned int flags,
+					 unsigned int *nb_elements_in_db)
 {
 	uint8_t *p;
 	size_t remaining;
@@ -271,10 +271,14 @@ int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
 			errno = EIO;
 			goto failed;
 		}
-		message->dn = ldb_dn_new(message, ldb, (char *)p);
-		if (message->dn == NULL) {
-			errno = ENOMEM;
-			goto failed;
+		if (flags & LDB_UNPACK_DATA_FLAG_NO_DN) {
+			message->dn = NULL;
+		} else {
+			message->dn = ldb_dn_new(message, ldb, (char *)p);
+			if (message->dn == NULL) {
+				errno = ENOMEM;
+				goto failed;
+			}
 		}
 		/*
 		 * Redundant: by definition, remaining must be more
@@ -373,11 +377,15 @@ int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
 			}
 		}
 		element = &message->elements[nelem];
-		element->name = talloc_memdup(message->elements, attr, attr_len+1);
+		if (flags & LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC) {
+			element->name = attr;
+		} else {
+			element->name = talloc_memdup(message->elements, attr, attr_len+1);
 
-		if (element->name == NULL) {
-			errno = ENOMEM;
-			goto failed;
+			if (element->name == NULL) {
+				errno = ENOMEM;
+				goto failed;
+			}
 		}
 		element->flags = 0;
 
@@ -422,15 +430,18 @@ int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
 			}
 
 			element->values[j].length = len;
-			element->values[j].data = talloc_size(element->values, len+1);
-			if (element->values[j].data == NULL) {
-				errno = ENOMEM;
-				goto failed;
+			if (flags & LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC) {
+				element->values[j].data = p + 4;
+			} else {
+				element->values[j].data = talloc_size(element->values, len+1);
+				if (element->values[j].data == NULL) {
+					errno = ENOMEM;
+					goto failed;
+				}
+				memcpy(element->values[j].data, p + 4,
+				       len);
+				element->values[j].data[len] = 0;
 			}
-			memcpy(element->values[j].data, p + 4,
-			       len);
-			element->values[j].data[len] = 0;
-
 			remaining -= len;
 			p += len+4+1;
 		}
@@ -463,6 +474,30 @@ failed:
 	return -1;
 }
 
+/*
+ * Unpack a ldb message from a linear buffer in ldb_val
+ *
+ * Providing a list of attributes to this function allows selective unpacking.
+ * Giving a NULL list (or a list_size of 0) unpacks all the attributes.
+ *
+ * Free with ldb_unpack_data_free()
+ */
+int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
+				   const struct ldb_val *data,
+				   struct ldb_message *message,
+				   const char * const *list,
+				   unsigned int list_size,
+				   unsigned int *nb_elements_in_db)
+{
+	return ldb_unpack_data_only_attr_list_flags(ldb,
+						    data,
+						    message,
+						    list,
+						    list_size,
+						    0,
+						    nb_elements_in_db);
+}
+
 int ldb_unpack_data(struct ldb_context *ldb,
 		    const struct ldb_val *data,
 		    struct ldb_message *message)
diff --git a/lib/ldb/include/ldb_module.h b/lib/ldb/include/ldb_module.h
index c6a24d3..1c48590 100644
--- a/lib/ldb/include/ldb_module.h
+++ b/lib/ldb/include/ldb_module.h
@@ -390,6 +390,12 @@ int ldb_register_extended_match_rule(struct ldb_context *ldb,
 int ldb_pack_data(struct ldb_context *ldb,
 		  const struct ldb_message *message,
 		  struct ldb_val *data);
+/*
+ * Unpack a ldb message from a linear buffer in ldb_val
+ *
+ * Providing a list of attributes to this function allows selective unpacking.
+ * Giving a NULL list (or a list_size of 0) unpacks all the attributes.
+ */
 int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
 				   const struct ldb_val *data,
 				   struct ldb_message *message,
@@ -399,5 +405,27 @@ int ldb_unpack_data_only_attr_list(struct ldb_context *ldb,
 int ldb_unpack_data(struct ldb_context *ldb,
 		    const struct ldb_val *data,
 		    struct ldb_message *message);
+/*
+ * Unpack a ldb message from a linear buffer in ldb_val
+ *
+ * Providing a list of attributes to this function allows selective unpacking.
+ * Giving a NULL list (or a list_size of 0) unpacks all the attributes.
+ *
+ * Flags allow control of allocation, so that if
+ * LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC is specified, then values are
+ * not allocate, instead they point into the supplier constant buffer.
+ *
+ * Likewise if LDB_UNPACK_DATA_FLAG_NO_DN is specified, the DN is omitted.
+ */
+int ldb_unpack_data_only_attr_list_flags(struct ldb_context *ldb,
+					 const struct ldb_val *data,
+					 struct ldb_message *message,
+					 const char * const *list,
+					 unsigned int list_size,
+					 unsigned int flags,
+					 unsigned int *nb_elements_in_db);
+
+#define LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC 0x0001
+#define LDB_UNPACK_DATA_FLAG_NO_DN         0x0002
 
 #endif
diff --git a/lib/ldb/ldb_tdb/ldb_cache.c b/lib/ldb/ldb_tdb/ldb_cache.c
index 6467af1..2f19d27 100644
--- a/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/lib/ldb/ldb_tdb/ldb_cache.c
@@ -126,7 +126,7 @@ static int ltdb_attributes_load(struct ldb_module *module)
 	dn = ldb_dn_new(module, ldb, LTDB_ATTRIBUTES);
 	if (dn == NULL) goto failed;
 
-	r = ltdb_search_dn1(module, dn, msg);
+	r = ltdb_search_dn1(module, dn, msg, 0);
 	talloc_free(dn);
 	if (r != LDB_SUCCESS && r != LDB_ERR_NO_SUCH_OBJECT) {
 		goto failed;
@@ -301,7 +301,7 @@ int ltdb_cache_load(struct ldb_module *module)
 	baseinfo_dn = ldb_dn_new(baseinfo, ldb, LTDB_BASEINFO);
 	if (baseinfo_dn == NULL) goto failed;
 
-	r= ltdb_search_dn1(module, baseinfo_dn, baseinfo);
+	r= ltdb_search_dn1(module, baseinfo_dn, baseinfo, 0);
 	if (r != LDB_SUCCESS && r != LDB_ERR_NO_SUCH_OBJECT) {
 		goto failed;
 	}
@@ -319,7 +319,7 @@ int ltdb_cache_load(struct ldb_module *module)
 
 		tdb_transaction_commit(ltdb->tdb);
 
-		if (ltdb_search_dn1(module, baseinfo_dn, baseinfo) != LDB_SUCCESS) {
+		if (ltdb_search_dn1(module, baseinfo_dn, baseinfo, 0) != LDB_SUCCESS) {
 			goto failed;
 		}
 	}
@@ -341,7 +341,7 @@ int ltdb_cache_load(struct ldb_module *module)
 	options_dn = ldb_dn_new(options, ldb, LTDB_OPTIONS);
 	if (options_dn == NULL) goto failed;
 
-	r= ltdb_search_dn1(module, options_dn, options);
+	r= ltdb_search_dn1(module, options_dn, options, 0);
 	if (r != LDB_SUCCESS && r != LDB_ERR_NO_SUCH_OBJECT) {
 		goto failed;
 	}
@@ -374,7 +374,7 @@ int ltdb_cache_load(struct ldb_module *module)
 	indexlist_dn = ldb_dn_new(module, ldb, LTDB_INDEXLIST);
 	if (indexlist_dn == NULL) goto failed;
 
-	r = ltdb_search_dn1(module, indexlist_dn, ltdb->cache->indexlist);
+	r = ltdb_search_dn1(module, indexlist_dn, ltdb->cache->indexlist, 0);
 	if (r != LDB_SUCCESS && r != LDB_ERR_NO_SUCH_OBJECT) {
 		goto failed;
 	}
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index 5383653..392b4a7 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -105,7 +105,7 @@ static struct dn_list *ltdb_index_idxptr(struct ldb_module *module, TDB_DATA rec
 {
 	struct dn_list *list;
 	if (rec.dsize != sizeof(void *)) {
-		ldb_asprintf_errstring(ldb_module_get_ctx(module), 
+		ldb_asprintf_errstring(ldb_module_get_ctx(module),
 				       "Bad data size for idxptr %u", (unsigned)rec.dsize);
 		return NULL;
 	}
@@ -115,14 +115,14 @@ static struct dn_list *ltdb_index_idxptr(struct ldb_module *module, TDB_DATA rec
 	memcpy(&list, rec.dptr, sizeof(void *));
 	list = talloc_get_type(list, struct dn_list);
 	if (list == NULL) {
-		ldb_asprintf_errstring(ldb_module_get_ctx(module), 
-				       "Bad type '%s' for idxptr", 
+		ldb_asprintf_errstring(ldb_module_get_ctx(module),
+				       "Bad type '%s' for idxptr",
 				       talloc_get_name(list));
 		return NULL;
 	}
 	if (check_parent && list->dn && talloc_parent(list->dn) != list) {
-		ldb_asprintf_errstring(ldb_module_get_ctx(module), 
-				       "Bad parent '%s' for idxptr", 
+		ldb_asprintf_errstring(ldb_module_get_ctx(module),
+				       "Bad parent '%s' for idxptr",
 				       talloc_get_name(talloc_parent(list->dn)));
 		return NULL;
 	}
@@ -130,7 +130,7 @@ static struct dn_list *ltdb_index_idxptr(struct ldb_module *module, TDB_DATA rec
 }
 
 /*
-  return the @IDX list in an index entry for a dn as a 
+  return the @IDX list in an index entry for a dn as a
   struct dn_list
  */
 static int ltdb_dn_list_load(struct ldb_module *module,
@@ -178,7 +178,9 @@ normal_index:
 		return LDB_ERR_OPERATIONS_ERROR;
 	}
 
-	ret = ltdb_search_dn1(module, dn, msg);
+	ret = ltdb_search_dn1(module, dn, msg,
+			      LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC
+			      |LDB_UNPACK_DATA_FLAG_NO_DN);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(msg);
 		return ret;
@@ -192,10 +194,18 @@ normal_index:
 		return LDB_SUCCESS;
 	}
 
-	/* we avoid copying the strings by stealing the list */
+	/*
+	 * we avoid copying the strings by stealing the list.  We have
+	 * to steal msg onto el->values (which looks odd) because we
+	 * asked for the memory to be allocated on msg, not on each
+	 * value with LDB_UNPACK_DATA_FLAG_NO_DATA_ALLOC above
+	 */
+	talloc_steal(el->values, msg);
 	list->dn = talloc_steal(list, el->values);
 	list->count = el->num_values;
 
+	/* We don't need msg->elements any more */
+	talloc_free(msg->elements);
 	return LDB_SUCCESS;
 }
 
@@ -203,7 +213,7 @@ normal_index:
 /*
   save a dn_list into a full @IDX style record
  */
-static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn, 
+static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn,
 				   struct dn_list *list)
 {
 	struct ldb_message *msg;
@@ -249,7 +259,7 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn,
 /*
   save a dn_list into the database, in either @IDX or internal format
  */
-static int ltdb_dn_list_store(struct ldb_module *module, struct ldb_dn *dn, 
+static int ltdb_dn_list_store(struct ldb_module *module, struct ldb_dn *dn,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list