Re: [Samba] Interoperability with MAC OSX clients, resource forks, xattrs
Stefan Rompf stefan at loplof.de writes: Thoughts? I'm working on a adouble backend for _Netatalk_ which will store all Mac extra data in extended attributes. As you've noticed most filesystems limit the maximum size of EAs, therefore the new adouble module will split Mac ressourceforks larger than this limit into multiple EAs. -f -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
[Samba] Can not logon to domain
Hi all, After new year I started to getting error when trying to logon to domain. On XP machine I get The system connot log you on now because the domain DOMAIN is not available. On Win7 Trust Relationship Between Workstation and Domain Fails Everything worked well before Christmass; I don't remember any (relevant) changes. I'm getting this error in log: netlogon_creds_server_check failed. Rejecting auth request from client COMPUTER machine account COMPUTER$ After reading some googled solution nothing seems be relevant for me ... I tried to enable WINS - nothing. I set new machine joining it without problem, but now can not logon. Samba version 3.5.11 (Ubunutu 11.10) Ldap: 2.4.25 Machines: WinXP and Win7 For moment we setup local account to login, but profile is not loaded - as expected - what is kind of blocking. Note: I have two PDC on net. One works ok (debian testing), other not (ubuntu). -- Oto BREZINA -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Re: [Samba] Can not logon to domain
On 02/01/12 12:50, sa...@printflow.eu wrote: Hi all, After new year I started to getting error when trying to logon to domain. On XP machine I get The system connot log you on now because the domain DOMAIN is not available. On Win7 Trust Relationship Between Workstation and Domain Fails Everything worked well before Christmass; I don't remember any (relevant) changes. I'm getting this error in log: netlogon_creds_server_check failed. Rejecting auth request from client COMPUTER machine account COMPUTER$ After reading some googled solution nothing seems be relevant for me ... I tried to enable WINS - nothing. I set new machine joining it without problem, but now can not logon. Samba version 3.5.11 (Ubunutu 11.10) Ldap: 2.4.25 Machines: WinXP and Win7 For moment we setup local account to login, but profile is not loaded - as expected - what is kind of blocking. Note: I have two PDC on net. One works ok (debian testing), other not (ubuntu). Do you mean you have two PDCs or a primary DC and a backup DC. As I understand it, you can't have multiple Primary Domain Controllers on Samba. PDC is enabled if you have both Domain Logons and Domain Master set to yes. You can demote on to BDC by setting Domain Master to no. Also, only one can the WINS server. Adding the IP of the WINS server to the network settings on the clients may make it work although it shouldn't be necessary. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
[Samba] limiting netbios browsing
Given a DC environment where very few (1-3) hosts actually need to be discovered via browsing is there a good way to limit what is browseable? I'm thinking of something like a read-only WINS - where WINS provides only those servers that need be contacted and doesn't allow client registrations. Such as a wins.dat that only contains the following: VERSION 1 0 MYDOMAIN#1e 1325615798 0.0.0.0 e4R MYDOMAIN#1c 1325572378 192.168.1.4 e4R FILESERVER#00 1325615798 192.168.1.6 64R FILESERVER#20 1325615798 192.168.1.6 64R MYDOMAIN#00 1325615798 0.0.0.0 e4R DOMCONTROL#20 1325572378 192.168.1.4 66R DOMCONTROL#00 1325572378 192.168.1.4 66R DOMCONTROL#03 1325572378 192.168.1.4 66R MYDOMAIN#1b 1325572378 192.168.1.4 64R FILESERVER#03 1325615798 192.168.1.6 64R With a p-p node type clients can browse for the needed info as shown above but wouldn't see all of the other client systems in the browse list. Unfortunately the wins.dat file will not maintain a read only status and all of the clients will end up getting registered (and in the browse list). Am I missing something? Thanks, Chris -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ad3c0e0 talloc: Slightly simplify talloc_unlink via 0bee871 talloc: Fix a typo from 48804e4 Fix the build without kerberos http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ad3c0e03e2e1178a707ec6c529108f1df71a47a4 Author: Volker Lendecke v...@samba.org Date: Mon Jan 2 14:56:04 2012 +0100 talloc: Slightly simplify talloc_unlink Nested if's are hard to understand to me. Signed-off-by: Stefan Metzmacher me...@samba.org Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Mon Jan 2 19:07:23 CET 2012 on sn-devel-104 commit 0bee8719b2dffc98557b9b3d68bb589b5589f3a4 Author: Volker Lendecke v...@samba.org Date: Mon Jan 2 14:27:37 2012 +0100 talloc: Fix a typo --- Summary of changes: lib/talloc/talloc.c | 21 ++--- 1 files changed, 10 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 2098a32..38e6f21 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -1043,7 +1043,7 @@ static inline int talloc_unreference(const void *context, const void *ptr) */ _PUBLIC_ int talloc_unlink(const void *context, void *ptr) { - struct talloc_chunk *tc_p, *new_p; + struct talloc_chunk *tc_p, *new_p, *tc_c; void *new_parent; if (ptr == NULL) { @@ -1058,14 +1058,13 @@ _PUBLIC_ int talloc_unlink(const void *context, void *ptr) return 0; } - if (context == NULL) { - if (talloc_parent_chunk(ptr) != NULL) { - return -1; - } + if (context != NULL) { + tc_c = talloc_chunk_from_ptr(context); } else { - if (talloc_chunk_from_ptr(context) != talloc_parent_chunk(ptr)) { - return -1; - } + tc_c = NULL; + } + if (tc_c != talloc_parent_chunk(ptr)) { + return -1; } tc_p = talloc_chunk_from_ptr(ptr); @@ -1176,7 +1175,7 @@ _PUBLIC_ void *talloc_check_name(const void *ptr, const char *name) return NULL; } -static void talloc_abort_type_missmatch(const char *location, +static void talloc_abort_type_mismatch(const char *location, const char *name, const char *expected) { @@ -1199,7 +1198,7 @@ _PUBLIC_ void *_talloc_get_type_abort(const void *ptr, const char *name, const c const char *pname; if (unlikely(ptr == NULL)) { - talloc_abort_type_missmatch(location, NULL, name); + talloc_abort_type_mismatch(location, NULL, name); return NULL; } @@ -1208,7 +1207,7 @@ _PUBLIC_ void *_talloc_get_type_abort(const void *ptr, const char *name, const c return discard_const_p(void, ptr); } - talloc_abort_type_missmatch(location, pname, name); + talloc_abort_type_mismatch(location, pname, name); return NULL; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 4fd1220 s4:torture/rpc/netlogon.c - enhance the DsRGetDCName* tests via 9ab7299 ldb:ldb/common/ldb_controls.c - reference err_string variable correctly via 79f9a22 s4-provision: Fix tdbdump path lookup in make test. from ad3c0e0 talloc: Slightly simplify talloc_unlink http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4fd1220f9ab3e205620256a9c085bfc8de3ddc63 Author: Matthias Dieter Wallnöfer m...@samba.org Date: Thu Nov 24 10:20:24 2011 +0100 s4:torture/rpc/netlogon.c - enhance the DsRGetDCName* tests To check for the expected behaviour (DS_* flags). Always according to MS-NRPC 2.2.1.2.1. Signed-off-by: Stefan Metzmacher me...@samba.org Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Mon Jan 2 20:43:05 CET 2012 on sn-devel-104 commit 9ab7299b329e55e0a320afa9252f05639510453e Author: Matthias Dieter Wallnöfer m...@samba.org Date: Thu Dec 22 11:47:44 2011 +0100 ldb:ldb/common/ldb_controls.c - reference err_string variable correctly Signed-off-by: Stefan Metzmacher me...@samba.org commit 79f9a2240e310d8e1fecec67084f25be694ff3b8 Author: Andreas Schneider a...@samba.org Date: Fri Dec 16 19:03:54 2011 +0100 s4-provision: Fix tdbdump path lookup in make test. Signed-off-by: Stefan Metzmacher me...@samba.org --- Summary of changes: lib/ldb/common/ldb_controls.c |2 +- .../scripting/python/samba/provision/sambadns.py |2 +- source4/torture/rpc/netlogon.c | 96 3 files changed, 98 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/common/ldb_controls.c b/lib/ldb/common/ldb_controls.c index 5b5f357..7ce4fc3 100644 --- a/lib/ldb/common/ldb_controls.c +++ b/lib/ldb/common/ldb_controls.c @@ -1041,7 +1041,7 @@ struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, TALLOC_C for (i = 0; control_strings[i]; i++) { ctrl[i] = ldb_parse_control_from_string(ldb, ctrl, control_strings[i]); if (ctrl[i] == NULL) { - if( ldb_errstring == NULL ) { + if (ldb_errstring(ldb) == NULL) { /* no controls matched, throw an error */ ldb_asprintf_errstring(ldb, Invalid control name: '%s', control_strings[i]); } diff --git a/source4/scripting/python/samba/provision/sambadns.py b/source4/scripting/python/samba/provision/sambadns.py index 9d85307..5fa022b 100644 --- a/source4/scripting/python/samba/provision/sambadns.py +++ b/source4/scripting/python/samba/provision/sambadns.py @@ -669,7 +669,7 @@ def tdb_copy(logger, file1, file2): Copy tdb file using tdbbackup utility and rename it # Find the location of tdbbackup tool -dirs = [bin, samba.param.bin_dir()] +dirs = [bin, samba.param.bin_dir()] + os.getenv('PATH').split(os.pathsep) for d in dirs: toolpath = os.path.join(d, tdbbackup) if os.path.exists(toolpath): diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index ab9ef02..f1d605c 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -2481,12 +2481,44 @@ static bool test_netr_DsRGetDCName(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, DsRGetDCName); torture_assert_werr_ok(tctx, r.out.result, DsRGetDCName); + torture_assert_int_equal(tctx, +(info-dc_flags (DS_DNS_CONTROLLER)), +DS_DNS_CONTROLLER, +DsRGetDCName); + torture_assert_int_equal(tctx, +(info-dc_flags (DS_DNS_DOMAIN)), +DS_DNS_DOMAIN, +DsRGetDCName); + torture_assert_int_equal(tctx, +(info-dc_flags (DS_DNS_FOREST_ROOT)), +DS_DNS_FOREST_ROOT, +DsRGetDCName); + r.in.domain_name= lpcfg_workgroup(tctx-lp_ctx); + r.in.flags = 0; status = dcerpc_netr_DsRGetDCName_r(b, tctx, r); torture_assert_ntstatus_ok(tctx, status, DsRGetDCName); torture_assert_werr_ok(tctx, r.out.result, DsRGetDCName); + torture_assert_int_equal(tctx, +(info-dc_flags (DS_DNS_CONTROLLER)), 0, +DsRGetDCName); + torture_assert_int_equal(tctx, +(info-dc_flags (DS_DNS_DOMAIN)), 0, +DsRGetDCName); + torture_assert_int_equal(tctx, +
[SCM] CTDB repository - branch master updated - ctdb-1.12-154-g15d8ae8
The branch, master has been updated via 15d8ae8b0f80f95d7839528b8ac60aa0e2485c77 (commit) via adcb076612c56f92cfb6f3ba90721981a067a494 (commit) via 726b598076132a5a73f9259d6b65ee2a4012099f (commit) via 5b11f990404c26c279c9ae389483e560f1c01a81 (commit) via 54377ef8b992f92d3a4ece42ee72e37d22cd2de6 (commit) via 2c1baf5ddd3c2cdd2a3f98b8e208d3a48530d1d1 (commit) via 355685a14be17bf4648788f8a72c54790fe03502 (commit) via fade71539482e8276f57ba3c003fe004d8666ce7 (commit) via 920e3a732eb9e09004edde6cfb3c7db8a004016f (commit) from 809d1f3b8a9232fce0376cb47e4f633b49237529 (commit) http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master - Log - commit 15d8ae8b0f80f95d7839528b8ac60aa0e2485c77 Merge: adcb076612c56f92cfb6f3ba90721981a067a494 809d1f3b8a9232fce0376cb47e4f633b49237529 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue Jan 3 12:40:15 2012 +1100 Merge branch 'master' of ssh://git.samba.org/data/git/ctdb commit adcb076612c56f92cfb6f3ba90721981a067a494 Merge: 00373958a5d5fb8c9b99548d5b9f327e78669162 726b598076132a5a73f9259d6b65ee2a4012099f Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue Jan 3 12:31:37 2012 +1100 Merge remote branch 'martins/nodestatus' commit 726b598076132a5a73f9259d6b65ee2a4012099f Author: Martin Schwenke mar...@meltin.net Date: Wed Dec 7 18:40:55 2011 +1100 Tests - make a comment more accurate Signed-off-by: Martin Schwenke mar...@meltin.net commit 5b11f990404c26c279c9ae389483e560f1c01a81 Author: Martin Schwenke mar...@meltin.net Date: Wed Dec 7 14:04:54 2011 +1100 Tests - test code for parse_nodestring() function This function is fairly complex so here is some test code. This reworks Makefile a bit and also provides test stubs for some libctdb functions. Signed-off-by: Martin Schwenke mar...@meltin.net commit 54377ef8b992f92d3a4ece42ee72e37d22cd2de6 Author: Martin Schwenke mar...@meltin.net Date: Wed Dec 7 13:40:24 2011 +1100 Rename struct traverse_state to allow tools C files to be #included. Signed-off-by: Martin Schwenke mar...@meltin.net commit 2c1baf5ddd3c2cdd2a3f98b8e208d3a48530d1d1 Author: Martin Schwenke mar...@meltin.net Date: Wed Dec 7 13:35:49 2011 +1100 ctdb tool - remove verify_node() function parse_nodestring() checks what this used to check. parse_nodestring() already has the nodemap. It was a 50-50 decision to decide whether to update verify_node() to check against a nodemap that is passed in or to delete it. Signed-off-by: Martin Schwenke mar...@meltin.net Conflicts: tools/ctdb.c Signed-off-by: Martin Schwenke mar...@meltin.net commit 355685a14be17bf4648788f8a72c54790fe03502 Author: Martin Schwenke mar...@meltin.net Date: Tue Dec 6 20:17:02 2011 +1100 ctdb tool - new command ctdb nodestatus [nodestring] This is very much like ctdb status but actually returns the status for use in scripts. This can be used in 2 modes: * An optional nodestring is passed directly to the command without using -n. In this mode the current node is asked for the status of all listed nodes. * The nodestring is passed via -n. In this mode the designated nodes will be asked for their status. This is like ctdb status. These modes can be mixed. For example: ctdb nodestatus 1,2,3 -n 0 asks node 0 for the status of nodes 1, 2 and 3, returning the bitwise OR of their statuses. This version uses the auto_all functionality, so the output isn't necessarily pretty. An improved version that does its own -n processing may appear soon. Signed-off-by: Martin Schwenke mar...@meltin.net commit fade71539482e8276f57ba3c003fe004d8666ce7 Author: Martin Schwenke mar...@meltin.net Date: Tue Dec 6 20:10:34 2011 +1100 ctdb tool - factor out status printing functions Create 2 new functions: control_status_1_machine() and control_status_1_human() that contain chunks of code from control_status(). We're about to find another purpose for these functions. This should be a no-op. Signed-off-by: Martin Schwenke mar...@meltin.net commit 920e3a732eb9e09004edde6cfb3c7db8a004016f Author: Martin Schwenke mar...@meltin.net Date: Tue Dec 6 19:50:40 2011 +1100 ctdb tool - generalise nodestring parsing for -n Centralise -n nodestring parsing and add the ability to pass a comma-separated list of node numbers. Listing a node that is disconnected or deleted results in failure, similar to the way passing a single node currently works. All of the auto_all commands inherit this functionality. For now, the non-auto_all commands do not inherit this - they need to be individually tweaked. Therefore, we
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 90f06d6 s4-provision: Fix the problem of DnsProperty values not being set correctly from 4fd1220 s4:torture/rpc/netlogon.c - enhance the DsRGetDCName* tests http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 90f06d69f02072d7b76fe2fa80963d6bf82c2bae Author: Amitay Isaacs ami...@gmail.com Date: Tue Jan 3 13:51:00 2012 +1100 s4-provision: Fix the problem of DnsProperty values not being set correctly DnsProperty can have empty 'data' member. To parse Dnsproperty with empty data, dnsp.idl has a hack as follows: [switch_is(wDataLength?id:DSPROPERTY_ZONE_EMPTY)] dnsPropertyData data; This implies, to set 'data' value, wDataLength has to be set to a non-zero value first. Autobuild-User: Amitay Isaacs ami...@samba.org Autobuild-Date: Tue Jan 3 05:26:32 CET 2012 on sn-devel-104 --- Summary of changes: .../scripting/python/samba/provision/sambadns.py |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/scripting/python/samba/provision/sambadns.py b/source4/scripting/python/samba/provision/sambadns.py index 5fa022b..db98f13 100644 --- a/source4/scripting/python/samba/provision/sambadns.py +++ b/source4/scripting/python/samba/provision/sambadns.py @@ -144,6 +144,7 @@ class SRVRecord(dnsp.DnssrvRpcRecord): class TypeProperty(dnsp.DnsProperty): def __init__(self, zone_type=dnsp.DNS_ZONE_TYPE_PRIMARY): super(TypeProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_TYPE self.data = zone_type @@ -151,6 +152,7 @@ class TypeProperty(dnsp.DnsProperty): class AllowUpdateProperty(dnsp.DnsProperty): def __init__(self, allow_update=dnsp.DNS_ZONE_UPDATE_SECURE): super(AllowUpdateProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_ALLOW_UPDATE self.data = allow_update @@ -158,6 +160,7 @@ class AllowUpdateProperty(dnsp.DnsProperty): class SecureTimeProperty(dnsp.DnsProperty): def __init__(self, secure_time=0): super(SecureTimeProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_SECURE_TIME self.data = secure_time @@ -165,6 +168,7 @@ class SecureTimeProperty(dnsp.DnsProperty): class NorefreshIntervalProperty(dnsp.DnsProperty): def __init__(self, norefresh_interval=0): super(NorefreshIntervalProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_NOREFRESH_INTERVAL self.data = norefresh_interval @@ -172,6 +176,7 @@ class NorefreshIntervalProperty(dnsp.DnsProperty): class RefreshIntervalProperty(dnsp.DnsProperty): def __init__(self, refresh_interval=0): super(RefreshIntervalProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_REFRESH_INTERVAL self.data = refresh_interval @@ -179,6 +184,7 @@ class RefreshIntervalProperty(dnsp.DnsProperty): class AgingStateProperty(dnsp.DnsProperty): def __init__(self, aging_enabled=0): super(AgingStateProperty, self).__init__() +self.wDataLength = 1 self.version = 1 self.id = dnsp.DSPROPERTY_ZONE_AGING_STATE self.data = aging_enabled @@ -186,6 +192,7 @@ class AgingStateProperty(dnsp.DnsProperty): class AgingEnabledTimeProperty(dnsp.DnsProperty): def __init__(self, next_cycle_hours=0): super(AgingEnabledTimeProperty, self).__init__() +self.wDataLength = 1 self.version = 1; self.id = dnsp.DSPROPERTY_ZONE_AGING_ENABLED_TIME self.data = next_cycle_hours -- Samba Shared Repository
autobuild: intermittent test failure detected
The autobuild test system has detected an intermittent failing test in the current master tree. The autobuild log of the failure is available here: http://git.samba.org/autobuild.flakey/2012-01-03-0528/flakey.log The samba3 build logs are available here: http://git.samba.org/autobuild.flakey/2012-01-03-0528/samba3.stderr http://git.samba.org/autobuild.flakey/2012-01-03-0528/samba3.stdout The source4 build logs are available here: http://git.samba.org/autobuild.flakey/2012-01-03-0528/samba4.stderr http://git.samba.org/autobuild.flakey/2012-01-03-0528/samba4.stdout The top commit at the time of the failure was: commit 4fd1220f9ab3e205620256a9c085bfc8de3ddc63 Author: Matthias Dieter Wallnöfer m...@samba.org Date: Thu Nov 24 10:20:24 2011 +0100 s4:torture/rpc/netlogon.c - enhance the DsRGetDCName* tests To check for the expected behaviour (DS_* flags). Always according to MS-NRPC 2.2.1.2.1. Signed-off-by: Stefan Metzmacher me...@samba.org Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Mon Jan 2 20:43:05 CET 2012 on sn-devel-104
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f66ef5c upgradeprovision: do not hold references to messageElements via f05edc0 pyldb: raise an exception if we can't add the attribute via 3213d1e upgradeprovision: treat provision without oem attribute as quite recent, it's provision that comes from Windows replication from 90f06d6 s4-provision: Fix the problem of DnsProperty values not being set correctly http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f66ef5cfbc932dc03a5bea61e9cb10dd8d948128 Author: Matthieu Patou m...@matws.net Date: Mon Jan 2 19:27:48 2012 -0800 upgradeprovision: do not hold references to messageElements Autobuild-User: Matthieu Patou m...@samba.org Autobuild-Date: Tue Jan 3 08:20:02 CET 2012 on sn-devel-104 commit f05edc0ecb9da2cb00a83b38d0be5812cc4ccf77 Author: Matthieu Patou m...@matws.net Date: Mon Jan 2 19:25:56 2012 -0800 pyldb: raise an exception if we can't add the attribute commit 3213d1e0b770690b1a964f38fb57ebbcd8ce0746 Author: Matthieu Patou m...@matws.net Date: Thu Aug 25 18:05:28 2011 +0200 upgradeprovision: treat provision without oem attribute as quite recent, it's provision that comes from Windows replication --- Summary of changes: lib/ldb/pyldb.c|7 ++- source4/scripting/bin/upgradeprovision | 29 ++--- 2 files changed, 24 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index b2315e6..b253bcd 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -2668,12 +2668,17 @@ static int py_ldb_msg_setitem(PyLdbMessageObject *self, PyObject *name, PyObject /* delitem */ ldb_msg_remove_attr(self-msg, attr_name); } else { + int ret; struct ldb_message_element *el = PyObject_AsMessageElement(self-msg, value, 0, attr_name); if (el == NULL) return -1; ldb_msg_remove_attr(pyldb_Message_AsMessage(self), attr_name); - ldb_msg_add(pyldb_Message_AsMessage(self), el, el-flags); + ret = ldb_msg_add(pyldb_Message_AsMessage(self), el, el-flags); + if (ret != LDB_SUCCESS) { + PyErr_SetLdbError(PyExc_LdbError, ret, NULL); + return -1; + } } return 0; } diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision index f403120..738d6be 100755 --- a/source4/scripting/bin/upgradeprovision +++ b/source4/scripting/bin/upgradeprovision @@ -341,11 +341,11 @@ def handle_special_case(att, delta, new, old, useReplMetadata, basedn, aldb): :return: True to indicate that the attribute should be kept, False for discarding it -flag = delta.get(att).flags() # We do most of the special case handle if we do not have the # highest usn as otherwise the replPropertyMetaData will guide us more # correctly if not useReplMetadata: +flag = delta.get(att).flags() if (att == sPNMappings and flag == FLAG_MOD_REPLACE and ldb.Dn(aldb, CN=Directory Service,CN=Windows NT, CN=Services,CN=Configuration,%s % basedn) @@ -418,7 +418,7 @@ def handle_special_case(att, delta, new, old, useReplMetadata, basedn, aldb): # This is a bit of special animal as we might have added # already SPN entries to the list that has to be modified # So we go in detail to try to find out what has to be added ... -if (att == servicePrincipalName and flag == FLAG_MOD_REPLACE): +if (att == servicePrincipalName and delta.get(att).flags() == FLAG_MOD_REPLACE): hash = {} newval = [] changeDelta = 0 @@ -763,8 +763,7 @@ def handle_links(samdb, att, basedn, dn, value, ref_value, delta): :param delta: The MessageElement object that will be applied for transforming the current provision -res = samdb.search(expression=dn=%s % dn, base=basedn, -controls=[search_options:1:2, reveal:1], +res = samdb.search(base=dn, controls=[search_options:1:2, reveal:1], attrs=[att]) blacklist = {} @@ -772,7 +771,8 @@ def handle_links(samdb, att, basedn, dn, value, ref_value, delta): newlinklist = [] changed = False -newlinklist.extend(value) +for v in value: +newlinklist.append(str(v)) for e in value: hash[e] = 1 @@ -797,6 +797,8 @@ def handle_links(samdb, att, basedn, dn, value, ref_value, delta): else: delta.remove(att) +return delta + msg_elt_flag_strs = { ldb.FLAG_MOD_ADD: