<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-13164</id>
	<title>Nabble - Samba - samba-technical</title>
	<updated>2009-11-29T15:57:11Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Samba---samba-technical-f13164.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Samba---samba-technical-f13164.html" />
	<subtitle type="html">Discussions on Samba internals. For general questions please subscribe to the list samba@samba.org</subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26567753</id>
	<title>Re: important: Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T15:57:11Z</published>
	<updated>2009-11-29T15:57:11Z</updated>
	<author>
		<name>Andrew Bartlett</name>
	</author>
	<content type="html">On Mon, 2009-11-30 at 01:07 +0300, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 30/11/2009 00:30, Andrew Bartlett wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Sun, 2009-11-29 at 17:02 +0300, Matthieu Patou wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Dear all, I've been trying to upgrade a very old provision (alpha3) I've
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; been hit by errors like this:
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; _ldb.LdbError: (80, 'schema_load_init: dsdb_set_schema() failed: 32:No
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; such object')
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; After a careful investigation I am 99% sure that those two changes
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; (introduced in changeset 6b05a907) are wrong
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; @@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mod_msg-&amp;gt;num_elements&amp;gt; &amp;nbsp;0) {
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; @@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mod_msg-&amp;gt;num_elements&amp;gt; &amp;nbsp;0) {
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Because the different elements with different flags (add,replace,delete)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; and using samdb_replace will override this flag by using just replace.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Obviously if the ldb_diff was telling you that you should add the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; attribute 'foo' trying to make ldb modify the 'foo' attribute will not
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; be very good.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Also I'm quite puzzled by the use ldb_msg_diff and the order of
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; parameters. Because res-&amp;gt;msgs[0] is an message element obtained from a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; search in the LDB database represented by the ldb object.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; So to my mind by doing
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; we are comparing res-&amp;gt;msgs[0] and msg and using res-&amp;gt;msgs[0] as a
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; reference, so there is no point trying to apply changes in the ldb
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; object as the attributes have already the value contained in the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; different messageElement of the mod_msg object.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; So I think parameters should be swapped it makes just sens from the
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; point of view of the comparison and the modification of the ldb but for
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; the overall logic I'm much more reserved.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt; I've looked over the code, and while I agree the samdb_replace seems
&lt;br&gt;&amp;gt; &amp;gt; wrong, but before we added it, it just didn't work. &amp;nbsp;The goal of this
&lt;br&gt;&amp;gt; &amp;gt; routine is to build new @ATTRIBUTE records and @INDEX records, and to
&lt;br&gt;&amp;gt; &amp;gt; then, if they differ from the DB, replace them in a DB.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; It's not very clear from what @ATTRIBUTE and @INDEX are built can you 
&lt;br&gt;&amp;gt; explain me ?
&lt;/div&gt;&lt;/div&gt;What we do is walk over the schema, and if the schema elements tell us
&lt;br&gt;that an object is case sensitive, or if it is indexed, then we add it to
&lt;br&gt;those attributes. 
&lt;br&gt;&lt;br&gt;The idea is then that every time we load the schema, we check that this
&lt;br&gt;on-disk record (used by ldb before the schema is loaded, and used to
&lt;br&gt;determine indexing) is in sync with the schema. 
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; The purpose of res-&amp;gt;msgs[0] is to give the current DB as a base to the
&lt;br&gt;&amp;gt; &amp;gt; diff function.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; Yeah I checked that ldb_msg_diff use the last ldbMessage as the ref, I 
&lt;br&gt;&amp;gt; tried to revert to ldb_modify but it didn't make the trick, as it was 
&lt;br&gt;&amp;gt; proposing &amp;nbsp;to add attribute to @ATTRIBUTE that were already in the database.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I'll try to remake trace so that we can further discuss it.
&lt;br&gt;&lt;br&gt;Thanks, 
&lt;br&gt;&lt;br&gt;Andrew Bartlett
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andrew Bartlett &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://samba.org/~abartlet/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org/~abartlet/&lt;/a&gt;&lt;br&gt;Authentication Developer, Samba Team &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://samba.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org&lt;/a&gt;&lt;br&gt;Samba Developer, Cisco Inc.
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26567753/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26567753.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26567654</id>
	<title>Re: important: Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T15:41:23Z</published>
	<updated>2009-11-29T15:41:23Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I finally rested the whole thing reverting to ldb_modify is to my mind 
&lt;br&gt;the good solution.
&lt;br&gt;&lt;br&gt;I attached a patch for this and 2 patch for updateprovision.
&lt;br&gt;&lt;br&gt;The whole serie allow update of quite old provision (ie. alpha3).
&lt;br&gt;&lt;br&gt;Matthieu
&lt;br&gt;&lt;br&gt;On 30/11/2009 01:07, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 30/11/2009 00:30, Andrew Bartlett wrote:
&lt;br&gt;&amp;gt;&amp;gt; On Sun, 2009-11-29 at 17:02 +0300, Matthieu Patou wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Dear all, I've been trying to upgrade a very old provision (alpha3) I've
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; been hit by errors like this:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; _ldb.LdbError: (80, 'schema_load_init: dsdb_set_schema() failed: 32:No
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; such object')
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; After a careful investigation I am 99% sure that those two changes
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; (introduced in changeset 6b05a907) are wrong
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if (mod_msg-&amp;gt;num_elements&amp;gt; 0) {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; - ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; + ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; @@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; if (mod_msg-&amp;gt;num_elements&amp;gt; 0) {
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; - ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; + ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; }
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Because the different elements with different flags (add,replace,delete)
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; and using samdb_replace will override this flag by using just replace.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Obviously if the ldb_diff was telling you that you should add the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; attribute 'foo' trying to make ldb modify the 'foo' attribute will not
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; be very good.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Also I'm quite puzzled by the use ldb_msg_diff and the order of
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; parameters. Because res-&amp;gt;msgs[0] is an message element obtained from a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; search in the LDB database represented by the ldb object.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; So to my mind by doing
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; we are comparing res-&amp;gt;msgs[0] and msg and using res-&amp;gt;msgs[0] as a
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; reference, so there is no point trying to apply changes in the ldb
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; object as the attributes have already the value contained in the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; different messageElement of the mod_msg object.
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; So I think parameters should be swapped it makes just sens from the
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; point of view of the comparison and the modification of the ldb but for
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; the overall logic I'm much more reserved.
&lt;br&gt;&amp;gt;&amp;gt; I've looked over the code, and while I agree the samdb_replace seems
&lt;br&gt;&amp;gt;&amp;gt; wrong, but before we added it, it just didn't work. The goal of this
&lt;br&gt;&amp;gt;&amp;gt; routine is to build new @ATTRIBUTE records and @INDEX records, and to
&lt;br&gt;&amp;gt;&amp;gt; then, if they differ from the DB, replace them in a DB.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; It's not very clear from what @ATTRIBUTE and @INDEX are built can you
&lt;br&gt;&amp;gt; explain me ?
&lt;br&gt;&amp;gt;&amp;gt; The purpose of res-&amp;gt;msgs[0] is to give the current DB as a base to the
&lt;br&gt;&amp;gt;&amp;gt; diff function.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; Yeah I checked that ldb_msg_diff use the last ldbMessage as the ref, I
&lt;br&gt;&amp;gt; tried to revert to ldb_modify but it didn't make the trick, as it was
&lt;br&gt;&amp;gt; proposing to add attribute to @ATTRIBUTE that were already in the database.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'll try to remake trace so that we can further discuss it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Matthieu.
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;tt&gt;[0001-s4-remove-a-leftover-debug-message.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From 11509ff6cfe4ec9b03f6f1a6112033076b8c23d6 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26567654&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, 30 Nov 2009 02:36:52 +0300
&lt;br&gt;Subject: [PATCH 1/3] s4: remove a leftover debug message :-)
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; &amp;nbsp;1 -
&lt;br&gt;&amp;nbsp;1 files changed, 0 insertions(+), 1 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index 4b0cfec..f8735fc 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -341,7 +341,6 @@ def dn_sort(x,y):
&lt;br&gt;&amp;nbsp;# it also populate hash structure for later use in the upgrade process
&lt;br&gt;&amp;nbsp;def handle_security_desc(ischema,att,msgElt,hashallSD,old,new):
&lt;br&gt;&amp;nbsp;	if ischema == 1 and att == &amp;quot;defaultSecurityDescriptor&amp;quot; &amp;nbsp;and msgElt.flags() == ldb.FLAG_MOD_REPLACE:
&lt;br&gt;-		print &amp;quot;coin coin&amp;quot;
&lt;br&gt;&amp;nbsp;		hashSD = {}
&lt;br&gt;&amp;nbsp;		hashSD[&amp;quot;oldSD&amp;quot;] = old[0][att]
&lt;br&gt;&amp;nbsp;		hashSD[&amp;quot;newSD&amp;quot;] = new[0][att]
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[0002-s4-reorder-action-to-permit-old-provision-to-be-corr.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From c49bc545ebe68ec486da5521282b8981cc2dea8a Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26567654&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, 30 Nov 2009 02:37:35 +0300
&lt;br&gt;Subject: [PATCH 2/3] s4: reorder action to permit old provision to be correctly upgraded
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; 13 ++++++++-----
&lt;br&gt;&amp;nbsp;1 files changed, 8 insertions(+), 5 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index f8735fc..bcf4d10 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -495,6 +495,7 @@ def check_diff_name(newpaths,paths,creds,session,basedn,names,ischema):
&lt;br&gt;&amp;nbsp;	# Connect to the reference provision and get all the attribute in the partition referred by name
&lt;br&gt;&amp;nbsp;	newsam_ldb = Ldb(newpaths.samdb, session_info=session, credentials=creds,lp=lp)
&lt;br&gt;&amp;nbsp;	sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp, options=[&amp;quot;modules:samba_dsdb&amp;quot;])
&lt;br&gt;+	sam_ldb.transaction_start()
&lt;br&gt;&amp;nbsp;	if ischema:
&lt;br&gt;&amp;nbsp;		res = newsam_ldb.search(expression=&amp;quot;objectClass=*&amp;quot;,base=basedn, scope=SCOPE_SUBTREE,attrs=[&amp;quot;dn&amp;quot;])
&lt;br&gt;&amp;nbsp;		res2 = sam_ldb.search(expression=&amp;quot;objectClass=*&amp;quot;,base=basedn, scope=SCOPE_SUBTREE,attrs=[&amp;quot;dn&amp;quot;])
&lt;br&gt;@@ -502,6 +503,7 @@ def check_diff_name(newpaths,paths,creds,session,basedn,names,ischema):
&lt;br&gt;&amp;nbsp;		res = newsam_ldb.search(expression=&amp;quot;objectClass=*&amp;quot;,base=basedn, scope=SCOPE_SUBTREE,attrs=[&amp;quot;dn&amp;quot;],controls=[&amp;quot;search_options:1:2&amp;quot;])
&lt;br&gt;&amp;nbsp;		res2 = sam_ldb.search(expression=&amp;quot;objectClass=*&amp;quot;,base=basedn, scope=SCOPE_SUBTREE,attrs=[&amp;quot;dn&amp;quot;],controls=[&amp;quot;search_options:1:2&amp;quot;])
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+	sam_ldb.transaction_commit()
&lt;br&gt;&amp;nbsp;	# Create a hash for speeding the search of new object
&lt;br&gt;&amp;nbsp;	for i in range(0,len(res)):
&lt;br&gt;&amp;nbsp;		hash_new[str(res[i][&amp;quot;dn&amp;quot;]).lower()] = res[i][&amp;quot;dn&amp;quot;]
&lt;br&gt;@@ -533,9 +535,10 @@ def check_diff_name(newpaths,paths,creds,session,basedn,names,ischema):
&lt;br&gt;&amp;nbsp;		sam_ldb.set_schema_from_ldb(schema.ldb)
&lt;br&gt;&amp;nbsp;		# And now we can connect to the DB - the schema won't be loaded from the DB
&lt;br&gt;&amp;nbsp;		sam_ldb.connect(paths.samdb)
&lt;br&gt;-		sam_ldb.transaction_start()
&lt;br&gt;&amp;nbsp;	else:
&lt;br&gt;-		sam_ldb.transaction_start()
&lt;br&gt;+		sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp, options=[&amp;quot;modules:samba_dsdb&amp;quot;])
&lt;br&gt;+
&lt;br&gt;+	sam_ldb.transaction_start()
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	empty = ldb.Message()
&lt;br&gt;&amp;nbsp;	message(SIMPLE,&amp;quot;There are %d missing objects&amp;quot;%(len(listMissing)))
&lt;br&gt;@@ -762,12 +765,12 @@ newpaths = get_paths(targetdir=provisiondir)
&lt;br&gt;&amp;nbsp;populate_backlink(newpaths,creds,session,names.schemadn)
&lt;br&gt;&amp;nbsp;# Check the difference
&lt;br&gt;&amp;nbsp;update_basesamdb(newpaths,paths,names)
&lt;br&gt;-update_secrets(newpaths,paths,creds,session)
&lt;br&gt;-update_privilege(newpaths,paths)
&lt;br&gt;-update_machine_account_password(paths,creds,session,names)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;if opts.full:
&lt;br&gt;&amp;nbsp;	update_samdb(newpaths,paths,creds,session,names)
&lt;br&gt;+update_secrets(newpaths,paths,creds,session)
&lt;br&gt;+update_privilege(newpaths,paths)
&lt;br&gt;+update_machine_account_password(paths,creds,session,names)
&lt;br&gt;&amp;nbsp;# SD should be created with admin but as some previous acl were so wrong that admin can't modify them we have first
&lt;br&gt;&amp;nbsp;# to recreate them with the good form but with system account and then give the ownership to admin ...
&lt;br&gt;&amp;nbsp;admin_session_info = admin_session(lp, str(names.domainsid))
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[0003-s4-replace-wrong-sambdb_replace-by-ldb_modify.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From 87be99a95103585515f5c0b79ef3dfc1b731d240 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26567654&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Mon, 30 Nov 2009 02:38:46 +0300
&lt;br&gt;Subject: [PATCH 3/3] s4: replace wrong sambdb_replace by ldb_modify
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/dsdb/schema/schema_set.c | &amp;nbsp; &amp;nbsp;4 ++--
&lt;br&gt;&amp;nbsp;1 files changed, 2 insertions(+), 2 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
&lt;br&gt;index c321bc9..a984c03 100644
&lt;br&gt;--- a/source4/dsdb/schema/schema_set.c
&lt;br&gt;+++ b/source4/dsdb/schema/schema_set.c
&lt;br&gt;@@ -137,7 +137,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;nbsp;		
&lt;br&gt;&amp;nbsp;		mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;nbsp;		if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;-			ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;+			ldb_modify(ldb,mod_msg);
&lt;br&gt;&amp;nbsp;		}
&lt;br&gt;&amp;nbsp;	}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -165,7 +165,7 @@ static int dsdb_schema_set_attributes(struct ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;nbsp;		if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;-			ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;+			ldb_modify(ldb,mod_msg);
&lt;br&gt;&amp;nbsp;		}
&lt;br&gt;&amp;nbsp;	}
&lt;br&gt;&amp;nbsp;	if (ret == LDB_ERR_OPERATIONS_ERROR || ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS || ret == LDB_ERR_INVALID_DN_SYNTAX) {
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26567654.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26566987</id>
	<title>Creating vanilla object for helping the upgrade of non provisionned object</title>
	<published>2009-11-29T14:28:29Z</published>
	<updated>2009-11-29T14:28:29Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Hello andrew,
&lt;br&gt;&lt;br&gt;I was thinking and making tests with creation of vanilla objects in a 
&lt;br&gt;provision.
&lt;br&gt;The goal of this creation is to create same objects in the current 
&lt;br&gt;provision and in the reference and to see how they differ and then to 
&lt;br&gt;reapply on non provisionned objects (ie. users create after provision) 
&lt;br&gt;the change.
&lt;br&gt;&lt;br&gt;But it turns out to be a quite complicated task: you have to create all 
&lt;br&gt;the hierarchy for object and soon created object will have to comply 
&lt;br&gt;with the mustContain attribute so it's gonna be quite hard soon to 
&lt;br&gt;create with just a program.
&lt;br&gt;And at the other hand I'm not very sure of what it can brings.
&lt;br&gt;It is supposed to help with the upgrade of non provisionned object but I 
&lt;br&gt;curious to know what are the attribute that are forced to a certain 
&lt;br&gt;value like it was done more or less with template.ldb before.
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Creating-vanilla-object-for-helping-the-upgrade-of-non-provisionned-object-tp26566987p26566987.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26566775</id>
	<title>Re: important: Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T14:07:52Z</published>
	<updated>2009-11-29T14:07:52Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">On 30/11/2009 00:30, Andrew Bartlett wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Sun, 2009-11-29 at 17:02 +0300, Matthieu Patou wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Dear all, I've been trying to upgrade a very old provision (alpha3) I've
&lt;br&gt;&amp;gt;&amp;gt; been hit by errors like this:
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; _ldb.LdbError: (80, 'schema_load_init: dsdb_set_schema() failed: 32:No
&lt;br&gt;&amp;gt;&amp;gt; such object')
&lt;br&gt;&amp;gt;&amp;gt; After a careful investigation I am 99% sure that those two changes
&lt;br&gt;&amp;gt;&amp;gt; (introduced in changeset 6b05a907) are wrong
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; @@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mod_msg-&amp;gt;num_elements&amp;gt; &amp;nbsp;0) {
&lt;br&gt;&amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; @@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct
&lt;br&gt;&amp;gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (mod_msg-&amp;gt;num_elements&amp;gt; &amp;nbsp;0) {
&lt;br&gt;&amp;gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Because the different elements with different flags (add,replace,delete)
&lt;br&gt;&amp;gt;&amp;gt; and using samdb_replace will override this flag by using just replace.
&lt;br&gt;&amp;gt;&amp;gt; Obviously if the ldb_diff was telling you that you should add the
&lt;br&gt;&amp;gt;&amp;gt; attribute 'foo' trying to make ldb modify the 'foo' attribute will not
&lt;br&gt;&amp;gt;&amp;gt; be very good.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Also I'm quite puzzled by the use ldb_msg_diff and the order of
&lt;br&gt;&amp;gt;&amp;gt; parameters. Because res-&amp;gt;msgs[0] is an message element obtained from a
&lt;br&gt;&amp;gt;&amp;gt; search in the LDB database represented by the ldb object.
&lt;br&gt;&amp;gt;&amp;gt; So to my mind by doing
&lt;br&gt;&amp;gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt;&amp;gt; we are comparing res-&amp;gt;msgs[0] and msg and using res-&amp;gt;msgs[0] as a
&lt;br&gt;&amp;gt;&amp;gt; reference, so there is no point trying to apply changes in the ldb
&lt;br&gt;&amp;gt;&amp;gt; object as the attributes have already the value contained in the
&lt;br&gt;&amp;gt;&amp;gt; different messageElement of the mod_msg object.
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; So I think parameters should be swapped it makes just sens from the
&lt;br&gt;&amp;gt;&amp;gt; point of view of the comparison and the modification of the ldb but for
&lt;br&gt;&amp;gt;&amp;gt; the overall logic I'm much more reserved.
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; I've looked over the code, and while I agree the samdb_replace seems
&lt;br&gt;&amp;gt; wrong, but before we added it, it just didn't work. &amp;nbsp;The goal of this
&lt;br&gt;&amp;gt; routine is to build new @ATTRIBUTE records and @INDEX records, and to
&lt;br&gt;&amp;gt; then, if they differ from the DB, replace them in a DB.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;/div&gt;It's not very clear from what @ATTRIBUTE and @INDEX are built can you 
&lt;br&gt;explain me ?
&lt;br&gt;&amp;gt; The purpose of res-&amp;gt;msgs[0] is to give the current DB as a base to the
&lt;br&gt;&amp;gt; diff function.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;Yeah I checked that ldb_msg_diff use the last ldbMessage as the ref, I 
&lt;br&gt;tried to revert to ldb_modify but it didn't make the trick, as it was 
&lt;br&gt;proposing &amp;nbsp;to add attribute to @ATTRIBUTE that were already in the database.
&lt;br&gt;&lt;br&gt;I'll try to remake trace so that we can further discuss it.
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26566775.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26566363</id>
	<title>Re: important: Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T13:30:29Z</published>
	<updated>2009-11-29T13:30:29Z</updated>
	<author>
		<name>Andrew Bartlett</name>
	</author>
	<content type="html">On Sun, 2009-11-29 at 17:02 +0300, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Dear all, I've been trying to upgrade a very old provision (alpha3) I've 
&lt;br&gt;&amp;gt; been hit by errors like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; _ldb.LdbError: (80, 'schema_load_init: dsdb_set_schema() failed: 32:No 
&lt;br&gt;&amp;gt; such object')
&lt;br&gt;&amp;gt; After a careful investigation I am 99% sure that those two changes 
&lt;br&gt;&amp;gt; (introduced in changeset 6b05a907) are wrong
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; @@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; @@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;&amp;gt; ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Because the different elements with different flags (add,replace,delete) 
&lt;br&gt;&amp;gt; and using samdb_replace will override this flag by using just replace. 
&lt;br&gt;&amp;gt; Obviously if the ldb_diff was telling you that you should add the 
&lt;br&gt;&amp;gt; attribute 'foo' trying to make ldb modify the 'foo' attribute will not 
&lt;br&gt;&amp;gt; be very good.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Also I'm quite puzzled by the use ldb_msg_diff and the order of 
&lt;br&gt;&amp;gt; parameters. Because res-&amp;gt;msgs[0] is an message element obtained from a 
&lt;br&gt;&amp;gt; search in the LDB database represented by the ldb object.
&lt;br&gt;&amp;gt; So to my mind by doing
&lt;br&gt;&amp;gt; mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;gt; we are comparing res-&amp;gt;msgs[0] and msg and using res-&amp;gt;msgs[0] as a 
&lt;br&gt;&amp;gt; reference, so there is no point trying to apply changes in the ldb 
&lt;br&gt;&amp;gt; object as the attributes have already the value contained in the 
&lt;br&gt;&amp;gt; different messageElement of the mod_msg object.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So I think parameters should be swapped it makes just sens from the 
&lt;br&gt;&amp;gt; point of view of the comparison and the modification of the ldb but for 
&lt;br&gt;&amp;gt; the overall logic I'm much more reserved.
&lt;/div&gt;&lt;/div&gt;I've looked over the code, and while I agree the samdb_replace seems
&lt;br&gt;wrong, but before we added it, it just didn't work. &amp;nbsp;The goal of this
&lt;br&gt;routine is to build new @ATTRIBUTE records and @INDEX records, and to
&lt;br&gt;then, if they differ from the DB, replace them in a DB.
&lt;br&gt;&lt;br&gt;The purpose of res-&amp;gt;msgs[0] is to give the current DB as a base to the
&lt;br&gt;diff function. 
&lt;br&gt;&lt;br&gt;Andrew Bartlett
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andrew Bartlett &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://samba.org/~abartlet/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org/~abartlet/&lt;/a&gt;&lt;br&gt;Authentication Developer, Samba Team &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://samba.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org&lt;/a&gt;&lt;br&gt;Samba Developer, Cisco Inc.
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26566363/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26566363.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26563743</id>
	<title>Patches for upgradeprovision</title>
	<published>2009-11-29T08:57:34Z</published>
	<updated>2009-11-29T08:57:34Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;Please find attach patches for upgradeprovision, it would be nice to 
&lt;br&gt;have them in alpha9.
&lt;br&gt;&lt;br&gt;Patch 1: upgradeprovision will now look at the current domain level in 
&lt;br&gt;the to be upgraded provision so that the reference provision is also 
&lt;br&gt;created with the same domain level.
&lt;br&gt;Patch 2: make upgradeprovision upgrade defaultSecurityDescriptor
&lt;br&gt;Patch 3: handle upgrade of provision where the name attribute was not 
&lt;br&gt;present initialy (ie. my provision !)
&lt;br&gt;Patch 4: it turns out that targetdir can cause problem so remove this 
&lt;br&gt;option as it can be replaced by -s path_to_smb.conf
&lt;br&gt;&lt;br&gt;They are also available at
&lt;br&gt;&lt;a href=&quot;http://repo.or.cz/w/Samba/ekacnet.git&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://repo.or.cz/w/Samba/ekacnet.git&lt;/a&gt;&amp;nbsp;branch upgradeschema
&lt;br&gt;&lt;br&gt;let me know !
&lt;br&gt;Matthieu
&lt;br&gt;&lt;br /&gt;&lt;tt&gt;[0003-s4-Handle-the-case-in-secrets.ldb-without-name-attri.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From add4ea60eb7e71dad9f41822c9ea56e924cdc273 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26563743&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 29 Nov 2009 16:26:31 +0300
&lt;br&gt;Subject: [PATCH 3/4] s4: Handle the case in secrets.ldb without name attribute
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; 30 +++++++++++++++++++++++++-----
&lt;br&gt;&amp;nbsp;1 files changed, 25 insertions(+), 5 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index 38bc092..cb9e1d2 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -73,7 +73,7 @@ hashAttrNotCopied = { 	&amp;quot;dn&amp;quot;: 1,&amp;quot;whenCreated&amp;quot;: 1,&amp;quot;whenChanged&amp;quot;: 1,&amp;quot;objectGUID&amp;quot;: 1
&lt;br&gt;&amp;nbsp;						&amp;quot;showInAdvancedViewOnly&amp;quot;: 1,&amp;quot;instanceType&amp;quot;: 1, &amp;quot;cn&amp;quot;: 1, &amp;quot;msDS-Behavior-Version&amp;quot;:1, &amp;quot;nextRid&amp;quot;:1,\
&lt;br&gt;&amp;nbsp;						&amp;quot;nTMixedDomain&amp;quot;: 1,&amp;quot;versionNumber&amp;quot;:1, &amp;quot;lmPwdHistory&amp;quot;:1, &amp;quot;pwdLastSet&amp;quot;: 1, &amp;quot;ntPwdHistory&amp;quot;:1, &amp;quot;unicodePwd&amp;quot;:1,\
&lt;br&gt;&amp;nbsp;						&amp;quot;dBCSPwd&amp;quot;:1,&amp;quot;supplementalCredentials&amp;quot;:1,&amp;quot;gPCUserExtensionNames&amp;quot;:1, &amp;quot;gPCMachineExtensionNames&amp;quot;:1,\
&lt;br&gt;-						&amp;quot;maxPwdAge&amp;quot;:1, &amp;quot;mail&amp;quot;:1, &amp;quot;secret&amp;quot;:1,&amp;quot;possibleInferiors&amp;quot;:1}
&lt;br&gt;+						&amp;quot;maxPwdAge&amp;quot;:1, &amp;quot;mail&amp;quot;:1, &amp;quot;secret&amp;quot;:1,&amp;quot;possibleInferiors&amp;quot;:1, &amp;quot;sAMAccountType&amp;quot;:1}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Usually for an object that already exists we do not overwrite attributes as they might have been changed for good
&lt;br&gt;&amp;nbsp;# reasons. Anyway for a few of thems it's mandatory to replace them otherwise the provision will be broken somehow.
&lt;br&gt;@@ -458,12 +458,31 @@ def update_secrets(newpaths,paths,creds,session):
&lt;br&gt;&amp;nbsp;			delta.remove(att)
&lt;br&gt;&amp;nbsp;		for att in delta:
&lt;br&gt;&amp;nbsp;			i = i + 1
&lt;br&gt;+
&lt;br&gt;+			if att == &amp;quot;name&amp;quot;:
&lt;br&gt;+				message(CHANGE,&amp;quot;Found attribute name on &amp;nbsp;%s, must rename the DN &amp;quot;%(res2[0].dn))
&lt;br&gt;+				secrets_ldb.rename(res2[0].dn,ldb.Dn(secrets_ldb,&amp;quot;%sfoo&amp;quot;%str(res2[0].dn)))
&lt;br&gt;+				secrets_ldb.rename(ldb.Dn(secrets_ldb,&amp;quot;%sfoo&amp;quot;%str(res2[0].dn)),res2[0].dn)
&lt;br&gt;+			else:
&lt;br&gt;+				delta.remove(att)
&lt;br&gt;+
&lt;br&gt;+
&lt;br&gt;+	for entry in listPresent:
&lt;br&gt;+		res = newsecrets_ldb.search(expression=&amp;quot;dn=%s&amp;quot;%entry,base=&amp;quot;&amp;quot;, scope=SCOPE_SUBTREE)
&lt;br&gt;+		res2 = secrets_ldb.search(expression=&amp;quot;dn=%s&amp;quot;%entry,base=&amp;quot;&amp;quot;, scope=SCOPE_SUBTREE)
&lt;br&gt;+		delta = secrets_ldb.msg_diff(res2[0],res[0])
&lt;br&gt;+		i=0
&lt;br&gt;+		for att in hashAttrNotCopied.keys():
&lt;br&gt;+			delta.remove(att)
&lt;br&gt;+		for att in delta:
&lt;br&gt;+			i = i + 1
&lt;br&gt;&amp;nbsp;			if att != &amp;quot;dn&amp;quot;:
&lt;br&gt;&amp;nbsp;				message(CHANGE,&amp;quot; Adding/Changing attribute %s to %s&amp;quot;%(att,res2[0].dn))
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;		delta.dn = res2[0].dn
&lt;br&gt;&amp;nbsp;		secrets_ldb.modify(delta)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;+
&lt;br&gt;&amp;nbsp;# Check difference between the current provision and the reference provision.
&lt;br&gt;&amp;nbsp;# It looks for all object which base DN is name if ischema is false then scan is done in
&lt;br&gt;&amp;nbsp;# cross partition mode.
&lt;br&gt;@@ -595,8 +614,8 @@ def check_updated_sd(newpaths,paths,creds,session,names):
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Simple update method for updating the SD that rely on the fact that nobody should have modified the SD
&lt;br&gt;&amp;nbsp;# This assumption is safe right now (alpha9) but should be removed asap
&lt;br&gt;-def update_sd(newpaths,paths,creds,session,names):
&lt;br&gt;-	sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp)
&lt;br&gt;+def update_sd(paths,creds,session,names):
&lt;br&gt;+	sam_ldb = Ldb(paths.samdb, session_info=session, credentials=creds,lp=lp,options=[&amp;quot;modules:samba_dsdb&amp;quot;])
&lt;br&gt;&amp;nbsp;	sam_ldb.transaction_start()
&lt;br&gt;&amp;nbsp;	# First update the SD for the rootdn
&lt;br&gt;&amp;nbsp;	sam_ldb.set_session_info(session)
&lt;br&gt;@@ -755,8 +774,9 @@ if opts.full:
&lt;br&gt;&amp;nbsp;# SD should be created with admin but as some previous acl were so wrong that admin can't modify them we have first
&lt;br&gt;&amp;nbsp;# to recreate them with the good form but with system account and then give the ownership to admin ...
&lt;br&gt;&amp;nbsp;admin_session_info = admin_session(lp, str(names.domainsid))
&lt;br&gt;-update_sd(newpaths,paths,creds,session,names)
&lt;br&gt;-update_sd(newpaths,paths,creds,admin_session_info,names)
&lt;br&gt;+message(SIMPLE,&amp;quot;Updating SD&amp;quot;)
&lt;br&gt;+update_sd(paths,creds,session,names)
&lt;br&gt;+update_sd(paths,creds,admin_session_info,names)
&lt;br&gt;&amp;nbsp;check_updated_sd(newpaths,paths,creds,session,names)
&lt;br&gt;&amp;nbsp;message(SIMPLE,&amp;quot;Upgrade finished !&amp;quot;)
&lt;br&gt;&amp;nbsp;# remove reference provision now that everything is done !
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[0004-s4-Remove-targetdir-as-it-can-cause-some-trouble-and.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From 87390442208c9f9fa110773f83700ca0b63f0d73 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26563743&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 29 Nov 2009 19:44:08 +0300
&lt;br&gt;Subject: [PATCH 4/4] s4: Remove targetdir as it can cause some trouble and can be replaced by an adapted -s smb.conf
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; &amp;nbsp;4 +---
&lt;br&gt;&amp;nbsp;1 files changed, 1 insertions(+), 3 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index cb9e1d2..4b0cfec 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -112,8 +112,6 @@ parser.add_option(&amp;quot;--debugchange&amp;quot;, help=&amp;quot;Print information on what is different
&lt;br&gt;&amp;nbsp;parser.add_option(&amp;quot;--debugchangesd&amp;quot;, help=&amp;quot;Print information security descriptors differences&amp;quot;, action=&amp;quot;store_true&amp;quot;)
&lt;br&gt;&amp;nbsp;parser.add_option(&amp;quot;--debugall&amp;quot;, help=&amp;quot;Print all available information (very verbose)&amp;quot;, action=&amp;quot;store_true&amp;quot;)
&lt;br&gt;&amp;nbsp;parser.add_option(&amp;quot;--full&amp;quot;, help=&amp;quot;Perform full upgrade of the samdb (schema, configuration, new objects, ...&amp;quot;, action=&amp;quot;store_true&amp;quot;)
&lt;br&gt;-parser.add_option(&amp;quot;--targetdir&amp;quot;, type=&amp;quot;string&amp;quot;, metavar=&amp;quot;DIR&amp;quot;,
&lt;br&gt;-					help=&amp;quot;Set target directory&amp;quot;)
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;opts = parser.parse_args()[0]
&lt;br&gt;&amp;nbsp;
&lt;br&gt;@@ -749,7 +747,7 @@ def update_machine_account_password(paths,creds,session,names):
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# From here start the big steps of the program
&lt;br&gt;&amp;nbsp;# First get files paths
&lt;br&gt;-paths=get_paths(targetdir=opts.targetdir,smbconf=smbconf)
&lt;br&gt;+paths=get_paths(smbconf=smbconf)
&lt;br&gt;&amp;nbsp;paths.setup = setup_dir
&lt;br&gt;&amp;nbsp;def setup_path(file):
&lt;br&gt;&amp;nbsp;	return os.path.join(setup_dir, file)
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[0001-s4-load-the-domain-level-of-the-current-provision-an.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From 0c1a0b230f34ddc17ede455036e58aa7f60afd58 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26563743&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Fri, 27 Nov 2009 20:50:04 +0300
&lt;br&gt;Subject: [PATCH 1/4] s4: load the domain level of the current provision and create a provision with the same domain level
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; 10 ++++++++--
&lt;br&gt;&amp;nbsp;1 files changed, 8 insertions(+), 2 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index 2f0ce84..486bad1 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -39,7 +39,7 @@ from base64 import b64encode
&lt;br&gt;&amp;nbsp;import samba
&lt;br&gt;&amp;nbsp;from samba.credentials import DONT_USE_KERBEROS
&lt;br&gt;&amp;nbsp;from samba.auth import system_session, admin_session
&lt;br&gt;-from samba import Ldb
&lt;br&gt;+from samba import Ldb, DS_DOMAIN_FUNCTION_2003, DS_DOMAIN_FUNCTION_2008, DS_DC_FUNCTION_2008_R2
&lt;br&gt;&amp;nbsp;from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError
&lt;br&gt;&amp;nbsp;import ldb
&lt;br&gt;&amp;nbsp;import samba.getopt as options
&lt;br&gt;@@ -222,10 +222,14 @@ def guess_names_from_current_provision(credentials,session_info,paths):
&lt;br&gt;&amp;nbsp;	names.ntdsguid = str(ndr_unpack( misc.GUID,res5[0][&amp;quot;objectGUID&amp;quot;][0]))
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	# domain guid/sid
&lt;br&gt;-	attrs6 = [&amp;quot;objectGUID&amp;quot;, &amp;quot;objectSid&amp;quot;, ]
&lt;br&gt;+	attrs6 = [&amp;quot;objectGUID&amp;quot;, &amp;quot;objectSid&amp;quot;,&amp;quot;msDS-Behavior-Version&amp;quot; ]
&lt;br&gt;&amp;nbsp;	res6 = samdb.search(expression=&amp;quot;(objectClass=*)&amp;quot;,base=basedn, scope=SCOPE_BASE, attrs=attrs6)
&lt;br&gt;&amp;nbsp;	names.domainguid = str(ndr_unpack( misc.GUID,res6[0][&amp;quot;objectGUID&amp;quot;][0]))
&lt;br&gt;&amp;nbsp;	names.domainsid = ndr_unpack( security.dom_sid,res6[0][&amp;quot;objectSid&amp;quot;][0])
&lt;br&gt;+	if int(res6[0][&amp;quot;msDS-Behavior-Version&amp;quot;][0]) &amp;lt; DS_DOMAIN_FUNCTION_2003:
&lt;br&gt;+		names.domainlevel = DS_DOMAIN_FUNCTION_2003
&lt;br&gt;+	else:
&lt;br&gt;+		names.domainlevel = int(res6[0][&amp;quot;msDS-Behavior-Version&amp;quot;][0])
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	# policy guid
&lt;br&gt;&amp;nbsp;	attrs7 = [&amp;quot;cn&amp;quot;,&amp;quot;displayName&amp;quot;]
&lt;br&gt;@@ -262,6 +266,7 @@ def print_names(names):
&lt;br&gt;&amp;nbsp;	message(GUESS, &amp;quot;domainsid &amp;nbsp; :&amp;quot;+str(names.domainsid))
&lt;br&gt;&amp;nbsp;	message(GUESS, &amp;quot;domainguid &amp;nbsp;:&amp;quot;+names.domainguid)
&lt;br&gt;&amp;nbsp;	message(GUESS, &amp;quot;ntdsguid &amp;nbsp; &amp;nbsp;:&amp;quot;+names.ntdsguid)
&lt;br&gt;+	message(GUESS, &amp;quot;domainlevel :&amp;quot;+str(names.domainlevel))
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;# Create a fresh new reference provision
&lt;br&gt;&amp;nbsp;# This provision will be the reference for knowing what has changed in the
&lt;br&gt;@@ -297,6 +302,7 @@ def newprovision(names,setup_dir,creds,session,smbconf):
&lt;br&gt;&amp;nbsp;		slapd_path=None,
&lt;br&gt;&amp;nbsp;		setup_ds_path=None,
&lt;br&gt;&amp;nbsp;		nosync=None,
&lt;br&gt;+		dom_for_fun_level=names.domainlevel,
&lt;br&gt;&amp;nbsp;		ldap_dryrun_mode=None)
&lt;br&gt;&amp;nbsp;	return provdir
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[0002-s4-don-t-forget-to-update-defaultSecurityDescriptor.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;From 10aeddec0c80900d1741a5462d91326447a858d3 Mon Sep 17 00:00:00 2001
&lt;br&gt;From: Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26563743&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Date: Sun, 29 Nov 2009 02:28:26 +0300
&lt;br&gt;Subject: [PATCH 2/4] s4: don't forget to update defaultSecurityDescriptor
&lt;br&gt;&lt;br&gt;---
&lt;br&gt;&amp;nbsp;source4/scripting/bin/upgradeprovision | &amp;nbsp; &amp;nbsp;6 ++++--
&lt;br&gt;&amp;nbsp;1 files changed, 4 insertions(+), 2 deletions(-)
&lt;br&gt;&lt;br&gt;diff --git a/source4/scripting/bin/upgradeprovision b/source4/scripting/bin/upgradeprovision
&lt;br&gt;index 486bad1..38bc092 100755
&lt;br&gt;--- a/source4/scripting/bin/upgradeprovision
&lt;br&gt;+++ b/source4/scripting/bin/upgradeprovision
&lt;br&gt;@@ -79,7 +79,8 @@ hashAttrNotCopied = { 	&amp;quot;dn&amp;quot;: 1,&amp;quot;whenCreated&amp;quot;: 1,&amp;quot;whenChanged&amp;quot;: 1,&amp;quot;objectGUID&amp;quot;: 1
&lt;br&gt;&amp;nbsp;# reasons. Anyway for a few of thems it's mandatory to replace them otherwise the provision will be broken somehow.
&lt;br&gt;&amp;nbsp;hashOverwrittenAtt = {	 &amp;quot;prefixMap&amp;quot;: replace, &amp;quot;systemMayContain&amp;quot;: replace,&amp;quot;systemOnly&amp;quot;:replace, &amp;quot;searchFlags&amp;quot;:replace,\
&lt;br&gt;&amp;nbsp;						 &amp;quot;mayContain&amp;quot;:replace, &amp;nbsp;&amp;quot;systemFlags&amp;quot;:replace,
&lt;br&gt;-						 &amp;quot;oEMInformation&amp;quot;:replace, &amp;quot;operatingSystemVersion&amp;quot;:replace, &amp;quot;adminPropertyPages&amp;quot;:1,&amp;quot;possibleInferiors&amp;quot;:replace+delete}
&lt;br&gt;+						 &amp;quot;oEMInformation&amp;quot;:replace, &amp;quot;operatingSystemVersion&amp;quot;:replace, &amp;quot;adminPropertyPages&amp;quot;:replace,
&lt;br&gt;+						 &amp;quot;defaultSecurityDescriptor&amp;quot;: replace}
&lt;br&gt;&amp;nbsp;backlinked = []
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;def define_what_to_log(opts):
&lt;br&gt;@@ -342,11 +343,12 @@ def dn_sort(x,y):
&lt;br&gt;&amp;nbsp;# it also populate hash structure for later use in the upgrade process
&lt;br&gt;&amp;nbsp;def handle_security_desc(ischema,att,msgElt,hashallSD,old,new):
&lt;br&gt;&amp;nbsp;	if ischema == 1 and att == &amp;quot;defaultSecurityDescriptor&amp;quot; &amp;nbsp;and msgElt.flags() == ldb.FLAG_MOD_REPLACE:
&lt;br&gt;+		print &amp;quot;coin coin&amp;quot;
&lt;br&gt;&amp;nbsp;		hashSD = {}
&lt;br&gt;&amp;nbsp;		hashSD[&amp;quot;oldSD&amp;quot;] = old[0][att]
&lt;br&gt;&amp;nbsp;		hashSD[&amp;quot;newSD&amp;quot;] = new[0][att]
&lt;br&gt;&amp;nbsp;		hashallSD[str(old[0].dn)] = hashSD
&lt;br&gt;-		return 1
&lt;br&gt;+		return 0
&lt;br&gt;&amp;nbsp;	if att == &amp;quot;nTSecurityDescriptor&amp;quot; &amp;nbsp;and msgElt.flags() == ldb.FLAG_MOD_REPLACE:
&lt;br&gt;&amp;nbsp;		if ischema == 0:
&lt;br&gt;&amp;nbsp;			hashSD = {}
&lt;br&gt;-- 
&lt;br&gt;1.6.3.3
&lt;br&gt;&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Patches-for-upgradeprovision-tp26563743p26563743.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26562319</id>
	<title>important: Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T06:02:32Z</published>
	<updated>2009-11-29T06:02:32Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Dear all, I've been trying to upgrade a very old provision (alpha3) I've 
&lt;br&gt;been hit by errors like this:
&lt;br&gt;&lt;br&gt;_ldb.LdbError: (80, 'schema_load_init: dsdb_set_schema() failed: 32:No 
&lt;br&gt;such object')
&lt;br&gt;After a careful investigation I am 99% sure that those two changes 
&lt;br&gt;(introduced in changeset 6b05a907) are wrong
&lt;br&gt;&lt;br&gt;@@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;@@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;Because the different elements with different flags (add,replace,delete) 
&lt;br&gt;and using samdb_replace will override this flag by using just replace. 
&lt;br&gt;Obviously if the ldb_diff was telling you that you should add the 
&lt;br&gt;attribute 'foo' trying to make ldb modify the 'foo' attribute will not 
&lt;br&gt;be very good.
&lt;br&gt;&lt;br&gt;Also I'm quite puzzled by the use ldb_msg_diff and the order of 
&lt;br&gt;parameters. Because res-&amp;gt;msgs[0] is an message element obtained from a 
&lt;br&gt;search in the LDB database represented by the ldb object.
&lt;br&gt;So to my mind by doing
&lt;br&gt;mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;we are comparing res-&amp;gt;msgs[0] and msg and using res-&amp;gt;msgs[0] as a 
&lt;br&gt;reference, so there is no point trying to apply changes in the ldb 
&lt;br&gt;object as the attributes have already the value contained in the 
&lt;br&gt;different messageElement of the mod_msg object.
&lt;br&gt;&lt;br&gt;So I think parameters should be swapped it makes just sens from the 
&lt;br&gt;point of view of the comparison and the modification of the ldb but for 
&lt;br&gt;the overall logic I'm much more reserved.
&lt;br&gt;&lt;br&gt;Can someone have a closer look on this ?
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26562319.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26562171</id>
	<title>Re: NetShareEnum: disable sanity check for better compatibility with Windows</title>
	<published>2009-11-29T05:46:12Z</published>
	<updated>2009-11-29T05:46:12Z</updated>
	<author>
		<name>Volker Lendecke</name>
	</author>
	<content type="html">On Sun, Nov 29, 2009 at 02:15:18PM +0100, Giovanni Bajo wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; the attached patches increase Samba compatibility with Windows by
&lt;br&gt;&amp;gt; disabling a sanity check which prevents Samba from issuing an answer to
&lt;br&gt;&amp;gt; a NetShareEnum request in case of a corrupted (invalid) packet.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Long version. I have recently bought a Samsung BD-P3600 bluray player.
&lt;br&gt;&amp;gt; This unit has wired/wifi connection and a primitive/buggy support for
&lt;br&gt;&amp;gt; streaming files off Windows shares. It works well if the shares are on a
&lt;br&gt;&amp;gt; Windows PC, but it fails to detect shares on Linux and Mac OSX. I
&lt;br&gt;&amp;gt; investigated the problem and it turns out that the bluray player sends
&lt;br&gt;&amp;gt; an invalid packet:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 0000 &amp;nbsp;00 1b fc 91 80 08 00 12 &amp;nbsp;fb 2a d9 7c 08 00 45 00 &amp;nbsp; ........ .*.|..E.
&lt;br&gt;&amp;gt; 0010 &amp;nbsp;00 9e b8 2e 40 00 40 06 &amp;nbsp;fe c2 c0 a8 01 17 c0 a8 &amp;nbsp; ....@.@. ........
&lt;br&gt;&amp;gt; 0020 &amp;nbsp;01 01 cc 54 00 8b 46 cc &amp;nbsp;34 d6 de 00 9f ae 80 18 &amp;nbsp; ...T..F. 4.......
&lt;br&gt;&amp;gt; 0030 &amp;nbsp;0b 68 01 e3 00 00 01 01 &amp;nbsp;08 0a 00 00 99 c7 00 64 &amp;nbsp; .h...... .......d
&lt;br&gt;&amp;gt; 0040 &amp;nbsp;41 2d 00 00 00 66 ff 53 &amp;nbsp;4d 42 25 00 00 00 00 08 &amp;nbsp; A-...f.S MB%.....
&lt;br&gt;&amp;gt; 0050 &amp;nbsp;01 00 00 00 00 00 00 00 &amp;nbsp;00 00 00 00 00 00 01 00 &amp;nbsp; ........ ........
&lt;br&gt;&amp;gt; 0060 &amp;nbsp;3b 00 00 00 9f 00 0e 1a &amp;nbsp;00 00 00 63 00 ff ff 00 &amp;nbsp; ;....... ...c....
&lt;br&gt;&amp;gt; 0070 &amp;nbsp;00 00 00 00 00 00 00 00 &amp;nbsp;00 1a 00 4c 00 00 00 66 &amp;nbsp; ........ ...L...f
&lt;br&gt;&amp;gt; 0080 &amp;nbsp;00 00 00 27 00 5c 50 49 &amp;nbsp;50 45 5c 4c 41 4e 4d 41 &amp;nbsp; ...'.\PI PE\LANMA
&lt;br&gt;&amp;gt; 0090 &amp;nbsp;4e 00 00 00 57 72 4c 65 &amp;nbsp;68 00 42 31 33 42 57 7a &amp;nbsp; N...WrLe h.B13BWz
&lt;br&gt;&amp;gt; 00a0 &amp;nbsp;57 57 57 7a 42 39 42 00 &amp;nbsp;01 00 ff ff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WWWzB9B. ....
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Microsoft Windows Lanman Remote API Protocol
&lt;br&gt;&amp;gt; &amp;nbsp; Function Code: NetShareEnum (0)
&lt;br&gt;&amp;gt; &amp;nbsp; Parameter Descriptor: WrLeh
&lt;br&gt;&amp;gt; &amp;nbsp; Return Descriptor: B13BWzWWWzB9B
&lt;br&gt;&amp;gt; &amp;nbsp; Detail Level: 1
&lt;br&gt;&amp;gt; &amp;nbsp; Receive Buffer Length: 65535
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This packet is malformed because, for level 1 query, the correct return
&lt;br&gt;&amp;gt; descriptor would be &amp;quot;B13BWz&amp;quot;. I've attached the full wireshark dump, in
&lt;br&gt;&amp;gt; case it matters.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; What happens is that Samba refuses to answer to this query because it
&lt;br&gt;&amp;gt; fails an internal sanity check; instead, Windows happily answers and the
&lt;br&gt;&amp;gt; conversation goes on.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I verified my fix against a samba2 server (this is what I'm running on
&lt;br&gt;&amp;gt; my DDWRT-based router), and forward-ported the same patch on samba3 and
&lt;br&gt;&amp;gt; samba4 trees by visual inspection.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is my first contribution to Samba, so I'm looking for some guidance
&lt;br&gt;&amp;gt; for this patch to be accepted.
&lt;/div&gt;&lt;/div&gt;It seems that the descriptor they send is actually a level2
&lt;br&gt;descriptor. Can you get us a trace against a Windows box? I
&lt;br&gt;would be interested to see what they return in this case. Do
&lt;br&gt;they decide based upon the level or the descriptor?
&lt;br&gt;&lt;br&gt;And, would it be possible not to completely drop the check
&lt;br&gt;but to also allow the level2 descriptor for level1?
&lt;br&gt;&lt;br&gt;Volker
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (204 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26562171/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NetShareEnum%3A-disable-sanity-check-for-better-compatibility-with-Windows-tp26562058p26562171.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26562174</id>
	<title>Wrong logic (to my mind) in schema_set.c</title>
	<published>2009-11-29T05:44:52Z</published>
	<updated>2009-11-29T05:44:52Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Dear all, I've been trying to upgrade a very old provision (alpha3) I've 
&lt;br&gt;been hit by errors like this:
&lt;br&gt;index 8b1188a..5ded04e 100644
&lt;br&gt;--- a/source4/dsdb/schema/schema_set.c
&lt;br&gt;+++ b/source4/dsdb/schema/schema_set.c
&lt;br&gt;@@ -135,7 +135,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res-&amp;gt;msgs[0], msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;@@ -154,7 +154,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (ret == LDB_ERR_NO_SUCH_OBJECT) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ret = ldb_add(ldb, msg_idx);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else if (ret != LDB_SUCCESS) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (res-&amp;gt;count != 1) {
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; } else if (res_idx-&amp;gt;count != 1) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ret = ldb_add(ldb, msg_idx);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} else {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ret = LDB_SUCCESS;
&lt;br&gt;@@ -163,7 +163,7 @@ static int dsdb_schema_set_attributes(struct 
&lt;br&gt;ldb_context *ldb, struct dsdb_schem
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mod_msg = ldb_msg_diff(ldb, res_idx-&amp;gt;msgs[0], msg_idx);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (mod_msg-&amp;gt;num_elements &amp;gt; 0) {
&lt;br&gt;- &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = ldb_modify(ldb, mod_msg);
&lt;br&gt;+ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ret = samdb_replace(ldb, mem_ctx, mod_msg);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Wrong-logic-%28to-my-mind%29-in-schema_set.c-tp26562174p26562174.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26562058</id>
	<title>NetShareEnum: disable sanity check for better compatibility with Windows</title>
	<published>2009-11-29T05:15:18Z</published>
	<updated>2009-11-29T05:15:18Z</updated>
	<author>
		<name>Giovanni Bajo</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;the attached patches increase Samba compatibility with Windows by
&lt;br&gt;disabling a sanity check which prevents Samba from issuing an answer to
&lt;br&gt;a NetShareEnum request in case of a corrupted (invalid) packet.
&lt;br&gt;&lt;br&gt;Long version. I have recently bought a Samsung BD-P3600 bluray player.
&lt;br&gt;This unit has wired/wifi connection and a primitive/buggy support for
&lt;br&gt;streaming files off Windows shares. It works well if the shares are on a
&lt;br&gt;Windows PC, but it fails to detect shares on Linux and Mac OSX. I
&lt;br&gt;investigated the problem and it turns out that the bluray player sends
&lt;br&gt;an invalid packet:
&lt;br&gt;&lt;br&gt;0000 &amp;nbsp;00 1b fc 91 80 08 00 12 &amp;nbsp;fb 2a d9 7c 08 00 45 00 &amp;nbsp; ........ .*.|..E.
&lt;br&gt;0010 &amp;nbsp;00 9e b8 2e 40 00 40 06 &amp;nbsp;fe c2 c0 a8 01 17 c0 a8 &amp;nbsp; ....@.@. ........
&lt;br&gt;0020 &amp;nbsp;01 01 cc 54 00 8b 46 cc &amp;nbsp;34 d6 de 00 9f ae 80 18 &amp;nbsp; ...T..F. 4.......
&lt;br&gt;0030 &amp;nbsp;0b 68 01 e3 00 00 01 01 &amp;nbsp;08 0a 00 00 99 c7 00 64 &amp;nbsp; .h...... .......d
&lt;br&gt;0040 &amp;nbsp;41 2d 00 00 00 66 ff 53 &amp;nbsp;4d 42 25 00 00 00 00 08 &amp;nbsp; A-...f.S MB%.....
&lt;br&gt;0050 &amp;nbsp;01 00 00 00 00 00 00 00 &amp;nbsp;00 00 00 00 00 00 01 00 &amp;nbsp; ........ ........
&lt;br&gt;0060 &amp;nbsp;3b 00 00 00 9f 00 0e 1a &amp;nbsp;00 00 00 63 00 ff ff 00 &amp;nbsp; ;....... ...c....
&lt;br&gt;0070 &amp;nbsp;00 00 00 00 00 00 00 00 &amp;nbsp;00 1a 00 4c 00 00 00 66 &amp;nbsp; ........ ...L...f
&lt;br&gt;0080 &amp;nbsp;00 00 00 27 00 5c 50 49 &amp;nbsp;50 45 5c 4c 41 4e 4d 41 &amp;nbsp; ...'.\PI PE\LANMA
&lt;br&gt;0090 &amp;nbsp;4e 00 00 00 57 72 4c 65 &amp;nbsp;68 00 42 31 33 42 57 7a &amp;nbsp; N...WrLe h.B13BWz
&lt;br&gt;00a0 &amp;nbsp;57 57 57 7a 42 39 42 00 &amp;nbsp;01 00 ff ff &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WWWzB9B. ....
&lt;br&gt;&lt;br&gt;Microsoft Windows Lanman Remote API Protocol
&lt;br&gt;&amp;nbsp; Function Code: NetShareEnum (0)
&lt;br&gt;&amp;nbsp; Parameter Descriptor: WrLeh
&lt;br&gt;&amp;nbsp; Return Descriptor: B13BWzWWWzB9B
&lt;br&gt;&amp;nbsp; Detail Level: 1
&lt;br&gt;&amp;nbsp; Receive Buffer Length: 65535
&lt;br&gt;&lt;br&gt;This packet is malformed because, for level 1 query, the correct return
&lt;br&gt;descriptor would be &amp;quot;B13BWz&amp;quot;. I've attached the full wireshark dump, in
&lt;br&gt;case it matters.
&lt;br&gt;&lt;br&gt;What happens is that Samba refuses to answer to this query because it
&lt;br&gt;fails an internal sanity check; instead, Windows happily answers and the
&lt;br&gt;conversation goes on.
&lt;br&gt;&lt;br&gt;I verified my fix against a samba2 server (this is what I'm running on
&lt;br&gt;my DDWRT-based router), and forward-ported the same patch on samba3 and
&lt;br&gt;samba4 trees by visual inspection.
&lt;br&gt;&lt;br&gt;This is my first contribution to Samba, so I'm looking for some guidance
&lt;br&gt;for this patch to be accepted.
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;-- 
&lt;br&gt;Giovanni Bajo
&lt;br&gt;Develer S.r.l.
&lt;br&gt;&lt;a href=&quot;http://www.develer.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.develer.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br /&gt;&lt;tt&gt;[netshareenum.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
&lt;br&gt;index 6fc72c2..b3b3ec7 100644
&lt;br&gt;--- a/source3/smbd/lanman.c
&lt;br&gt;+++ b/source3/smbd/lanman.c
&lt;br&gt;@@ -1799,9 +1799,6 @@ static bool api_RNetShareEnum( connection_struct *conn, uint16 vuid,
&lt;br&gt;&amp;nbsp;	if (!prefix_ok(str1,&amp;quot;WrLeh&amp;quot;)) {
&lt;br&gt;&amp;nbsp;		return False;
&lt;br&gt;&amp;nbsp;	}
&lt;br&gt;-	if (!check_share_info(uLevel,str2)) {
&lt;br&gt;-		return False;
&lt;br&gt;-	}
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	/* Ensure all the usershares are loaded. */
&lt;br&gt;&amp;nbsp;	become_root();
&lt;br&gt;diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c
&lt;br&gt;index 04ea700..66b93e8 100644
&lt;br&gt;--- a/source4/ntvfs/ipc/ipc_rap.c
&lt;br&gt;+++ b/source4/ntvfs/ipc/ipc_rap.c
&lt;br&gt;@@ -260,20 +260,6 @@ static NTSTATUS _rap_netshareenum(struct rap_call *call)
&lt;br&gt;&amp;nbsp;	RAP_GOTO(rap_srv_pull_bufsize(call, &amp;r.in.bufsize));
&lt;br&gt;&amp;nbsp;	RAP_GOTO(rap_srv_pull_expect_multiple(call));
&lt;br&gt;&amp;nbsp;
&lt;br&gt;-	switch(r.in.level) {
&lt;br&gt;-	case 0:
&lt;br&gt;-		if (strcmp(call-&amp;gt;datadesc, &amp;quot;B13&amp;quot;) != 0)
&lt;br&gt;-			return NT_STATUS_INVALID_PARAMETER;
&lt;br&gt;-		break;
&lt;br&gt;-	case 1:
&lt;br&gt;-		if (strcmp(call-&amp;gt;datadesc, &amp;quot;B13BWz&amp;quot;) != 0)
&lt;br&gt;-			return NT_STATUS_INVALID_PARAMETER;
&lt;br&gt;-		break;
&lt;br&gt;-	default:
&lt;br&gt;-		return NT_STATUS_INVALID_PARAMETER;
&lt;br&gt;-		break;
&lt;br&gt;-	}
&lt;br&gt;-
&lt;br&gt;&amp;nbsp;	result = rap_netshareenum(call, call-&amp;gt;event_ctx, call-&amp;gt;lp_ctx, &amp;r);
&lt;br&gt;&amp;nbsp;
&lt;br&gt;&amp;nbsp;	if (!NT_STATUS_IS_OK(result))
&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;&lt;tt&gt;[netshareenum.samba2.patch]&lt;/tt&gt;&lt;br /&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;tt&gt;Index: source/smbd/lanman.c
&lt;br&gt;===================================================================
&lt;br&gt;--- source/smbd/lanman.c	(revisione 26701)
&lt;br&gt;+++ source/smbd/lanman.c	(copia locale)
&lt;br&gt;@@ -1625,7 +1625,6 @@
&lt;br&gt;&amp;nbsp; &amp;nbsp;int f_len = 0, s_len = 0;
&lt;br&gt;&amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp;if (!prefix_ok(str1,&amp;quot;WrLeh&amp;quot;)) return False;
&lt;br&gt;- &amp;nbsp;if (!check_share_info(uLevel,str2)) return False;
&lt;br&gt;&amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;nbsp; &amp;nbsp;data_len = fixed_len = string_len = 0;
&lt;br&gt;&amp;nbsp; &amp;nbsp;for (i=0;i&amp;lt;count;i++)
&lt;br&gt;&lt;/tt&gt;&lt;hr align=&quot;left&quot; width=&quot;300&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;dump2.pcap.bz2&lt;/strong&gt; (6K) &lt;a href=&quot;http://old.nabble.com/attachment/26562058/0/dump2.pcap.bz2&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/NetShareEnum%3A-disable-sanity-check-for-better-compatibility-with-Windows-tp26562058p26562058.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26561415</id>
	<title>Re: Updatings SD</title>
	<published>2009-11-29T03:59:35Z</published>
	<updated>2009-11-29T03:59:35Z</updated>
	<author>
		<name>Nadezhda Ivanova-2</name>
	</author>
	<content type="html">Hi Mattieu,
&lt;br&gt;Good work! Time was not lost, I found some possible instability in my code while playing with the script. Also I still thing its possible to accomplish what you are doing without the need of a second control, just using sd_flags control. However, I suppose we can use your control for the time being, and decide later whether to keep it or use sd_flags. I will talk to Andrew when I see him on IRC to include your script in the alpha.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Nadya
&lt;br&gt;----- Original Message -----
&lt;br&gt;&amp;gt; From: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26561415&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical-bounces@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26561415&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical-bounces@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26561415&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt; &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26561415&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt;&amp;gt;, Matthieu Patou &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26561415&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mat+Informatique.Samba@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sent: Sunday, November 29, 2009 1:11:43 AM GMT+0200 Europe;Athens
&lt;br&gt;&amp;gt; Subject: Re: Updatings SD
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; Hello Nadya,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I put more trace and I find the problem: defaultSecurityDescriptor was 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; not upgraded because previously I had a plan to make something rather 
&lt;br&gt;&amp;gt; complicated with SD update that implied to have the previous SD.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; So the story is solved no need to investigate more !
&lt;br&gt;&amp;gt; Sorry for the lost time on research ...
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Matthieu.
&lt;br&gt;&amp;gt; On 26/11/2009 20:06, Matthieu Patou wrote:
&lt;br&gt;&amp;gt; &amp;gt; Hello Nadya,
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; I'll need your help to help me to understand why I'm failling with 
&lt;br&gt;&amp;gt; the
&lt;br&gt;&amp;gt; &amp;gt; upgradesprovision to correctly update some SD:
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; cn=administrator,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt; cn=dns,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt; cn=guest,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt; cn=krbtgt,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; As all the other SD are OK I'm rather encline to think that the
&lt;br&gt;&amp;gt; &amp;gt; update_sd does its job pretty well ... If you had a look at the
&lt;br&gt;&amp;gt; &amp;gt; updateprovision.log you will see the DN then the updated SD and 
&lt;br&gt;&amp;gt; finally
&lt;br&gt;&amp;gt; &amp;gt; the reference SDDL.
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; The SDDL share a lot but diverge on some points can you try to light 
&lt;br&gt;&amp;gt; my
&lt;br&gt;&amp;gt; &amp;gt; way ?
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Of course I also have problems with this but it's related to policy
&lt;br&gt;&amp;gt; &amp;gt; object and we know that we still have a slight problem on one flag 
&lt;br&gt;&amp;gt; for
&lt;br&gt;&amp;gt; &amp;gt; the SACL (so I'm not very nervous with this)
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; cn={f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,cn=system,
&lt;br&gt;&amp;gt; dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; cn=machine,cn{f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,
&lt;br&gt;&amp;gt; cn=system,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; cn=user,cn{f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,
&lt;br&gt;&amp;gt; cn=system,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Of course let me know !
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Matthieu
&lt;br&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Updatings-SD-tp26532368p26561415.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26560399</id>
	<title>Re: update_machine_account_password</title>
	<published>2009-11-29T01:25:31Z</published>
	<updated>2009-11-29T01:25:31Z</updated>
	<author>
		<name>Andrew Bartlett</name>
	</author>
	<content type="html">On Sun, 2009-11-29 at 12:07 +0300, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On 29/11/2009 10:02, Andrew Bartlett wrote:
&lt;br&gt;&amp;gt; &amp;gt; On Fri, 2009-11-27 at 20:23 +0300, Matthieu Patou wrote:
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Andrew B,
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; For a reason that I can't explain update_machine_account_password do not
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; work properly to update the supplementalCredentials and that's why using
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; smbclient for s4 against the updated tridge provision is failing
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; (because it's provision use w2K8 domain level and everything is done so
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; that aes is activated).
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; I tried several trick and failed so a guru of this stuff is required.
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Note that setting the password with sbin/setpassword but things back in
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; order (well once the kvno has been modified to put secrets.ldb and
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; sam.ldb in sync)
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; Could you have a look ?
&lt;br&gt;&amp;gt; &amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;gt; The easy answer it to simply use the same code as setpassword, whatever
&lt;br&gt;&amp;gt; &amp;gt; that is. &amp;nbsp;(That way, we keep this script using well known and otherwise
&lt;br&gt;&amp;gt; &amp;gt; tested code).
&lt;br&gt;&amp;gt; &amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; I tried also with the code of setpassword without success as I wrote in 
&lt;br&gt;&amp;gt; my other email on this thread what maid the password change succeed for 
&lt;br&gt;&amp;gt; the AES stuff is the fact that I used -s path_to_smb.conf when the 
&lt;br&gt;&amp;gt; database is not located in the default path.
&lt;/div&gt;&lt;/div&gt;Ahh, that would be a problem. &amp;nbsp;We would be using the wrong realm and
&lt;br&gt;domain. &amp;nbsp;We should store the domain in the @SAMBA_DSDB record, and build
&lt;br&gt;the realm from the default basedn. &amp;nbsp;We should also reconsider whenever
&lt;br&gt;we use lp_ctx in ldb. 
&lt;br&gt;&lt;br&gt;But using the right smb.conf is also required, and is the short and
&lt;br&gt;long-term fix. 
&lt;br&gt;&lt;br&gt;Andrew Bartlett
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andrew Bartlett &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://samba.org/~abartlet/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org/~abartlet/&lt;/a&gt;&lt;br&gt;Authentication Developer, Samba Team &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://samba.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org&lt;/a&gt;&lt;br&gt;Samba Developer, Cisco Inc.
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26560399/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/update_machine_account_password-tp26545488p26560399.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26560284</id>
	<title>Re: update_machine_account_password</title>
	<published>2009-11-29T01:07:44Z</published>
	<updated>2009-11-29T01:07:44Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">On 29/11/2009 10:02, Andrew Bartlett wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Fri, 2009-11-27 at 20:23 +0300, Matthieu Patou wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt;&amp;gt; Andrew B,
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; For a reason that I can't explain update_machine_account_password do not
&lt;br&gt;&amp;gt;&amp;gt; work properly to update the supplementalCredentials and that's why using
&lt;br&gt;&amp;gt;&amp;gt; smbclient for s4 against the updated tridge provision is failing
&lt;br&gt;&amp;gt;&amp;gt; (because it's provision use w2K8 domain level and everything is done so
&lt;br&gt;&amp;gt;&amp;gt; that aes is activated).
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; I tried several trick and failed so a guru of this stuff is required.
&lt;br&gt;&amp;gt;&amp;gt; Note that setting the password with sbin/setpassword but things back in
&lt;br&gt;&amp;gt;&amp;gt; order (well once the kvno has been modified to put secrets.ldb and
&lt;br&gt;&amp;gt;&amp;gt; sam.ldb in sync)
&lt;br&gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; Could you have a look ?
&lt;br&gt;&amp;gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; The easy answer it to simply use the same code as setpassword, whatever
&lt;br&gt;&amp;gt; that is. &amp;nbsp;(That way, we keep this script using well known and otherwise
&lt;br&gt;&amp;gt; tested code).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;/div&gt;I tried also with the code of setpassword without success as I wrote in 
&lt;br&gt;my other email on this thread what maid the password change succeed for 
&lt;br&gt;the AES stuff is the fact that I used -s path_to_smb.conf when the 
&lt;br&gt;database is not located in the default path.
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/update_machine_account_password-tp26545488p26560284.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26559791</id>
	<title>Re: update_machine_account_password</title>
	<published>2009-11-28T23:02:55Z</published>
	<updated>2009-11-28T23:02:55Z</updated>
	<author>
		<name>Andrew Bartlett</name>
	</author>
	<content type="html">On Fri, 2009-11-27 at 20:23 +0300, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Andrew B,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; For a reason that I can't explain update_machine_account_password do not 
&lt;br&gt;&amp;gt; work properly to update the supplementalCredentials and that's why using 
&lt;br&gt;&amp;gt; smbclient for s4 against the updated tridge provision is failing 
&lt;br&gt;&amp;gt; (because it's provision use w2K8 domain level and everything is done so 
&lt;br&gt;&amp;gt; that aes is activated).
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I tried several trick and failed so a guru of this stuff is required.
&lt;br&gt;&amp;gt; Note that setting the password with sbin/setpassword but things back in 
&lt;br&gt;&amp;gt; order (well once the kvno has been modified to put secrets.ldb and 
&lt;br&gt;&amp;gt; sam.ldb in sync)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Could you have a look ?
&lt;/div&gt;&lt;/div&gt;The easy answer it to simply use the same code as setpassword, whatever
&lt;br&gt;that is. &amp;nbsp;(That way, we keep this script using well known and otherwise
&lt;br&gt;tested code). 
&lt;br&gt;&lt;br&gt;Andrew Bartlett
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Andrew Bartlett &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://samba.org/~abartlet/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org/~abartlet/&lt;/a&gt;&lt;br&gt;Authentication Developer, Samba Team &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://samba.org&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://samba.org&lt;/a&gt;&lt;br&gt;Samba Developer, Cisco Inc.
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (196 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26559791/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/update_machine_account_password-tp26545488p26559791.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26557915</id>
	<title>Re: Updatings SD</title>
	<published>2009-11-28T15:15:47Z</published>
	<updated>2009-11-28T15:15:47Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Hello Nadya,
&lt;br&gt;&lt;br&gt;I put more trace and I find the problem: defaultSecurityDescriptor was 
&lt;br&gt;not upgraded because previously I had a plan to make something rather 
&lt;br&gt;complicated with SD update that implied to have the previous SD.
&lt;br&gt;&lt;br&gt;So the story is solved no need to investigate more !
&lt;br&gt;Sorry for the lost time on research ...
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;On 26/11/2009 20:06, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hello Nadya,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'll need your help to help me to understand why I'm failling with the
&lt;br&gt;&amp;gt; upgradesprovision to correctly update some SD:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cn=administrator,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; cn=dns,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; cn=guest,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt; cn=krbtgt,cn=users,dc=smb4,dc=tst
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As all the other SD are OK I'm rather encline to think that the
&lt;br&gt;&amp;gt; update_sd does its job pretty well ... If you had a look at the
&lt;br&gt;&amp;gt; updateprovision.log you will see the DN then the updated SD and finally
&lt;br&gt;&amp;gt; the reference SDDL.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The SDDL share a lot but diverge on some points can you try to light my
&lt;br&gt;&amp;gt; way ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Of course I also have problems with this but it's related to policy
&lt;br&gt;&amp;gt; object and we know that we still have a slight problem on one flag for
&lt;br&gt;&amp;gt; the SACL (so I'm not very nervous with this)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cn={f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,cn=system,dc=smb4,dc=tst
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cn=machine,cn{f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,cn=system,dc=smb4,dc=tst
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; cn=user,cn{f6f519f1-7ec2-4f98-9b87-3d05e2dc697b},cn=policies,cn=system,dc=smb4,dc=tst
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Of course let me know !
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Matthieu
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Updatings-SD-tp26532368p26557915.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26557817</id>
	<title>s4-drs: cope with bogus empty attributes from w2k8-r2 (Re: [SCM] Samba Shared Repository - branch master updated)</title>
	<published>2009-11-28T15:02:31Z</published>
	<updated>2009-11-28T15:02:31Z</updated>
	<author>
		<name>tridge@samba.org</name>
	</author>
	<content type="html">Hi Metze,
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +	/* delete any empty elements */
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +	for (i=0; i &amp;lt; msg-&amp;gt;num_elements; i++) {
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +		if (msg-&amp;gt;elements[i].name == NULL) {
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +			ldb_msg_remove_element(msg, &amp;msg-&amp;gt;elements[i]);
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +			i--;
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +		}
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +	}
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;gt; +
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; We need to be careful about this, an empty element means
&lt;br&gt;&amp;nbsp;&amp;gt; we should remove existing values.
&lt;br&gt;&amp;nbsp;&amp;gt; If remove the empty ones here, we need to let the repl_meta_data module
&lt;br&gt;&amp;nbsp;&amp;gt; remove them based on the received meta_data array.
&lt;br&gt;&lt;br&gt;my comment in the above is perhaps misleading. I'm removing &amp;quot;empty&amp;quot;
&lt;br&gt;ones that have a NULL name. It only gets a NULL name when the attid is
&lt;br&gt;invalid (not in the prefixmap) and it also has no elements.
&lt;br&gt;&lt;br&gt;So we are not removing all the empty entries, so we don't need any
&lt;br&gt;change in repl_meta_data.c at the moment. Before the above change we
&lt;br&gt;were just exiting the DRS replication with an error.
&lt;br&gt;&lt;br&gt;This change was just to cope with what appears to be a bug in w2k8-r2,
&lt;br&gt;where it sometimes sends completely bogus empty entries with bad attid
&lt;br&gt;values. Kamen is looking into this with Bill Wesse, but I wanted a way
&lt;br&gt;to avoid this problem now as otherwise I can't do any DRS testing. I
&lt;br&gt;haven't found any way to remove these broken objects/attributes from
&lt;br&gt;the w2k8 server, as they are already deleted, and they don't seem to
&lt;br&gt;be being removed as part of the normal tombstoning. Re-installing
&lt;br&gt;w2k8-r2 each time this happens is too painful for regular development.
&lt;br&gt;&lt;br&gt;I actually suspect the bug in w2k8-r2 is triggered by our ldap.py
&lt;br&gt;testsuite somehow, as the bad objects are ones we create in that
&lt;br&gt;testsuite, with one of the test objectclasses we create.
&lt;br&gt;&lt;br&gt;Cheers, Tridge
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/s4-drs%3A-cope-with-bogus-empty-attributes-from-w2k8-r2-%28Re%3A--SCM--Samba-Shared-Repository---branch-master-updated%29-tp26552596p26557817.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26557192</id>
	<title>Re: update_machine_account_password</title>
	<published>2009-11-28T13:44:02Z</published>
	<updated>2009-11-28T13:44:02Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">Andrew,
&lt;br&gt;Don't know it comes to my mind by I decided to make a test with -s 
&lt;br&gt;parameter instead of --targetdir
&lt;br&gt;that is to say:
&lt;br&gt;&lt;br&gt;./scripting/bin/upgradeprovision -s /home/mat/tridge/etc/smb.conf
&lt;br&gt;instead of
&lt;br&gt;./scripting/bin/upgradeprovision --targetdir /home/mat/tridge
&lt;br&gt;&lt;br&gt;And now it's working. I am wondering what the -s trigger or set so that 
&lt;br&gt;just using --target dir do not the same effet.
&lt;br&gt;&lt;br&gt;Worth investigating, I guess I should remove the --targetdir option.
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;On 27/11/2009 20:23, Matthieu Patou wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Andrew B,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For a reason that I can't explain update_machine_account_password do not
&lt;br&gt;&amp;gt; work properly to update the supplementalCredentials and that's why using
&lt;br&gt;&amp;gt; smbclient for s4 against the updated tridge provision is failing
&lt;br&gt;&amp;gt; (because it's provision use w2K8 domain level and everything is done so
&lt;br&gt;&amp;gt; that aes is activated).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I tried several trick and failed so a guru of this stuff is required.
&lt;br&gt;&amp;gt; Note that setting the password with sbin/setpassword but things back in
&lt;br&gt;&amp;gt; order (well once the kvno has been modified to put secrets.ldb and
&lt;br&gt;&amp;gt; sam.ldb in sync)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Could you have a look ?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Matthieu.
&lt;/div&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/update_machine_account_password-tp26545488p26557192.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26557035</id>
	<title>Re: Patches for allowing upgradeprovision to upgrade SD</title>
	<published>2009-11-28T13:15:54Z</published>
	<updated>2009-11-28T13:15:54Z</updated>
	<author>
		<name>Matthieu Patou-5</name>
	</author>
	<content type="html">On 28/11/2009 02:31, &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26557035&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tridge@...&lt;/a&gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi Matthieu,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks for that! I've confirmed that it fixes the upgrade for my
&lt;br&gt;&amp;gt; box. I'm now doing more tests and expect to push the patch soon.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I'm very impressed at how this upgradeprovision script has worked
&lt;br&gt;&amp;gt; out. Thanks for all your work on it!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers, Tridge
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;
&lt;/div&gt;Tridge,
&lt;br&gt;I've one more patch in my repo that I will (soooooon) push &amp;nbsp;because 
&lt;br&gt;right now we do a provision with a w2k3 domain and for instance your 
&lt;br&gt;provision is 2008 so the script must detect this and make a reference 
&lt;br&gt;provision with the same domain level as the updated provision.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Stay tuned !
&lt;br&gt;&lt;br&gt;Matthieu.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Patches-for-allowing-upgradeprovision-to-upgrade-SD-tp26532272p26557035.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26555627</id>
	<title>Re: the function of SMB_STRUCT_STAT *sbuf in vfs readdir() ?</title>
	<published>2009-11-28T10:14:16Z</published>
	<updated>2009-11-28T10:14:16Z</updated>
	<author>
		<name>Volker Lendecke</name>
	</author>
	<content type="html">On Sat, Nov 28, 2009 at 02:51:37PM +0100, Olivier Sessink wrote:
&lt;br&gt;&amp;gt; what is the function of SMB_STRUCT_STAT *sbuf in the VFS readdir API ?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; is it supposed to be filled by the SMB_VFS_NEXT_READDIR call? (e.g. can
&lt;br&gt;&amp;gt; you use it after that call?)
&lt;br&gt;&lt;br&gt;Some operating systems provide something similar to the NFS
&lt;br&gt;readdirplus operation, also giving stat info in a single
&lt;br&gt;syscall. The READDIR sbuf argument is giving VFS
&lt;br&gt;implementations a chance to fill that in. If you don't do
&lt;br&gt;that in a transparent module, just pass it down.
&lt;br&gt;&lt;br&gt;You can't rely on it being set though, the check macros is
&lt;br&gt;VALID_STAT().
&lt;br&gt;&lt;br&gt;Volker
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (204 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26555627/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/the-function-of-SMB_STRUCT_STAT-*sbuf-in-vfs-readdir%28%29---tp26553270p26555627.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26554800</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T08:30:37Z</published>
	<updated>2009-11-28T08:30:37Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">Hi Matthias,
&lt;br&gt;&lt;br&gt;On Sat, Nov 28, 2009 at 03:57:21PM +0000, Matthias Dieter Wallnöfer wrote:
&lt;br&gt;&amp;gt; sorry for the remove of the first code block &amp;quot;if not opts.interactive and (opts.realm is None or opts.domain is None):&amp;quot;. I was too fast and thought maybe this was the problem since the interactive mode didn't work on my box. Later I discovered that this is due to the split function of the call  socket.getfqdn().split(&amp;quot;.&amp;quot;, 1)[1].upper()). Therefore I would let in the error handling like this since it's really a bugfix.
&lt;br&gt;&lt;br&gt;&amp;gt; Okay, the first part I will restore
&lt;br&gt;Please see my comments about the other code parts as well - I don't
&lt;br&gt;think they are correct either. Is there any particular reason for
&lt;br&gt;prompting the user twice when we are not able to determine a sane
&lt;br&gt;default?
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br&gt;&amp;gt; --- Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt; schrieb am Sa, 28.11.2009:
&lt;br&gt;&lt;br&gt;&amp;gt; Von: Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Betreff: Re: [SCM] Samba Shared Repository - branch master updated
&lt;br&gt;&amp;gt; An: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt;
&lt;br&gt;&amp;gt; CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-cvs@...&lt;/a&gt;
&lt;br&gt;&amp;gt; Datum: Samstag, 28. November 2009, 15:10
&lt;br&gt;&lt;br&gt;&amp;gt; On Fri, 2009-11-27 at 06:04 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;br&gt;&amp;gt; &amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt; &amp;gt;        via  a7fa3a9... s4:provision.py - cosmetic output correction
&lt;br&gt;&amp;gt; &amp;gt;        via  6b835b0... s4:setup/provision - make the interactive mode work again
&lt;br&gt;&amp;gt; &amp;gt;       from  7504b03... s4:WHATSNEW4.txt - Add also here a comment about the &amp;quot;upgrade_from_s3&amp;quot; script
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; &amp;gt; commit a7fa3a9703bf9f0c72031c84998f4fb21ba95429
&lt;br&gt;&amp;gt; &amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Date:   Fri Nov 27 13:07:52 2009 +0100
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;     s4:provision.py - cosmetic output correction
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; commit 6b835b0691faab904246e587ffa6ff74b9fb53e2
&lt;br&gt;&amp;gt; &amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;gt; Date:   Fri Nov 27 13:02:31 2009 +0100
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt;     s4:setup/provision - make the interactive mode work again
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&lt;br&gt;&amp;gt; &amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;gt;  source4/scripting/python/samba/provision.py |    2 +-
&lt;br&gt;&amp;gt; &amp;gt;  source4/setup/provision                     |   16 +++-------------
&lt;br&gt;&amp;gt; &amp;gt;  2 files changed, 4 insertions(+), 14 deletions(-)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; index ed350dd..f1aa07c 100755
&lt;br&gt;&amp;gt; &amp;gt; --- a/source4/setup/provision
&lt;br&gt;&amp;gt; &amp;gt; +++ b/source4/setup/provision
&lt;br&gt;&amp;gt; &amp;gt; @@ -122,14 +122,6 @@ def message(text):
&lt;br&gt;&amp;gt; &amp;gt;  if len(sys.argv) == 1:
&lt;br&gt;&amp;gt; &amp;gt;      opts.interactive = True
&lt;br&gt;&amp;gt; &amp;gt;  
&lt;br&gt;&amp;gt; &amp;gt; -if not opts.interactive and (opts.realm is None or opts.domain is None):
&lt;br&gt;&amp;gt; &amp;gt; -    if opts.realm is None:
&lt;br&gt;&amp;gt; &amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No realm set&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt; -    if opts.domain is None:
&lt;br&gt;&amp;gt; &amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No domain set&amp;quot;
&lt;br&gt;&amp;gt; &amp;gt; -    parser.print_usage()
&lt;br&gt;&amp;gt; &amp;gt; -    sys.exit(1)
&lt;br&gt;&amp;gt; &amp;gt; -
&lt;br&gt;&amp;gt; ^^^ This change isn't necessary to make the interactive mode work (it
&lt;br&gt;&amp;gt; explicitly checks for interactive mode not being in use), and it breaks
&lt;br&gt;&amp;gt; usage when not in interactive mode because we end up with no
&lt;br&gt;&amp;gt; realm/domain being set. 
&lt;/div&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &amp;gt; if opts.interactive:
&lt;br&gt;&amp;gt; &amp;gt;      from getpass import getpass
&lt;br&gt;&amp;gt; &amp;gt;      import socket
&lt;br&gt;&amp;gt; &amp;gt; @@ -137,19 +129,17 @@ if opts.interactive:
&lt;br&gt;&amp;gt; &amp;gt;          if default is not None:
&lt;br&gt;&amp;gt; &amp;gt;              print &amp;quot;%s [%s]: &amp;quot; % (prompt,default),
&lt;br&gt;&amp;gt; &amp;gt;          else:
&lt;br&gt;&amp;gt; &amp;gt; -            print &amp;quot;%s: &amp;quot; % (prompt,),
&lt;br&gt;&amp;gt; &amp;gt; +            print &amp;quot;%s: &amp;quot; % (prompt),
&lt;br&gt;&amp;gt; &amp;gt;          return sys.stdin.readline().rstrip(&amp;quot;\n&amp;quot;) or default
&lt;br&gt;&amp;gt; &amp;gt;      try:
&lt;br&gt;&amp;gt; &amp;gt;          opts.realm = ask(&amp;quot;Realm&amp;quot;, socket.getfqdn().split(&amp;quot;.&amp;quot;, 1)[1].upper())
&lt;br&gt;&amp;gt; &amp;gt;      except IndexError:
&lt;br&gt;&amp;gt; &amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess realm from %s&amp;quot; % ( socket.getfqdn())
&lt;br&gt;&amp;gt; &amp;gt; -        sys.exit(1)
&lt;br&gt;&amp;gt; &amp;gt; +        opts.realm = ask(&amp;quot;Realm&amp;quot;, None)
&lt;br&gt;&amp;gt; ^^^ We've already asked the user for a realm, why ask twice? Rather, we
&lt;br&gt;&amp;gt; should not set a default value if the users FQDN is broken because it
&lt;br&gt;&amp;gt; contains no dots.
&lt;/div&gt;&lt;br&gt;&amp;gt; &amp;gt;     try:
&lt;br&gt;&amp;gt; &amp;gt;          opts.domain = ask(&amp;quot;Domain&amp;quot;, opts.realm.split(&amp;quot;.&amp;quot;)[0])
&lt;br&gt;&amp;gt; &amp;gt;      except IndexError:
&lt;br&gt;&amp;gt; &amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess domain from %s&amp;quot; % ( opts.realm())
&lt;br&gt;&amp;gt; &amp;gt; -        sys.exit(1)
&lt;br&gt;&amp;gt; &amp;gt; +        opts.domain = ask(&amp;quot;Domain&amp;quot;, None)
&lt;br&gt;&amp;gt; ^^^ Same here, let's just get the default value right in the first
&lt;br&gt;&amp;gt; place.
&lt;br&gt;&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&lt;br&gt;&amp;gt; Jelmer
&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;gt; __________________________________________________
&lt;br&gt;&amp;gt; Do You Yahoo!?
&lt;br&gt;&amp;gt; Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&amp;nbsp;
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554800&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt; - &lt;a href=&quot;http://jelmer.vernstok.nl/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jelmer.vernstok.nl/&lt;/a&gt;&lt;br&gt;&amp;nbsp;17:29:41 up 14 min, &amp;nbsp;3 users, &amp;nbsp;load average: 0.53, 0.58, 0.44
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26554800.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26554343</id>
	<title>Re: Commit: 0920e0b63b806c8ed4839271048dd4924ed02b2b</title>
	<published>2009-11-28T08:00:15Z</published>
	<updated>2009-11-28T08:00:15Z</updated>
	<author>
		<name>Kamen Mazdrashki-2</name>
	</author>
	<content type="html">On Sat, Nov 28, 2009 at 07:32, &amp;nbsp;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554343&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tridge@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; it is far too dangerous. The environment variable LDB_URL is the
&lt;br&gt;&amp;gt; standard environment variable used by the ldb tools to avoid using the
&lt;br&gt;&amp;gt; -H option. It is not uncommon for someone to set this to point at a
&lt;br&gt;&amp;gt; real LDB. In my case I had it pointed at my sam.ldb, which meant that
&lt;br&gt;&amp;gt; running &amp;quot;make test&amp;quot; not only failed, it also corrupted by sam database.
&lt;br&gt;&amp;gt;
&lt;br&gt;This is good to know.
&lt;br&gt;I haven't realized it is used that way - I thought it is temporary DB to be
&lt;br&gt;used during testing - I don't know why I was thinking it is cleaned every
&lt;br&gt;test suite is started :)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;  &amp;gt; Could we just use another name for the environment variable used?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; no, please don't use an environment variable for this sort of thing.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you want to have a way to override the location of this test ldb,
&lt;br&gt;&amp;gt; then use lp_parm_string() and then pass the location using the
&lt;br&gt;&amp;gt; --option command line option. To see some examples of this, try:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  git grep lp_parm_string source4/torture/
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; for example, you could have:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  ldb_url = lp_parm_string(tctx-&amp;gt;lp_ctx, NULL, &amp;quot;drstest&amp;quot;, &amp;quot;ldb_url&amp;quot;);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; and then set it with:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;  --option drstest:ldb_url=foo.ldb
&lt;/div&gt;&lt;br&gt;This is much better solution. I will do it that way.
&lt;br&gt;&lt;br&gt;Thanks for spotting that out and... sorry for inconveniences you might
&lt;br&gt;have had with this approach.
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;CU,
&lt;br&gt;Kamen Mazdrashki
&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554343&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;kamen.mazdrashki@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;http://repo.or.cz/w/Samba/kamenim.git&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://repo.or.cz/w/Samba/kamenim.git&lt;/a&gt;&lt;br&gt;-------------------------------------
&lt;br&gt;CISCO SYSTEMS BULGARIA EOOD
&lt;br&gt;&lt;a href=&quot;http://www.cisco.com/global/BG/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.cisco.com/global/BG/&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Commit%3A-0920e0b63b806c8ed4839271048dd4924ed02b2b-tp26544293p26554343.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26554325</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T07:57:21Z</published>
	<updated>2009-11-28T07:57:21Z</updated>
	<author>
		<name>Matthias Dieter Wallnöfer-3</name>
	</author>
	<content type="html">Jelmer,
&lt;br&gt;&lt;br&gt;sorry for the remove of the first code block &amp;quot;if not opts.interactive and (opts.realm is None or opts.domain is None):&amp;quot;. I was too fast and thought maybe this was the problem since the interactive mode didn't work on my box. Later I discovered that this is due to the split function of the call  socket.getfqdn().split(&amp;quot;.&amp;quot;, 1)[1].upper()). Therefore I would let in the error handling like this since it's really a bugfix.
&lt;br&gt;&lt;br&gt;Okay, the first part I will restore
&lt;br&gt;&lt;br&gt;Matthias
&lt;br&gt;&lt;br&gt;--- Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt; schrieb am Sa, 28.11.2009:
&lt;br&gt;&lt;br&gt;Von: Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Betreff: Re: [SCM] Samba Shared Repository - branch master updated
&lt;br&gt;An: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt;
&lt;br&gt;CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-cvs@...&lt;/a&gt;
&lt;br&gt;Datum: Samstag, 28. November 2009, 15:10
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 06:04 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt;        via  a7fa3a9... s4:provision.py - cosmetic output correction
&lt;br&gt;&amp;gt;        via  6b835b0... s4:setup/provision - make the interactive mode work again
&lt;br&gt;&amp;gt;       from  7504b03... s4:WHATSNEW4.txt - Add also here a comment about the &amp;quot;upgrade_from_s3&amp;quot; script
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit a7fa3a9703bf9f0c72031c84998f4fb21ba95429
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 13:07:52 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:provision.py - cosmetic output correction
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 6b835b0691faab904246e587ffa6ff74b9fb53e2
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554325&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 13:02:31 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:setup/provision - make the interactive mode work again
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/provision.py |    2 +-
&lt;br&gt;&amp;gt;  source4/setup/provision                     |   16 +++-------------
&lt;br&gt;&amp;gt;  2 files changed, 4 insertions(+), 14 deletions(-)
&lt;/div&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; index ed350dd..f1aa07c 100755
&lt;br&gt;&amp;gt; --- a/source4/setup/provision
&lt;br&gt;&amp;gt; +++ b/source4/setup/provision
&lt;br&gt;&amp;gt; @@ -122,14 +122,6 @@ def message(text):
&lt;br&gt;&amp;gt;  if len(sys.argv) == 1:
&lt;br&gt;&amp;gt;      opts.interactive = True
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -if not opts.interactive and (opts.realm is None or opts.domain is None):
&lt;br&gt;&amp;gt; -    if opts.realm is None:
&lt;br&gt;&amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No realm set&amp;quot;
&lt;br&gt;&amp;gt; -    if opts.domain is None:
&lt;br&gt;&amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No domain set&amp;quot;
&lt;br&gt;&amp;gt; -    parser.print_usage()
&lt;br&gt;&amp;gt; -    sys.exit(1)
&lt;br&gt;&amp;gt; -
&lt;/div&gt;^^^ This change isn't necessary to make the interactive mode work (it
&lt;br&gt;explicitly checks for interactive mode not being in use), and it breaks
&lt;br&gt;usage when not in interactive mode because we end up with no
&lt;br&gt;realm/domain being set. 
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; if opts.interactive:
&lt;br&gt;&amp;gt;      from getpass import getpass
&lt;br&gt;&amp;gt;      import socket
&lt;br&gt;&amp;gt; @@ -137,19 +129,17 @@ if opts.interactive:
&lt;br&gt;&amp;gt;          if default is not None:
&lt;br&gt;&amp;gt;              print &amp;quot;%s [%s]: &amp;quot; % (prompt,default),
&lt;br&gt;&amp;gt;          else:
&lt;br&gt;&amp;gt; -            print &amp;quot;%s: &amp;quot; % (prompt,),
&lt;br&gt;&amp;gt; +            print &amp;quot;%s: &amp;quot; % (prompt),
&lt;br&gt;&amp;gt;          return sys.stdin.readline().rstrip(&amp;quot;\n&amp;quot;) or default
&lt;br&gt;&amp;gt;      try:
&lt;br&gt;&amp;gt;          opts.realm = ask(&amp;quot;Realm&amp;quot;, socket.getfqdn().split(&amp;quot;.&amp;quot;, 1)[1].upper())
&lt;br&gt;&amp;gt;      except IndexError:
&lt;br&gt;&amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess realm from %s&amp;quot; % ( socket.getfqdn())
&lt;br&gt;&amp;gt; -        sys.exit(1)
&lt;br&gt;&amp;gt; +        opts.realm = ask(&amp;quot;Realm&amp;quot;, None)
&lt;/div&gt;^^^ We've already asked the user for a realm, why ask twice? Rather, we
&lt;br&gt;should not set a default value if the users FQDN is broken because it
&lt;br&gt;contains no dots.
&lt;br&gt;&lt;br&gt;&amp;gt;     try:
&lt;br&gt;&amp;gt;          opts.domain = ask(&amp;quot;Domain&amp;quot;, opts.realm.split(&amp;quot;.&amp;quot;)[0])
&lt;br&gt;&amp;gt;      except IndexError:
&lt;br&gt;&amp;gt; -        print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess domain from %s&amp;quot; % ( opts.realm())
&lt;br&gt;&amp;gt; -        sys.exit(1)
&lt;br&gt;&amp;gt; +        opts.domain = ask(&amp;quot;Domain&amp;quot;, None)
&lt;br&gt;^^^ Same here, let's just get the default value right in the first
&lt;br&gt;place.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br&gt;&lt;br&gt;__________________________________________________
&lt;br&gt;Do You Yahoo!?
&lt;br&gt;Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
&lt;br&gt;&lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26554325.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26554301</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T07:53:42Z</published>
	<updated>2009-11-28T07:53:42Z</updated>
	<author>
		<name>Matthias Dieter Wallnöfer</name>
	</author>
	<content type="html">I moved the method down since I find it easier to locate there. That was the primary reason. Thanks for pointing out the two linespace convention for python. Didn't know that. I will reintroduce them.
&lt;br&gt;&lt;br&gt;Matthias
&lt;br&gt;&lt;br&gt;--- Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt; schrieb am Sa, 28.11.2009:
&lt;br&gt;&lt;br&gt;Von: Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Betreff: Re: [SCM] Samba Shared Repository - branch master updated
&lt;br&gt;An: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt;
&lt;br&gt;CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-cvs@...&lt;/a&gt;
&lt;br&gt;Datum: Samstag, 28. November 2009, 15:16
&lt;br&gt;&lt;br&gt;Hi Matthias,
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 08:59 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt;        via  0cc45b4... s4:upgrade.py - rework to make the upgrade s3 -&amp;gt; s4 possible again
&lt;br&gt;&amp;gt;        via  bd6c133... s4:upgrade_from_s3 - Fix message outputs
&lt;br&gt;&amp;gt;        via  dbb8989... s4:upgrade.py - the import of WINS databases don't seem to work always
&lt;br&gt;&amp;gt;        via  70b3161... s4:samba3.py - ignore comments in &amp;quot;smb.conf&amp;quot; files
&lt;br&gt;&amp;gt;        via  82adfa3... s4:samba3.py - don't read those informations out from the TDB
&lt;br&gt;&amp;gt;        via  f299efa... s4:samba3.py - support the TDB version 3
&lt;br&gt;&amp;gt;       from  a5d854a... s4:provision - Fix up the provision of &amp;quot;standalone&amp;quot; and &amp;quot;member&amp;quot; mode
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 0cc45b47dc787abb2c3c31e4fc824798d9f3efe9
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 15:50:26 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:upgrade.py - rework to make the upgrade s3 -&amp;gt; s4 possible again
&lt;br&gt;&amp;gt;     
&lt;br&gt;&amp;gt;     Able to read basic settings &amp;quot;workgroup&amp;quot;, &amp;quot;realm&amp;quot;, &amp;quot;netbios name&amp;quot; and the
&lt;br&gt;&amp;gt;     function mode from the s3 &amp;quot;smb.conf&amp;quot; and use them for the provision of s4.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit bd6c133e506fdb5dee13e0a144ef99c6d452be42
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 15:49:18 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:upgrade_from_s3 - Fix message outputs
&lt;br&gt;&amp;gt;     
&lt;br&gt;&amp;gt;     The quiet parameter was interpreted in the reverse manner.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit dbb8989e05ac3189a5eca11fa40d572388ea02fc
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 15:02:18 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:upgrade.py - the import of WINS databases don't seem to work always
&lt;br&gt;&amp;gt;     
&lt;br&gt;&amp;gt;     Disable it for now until the cause has been found
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 70b31610909544c58fd87c5e0aa00e02eb5f6d4b
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 15:00:41 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:samba3.py - ignore comments in &amp;quot;smb.conf&amp;quot; files
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 82adfa39b75aa628c88f828278c6ac09335d1a49
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=8&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 14:59:12 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:samba3.py - don't read those informations out from the TDB
&lt;br&gt;&amp;gt;     
&lt;br&gt;&amp;gt;     At the moment those three calls are broken
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit f299efa8f05c6a5b739222bdf75690a4591d3650
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554301&amp;i=9&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 14:58:37 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:samba3.py - support the TDB version 3
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt;  source4/scripting/bin/upgrade_from_s3     |    6 +-
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/samba3.py  |   11 +-
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/upgrade.py |  144 ++++++++++++++--------------
&lt;br&gt;&amp;gt;  3 files changed, 81 insertions(+), 80 deletions(-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Changeset truncated at 500 lines:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; diff --git a/source4/scripting/bin/upgrade_from_s3 b/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; index 03f4415..7e1e1fd 100755
&lt;br&gt;&amp;gt; --- a/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; +++ b/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; @@ -50,14 +50,14 @@ opts, args = parser.parse_args()
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt;  def message(text):
&lt;br&gt;&amp;gt;      &amp;quot;&amp;quot;&amp;quot;Print a message if quiet is not set.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt; -    if opts.quiet:
&lt;br&gt;&amp;gt; +    if not opts.quiet:
&lt;br&gt;&amp;gt;          print text
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt;  if len(args) &amp;lt; 1:
&lt;br&gt;&amp;gt;      parser.print_usage()
&lt;br&gt;&amp;gt;      sys.exit(1)
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -message(&amp;quot;Reading Samba3 databases and smb.conf\n&amp;quot;)
&lt;br&gt;&amp;gt; +message(&amp;quot;Reading Samba3 databases and smb.conf&amp;quot;)
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt;  libdir = args[0]
&lt;br&gt;&amp;gt;  if not os.path.isdir(libdir):
&lt;br&gt;&amp;gt; @@ -71,7 +71,7 @@ else:
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt;  samba3 = Samba3(libdir, smbconf)
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -message(&amp;quot;Provisioning\n&amp;quot;)
&lt;br&gt;&amp;gt; +message(&amp;quot;Provisioning&amp;quot;)
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt;  setup_dir = opts.setupdir
&lt;br&gt;&amp;gt;  if setup_dir is None:
&lt;br&gt;&amp;gt; diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; index 179efa2..c21b457 100644
&lt;br&gt;&amp;gt; --- a/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; +++ b/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; @@ -509,7 +509,7 @@ class TdbSam(TdbDatabase):
&lt;br&gt;&amp;gt;      &amp;quot;&amp;quot;&amp;quot;Samba 3 TDB passdb backend reader.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt;      def _check_version(self):
&lt;br&gt;&amp;gt;          self.version = fetch_uint32(self.tdb, &amp;quot;INFO/version\0&amp;quot;) or 0
&lt;br&gt;&amp;gt; -        assert self.version in (0, 1, 2)
&lt;br&gt;&amp;gt; +        assert self.version in (0, 1, 2, 3)
&lt;/div&gt;^^ Please revert these changes. Clearly we don't support version 3 yet,
&lt;br&gt;so we shouldn't pretend like we do. I'd rather see us fail with a clear
&lt;br&gt;assertion error than breaking the v2 support. Furthermore, supporting
&lt;br&gt;version 3 properly shouldn't be too hard.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; def usernames(self):
&lt;br&gt;&amp;gt;          &amp;quot;&amp;quot;&amp;quot;Iterate over the usernames in this Tdb database.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt; @@ -592,9 +592,10 @@ class TdbSam(TdbDatabase):
&lt;br&gt;&amp;gt;          for entry in hours:
&lt;br&gt;&amp;gt;              for i in range(8):
&lt;br&gt;&amp;gt;                  user.hours.append(ord(entry) &amp; (2 ** i) == (2 ** i))
&lt;br&gt;&amp;gt; -        (user.bad_password_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; -        (user.logon_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; -        (user.unknown_6, data) = unpack_uint32(data)
&lt;br&gt;&amp;gt; +        # FIXME
&lt;br&gt;&amp;gt; +        #(user.bad_password_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; +        #(user.logon_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; +        #(user.unknown_6, data) = unpack_uint32(data)
&lt;br&gt;&amp;gt;          assert len(data) == 0
&lt;br&gt;&amp;gt;          return user
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; @@ -683,7 +684,7 @@ class ParamFile(object):
&lt;br&gt;&amp;gt;          section = None
&lt;br&gt;&amp;gt;          for i, l in enumerate(open(filename, 'r').xreadlines()):
&lt;br&gt;&amp;gt;              l = l.strip()
&lt;br&gt;&amp;gt; -            if not l:
&lt;br&gt;&amp;gt; +            if not l or l[0] == '#' or l[0] == ';':
&lt;br&gt;&amp;gt;                  continue
&lt;br&gt;&amp;gt;              if l[0] == &amp;quot;[&amp;quot; and l[-1] == &amp;quot;]&amp;quot;:
&lt;br&gt;&amp;gt;                  section = self._sanitize_name(l[1:-1])
&lt;/div&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; index 8194552..44b43a1 100644
&lt;br&gt;&amp;gt; --- a/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; +++ b/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; @@ -92,7 +93,6 @@ def import_sam_account(samldb,acc,domaindn,domainsid):
&lt;br&gt;&amp;gt;          &amp;quot;ntPwdHash:&amp;quot;: acc.nt_password,
&lt;br&gt;&amp;gt;          })
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -
&lt;br&gt;&amp;gt;  def import_sam_group(samldb, sid, gid, sid_name_use, nt_name, comment, domaindn):
&lt;br&gt;&amp;gt;      &amp;quot;&amp;quot;&amp;quot;Upgrade a SAM group.
&lt;br&gt;&amp;gt;      
&lt;br&gt;&amp;gt; @@ -132,7 +132,6 @@ def import_sam_group(samldb, sid, gid, sid_name_use, nt_name, comment, domaindn)
&lt;br&gt;&amp;gt;          &amp;quot;samba3SidNameUse&amp;quot;: str(sid_name_use)
&lt;br&gt;&amp;gt;          })
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -
&lt;/div&gt;^^ The two empty lines are intentional here - PEP8 (standard coding
&lt;br&gt;style for Python) specifies two empty lines between top-level objects.
&lt;br&gt;Please don't remove them.
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; @@ -157,7 +156,6 @@ def import_idmap(samdb,samba3_idmap,domaindn):
&lt;br&gt;&amp;gt;                            &amp;quot;type&amp;quot;: &amp;quot;group&amp;quot;,
&lt;br&gt;&amp;gt;                            &amp;quot;unixID&amp;quot;: str(gid)})
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -
&lt;br&gt;&amp;gt;  def import_wins(samba4_winsdb, samba3_winsdb):
&lt;br&gt;&amp;gt;      &amp;quot;&amp;quot;&amp;quot;Import settings from a Samba3 WINS database.
&lt;br&gt;&amp;gt;      
&lt;br&gt;&amp;gt; @@ -208,73 +206,6 @@ def import_wins(samba4_winsdb, samba3_winsdb):
&lt;br&gt;&amp;gt;                         &amp;quot;objectClass&amp;quot;: &amp;quot;winsMaxVersion&amp;quot;,
&lt;br&gt;&amp;gt;                         &amp;quot;maxVersion&amp;quot;: str(version_id)})
&lt;br&gt;&amp;gt;  
&lt;br&gt;&amp;gt; -def upgrade_provision(samba3, setup_dir, message, credentials, session_info, smbconf, targetdir):
&lt;/div&gt;^^^ Why did you move this function? It makes it very hard to spot what
&lt;br&gt;actual changes you made.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br&gt;&lt;br&gt;__________________________________________________
&lt;br&gt;Do You Yahoo!?
&lt;br&gt;Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
&lt;br&gt;&lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26554301.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26554283</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T07:51:44Z</published>
	<updated>2009-11-28T07:51:44Z</updated>
	<author>
		<name>Matthias Dieter Wallnöfer-3</name>
	</author>
	<content type="html">Will revert soon.
&lt;br&gt;&lt;br&gt;Matthias
&lt;br&gt;&lt;br&gt;--- Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt; schrieb am Sa, 28.11.2009:
&lt;br&gt;&lt;br&gt;Von: Jelmer Vernooij &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jelmer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Betreff: Re: [SCM] Samba Shared Repository - branch master updated
&lt;br&gt;An: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-technical@...&lt;/a&gt;
&lt;br&gt;CC: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;samba-cvs@...&lt;/a&gt;
&lt;br&gt;Datum: Samstag, 28. November 2009, 15:22
&lt;br&gt;&lt;br&gt;Hi Matthias,
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 09:42 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 6c3e2417a0639cd7c367de93615c422cf5217456
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 16:39:27 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:samba3.py (and test) - deactivate the tests until those parameters are fixed
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 08b3c396d7d534c9bfa29a7cd015a97d504d45a9
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 16:35:28 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:upgrade.py - Umlaut problem
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 1af31aed0bd430d0af3a52962fa21f5c08309f01
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26554283&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date:   Fri Nov 27 16:34:44 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;     s4:tests.sh - Make also here the change from &amp;quot;upgrade&amp;quot; to &amp;quot;upgrade_from_s3&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/samba3.py       |    2 +-
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/tests/samba3.py |    6 +++---
&lt;br&gt;&amp;gt;  source4/scripting/python/samba/upgrade.py      |    2 +-
&lt;br&gt;&amp;gt;  source4/selftest/tests.sh                      |    2 +-
&lt;br&gt;&amp;gt;  4 files changed, 6 insertions(+), 6 deletions(-)
&lt;/div&gt;Please revert these as well - these tests were working fine previous to
&lt;br&gt;your changes, they really shouldn't be disabled without good reason!
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br&gt;&lt;br&gt;__________________________________________________
&lt;br&gt;Do You Yahoo!?
&lt;br&gt;Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
&lt;br&gt;&lt;a href=&quot;http://mail.yahoo.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://mail.yahoo.com&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26554283.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553626</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T06:31:51Z</published>
	<updated>2009-11-28T06:31:51Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">Hi Matthias,
&lt;br&gt;&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 7d400715e9af2056690c03a1a2f45c7f343fa313
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553626&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 21:14:44 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:registry/util - Don't include the trailing '\0' in the internal data format but add it on the back-conversion to a string
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; As far as I know the registry library saves all data (including) strings without
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; the null termination. So do it also here in a similar way.
&lt;br&gt;Is there anything in particular that prompted this change? It's
&lt;br&gt;unnecessary as talloc_convert_string_convenience should already
&lt;br&gt;null-terminate.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (852 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26553626/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26553626.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553556</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T06:22:14Z</published>
	<updated>2009-11-28T06:22:14Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">Hi Matthias,
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 09:42 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 6c3e2417a0639cd7c367de93615c422cf5217456
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553556&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 16:39:27 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:samba3.py (and test) - deactivate the tests until those parameters are fixed
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 08b3c396d7d534c9bfa29a7cd015a97d504d45a9
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553556&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 16:35:28 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:upgrade.py - Umlaut problem
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 1af31aed0bd430d0af3a52962fa21f5c08309f01
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553556&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 16:34:44 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:tests.sh - Make also here the change from &amp;quot;upgrade&amp;quot; to &amp;quot;upgrade_from_s3&amp;quot;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/samba3.py &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/tests/samba3.py | &amp;nbsp; &amp;nbsp;6 +++---
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/upgrade.py &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;gt; &amp;nbsp;source4/selftest/tests.sh &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;gt; &amp;nbsp;4 files changed, 6 insertions(+), 6 deletions(-)
&lt;/div&gt;Please revert these as well - these tests were working fine previous to
&lt;/div&gt;your changes, they really shouldn't be disabled without good reason!
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (852 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26553556/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26553556.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553520</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T06:16:30Z</published>
	<updated>2009-11-28T06:16:30Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">Hi Matthias,
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 08:59 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;0cc45b4... s4:upgrade.py - rework to make the upgrade s3 -&amp;gt; s4 possible again
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;bd6c133... s4:upgrade_from_s3 - Fix message outputs
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;dbb8989... s4:upgrade.py - the import of WINS databases don't seem to work always
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;70b3161... s4:samba3.py - ignore comments in &amp;quot;smb.conf&amp;quot; files
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;82adfa3... s4:samba3.py - don't read those informations out from the TDB
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;f299efa... s4:samba3.py - support the TDB version 3
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;nbsp;a5d854a... s4:provision - Fix up the provision of &amp;quot;standalone&amp;quot; and &amp;quot;member&amp;quot; mode
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 0cc45b47dc787abb2c3c31e4fc824798d9f3efe9
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 15:50:26 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:upgrade.py - rework to make the upgrade s3 -&amp;gt; s4 possible again
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Able to read basic settings &amp;quot;workgroup&amp;quot;, &amp;quot;realm&amp;quot;, &amp;quot;netbios name&amp;quot; and the
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; function mode from the s3 &amp;quot;smb.conf&amp;quot; and use them for the provision of s4.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit bd6c133e506fdb5dee13e0a144ef99c6d452be42
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 15:49:18 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:upgrade_from_s3 - Fix message outputs
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; The quiet parameter was interpreted in the reverse manner.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit dbb8989e05ac3189a5eca11fa40d572388ea02fc
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 15:02:18 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:upgrade.py - the import of WINS databases don't seem to work always
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Disable it for now until the cause has been found
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 70b31610909544c58fd87c5e0aa00e02eb5f6d4b
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 15:00:41 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:samba3.py - ignore comments in &amp;quot;smb.conf&amp;quot; files
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 82adfa39b75aa628c88f828278c6ac09335d1a49
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 14:59:12 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:samba3.py - don't read those informations out from the TDB
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; At the moment those three calls are broken
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit f299efa8f05c6a5b739222bdf75690a4591d3650
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553520&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 14:58:37 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:samba3.py - support the TDB version 3
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/bin/upgrade_from_s3 &amp;nbsp; &amp;nbsp; | &amp;nbsp; &amp;nbsp;6 +-
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/samba3.py &amp;nbsp;| &amp;nbsp; 11 +-
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/upgrade.py | &amp;nbsp;144 ++++++++++++++--------------
&lt;br&gt;&amp;gt; &amp;nbsp;3 files changed, 81 insertions(+), 80 deletions(-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Changeset truncated at 500 lines:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; diff --git a/source4/scripting/bin/upgrade_from_s3 b/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; index 03f4415..7e1e1fd 100755
&lt;br&gt;&amp;gt; --- a/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; +++ b/source4/scripting/bin/upgrade_from_s3
&lt;br&gt;&amp;gt; @@ -50,14 +50,14 @@ opts, args = parser.parse_args()
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;def message(text):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Print a message if quiet is not set.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp;if opts.quiet:
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp;if not opts.quiet:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print text
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;if len(args) &amp;lt; 1:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;parser.print_usage()
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;sys.exit(1)
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -message(&amp;quot;Reading Samba3 databases and smb.conf\n&amp;quot;)
&lt;br&gt;&amp;gt; +message(&amp;quot;Reading Samba3 databases and smb.conf&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;libdir = args[0]
&lt;br&gt;&amp;gt; &amp;nbsp;if not os.path.isdir(libdir):
&lt;br&gt;&amp;gt; @@ -71,7 +71,7 @@ else:
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;samba3 = Samba3(libdir, smbconf)
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -message(&amp;quot;Provisioning\n&amp;quot;)
&lt;br&gt;&amp;gt; +message(&amp;quot;Provisioning&amp;quot;)
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;setup_dir = opts.setupdir
&lt;br&gt;&amp;gt; &amp;nbsp;if setup_dir is None:
&lt;br&gt;&amp;gt; diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; index 179efa2..c21b457 100644
&lt;br&gt;&amp;gt; --- a/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; +++ b/source4/scripting/python/samba/samba3.py
&lt;br&gt;&amp;gt; @@ -509,7 +509,7 @@ class TdbSam(TdbDatabase):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Samba 3 TDB passdb backend reader.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;def _check_version(self):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;self.version = fetch_uint32(self.tdb, &amp;quot;INFO/version\0&amp;quot;) or 0
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;assert self.version in (0, 1, 2)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;assert self.version in (0, 1, 2, 3)
&lt;/div&gt;^^ Please revert these changes. Clearly we don't support version 3 yet,
&lt;/div&gt;so we shouldn't pretend like we do. I'd rather see us fail with a clear
&lt;br&gt;assertion error than breaking the v2 support. Furthermore, supporting
&lt;br&gt;version 3 properly shouldn't be too hard.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; def usernames(self):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Iterate over the usernames in this Tdb database.&amp;quot;&amp;quot;&amp;quot;
&lt;br&gt;&amp;gt; @@ -592,9 +592,10 @@ class TdbSam(TdbDatabase):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for entry in hours:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for i in range(8):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;user.hours.append(ord(entry) &amp; (2 ** i) == (2 ** i))
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(user.bad_password_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(user.logon_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(user.unknown_6, data) = unpack_uint32(data)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# FIXME
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#(user.bad_password_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#(user.logon_count, data) = unpack_uint16(data)
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#(user.unknown_6, data) = unpack_uint32(data)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;assert len(data) == 0
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return user
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; @@ -683,7 +684,7 @@ class ParamFile(object):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section = None
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for i, l in enumerate(open(filename, 'r').xreadlines()):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;l = l.strip()
&lt;br&gt;&amp;gt; - &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if not l:
&lt;br&gt;&amp;gt; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if not l or l[0] == '#' or l[0] == ';':
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;continue
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if l[0] == &amp;quot;[&amp;quot; and l[-1] == &amp;quot;]&amp;quot;:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section = self._sanitize_name(l[1:-1])
&lt;/div&gt;&lt;/div&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; diff --git a/source4/scripting/python/samba/upgrade.py b/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; index 8194552..44b43a1 100644
&lt;br&gt;&amp;gt; --- a/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; +++ b/source4/scripting/python/samba/upgrade.py
&lt;br&gt;&amp;gt; @@ -92,7 +93,6 @@ def import_sam_account(samldb,acc,domaindn,domainsid):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;ntPwdHash:&amp;quot;: acc.nt_password,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;})
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -
&lt;br&gt;&amp;gt; &amp;nbsp;def import_sam_group(samldb, sid, gid, sid_name_use, nt_name, comment, domaindn):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Upgrade a SAM group.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; @@ -132,7 +132,6 @@ def import_sam_group(samldb, sid, gid, sid_name_use, nt_name, comment, domaindn)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;samba3SidNameUse&amp;quot;: str(sid_name_use)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;})
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -
&lt;/div&gt;^^ The two empty lines are intentional here - PEP8 (standard coding
&lt;/div&gt;style for Python) specifies two empty lines between top-level objects.
&lt;br&gt;Please don't remove them.
&lt;br&gt;&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; @@ -157,7 +156,6 @@ def import_idmap(samdb,samba3_idmap,domaindn):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;type&amp;quot;: &amp;quot;group&amp;quot;,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;unixID&amp;quot;: str(gid)})
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -
&lt;br&gt;&amp;gt; &amp;nbsp;def import_wins(samba4_winsdb, samba3_winsdb):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;&amp;quot;&amp;quot;Import settings from a Samba3 WINS database.
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; @@ -208,73 +206,6 @@ def import_wins(samba4_winsdb, samba3_winsdb):
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;objectClass&amp;quot;: &amp;quot;winsMaxVersion&amp;quot;,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;maxVersion&amp;quot;: str(version_id)})
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -def upgrade_provision(samba3, setup_dir, message, credentials, session_info, smbconf, targetdir):
&lt;/div&gt;^^^ Why did you move this function? It makes it very hard to spot what
&lt;/div&gt;actual changes you made.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (852 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26553520/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26553520.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553473</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T06:10:26Z</published>
	<updated>2009-11-28T06:10:26Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">On Fri, 2009-11-27 at 06:04 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;a7fa3a9... s4:provision.py - cosmetic output correction
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;6b835b0... s4:setup/provision - make the interactive mode work again
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;nbsp;7504b03... s4:WHATSNEW4.txt - Add also here a comment about the &amp;quot;upgrade_from_s3&amp;quot; script
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit a7fa3a9703bf9f0c72031c84998f4fb21ba95429
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553473&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 13:07:52 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:provision.py - cosmetic output correction
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 6b835b0691faab904246e587ffa6ff74b9fb53e2
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553473&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 13:02:31 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:setup/provision - make the interactive mode work again
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;nbsp;source4/scripting/python/samba/provision.py | &amp;nbsp; &amp;nbsp;2 +-
&lt;br&gt;&amp;gt; &amp;nbsp;source4/setup/provision &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 16 +++-------------
&lt;br&gt;&amp;gt; &amp;nbsp;2 files changed, 4 insertions(+), 14 deletions(-)
&lt;/div&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; index ed350dd..f1aa07c 100755
&lt;br&gt;&amp;gt; --- a/source4/setup/provision
&lt;br&gt;&amp;gt; +++ b/source4/setup/provision
&lt;br&gt;&amp;gt; @@ -122,14 +122,6 @@ def message(text):
&lt;br&gt;&amp;gt; &amp;nbsp;if len(sys.argv) == 1:
&lt;br&gt;&amp;gt; &amp;nbsp;	opts.interactive = True
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; -if not opts.interactive and (opts.realm is None or opts.domain is None):
&lt;br&gt;&amp;gt; -	if opts.realm is None:
&lt;br&gt;&amp;gt; -		print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No realm set&amp;quot;
&lt;br&gt;&amp;gt; -	if opts.domain is None:
&lt;br&gt;&amp;gt; -		print &amp;gt;&amp;gt;sys.stderr, &amp;quot;No domain set&amp;quot;
&lt;br&gt;&amp;gt; -	parser.print_usage()
&lt;br&gt;&amp;gt; -	sys.exit(1)
&lt;br&gt;&amp;gt; -
&lt;/div&gt;^^^ This change isn't necessary to make the interactive mode work (it
&lt;/div&gt;explicitly checks for interactive mode not being in use), and it breaks
&lt;br&gt;usage when not in interactive mode because we end up with no
&lt;br&gt;realm/domain being set. 
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; if opts.interactive:
&lt;br&gt;&amp;gt; &amp;nbsp;	from getpass import getpass
&lt;br&gt;&amp;gt; &amp;nbsp;	import socket
&lt;br&gt;&amp;gt; @@ -137,19 +129,17 @@ if opts.interactive:
&lt;br&gt;&amp;gt; &amp;nbsp;		if default is not None:
&lt;br&gt;&amp;gt; &amp;nbsp;			print &amp;quot;%s [%s]: &amp;quot; % (prompt,default),
&lt;br&gt;&amp;gt; &amp;nbsp;		else:
&lt;br&gt;&amp;gt; -			print &amp;quot;%s: &amp;quot; % (prompt,),
&lt;br&gt;&amp;gt; +			print &amp;quot;%s: &amp;quot; % (prompt),
&lt;br&gt;&amp;gt; &amp;nbsp;		return sys.stdin.readline().rstrip(&amp;quot;\n&amp;quot;) or default
&lt;br&gt;&amp;gt; &amp;nbsp;	try:
&lt;br&gt;&amp;gt; &amp;nbsp;		opts.realm = ask(&amp;quot;Realm&amp;quot;, socket.getfqdn().split(&amp;quot;.&amp;quot;, 1)[1].upper())
&lt;br&gt;&amp;gt; &amp;nbsp;	except IndexError:
&lt;br&gt;&amp;gt; -		print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess realm from %s&amp;quot; % ( socket.getfqdn())
&lt;br&gt;&amp;gt; -		sys.exit(1)
&lt;br&gt;&amp;gt; +		opts.realm = ask(&amp;quot;Realm&amp;quot;, None)
&lt;/div&gt;^^^ We've already asked the user for a realm, why ask twice? Rather, we
&lt;/div&gt;should not set a default value if the users FQDN is broken because it
&lt;br&gt;contains no dots.
&lt;br&gt;&lt;br&gt;&amp;gt; 	try:
&lt;br&gt;&amp;gt; &amp;nbsp;		opts.domain = ask(&amp;quot;Domain&amp;quot;, opts.realm.split(&amp;quot;.&amp;quot;)[0])
&lt;br&gt;&amp;gt; &amp;nbsp;	except IndexError:
&lt;br&gt;&amp;gt; -		print &amp;gt;&amp;gt;sys.stderr, &amp;quot;Cannot guess domain from %s&amp;quot; % ( opts.realm())
&lt;br&gt;&amp;gt; -		sys.exit(1)
&lt;br&gt;&amp;gt; +		opts.domain = ask(&amp;quot;Domain&amp;quot;, None)
&lt;br&gt;^^^ Same here, let's just get the default value right in the first
&lt;br&gt;place.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmer
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (852 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26553473/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26553473.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553439</id>
	<title>Re: [SCM] Samba Shared Repository - branch master updated</title>
	<published>2009-11-28T06:06:48Z</published>
	<updated>2009-11-28T06:06:48Z</updated>
	<author>
		<name>Jelmer Vernooij</name>
	</author>
	<content type="html">Hi Matthias,
&lt;br&gt;&lt;br&gt;On Fri, 2009-11-27 at 05:26 -0600, Matthias Dieter Wallnöfer wrote: 
&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;7504b03... s4:WHATSNEW4.txt - Add also here a comment about the &amp;quot;upgrade_from_s3&amp;quot; script
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;3d57da8... s4:howto.txt - add a notice about the upgrade possibilities and fix line spaces
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;fd31328... s4:upgrade script - rename it to &amp;quot;upgrade_from_s3&amp;quot; and do some rework
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;nbsp;d6c60f8... s3-nsstest: drastically shrink size and dependencies of nsstest binary.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 7504b03b541026c84a4f454b7572a3280296a8d9
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553439&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 11:07:11 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:WHATSNEW4.txt - Add also here a comment about the &amp;quot;upgrade_from_s3&amp;quot; script
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit 3d57da80e574f5f47effb41fd45361eec22f119e
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553439&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 11:02:20 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:howto.txt - add a notice about the upgrade possibilities and fix line spaces
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; commit fd313282a24e58570c2fa5b3fdfd0b84d0053363
&lt;br&gt;&amp;gt; Author: Matthias Dieter Wallnöfer &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26553439&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mwallnoefer@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Fri Nov 27 10:50:03 2009 +0100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4:upgrade script - rename it to &amp;quot;upgrade_from_s3&amp;quot; and do some rework
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; - Give a better name to the script
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; - Move it to the location where also &amp;quot;upgradeprovision&amp;quot; resides
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; - Fix up trailing whitespaces and tabs
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;nbsp;WHATSNEW4.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 11 ++++--
&lt;br&gt;&amp;gt; &amp;nbsp;howto4.txt &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | &amp;nbsp; 18 +++++++---
&lt;br&gt;&amp;gt; &amp;nbsp;.../upgrade =&amp;gt; scripting/bin/upgrade_from_s3} &amp;nbsp; &amp;nbsp; &amp;nbsp;| &amp;nbsp; 37 +++++++++++---------
&lt;br&gt;&amp;gt; &amp;nbsp;3 files changed, 41 insertions(+), 25 deletions(-)
&lt;br&gt;&amp;gt; &amp;nbsp;rename source4/{setup/upgrade =&amp;gt; scripting/bin
&lt;/div&gt;Please keep the upgrade script under setup/. Its name is too generic to
&lt;/div&gt;be installed in /bin. Alternatively, perhaps we should rename it to
&lt;br&gt;something specific to Samba.
&lt;br&gt;&lt;br&gt;This would have broken the build (there are tests for the upgrade script
&lt;br&gt;that you haven't changed), please update the blackbox tests as well when
&lt;br&gt;renaming binaries.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;&lt;br&gt;Jelmerb
&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (852 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26553439/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Re%3A--SCM--Samba-Shared-Repository---branch-master-updated-tp26460053p26553439.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553281</id>
	<title>Re: how to build samba 3.5</title>
	<published>2009-11-28T05:52:15Z</published>
	<updated>2009-11-28T05:52:15Z</updated>
	<author>
		<name>Olivier Sessink</name>
	</author>
	<content type="html">Stefan (metze) Metzmacher wrote:
&lt;br&gt;&amp;gt; Hi Olivier,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On Fri, Nov 27, 2009 at 03:37:12PM +0100, Olivier Sessink wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I would like to port a VFS module to samba 3.5 (because of the API changes).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; I've tried to build a samba git checkout, but autoconf fails:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; /usr/bin/m4:configure.in:23: cannot open `pkg.m4': No such file or directory
&lt;br&gt;[..]
&lt;br&gt;&lt;br&gt;&amp;gt; you should always use './autogen.sh' instead of autoconf directly.
&lt;br&gt;&lt;br&gt;thanks, works like a charm.
&lt;br&gt;&lt;br&gt;Olivier
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-to-build-samba-3.5-tp26543251p26553281.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26553270</id>
	<title>the function of SMB_STRUCT_STAT *sbuf in vfs readdir() ?</title>
	<published>2009-11-28T05:51:37Z</published>
	<updated>2009-11-28T05:51:37Z</updated>
	<author>
		<name>Olivier Sessink</name>
	</author>
	<content type="html">Hi all,
&lt;br&gt;&lt;br&gt;what is the function of SMB_STRUCT_STAT *sbuf in the VFS readdir API ?
&lt;br&gt;&lt;br&gt;is it supposed to be filled by the SMB_VFS_NEXT_READDIR call? (e.g. can
&lt;br&gt;you use it after that call?)
&lt;br&gt;&lt;br&gt;thanks,
&lt;br&gt;&lt;br&gt;Olivier
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/the-function-of-SMB_STRUCT_STAT-*sbuf-in-vfs-readdir%28%29---tp26553270p26553270.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26552596</id>
	<title>s4-drs: cope with bogus empty attributes from w2k8-r2 (Re: [SCM] Samba Shared Repository - branch master updated)</title>
	<published>2009-11-28T04:10:25Z</published>
	<updated>2009-11-28T04:10:25Z</updated>
	<author>
		<name>Stefan (metze) Metzmacher</name>
	</author>
	<content type="html">Hi Tridge,
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; The branch, master has been updated
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;via &amp;nbsp;1287c1d... s4-drs: cope with bogus empty attributes from w2k8-r2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; from &amp;nbsp;db41a0a... s4: fix SD update and password change in upgrade script
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; - Log -----------------------------------------------------------------
&lt;br&gt;&amp;gt; commit 1287c1d115fb7e8f3954bc05ff65007968403a9c
&lt;br&gt;&amp;gt; Author: Andrew Tridgell &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26552596&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;tridge@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt; Date: &amp;nbsp; Sat Nov 28 13:27:06 2009 +1100
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; s4-drs: cope with bogus empty attributes from w2k8-r2
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; w2k8-r2 sometimes sends empty attributes with completely bogus attrid
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; values in a DRS replication response. This allows us to continue with
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; the vampire operation despite these broken elements.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -----------------------------------------------------------------------
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Summary of changes:
&lt;br&gt;&amp;gt; &amp;nbsp;source4/dsdb/repl/replicated_objects.c | &amp;nbsp; 17 +++++++++++++++++
&lt;br&gt;&amp;gt; &amp;nbsp;1 files changed, 17 insertions(+), 0 deletions(-)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Changeset truncated at 500 lines:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c
&lt;br&gt;&amp;gt; index 020d5f1..a8a93e4 100644
&lt;br&gt;&amp;gt; --- a/source4/dsdb/repl/replicated_objects.c
&lt;br&gt;&amp;gt; +++ b/source4/dsdb/repl/replicated_objects.c
&lt;br&gt;&amp;gt; @@ -129,6 +129,15 @@ static WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
&lt;br&gt;&amp;gt; &amp;nbsp;		}
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;		status = dsdb_attribute_drsuapi_to_ldb(ldb, schema, a, msg-&amp;gt;elements, e);
&lt;br&gt;&amp;gt; +		if (!NT_STATUS_IS_OK(status) &amp;&amp; a-&amp;gt;value_ctr.num_values == 0) {
&lt;br&gt;&amp;gt; +			/* w2k8-r2 occasionally sends bogus empty
&lt;br&gt;&amp;gt; +			 &amp;nbsp; attributes with rubbish attribute IDs. The
&lt;br&gt;&amp;gt; +			 &amp;nbsp; only think we can do is discard these */
&lt;br&gt;&amp;gt; +			DEBUG(0,(__location__ &amp;quot;: Discarding bogus empty DsReplicaAttribute with attid 0x%x\n&amp;quot;,
&lt;br&gt;&amp;gt; +				 a-&amp;gt;attid));
&lt;br&gt;&amp;gt; +			ZERO_STRUCTP(e);
&lt;br&gt;&amp;gt; +			continue;
&lt;br&gt;&amp;gt; +		}
&lt;br&gt;&amp;gt; &amp;nbsp;		W_ERROR_NOT_OK_RETURN(status);
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; &amp;nbsp;		m-&amp;gt;attid			= a-&amp;gt;attid;
&lt;br&gt;&amp;gt; @@ -149,6 +158,14 @@ static WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
&lt;br&gt;&amp;gt; &amp;nbsp;		}
&lt;br&gt;&amp;gt; &amp;nbsp;	}
&lt;br&gt;&amp;gt; &amp;nbsp;
&lt;br&gt;&amp;gt; +	/* delete any empty elements */
&lt;br&gt;&amp;gt; +	for (i=0; i &amp;lt; msg-&amp;gt;num_elements; i++) {
&lt;br&gt;&amp;gt; +		if (msg-&amp;gt;elements[i].name == NULL) {
&lt;br&gt;&amp;gt; +			ldb_msg_remove_element(msg, &amp;msg-&amp;gt;elements[i]);
&lt;br&gt;&amp;gt; +			i--;
&lt;br&gt;&amp;gt; +		}
&lt;br&gt;&amp;gt; +	}
&lt;br&gt;&amp;gt; +
&lt;/div&gt;&lt;/div&gt;We need to be careful about this, an empty element means
&lt;br&gt;we should remove existing values.
&lt;br&gt;If remove the empty ones here, we need to let the repl_meta_data module
&lt;br&gt;remove them based on the received meta_data array.
&lt;br&gt;&lt;br&gt;metze
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (268 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26552596/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/s4-drs%3A-cope-with-bogus-empty-attributes-from-w2k8-r2-%28Re%3A--SCM--Samba-Shared-Repository---branch-master-updated%29-tp26552596p26552596.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26550795</id>
	<title>Re: how to build samba 3.5</title>
	<published>2009-11-27T22:23:10Z</published>
	<updated>2009-11-27T22:23:10Z</updated>
	<author>
		<name>Stefan (metze) Metzmacher</name>
	</author>
	<content type="html">Hi Olivier,
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;&amp;gt; On Fri, Nov 27, 2009 at 03:37:12PM +0100, Olivier Sessink wrote:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I would like to port a VFS module to samba 3.5 (because of the API changes).
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; I've tried to build a samba git checkout, but autoconf fails:
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; /usr/bin/m4:configure.in:23: cannot open `pkg.m4': No such file or directory
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; Is there a quick way to resolv this? Or another way to port my vfs
&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; module: is there a samba-3.5 snapshot available somewhere?
&lt;br&gt;&amp;gt;&amp;gt; I'm using autoconf 2.63, with that it works. What exact
&lt;br&gt;&amp;gt;&amp;gt; command did you issue?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; autoconf 2.61
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; $ cd samba/source3
&lt;br&gt;&amp;gt; $ autoconf
&lt;/div&gt;&lt;/div&gt;you should always use './autogen.sh' instead of autoconf directly.
&lt;br&gt;&lt;br&gt;metze
&lt;br&gt;&lt;br&gt;&lt;br /&gt; &lt;div class=&quot;small&quot;&gt;&lt;br/&gt;&lt;img src=&quot;http://old.nabble.com/images/icon_attachment.gif&quot; &gt; &lt;strong&gt;signature.asc&lt;/strong&gt; (268 bytes) &lt;a href=&quot;http://old.nabble.com/attachment/26550795/0/signature.asc&quot; target=&quot;_top&quot;&gt;Download Attachment&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/how-to-build-samba-3.5-tp26543251p26550795.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26550652</id>
	<title>Re: Commit: 0920e0b63b806c8ed4839271048dd4924ed02b2b</title>
	<published>2009-11-27T21:32:23Z</published>
	<updated>2009-11-27T21:32:23Z</updated>
	<author>
		<name>tridge@samba.org</name>
	</author>
	<content type="html">Hi Kamen,
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Actually the bug you've fixed with this commit is not a bug - it was 
&lt;br&gt;&amp;nbsp;&amp;gt; intended to work that way on purpose :).
&lt;br&gt;&lt;br&gt;it was a bug I think :-)
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; My aim was to make it work as follows:
&lt;br&gt;&amp;nbsp;&amp;gt; 1. If LDB_URL is set in environment, then test uses this url and 
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;temporary LDB used for testing is not deleted after test is done.
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;This way we can exam data in LDB if anything goes wrong and we
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp;need to review data used for testing.
&lt;br&gt;&lt;br&gt;it is far too dangerous. The environment variable LDB_URL is the
&lt;br&gt;standard environment variable used by the ldb tools to avoid using the
&lt;br&gt;-H option. It is not uncommon for someone to set this to point at a
&lt;br&gt;real LDB. In my case I had it pointed at my sam.ldb, which meant that
&lt;br&gt;running &amp;quot;make test&amp;quot; not only failed, it also corrupted by sam database.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Could we just use another name for the environment variable used?
&lt;br&gt;&lt;br&gt;no, please don't use an environment variable for this sort of thing.
&lt;br&gt;&lt;br&gt;If you want to have a way to override the location of this test ldb,
&lt;br&gt;then use lp_parm_string() and then pass the location using the
&lt;br&gt;--option command line option. To see some examples of this, try:
&lt;br&gt;&lt;br&gt;&amp;nbsp; git grep lp_parm_string source4/torture/
&lt;br&gt;&lt;br&gt;for example, you could have:
&lt;br&gt;&lt;br&gt;&amp;nbsp; ldb_url = lp_parm_string(tctx-&amp;gt;lp_ctx, NULL, &amp;quot;drstest&amp;quot;, &amp;quot;ldb_url&amp;quot;);
&lt;br&gt;&lt;br&gt;and then set it with:
&lt;br&gt;&lt;br&gt;&amp;nbsp; --option drstest:ldb_url=foo.ldb
&lt;br&gt;&lt;br&gt;Cheers, Tridge
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Commit%3A-0920e0b63b806c8ed4839271048dd4924ed02b2b-tp26544293p26550652.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26550625</id>
	<title>Re: [PATCH] s4-drs: replmd_delete implementation</title>
	<published>2009-11-27T21:24:17Z</published>
	<updated>2009-11-27T21:24:17Z</updated>
	<author>
		<name>tridge@samba.org</name>
	</author>
	<content type="html">Hi Eduardo,
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; My git tree is updated to these latest changes: git://
&lt;br&gt;&amp;nbsp;&amp;gt; repo.or.cz/Samba/eduardoll.git
&lt;br&gt;&lt;br&gt;Thanks, I've looked through your changes and I have some comments
&lt;br&gt;below.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; It will fail whenever sAMAccountType is specified in the message to be
&lt;br&gt;&amp;nbsp;&amp;gt; modified. Just for testing purpose, I modified the code above to not fail
&lt;br&gt;&amp;nbsp;&amp;gt; when el-&amp;gt;flag == LDB_FLAG_MOD_DELETE:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; el = ldb_msg_find_element(req-&amp;gt;op.mod.message, &amp;quot;sAMAccountType&amp;quot;);
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; if ((el != NULL) &amp;&amp; (el-&amp;gt;flags != LDB_FLAG_MOD_DELETE)) {
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ldb_asprintf_errstring(ldb,
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;quot;sAMAccountType must not be specified!&amp;quot;);
&lt;br&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return LDB_ERR_UNWILLING_TO_PERFORM;
&lt;br&gt;&amp;nbsp;&amp;gt; }
&lt;br&gt;&lt;br&gt;I think a better approach would be to set the &amp;quot;relax&amp;quot; control on the
&lt;br&gt;modify operation. The &amp;quot;relax&amp;quot; control can be set for internal
&lt;br&gt;operations to say &amp;quot;don't do strict checking, I know what I'm doing&amp;quot;.
&lt;br&gt;&lt;br&gt;If you run &amp;quot;git grep RELAX_OID&amp;quot; you'll find some existing places that
&lt;br&gt;use this control for similar purposes. You'll need to check for the
&lt;br&gt;relax control in samldb.c and if it is set then allow for modifies on
&lt;br&gt;sAMAccountType. Then in repl_meta_data.c you'll need to make sure the
&lt;br&gt;modify is done with the relax control set.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Regarding the delete test on Windows 2008, I could not find out an easy way
&lt;br&gt;&amp;nbsp;&amp;gt; to insert a new object into the CN=Schema,CN=Configuration,DC=x partition.
&lt;br&gt;&lt;br&gt;If you look in lib/ldb/tests/python/ldap.py you'll see some examples
&lt;br&gt;of adding a new schema entry. 
&lt;br&gt;&lt;br&gt;I looked into this a bit further, and it looks to me like deleting
&lt;br&gt;schema objects is not something we should be allowing anyway. 
&lt;br&gt;&lt;br&gt;I think the simplest thing to do is to not do the rename/modify and
&lt;br&gt;instead do a normal delete if the NC doesn't have a Deleted Objects
&lt;br&gt;container. 
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; Another thing I noticed is that all the deleted objects in
&lt;br&gt;&amp;nbsp;&amp;gt; *
&lt;br&gt;&amp;nbsp;&amp;gt; CN=Deleted Objects,CN=Configuration,DC=x*
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; have lastKnownParent:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; CN=NTDS
&lt;br&gt;&amp;nbsp;&amp;gt; Settings,CN=W2K8,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=adsamba,DC=ltc,DC=inovasoft,DC=unicamp,DC=br.
&lt;br&gt;&lt;br&gt;that's just because those are the objects that have been deleted on
&lt;br&gt;your system.
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; When browsing my DC using LDP I also noticed that shows a wellKnownObjects
&lt;br&gt;&amp;nbsp;&amp;gt; list that has de deleted container:
&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; wellKnownObjects:
&lt;br&gt;&amp;nbsp;&amp;gt; B:32:18E2EA80684F11D2B9AA00C04F79F805:CN=Deleted
&lt;br&gt;&amp;nbsp;&amp;gt; Objects,DC=adsamba,DC=ltc,DC=inovasoft,DC=unicamp,DC=br;
&lt;br&gt;&lt;br&gt;right
&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;gt; 
&lt;br&gt;&amp;nbsp;&amp;gt; Does samba has this wellKnownObjects? If so, should I create a entry in the
&lt;br&gt;&amp;nbsp;&amp;gt; samba's wellKnownObjects list?
&lt;br&gt;&lt;br&gt;Samba already creates this wellKnownObjects entry (try &amp;quot;git grep
&lt;br&gt;wellKnownObject&amp;quot; and you'll see it in setup/*.ldif).
&lt;br&gt;&lt;br&gt;I think the correct way of finding the Deleted Objects container for a
&lt;br&gt;NC is to fetch the wellKnownObjects attribute for the root of the NC,
&lt;br&gt;and then use the GUID embedded in that to find the Deleted Objects
&lt;br&gt;container. You could modify dsdb_get_deleted_objects_dn() to do this
&lt;br&gt;(thought you will have to pass the DN of the object being deleted). 
&lt;br&gt;&lt;br&gt;Now for some more specific comments on the code in your tree.
&lt;br&gt;&lt;br&gt;In dsdb_get_deleted_objects_dn() you do a search for the
&lt;br&gt;defaultNamingContext. It would have been much simpler to just call
&lt;br&gt;samdb_base_dn() which already returns this. 
&lt;br&gt;&lt;br&gt;I think though that dsdb_get_deleted_objects_dn() needs to be redone
&lt;br&gt;to take a DN argument, as the correct Deleted Objects container is
&lt;br&gt;different depending on what DN is being deleted. So I think you should
&lt;br&gt;probably first write a function which finds the root of a NC given a
&lt;br&gt;DN, and then construct the Deleted Objects DN from that. The function
&lt;br&gt;to find the root of a NC might look like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp;struct ldb_dn *dsdb_find_nc_root(struct ldb_context *samdb, const struct ldb_dn *dn);
&lt;br&gt;&lt;br&gt;it could operate in a couple of different ways. One possibility is to
&lt;br&gt;get the list of naming contexts from the rootDSE and then find the NC
&lt;br&gt;that matches the DN that is passed in. To make this easy you would
&lt;br&gt;sort the DNs from the list of naming contexts using a function similar
&lt;br&gt;to partition_sort_compare(). You'd then find the matching one by
&lt;br&gt;calling ldb_dn_compare_base().
&lt;br&gt;&lt;br&gt;Another alternative is to write a function that walks up the tree,
&lt;br&gt;looking for a DN with instanceType containing
&lt;br&gt;INSTANCE_TYPE_IS_NC_HEAD. 
&lt;br&gt;&lt;br&gt;In your replmd_delete() function you have the same bug that we
&lt;br&gt;discussed in the tutorial last week where you use
&lt;br&gt;ldb_dn_add_child_fmt() on a DN that came from a cache, thus modifying
&lt;br&gt;that DN. The current dsdb_get_deleted_objects_dn() function stores and
&lt;br&gt;returns values from cache.deleted_dn. When you call
&lt;br&gt;ldb_dn_add_child_fmt() you are modifying that DN directly, which means
&lt;br&gt;the 2nd time you call dsdb_get_deleted_objects_dn() you will not get
&lt;br&gt;the Deleted Objects DN, but instead you will get the DN you last
&lt;br&gt;modified.
&lt;br&gt;&lt;br&gt;Further down your replmd_delete() code you directly call
&lt;br&gt;ldb_rename(). That is OK for now, but later we will need to add a
&lt;br&gt;dsdb_module_rename() call in dsdb/samdb/ldb_modules/util.c to allow
&lt;br&gt;you to do a rename on the correct part of the module stack.
&lt;br&gt;&lt;br&gt;For the modify part of the replmd_delete() code, you need to read
&lt;br&gt;section 3.1.1.5.5.1.1 of [MS-ADTS].pdf to see how you should be
&lt;br&gt;handling which attributes need to be added and removed from the object
&lt;br&gt;when it is deleted. You should probably also read the other parts of
&lt;br&gt;[MS-ADTS] that deal with deleted objects.
&lt;br&gt;&lt;br&gt;If you read that doc, you'll see that you will need to do something
&lt;br&gt;like this:
&lt;br&gt;&lt;br&gt;&amp;nbsp;1) fetch the existing object from the database
&lt;br&gt;&lt;br&gt;&amp;nbsp;2) for each of the attributes of the object, get the schema attribute
&lt;br&gt;&amp;nbsp;structure using dsdb_attribute_by_lDAPDisplayName(). That will
&lt;br&gt;&amp;nbsp;return a struct dsdb_attribute, which contains a searchFlags element,
&lt;br&gt;&amp;nbsp;which says whether the attribute should be preserved on deletion.
&lt;br&gt;&lt;br&gt;&amp;nbsp;3) you'll also need to check the attribute against the list of
&lt;br&gt;&amp;nbsp;attributes specified in 3.1.1.5.5.1.1 as being always preserved.
&lt;br&gt;&lt;br&gt;Then for each attribute in the existing object that should be removed,
&lt;br&gt;you'll need to build up the msg ready for the modify. You need to make
&lt;br&gt;sure that you only specify an attribute for deletion if it is in the
&lt;br&gt;object currently (other the ldb_modify will give an error).
&lt;br&gt;&lt;br&gt;Finally, we will need a dsdb_module_modify() function, similar to what
&lt;br&gt;I mentioned about dsdb_module_rename() above.
&lt;br&gt;&lt;br&gt;Would you like me to help you by creating some of the helper functions
&lt;br&gt;you will need? For example, I could add the dsdb_module_modify(),
&lt;br&gt;dsdb_module_rename() and dsdb_find_nc_root() functions. I could also
&lt;br&gt;do the &amp;quot;relax&amp;quot; change needed in samldb.c. That would just leave you
&lt;br&gt;with the core logic of replmd_delete(). Or if you prefer to do all the
&lt;br&gt;functions yourself let me know.
&lt;br&gt;&lt;br&gt;Cheers, Tridge
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/-PATCH--s4-drs%3A-replmd_delete-implementation-tp26345560p26550625.html" />
</entry>

</feed>
