[SCM] Samba Shared Repository - branch master updated

2014-12-07 Thread Kamen Mazdrashki
The branch, master has been updated
   via  29732b0 s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH
   via  6214dbd s4-ldap: Pass on-wire transmitted control down the chain
  from  2845e1c s3: modules: Fix *allocate* calls to follow POSIX error 
return convention.

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


- Log -
commit 29732b0d427472041bf3a586f3eeb281ccd408d5
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Dec 2 05:04:40 2014 +0100

s4-tests/env_loadparm: Throw KeyError in case SMB_CONF_PATH

A bit more specific for the caller to know that env key is missing

Change-Id: I4d4c2121af868d79f46f865f420336222bc67347
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-by: Jelmer Vernooij jel...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Mon Dec  8 05:27:34 CET 2014 on sn-devel-104

commit 6214dbd5741e1e3e0e02b7e8eb42a76168a44192
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Dec 2 01:53:18 2014 +0100

s4-ldap: Pass on-wire transmitted control down the chain

Change-Id: Ic3a117f74e8a67c45584fdb520d92e4f0cb01c5e
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-by: Andrew Bartlett abart...@samba.org

---

Summary of changes:
 python/samba/tests/__init__.py | 2 +-
 source4/ldap_server/ldap_backend.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/__init__.py b/python/samba/tests/__init__.py
index 8e662ed..cca82bb 100644
--- a/python/samba/tests/__init__.py
+++ b/python/samba/tests/__init__.py
@@ -91,7 +91,7 @@ def env_loadparm():
 try:
 lp.load(os.environ[SMB_CONF_PATH])
 except KeyError:
-raise Exception(SMB_CONF_PATH not set)
+raise KeyError(SMB_CONF_PATH not set)
 return lp
 
 
diff --git a/source4/ldap_server/ldap_backend.c 
b/source4/ldap_server/ldap_backend.c
index b0877d2..fd2b579 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -459,7 +459,7 @@ static int ldapsrv_rename_with_controls(struct ldapsrv_call 
*call,
ret = ldb_build_rename_req(req, ldb, ldb,
olddn,
newdn,
-   NULL,
+   controls,
res,
ldb_modify_default_callback,
NULL);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2014-07-15 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4b68871 ntlm_auth: added require-membership tests
   via  6608402 torture: test_ntlm_auth.py now has a require-membership-of 
argument
  from  ca1e4af As David Woodhouse points out, this breaks backwards 
compatibility.

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


- Log -
commit 4b68871ae80d1834f5f5cecb0ab65ca9abb283bc
Author: Garming Sam garm...@catalyst.net.nz
Date:   Wed Jun 11 17:07:44 2014 +1200

ntlm_auth: added require-membership tests

(updated by abartlet to fix knownfail changes due to AD DC winbindd
use in master)
Change-Id: Iec41fbfc0f501888fd16323bf78da61aa549b4de
Signed-off-by: Garming Sam garm...@catalyst.net.nz Reviewed-by:
Andrew Bartlett abart...@samba.org
Reviewed-by: Kamen Mazdrashki kame...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Tue Jul 15 15:59:49 CEST 2014 on sn-devel-104

commit 66084025273ee8c793e6a947f69579ec0f0a7640
Author: Garming Sam garm...@catalyst.net.nz
Date:   Fri Jul 4 12:50:37 2014 +1200

torture: test_ntlm_auth.py now has a require-membership-of argument

Change-Id: I90c2172af792a082fbf49ee0ab7d6eedf5471440
Signed-off-by: Garming Sam garm...@catalyst.net.nz
Reviewed-by: Andrew Bartlett abart...@samba.org
Reviewed-by: Kamen Mazdrashki kame...@samba.org

---

Summary of changes:
 selftest/knownfail|2 +
 source3/script/tests/test_ntlm_auth_s3.sh |   74 +
 source3/torture/test_ntlm_auth.py |7 +++
 3 files changed, 83 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/knownfail b/selftest/knownfail
index 7d1702d..214a170 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -298,3 +298,5 @@
 ^samba.blackbox.wbinfo\(s3member:local\).wbinfo -U check for sane 
mapping\(s3member:local\)
 ^samba.blackbox.wbinfo\(s3member:local\).wbinfo -G against 
s3member\(s3member:local\)
 ^samba.blackbox.wbinfo\(s3member:local\).wbinfo -G check for sane 
mapping\(s3member:local\)
+^samba.ntlm_auth.\(dc:local\).ntlm_auth against winbindd with failed 
require-membership-of
+^samba.ntlm_auth.\(dc:local\).ntlm_auth with NTLMSSP gss-spnego-client and 
gss-spnego server against winbind with failed require-membership-of
diff --git a/source3/script/tests/test_ntlm_auth_s3.sh 
b/source3/script/tests/test_ntlm_auth_s3.sh
index ca7a952..66b 100755
--- a/source3/script/tests/test_ntlm_auth_s3.sh
+++ b/source3/script/tests/test_ntlm_auth_s3.sh
@@ -19,8 +19,73 @@ ADDARGS=$*
 incdir=`dirname $0`/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
+SID=`eval $BINDIR/wbinfo -n $USERNAME | cut -d ' ' -f1`
+BADSID=`eval $BINDIR/wbinfo -n $USERNAME | cut -d ' ' -f1 | sed 's/..$//'`
+
 failed=0
 
+test_interactive_prompt_stdout()
+{
+   tmpfile=$PREFIX/ntlm_commands
+
+   cat  $tmpfile EOF
+$DOMAIN/$USERNAME $PASSWORD
+EOF
+   cmd='$NTLM_AUTH $@ --require-membership-of=$SID 
--helper-protocol=squid-2.5-basic  $tmpfile 21'
+   eval echo $cmd
+   out=`eval $cmd`
+   ret=$?
+   rm -f $tmpfile
+
+   if [ $ret != 0 ] ; then
+   echo $out
+   echo command failed
+   false
+   return
+   fi
+
+   echo $out | grep OK /dev/null 21
+
+   if [ $? = 0 ] ; then
+   # authenticated .. succeed
+   true
+   else
+   echo failed to get successful authentication
+   false
+   fi
+}
+
+test_interactive_prompt_stdout_fail()
+{
+   tmpfile=$PREFIX/ntlm_commands
+
+   cat  $tmpfile EOF
+$DOMAIN\\$USERNAME $PASSWORD
+EOF
+   cmd='$NTLM_AUTH $@ --require-membership-of=$BADSID 
--helper-protocol=squid-2.5-basic  $tmpfile 21'
+   eval echo $cmd
+   out=`eval $cmd`
+   ret=$?
+   rm -f $tmpfile
+
+   if [ $ret != 0 ] ; then
+   echo $out
+   echo command failed
+   false
+   return
+   fi
+
+   echo $out | grep ERR /dev/null 21
+
+   if [ $? = 0 ] ; then
+   # failed to authenticate .. success
+   true
+   else
+   echo incorrectly gave a successful authentication
+   false
+   fi
+}
+
 testit ntlm_auth $PYTHON $SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH 
$ADDARGS || failed=`expr $failed + 1`
 # This should work even with NTLMv2
 testit ntlm_auth with specified domain $PYTHON 
$SRC3DIR/torture/test_ntlm_auth.py $NTLM_AUTH $ADDARGS --client-domain=fOo 
--server-domain=fOo || failed=`expr $failed + 1`
@@ -30,4 +95,13 @@ testit ntlm_auth with NTLMSSP gss-spnego-client and 
gss-spnego server $PYTHON
 testit ntlm_auth with NTLMSSP gss-spnego-client and gss-spnego server against 
winbind $PYTHON $SRC3DIR/torture

[SCM] Samba Shared Repository - branch master updated

2014-07-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  caa42ed s4-auth-krb: Fix talloc access after free in 
smb_krb5_update_keytab
  from  bf7f2b0 ctdb-tests: Do not run ip command if running against local 
daemons

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


- Log -
commit caa42ed385dc174d9529407d128424c37cff8e9c
Author: Samuel Cabrero scabr...@zentyal.com
Date:   Thu Jun 12 10:39:02 2014 +0200

s4-auth-krb: Fix talloc access after free in smb_krb5_update_keytab

Change-Id: Iaa168d520f124e0c43c7edd649318f0b8ee25020
Signed-off-by: Samuel Cabrero scabr...@zentyal.com
Reviewed-by: Kamen Mazdrashki kame...@samba.org
Reviewed-by: Andrew Bartlett abart...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Tue Jul  8 16:51:09 CEST 2014 on sn-devel-104

---

Summary of changes:
 source4/auth/kerberos/srv_keytab.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/kerberos/srv_keytab.c 
b/source4/auth/kerberos/srv_keytab.c
index 1fc8b4c..bd42316 100644
--- a/source4/auth/kerberos/srv_keytab.c
+++ b/source4/auth/kerberos/srv_keytab.c
@@ -277,7 +277,8 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
 
mem_ctx = talloc_new(parent_ctx);
if (!mem_ctx) {
-   *error_string = unable to allocate tmp_ctx for create_keytab;
+   *error_string = talloc_strdup(parent_ctx,
+   unable to allocate tmp_ctx for create_keytab);
return ENOMEM;
}
 
@@ -304,6 +305,7 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
  salt_princ, kvno, new_secret,
  context, enctypes, keytab, error_string);
if (ret) {
+   talloc_steal(parent_ctx, *error_string);
goto done;
}
 
@@ -311,6 +313,9 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
ret = keytab_add_keys(mem_ctx, principals,
  salt_princ, kvno - 1, old_secret,
  context, enctypes, keytab, error_string);
+   if (ret) {
+   talloc_steal(parent_ctx, *error_string);
+   }
}
 
 done:


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2014-06-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  7f36828 librpc: Fix a ignoring asprintf return warning
  from  4811cbe ctdb:server: fix DEBUG message for wrong event script 
options.

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


- Log -
commit 7f36828fccdac860e6ef06424e9b486aec1af00f
Author: Volker Lendecke v...@samba.org
Date:   Thu Jun 5 12:38:50 2014 +

librpc: Fix a ignoring asprintf return warning

Signed-off-by: Volker Lendecke v...@samba.org
Reviewed-by: Kamen Mazdrashki kame...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Thu Jun  5 22:28:16 CEST 2014 on sn-devel-104

---

Summary of changes:
 source4/librpc/rpc/dcerpc_util.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index f87d8da..a9eaccb 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -798,10 +798,11 @@ _PUBLIC_ void dcerpc_log_packet(const char *lockdir,
 
for (i=0;inum_examples;i++) {
char *name=NULL;
-   asprintf(name, %s/rpclog/%s-%u.%d.%s, 
-lockdir, ndr-name, opnum, i,
-(flagsNDR_IN)?in:out);
-   if (name == NULL) {
+   int ret;
+   ret = asprintf(name, %s/rpclog/%s-%u.%d.%s,
+  lockdir, ndr-name, opnum, i,
+  (flagsNDR_IN)?in:out);
+   if (ret == -1) {
return;
}
if (!file_exist(name)) {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2014-05-30 Thread Kamen Mazdrashki
The branch, master has been updated
   via  90f9db9 Fix several talloc stack frames not freed
  from  bd22312 s3:messaging: change unix_dgram_recv_handler() to use 
recvmsg, not recv

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


- Log -
commit 90f9db9c062f2953c19f62dab3fab0b61d8c8e6c
Author: Samuel Cabrero scabr...@zentyal.com
Date:   Wed May 28 17:57:31 2014 +0200

Fix several talloc stack frames not freed

Signed-off-by: Samuel Cabrero scabr...@zentyal.com
Reviewed-by: Kamen Mazdrashki kame...@samba.org
Reviewed-by: Andrew Bartlett abart...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Fri May 30 15:29:29 CEST 2014 on sn-devel-104

---

Summary of changes:
 source3/passdb/pdb_samba_dsdb.c   |8 
 source4/torture/libnetapi/libnetapi.c |1 +
 2 files changed, 9 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/passdb/pdb_samba_dsdb.c b/source3/passdb/pdb_samba_dsdb.c
index 01e747a..febf21c 100644
--- a/source3/passdb/pdb_samba_dsdb.c
+++ b/source3/passdb/pdb_samba_dsdb.c
@@ -339,6 +339,7 @@ static int pdb_samba_dsdb_replace_by_sam(struct 
pdb_samba_dsdb_state *state,
 
msg = ldb_msg_new(frame);
if (!msg) {
+   talloc_free(frame);
return false;
}
 
@@ -375,6 +376,7 @@ static int pdb_samba_dsdb_replace_by_sam(struct 
pdb_samba_dsdb_state *state,
   pw, strlen(pw),
   (void *)pw_utf16.data,
   pw_utf16.length)) {
+   talloc_free(frame);
return LDB_ERR_OPERATIONS_ERROR;
}
ret |= ldb_msg_add_value(msg, clearTextPassword, pw_utf16, 
NULL);
@@ -1011,6 +1013,7 @@ static NTSTATUS pdb_samba_dsdb_getgrgid(struct 
pdb_methods *m, GROUP_MAP *map,
 
status = idmap_xids_to_sids(state-idmap_ctx, tmp_ctx, id_maps);
if (!NT_STATUS_IS_OK(status)) {
+   talloc_free(tmp_ctx);
return status;
}
status = pdb_samba_dsdb_getgrsid(m, map, *id_map.sid);
@@ -1521,6 +1524,7 @@ static NTSTATUS pdb_samba_dsdb_delete_alias(struct 
pdb_methods *m,
 
if (ldb_transaction_start(state-ldb) != LDB_SUCCESS) {
DEBUG(0, (Failed to start transaction in 
dsdb_add_domain_alias(): %s\n, ldb_errstring(state-ldb)));
+   talloc_free(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
 
@@ -1542,15 +1546,18 @@ static NTSTATUS pdb_samba_dsdb_delete_alias(struct 
pdb_methods *m,
DEBUG(10, (ldb_delete failed %s\n,
   ldb_errstring(state-ldb)));
ldb_transaction_cancel(state-ldb);
+   talloc_free(tmp_ctx);
return NT_STATUS_LDAP(rc);
}
 
if (ldb_transaction_commit(state-ldb) != LDB_SUCCESS) {
DEBUG(0, (Failed to commit transaction in 
pdb_samba_dsdb_delete_alias(): %s\n,
  ldb_errstring(state-ldb)));
+   talloc_free(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
 
+   talloc_free(tmp_ctx);
return NT_STATUS_OK;
 }
 
@@ -2061,6 +2068,7 @@ static bool pdb_samba_dsdb_gid_to_sid(struct pdb_methods 
*m, gid_t gid,
 
status = idmap_xids_to_sids(state-idmap_ctx, tmp_ctx, id_maps);
if (!NT_STATUS_IS_OK(status)) {
+   talloc_free(tmp_ctx);
return false;
}
*sid = *id_map.sid;
diff --git a/source4/torture/libnetapi/libnetapi.c 
b/source4/torture/libnetapi/libnetapi.c
index c516976..431b531 100644
--- a/source4/torture/libnetapi/libnetapi.c
+++ b/source4/torture/libnetapi/libnetapi.c
@@ -35,6 +35,7 @@ bool torture_libnetapi_init_context(struct torture_context 
*tctx,
 
if (!lp_load(lpcfg_configfile(tctx-lp_ctx), true, false, false, true)) 
{
fprintf(stderr, error loading %s\n, 
lpcfg_configfile(tctx-lp_ctx));
+   talloc_free(frame);
return W_ERROR_V(WERR_GENERAL_FAILURE);
}
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2014-04-22 Thread Kamen Mazdrashki
The branch, master has been updated
   via  13784b7 s3:smbd: fix typo in comment for set_conn_force_user_group()
   via  9006198 s4:samba_kcc: Use 'dburl' passed from command line rather 
than lp.samdb_url()
   via  1b71f08 s4:kcc_util: fix loading connection transport object - used 
to refer to not defined object
   via  1325e0a s4:samba_kcc: fix reference to DSA object while building 
partial replica list
   via  b241aac s4:samba_kcc: Fix error handling opening export ldif file
   via  42fb23b s4:kcc_utils: Propagate 'samdb' into 
load_connection_transport() method
   via  8b68f9b s4:KCC: Use dsdb.DS_DOMAIN_FUNCTION_2008 constant for 
DS-Behavior comparisons
   via  c9b1f6b samba-tool/upgrade: Fix exception thrown during upgrade 
from samba3
  from  6549716 s3: srvsvc pipe - We should return WERR_BADFILE in 
_srvsvc_NetShareAdd if the path does not exist.

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


- Log -
commit 13784b74d84e1351e27702fd3bbfb04eeb9a40f8
Author: Michael Adam ob...@samba.org
Date:   Tue Apr 22 22:32:14 2014 +0200

s3:smbd: fix typo in comment for set_conn_force_user_group()

Signed-off-by: Michael Adam ob...@samba.org
Reviewed-by: Kamen Mazdrashki kame...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Wed Apr 23 01:49:09 CEST 2014 on sn-devel-104

commit 9006198839b740be9eb7a4c21ee227c66651b9e3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 17:51:09 2014 +0200

s4:samba_kcc: Use 'dburl' passed from command line rather than 
lp.samdb_url()

This patch makes '-H, --URL' param to actually work as expected

Change-Id: Ie7f4e9e3fc1f79a938473312e200f36de6886596
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit 1b71f080eae8fa7b7fb7a1e879bd460797edc010
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 17:39:21 2014 +0200

s4:kcc_util: fix loading connection transport object - used to refer to not 
defined object

Change-Id: If8dc8e8db85f1a882ec73dc83d28fa1b5156de84
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit 1325e0af6a1d411e7f3d6bb15ad69ffc59dd9296
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 17:36:58 2014 +0200

s4:samba_kcc: fix reference to DSA object while building partial replica 
list

Change-Id: I33209dfd42d8c3af8d80b862ba0022d15385311b
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit b241aacc4658a93102bc69d8f4a9c4a542b18cdd
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 17:32:36 2014 +0200

s4:samba_kcc: Fix error handling opening export ldif file

Change-Id: If52440272513ef244e33481476da0e884969153c
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit 42fb23b8b28601baaaca8c4f695a220ca1ead64b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 14:43:51 2014 +0200

s4:kcc_utils: Propagate 'samdb' into load_connection_transport() method

so it is actually able to make samdb.search-es

Change-Id: I8491fd215710a53fbb41d607381f89afb5267464
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit 8b68f9b931877cbaed86471dd34076ae929983a2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 14:32:48 2014 +0200

s4:KCC: Use dsdb.DS_DOMAIN_FUNCTION_2008 constant for DS-Behavior 
comparisons

DS_BEHAVIOR_WIN2008 was used so far which is a leftover from previous
KCC implementation in C

Change-Id: Id9b6551073c0b17cc27e086faa315b01305f39a5
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

commit c9b1f6b366e4f51c8fbf1051bcb44c7d91364b89
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 21 03:47:40 2014 +0200

samba-tool/upgrade: Fix exception thrown during upgrade from samba3

Change-Id: Ib486c0c7a68c53c61acdf270f966a43b1c61bace
Signed-off-by: Kamen Mazdrashki kame...@samba.org
Reviewed-By: Jelmer Vernooij jel...@samba.org

---

Summary of changes:
 python/samba/kcc_utils.py   |7 ---
 python/samba/upgrade.py |2 +-
 source3/smbd/service.c  |2 +-
 source4/scripting/bin/samba_kcc |   20 ++--
 4 files changed, 16 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/kcc_utils.py b/python/samba/kcc_utils.py
index 57c3187..ad0f4e5 100644
--- a/python/samba/kcc_utils.py
+++ b/python/samba/kcc_utils.py
@@ -502,7 +502,7 @@ class DirectoryServiceAgent(object):
 Is dsa at minimum windows level greater

[SCM] Samba Shared Repository - branch master updated

2014-02-09 Thread Kamen Mazdrashki
The branch, master has been updated
   via  9f2e6f5 s4:samba-tool/testparm: add a warning when acting as an 
AD-DC and not using UTF-8
  from  a397967 param: rename lp function and variable from nis_home_map 
to nis_homedir

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


- Log -
commit 9f2e6f532d085d864f44351e99212a63bc6a66ee
Author: Garming Sam garm...@catalyst.net.nz
Date:   Fri Jan 3 11:14:13 2014 +1300

s4:samba-tool/testparm: add a warning when acting as an AD-DC and not using 
UTF-8

Signed-off-by: Garming Sam garm...@catalyst.net.nz
Signed-off-by: Andrew Bartlett abart...@samba.org
Reviewed-by: Andrew Bartlett abart...@samba.org
Reviewed-by: Kamen Mazdrashki kame...@samba.org

Autobuild-User(master): Kamen Mazdrashki kame...@samba.org
Autobuild-Date(master): Mon Feb 10 02:26:28 CET 2014 on sn-devel-104

---

Summary of changes:
 python/samba/netcmd/testparm.py |8 
 1 files changed, 8 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/netcmd/testparm.py b/python/samba/netcmd/testparm.py
index 7825d25..9af141d 100644
--- a/python/samba/netcmd/testparm.py
+++ b/python/samba/netcmd/testparm.py
@@ -156,6 +156,14 @@ class cmd_testparm(Command):
 membership.)
 valid = False
 
+role = lp.get(server role)
+charset = lp.get(unix charset).upper()
+
+if role in [active directory domain controller, domain controller, 
dc] and charset not in [UTF-8, UTF8]:
+logger.warning(
+When acting as Active Directory domain controller, 
+unix charset is expected to be UTF-8.)
+
 return valid
 
 def allow_access(self, deny_list, allow_list, cname, caddr):


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-05-12 Thread Kamen Mazdrashki
The branch, master has been updated
   via  99df3f6 s4/test/getnc_exop: Tune the the test to work against 
windows
  from  62862e2 s3-libnetjoin: fix uninitialized variable.

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


- Log -
commit 99df3f6cbbdfa1693d805c2696e34f353dfa28ac
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu May 12 19:43:54 2011 +0300

s4/test/getnc_exop: Tune the the test to work against windows

It turns out that sometimes, w2k8-r2 returns objects
even when FSMO extended request has failed.

Also verify that target DC returns source_dsa_guid and
source_dsa_invocation_id correctly

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Fri May 13 02:26:04 CEST 2011 on sn-devel-104

---

Summary of changes:
 source4/torture/drs/python/getnc_exop.py |   44 ++---
 1 files changed, 27 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/python/getnc_exop.py 
b/source4/torture/drs/python/getnc_exop.py
index 3aeb7e0..904c013 100644
--- a/source4/torture/drs/python/getnc_exop.py
+++ b/source4/torture/drs/python/getnc_exop.py
@@ -84,53 +84,63 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
 Returns (owner, not_owner) pair where:
  owner: dns name for FSMO owner
  not_owner: dns name for DC not owning the FSMO
+# collect info to return later
+fsmo_info_1 = {dns_name: self.dnsname_dc1,
+   invocation_id: self.ldb_dc1.get_invocation_id(),
+   ntds_guid: self.ldb_dc1.get_ntds_GUID()}
+fsmo_info_2 = {dns_name: self.dnsname_dc2,
+   invocation_id: self.ldb_dc2.get_invocation_id(),
+   ntds_guid: self.ldb_dc2.get_ntds_GUID()}
+# determine the owner dc
 res = self.ldb_dc1.search(fsmo_obj_dn,
   scope=SCOPE_BASE, attrs=[fSMORoleOwner])
 assert len(res) == 1, Only one fSMORoleOwner value expected for 
%s!%fsmo_obj_dn
 fsmo_owner = res[0][fSMORoleOwner][0]
 if fsmo_owner == self.info_dc1[dsServiceName][0]:
-return (self.dnsname_dc1, self.dnsname_dc2)
-return (self.dnsname_dc2, self.dnsname_dc1)
+return (fsmo_info_1, fsmo_info_2)
+return (fsmo_info_2, fsmo_info_1)
 
 def _check_exop_failed(self, ctr6, expected_failure):
-c = drsuapi.DsGetNCChangesCtr6()
 self.assertEqual(ctr6.extended_ret, expected_failure)
-self.assertEqual(ctr6.object_count, 0)
-self.assertEqual(ctr6.first_object, None)
-self.aserrtEqual(ctr6.more_data, False)
+#self.assertEqual(ctr6.object_count, 0)
+#self.assertEqual(ctr6.first_object, None)
+self.assertEqual(ctr6.more_data, False)
 self.assertEqual(ctr6.nc_object_count, 0)
 self.assertEqual(ctr6.nc_linked_attributes_count, 0)
 self.assertEqual(ctr6.linked_attributes_count, 0)
 self.assertEqual(ctr6.linked_attributes, None)
-self.assertEqual(ctr6.drs_error, 0)
+self.assertEqual(ctr6.drs_error[0], 0)
 
 def test_FSMONotOwner(self):
 Test role transfer with against DC not owner of the role
 fsmo_dn = self.ldb_dc1.get_schema_basedn()
-(fsmo_owner_dc, fsmo_not_owner_dc) = 
self._determine_fSMORoleOwner(fsmo_dn)
-
-req8 = self._exop_req8(dest_dsa=9c637462-5b8c-4467-aef2-bdb1f57bc4ef,
-   invocation_id=self.ldb_dc1.get_invocation_id(),
+(fsmo_owner, fsmo_not_owner) = self._determine_fSMORoleOwner(fsmo_dn)
+
+req8 = self._exop_req8(dest_dsa=fsmo_owner[ntds_guid],
+   invocation_id=fsmo_not_owner[invocation_id],
nc_dn_str=fsmo_dn,
exop=drsuapi.DRSUAPI_EXOP_FSMO_REQ_ROLE)
 
-(drs, drs_handle) = self._ds_bind(fsmo_not_owner_dc)
+(drs, drs_handle) = self._ds_bind(fsmo_not_owner[dns_name])
 (level, ctr) = drs.DsGetNCChanges(drs_handle, 8, req8)
 self.assertEqual(level, 6, Expected level 6 response!)
 self._check_exop_failed(ctr, drsuapi.DRSUAPI_EXOP_ERR_FSMO_NOT_OWNER)
+self.assertEqual(ctr.source_dsa_guid, 
misc.GUID(fsmo_not_owner[ntds_guid]))
+self.assertEqual(ctr.source_dsa_invocation_id, 
misc.GUID(fsmo_not_owner[invocation_id]))
 
 def test_InvalidDestDSA(self):
 Test role transfer with invalid destination DSA guid
 fsmo_dn = self.ldb_dc1.get_schema_basedn()
-(fsmo_owner_dc, fsmo_not_owner_dc) = 
self._determine_fSMORoleOwner(fsmo_dn)
+(fsmo_owner, fsmo_not_owner) = self._determine_fSMORoleOwner(fsmo_dn)
 
 req8 = self._exop_req8(dest_dsa=9c637462-5b8c-4467-aef2

[SCM] Samba Shared Repository - branch master updated

2011-05-11 Thread Kamen Mazdrashki
The branch, master has been updated
   via  a8798d8 s4/drepl_fsmo: Add an CR so that message is visible in the 
logs
   via  d4481be s4/getnc_exop: Initial implementation of a testsuite for 
GetNCChanges extended opeartion handling
   via  647827d s4/getncchanges: Pre-mark extended requests as success in 
case a sub-function forget to do this
   via  55916e2 s4/getncchanges: Implement placeholder for handling ex-op 
collection of objects
   via  88a9f79 s4/getncchanges: Move the code that collects objects into 
separate function
   via  41496e7 s4/getncchanges: Don't mask Extended operation result - 
callers need it
   via  232a8df s4/getncchanges: Fail extended request rather than failing 
whole request
  from  f99d6f0 s3-printing: make cups_pull_comment_location() work again.

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


- Log -
commit a8798d8bce9a191ccd6e0692c75e38ffadba1011
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 11 21:05:42 2011 +0300

s4/drepl_fsmo: Add an CR so that message is visible in the logs

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed May 11 21:03:59 CEST 2011 on sn-devel-104

commit d4481be95c0c22ab8dd66edfdd82d1e9312b137d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 11 21:04:54 2011 +0300

s4/getnc_exop: Initial implementation of a testsuite for GetNCChanges 
extended opeartion handling

commit 647827d09ccba7bcfa6454119afc22de96397128
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 11 21:09:34 2011 +0300

s4/getncchanges: Pre-mark extended requests as success in case a 
sub-function forget to do this

commit 55916e273f0853084f5bc2171eefc86af69e27dc
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 11 20:49:42 2011 +0300

s4/getncchanges: Implement placeholder for handling ex-op collection of 
objects

Right now it is solely based on function that handles objects
in normal DsGetNCChanges calls.

commit 88a9f793aa3cc7d7be073eef618fded87420f0d3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 11 20:48:53 2011 +0300

s4/getncchanges: Move the code that collects objects into separate function

commit 41496e782df028a0fc8619aed6ca7a1173750677
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon May 9 20:11:22 2011 +0300

s4/getncchanges: Don't mask Extended operation result - callers need it

commit 232a8dfb060dcac27801b51b9576d76fb2f93655
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon May 9 20:09:49 2011 +0300

s4/getncchanges: Fail extended request rather than failing whole request

in case that destination_dsa_guid is not valid

---

Summary of changes:
 source4/dsdb/repl/drepl_fsmo.c|2 +-
 source4/rpc_server/drsuapi/getncchanges.c |  168 -
 source4/torture/drs/python/getnc_exop.py  |  136 +++
 3 files changed, 252 insertions(+), 54 deletions(-)
 create mode 100644 source4/torture/drs/python/getnc_exop.py


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_fsmo.c b/source4/dsdb/repl/drepl_fsmo.c
index f8f4769..db63853 100644
--- a/source4/dsdb/repl/drepl_fsmo.c
+++ b/source4/dsdb/repl/drepl_fsmo.c
@@ -111,7 +111,7 @@ NTSTATUS drepl_take_FSMO_role(struct irpc_message *msg,
 
if (fsmo_master_equal(ntds_dn, role_owner_dn) ||
(extended_op == DRSUAPI_EXOP_NONE)) {
-   DEBUG(0,(FSMO role check failed for DN %s and owner %s ,
+   DEBUG(0,(FSMO role check failed for DN %s and owner %s \n,
 ldb_dn_get_linearized(fsmo_role_dn),
 ldb_dn_get_linearized(role_owner_dn)));
r-out.result = WERR_OK;
diff --git a/source4/rpc_server/drsuapi/getncchanges.c 
b/source4/rpc_server/drsuapi/getncchanges.c
index 8ae5368..0c196aa 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -993,12 +993,14 @@ static WERROR getncchanges_change_master(struct 
drsuapi_bind_state *b_state,
msg-dn = drs_ObjectIdentifier_to_dn(msg, ldb, req10-naming_context);
W_ERROR_HAVE_NO_MEMORY(msg-dn);
 
+   /* TODO: make sure ntds_dn is a valid nTDSDSA object */
ret = dsdb_find_dn_by_guid(ldb, msg, req10-destination_dsa_guid, 
ntds_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0, (__location__ : Unable to find NTDS object for guid 
%s - %s\n,
  GUID_string(mem_ctx, req10-destination_dsa_guid), 
ldb_errstring(ldb)));
talloc_free(msg);
-   return WERR_DS_DRA_INTERNAL_ERROR;
+   ctr6-extended_ret = DRSUAPI_EXOP_ERR_UNKNOWN_CALLER;
+   return WERR_OK;
}
 
ret = ldb_msg_add_string(msg, fSMORoleOwner, 
ldb_dn_get_linearized(ntds_dn));
@@ -1161,6

[SCM] Samba Shared Repository - branch master updated

2011-05-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  ecc030e selftest: Polish selftest-vars.sh a little so it can be 
used again
  from  5def7a1 s4-selftest Add tests for proxy_samba4_dc

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


- Log -
commit ecc030e2898f4f7be195111a24c5a76505ea0543
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun May 8 13:31:32 2011 +0300

selftest: Polish selftest-vars.sh a little so it can be used again

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun May  8 22:50:01 CEST 2011 on sn-devel-104

---

Summary of changes:
 source4/scripting/devel/selftest-vars.sh |   24 ++--
 1 files changed, 14 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/devel/selftest-vars.sh 
b/source4/scripting/devel/selftest-vars.sh
index bc73c05..a8f323d 100644
--- a/source4/scripting/devel/selftest-vars.sh
+++ b/source4/scripting/devel/selftest-vars.sh
@@ -2,38 +2,42 @@
 # outside the test environment
 
 export UID_WRAPPER=1
-export NSS_WRAPPER_PASSWD=st/dc/passwd
-export NSS_WRAPPER_GROUP=st/dc/group
+export NSS_WRAPPER_PASSWD=$PWD/st/dc/passwd
+export NSS_WRAPPER_GROUP=$PWD/st/dc/group
 export CONFIGURATION=--configfile=$PWD/st/dc/etc/smb.conf
+export VAMPIRE_DC_SERVER=localvampiredc
+export VAMPIRE_DC_SERVER_IP=127.0.0.22
+export VAMPIRE_DC_NETBIOSNAME=localvampiredc1
+export VAMPIRE_DC_NETBIOSALIAS=localvampiredc
 export MEMBER_SERVER=localmember3
-export MEMBER_SERVER_IP=127.0.0.3
+export MEMBER_SERVER_IP=127.0.0.23
 export MEMBER_NETBIOSNAME=localmember3
 export MEMBER_NETBIOSALIAS=localmember
 export RPC_PROXY_SERVER=localrpcproxy4
-export RPC_PROXY_SERVER_IP=127.0.0.4
+export RPC_PROXY_SERVER_IP=127.0.0.24
 export RPC_PROXY_NETBIOSNAME=localrpcproxy4
 export RPC_PROXY_NETBIOSALIAS=localrpcproxy
 export SELFTEST_MAXTIME=1200
 export NETBIOSNAME=localdc1
 export REALM=SAMBA.EXAMPLE.COM
-export SOCKET_WRAPPER_DEFAULT_IFACE=1
+export SOCKET_WRAPPER_DEFAULT_IFACE=21
 export SERVER=localdc1
 export WINBINDD_SOCKET_DIR=$PWD/st/dc/winbindd_socket
 export SELFTEST_PREFIX=$PWD/st
 export DOMAIN=SAMBADOMAIN
 export BINDIR=./bin
-export DC_SERVER_IP=127.0.0.1
+export DC_SERVER_IP=127.0.0.21
 export 
SELFTEST_INTERFACES=127.0.0.6/8,127.0.0.7/8,127.0.0.8/8,127.0.0.9/8,127.0.0.10/8,127.0.0.11/8
 export SOCKET_WRAPPER_DIR=$PWD/st/w
 export DC_USERNAME=Administrator
 export USERNAME=Administrator
-export SERVER_IP=127.0.0.1
+export SERVER_IP=127.0.0.21
 export KRB5_CONFIG=$PWD/st/dc/etc/krb5.conf
 export PREFIX_ABS=$PWD/st
 export SRCDIR_ABS=$PWD
-export PREFIX=./st
-export KRB5CCNAME=./st/krb5ticket
-export SRCDIR=.
+export PREFIX=$PWD/st
+export KRB5CCNAME=$PWD/st/krb5ticket
+export SRCDIR=$PWD/
 export TLS_ENABLED=yes
 export DC_NETBIOSALIAS=localdc
 export DC_NETBIOSNAME=localdc1


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-02-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  b1f68b6 s4-libnet_vampire: Ignore some attributes when building 
working schema cache
   via  fb7975d s4-repl/working_schema: Ignore some attributes when bulding 
working schema cache
   via  f518dbc s4-replicated_objects: Implement a mechanism to relax some 
attributes conversion
  from  ec1009f s3-debug Always use C99 true/false rather than True and 
False

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


- Log -
commit b1f68b68717bbcddf81ba7776faaef52f424043b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Mar 1 02:32:19 2011 +0200

s4-libnet_vampire: Ignore some attributes when building working schema cache

Working schema cache will be used to convert replicated Schema objects
again later, i.e. used as reference, so we don't need to resolve all
attribute OIDs for working Schema cache to be usable.

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Mar  1 03:45:16 CET 2011 on sn-devel-104

commit fb7975d590e341a8d301a21e0c4957a376ee6fb0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Mar 1 02:30:12 2011 +0200

s4-repl/working_schema: Ignore some attributes when bulding working schema 
cache

We don't need all object attributes resolved and converted for a working
schema to be functional.

commit f518dbc0897ba89b8fba1b6cd839e1f36c3c8126
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Mar 1 02:25:24 2011 +0200

s4-replicated_objects: Implement a mechanism to relax some attributes 
conversion

during replicated object convert stage.
The problem is that we may have loops in schema graph and we can't
resolve those loops in just one pass. Ignoring some attributes
conversion will allow us to have a functional schema cache that we
can use later to resolve all attribute OIDs on another pass

---

Summary of changes:
 source4/dsdb/repl/replicated_objects.c |   44 +---
 source4/libnet/libnet_vampire.c|9 ++
 2 files changed, 49 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index bbfcfd8..d11de92 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -61,6 +61,14 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context *ldb,
struct dsdb_schema *working_schema;
const struct drsuapi_DsReplicaObjectListItemEx *cur;
int ret, pass_no;
+   uint32_t ignore_attids[] = {
+   DRSUAPI_ATTID_auxiliaryClass,
+   DRSUAPI_ATTID_mayContain,
+   DRSUAPI_ATTID_mustContain,
+   DRSUAPI_ATTID_possSuperiors,
+   DRSUAPI_ATTID_systemPossSuperiors,
+   DRSUAPI_ATTID_INVALID
+   };
 
/* make a copy of the iniatial_scheam so we don't mess with it */
working_schema = dsdb_schema_copy_shallow(mem_ctx, ldb, initial_schema);
@@ -111,6 +119,7 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context 
*ldb,
 */
werr = dsdb_convert_object_ex(ldb, working_schema, 
pfm_remote,
  cur, gensec_skey,
+ ignore_attids,
  tmp_ctx, object);
if (!W_ERROR_IS_OK(werr)) {
DEBUG(1,(Warning: Failed to convert schema 
object %s into ldb msg\n,
@@ -163,11 +172,26 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context 
*ldb,
return WERR_OK;
 }
 
+static bool dsdb_attid_in_list(const uint32_t attid_list[], uint32_t attid)
+{
+   const uint32_t *cur;
+   if (!attid_list) {
+   return false;
+   }
+   for (cur = attid_list; *cur != DRSUAPI_ATTID_INVALID; cur++) {
+   if (*cur == attid) {
+   return true;
+   }
+   }
+   return false;
+}
+
 WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
  const struct dsdb_schema *schema,
  const struct dsdb_schema_prefixmap *pfm_remote,
  const struct drsuapi_DsReplicaObjectListItemEx 
*in,
  const DATA_BLOB *gensec_skey,
+ const uint32_t *ignore_attids,
  TALLOC_CTX *mem_ctx,
  struct dsdb_extended_replicated_object *out)
 {
@@ -189,6 +213,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
struct replPropertyMetaData1 *rdn_m = NULL;
struct dom_sid *sid = NULL;
uint32_t rid

[SCM] Samba Shared Repository - branch master updated

2011-02-26 Thread Kamen Mazdrashki
The branch, master has been updated
   via  561205b s4/dsdb-util: Use DS_NTDSDSA_OPT_IS_GC flag definition
   via  ec54534 s4/tests: Include 'replica_sync' test in S4 test suite
   via  375eddc s4/drs-test: Remove unused imports
   via  62a6b75 s4/drs-test: remove netReplicateCmd test from 'deleted 
object' test case
   via  281e306 s4/drs-tests: Disable replication during 'deleted object' 
test
   via  90d0d3e s4/drs-tests: Move enable/disable replication methods to 
DrsBase class so we can re-use them
   via  1ca2ec1 s4-drepl: Schedule event to trigger replication rather than 
calling run_pending_ops directly
   via  05c90d2 s4-drepl: Fix replica sync callback to really store last 
error rather than last success
   via  d7f47fb s4-drepl: Refactor dreplsrv_run_pull_ops() to
   via  f0bde82 s4-drepl: Pass replication options from DsReplicaSync call
  from  48200c2 s3: Improve a dbg msg in aio_fork

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


- Log -
commit 561205b0166cb4a9c2efbb32b8429f6a83827eee
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 22 17:06:15 2011 +0200

s4/dsdb-util: Use DS_NTDSDSA_OPT_IS_GC flag definition

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun Feb 27 00:10:45 CET 2011 on sn-devel-104

commit ec5453427ea60990ac485849278e79a19511e1dd
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 22 17:05:54 2011 +0200

s4/tests: Include 'replica_sync' test in S4 test suite

commit 375eddc15e20a1a2cbaa5bd53962b0206ca7cef3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 22 04:38:12 2011 +0200

s4/drs-test: Remove unused imports

commit 62a6b754828e8e825b9ee732defc6b3855e06489
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 22 04:16:55 2011 +0200

s4/drs-test: remove netReplicateCmd test from 'deleted object' test case

DCs synchronization is moved to the test case setUp method
as there is no guarantee for the order of execution of tests
in a test case - thus netReplicateCmd may be executed after
ReplicateDeleteOjbect test

commit 281e3060451720445c4fb12f5dbbe5ccdc84ca92
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 22 03:40:07 2011 +0200

s4/drs-tests: Disable replication during 'deleted object' test

This allows us to remove the patch that prevents the test failure.

Also pass 'forced' flag to samba-tool drs replicate command, otherwise
DsReplicaSync will fail with 'replication not permitted' error

commit 90d0d3e5f8ab1c5152163c83e423913a4c24ec9b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Feb 21 17:49:54 2011 +0200

s4/drs-tests: Move enable/disable replication methods to DrsBase class so 
we can re-use them

commit 1ca2ec1188098c051fe7ab6d44c9b1cd1f802b18
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Feb 26 23:13:49 2011 +0200

s4-drepl: Schedule event to trigger replication rather than calling 
run_pending_ops directly

Executing dreplsrv_run_pending_ops() directly may cause a segfault
as in case of failure, the _drepl_replica_sync_done_cb() callback
gets called *before* drepl_replica_sync() returns. In such case,
irpc message gets freed twice - once when irpc_send_reply() gets called
and once when drepl_replica_sync() returns

commit 05c90d2fa696517612051a8e7c7dc765723e71f5
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Feb 26 23:01:20 2011 +0200

s4-drepl: Fix replica sync callback to really store last error rather than 
last success

commit d7f47fb87cb06ab9642bd188de435beed539c437
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Feb 26 21:00:46 2011 +0200

s4-drepl: Refactor dreplsrv_run_pull_ops() to

1. Take into account DSA options - we should not send replication
   requests in case OUTBOUND_REPLICATION is disabled
2. Use replication flags for the operation to determine if
   a forced replication is requested
3. In case outbound replication is disabled and we don't have
   DRSUAPI_DRS_SYNC_FORCED flag set, then we should record
   WERR_DS_DRA_SINK_DISABLED error as a last replication result

commit f0bde828e0ca76752c23920cc0fd563866e5a90b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Feb 26 20:36:19 2011 +0200

s4-drepl: Pass replication options from DsReplicaSync call

---

Summary of changes:
 source4/dsdb/common/util.c  |2 +-
 source4/dsdb/repl/drepl_extended.c  |2 +-
 source4/dsdb/repl/drepl_out_pull.c  |   53 ++-
 source4/dsdb/repl/drepl_service.c   |   18 ++---
 source4/dsdb/repl/drepl_service.h   |2 +
 source4/selftest/tests.py   |1 +
 source4/torture/drs/python/delete_object.py |   43 +++---
 source4

[SCM] Samba Shared Repository - branch master updated

2011-02-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  1273d50 s4/drs-tests:Blackbox test to verify DsReplicaSync handling
   via  bfb0adf s4/samba.tests: Raise BlackboxProcessError exception in 
case check_output method fails
   via  348295b s4/samba.tests: Extend CalledProcessError class to store 
STDOUT and STDERR for a failed rocess call
   via  adfb618 s4/drs-tests: Allow _net_drs_replicate to force replication 
and return output from command execution
   via  288e20c s4/drs-tests: Split samba-tool command line generation into 
separate method
   via  75856d5 s4/drs-tests: Inherit DrsReplSchemaTestCase from 
DrsBaseTestCase
   via  60bb40c s4/drs-tests: Inherit DrsFsmoTestCase from DrsBaseTestCase
   via  fcd4aa8 s4/drs-tests: Inherit DrsDeleteObjectTestCase from 
DrsBaseTestCase
   via  e210391 s4/drs-tests: Add a base class to hold common functionality 
for all DRS python tests
  from  367b35b s3: Fix pdb_ads_enum_aliasmem for empty aliases

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


- Log -
commit 1273d504f2abb6b87c45bf664b56c1902ba99219
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Feb 20 04:21:32 2011 +0200

s4/drs-tests:Blackbox test to verify DsReplicaSync handling

DsReplicaSync is indirectly called using 'samba-tool drs options' command
to enable/disable replication and 'samba-tool drs replicate' command
to trigger inbound replication cycle

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun Feb 20 23:03:03 CET 2011 on sn-devel-104

commit bfb0adf0b450452e3daf0b60269768b77c6291c3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Feb 20 04:17:25 2011 +0200

s4/samba.tests: Raise BlackboxProcessError exception in case check_output 
method fails

This way the caller gets the chance to receive STDOUT and STDERR for
a failed process.
We may use this info to check if a process has failed properly,
e.g. with expected output

commit 348295bf8ac5f39e5be23c0a6adb8c31e64766a2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Feb 20 04:15:08 2011 +0200

s4/samba.tests: Extend CalledProcessError class to store STDOUT and STDERR 
for a failed rocess call

commit adfb618ef5f7307bb5cf68185c6055375196db3a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 04:27:19 2011 +0200

s4/drs-tests: Allow _net_drs_replicate to force replication and return 
output from command execution

commit 288e20cfb7c7e39bfd07626c77a9a0eaa8955bcf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 04:09:45 2011 +0200

s4/drs-tests: Split samba-tool command line generation into separate method

so we can use to exec samba-tool passing different commands

commit 75856d53cb0d733c4df3a58708eb9f272260c176
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 03:25:20 2011 +0200

s4/drs-tests: Inherit DrsReplSchemaTestCase from DrsBaseTestCase

and remove duplicated functionality

commit 60bb40cd25bc8fd037f6a5e29e6fa3d62a88533e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 03:25:02 2011 +0200

s4/drs-tests: Inherit DrsFsmoTestCase from DrsBaseTestCase

and remove duplicated functionality

commit fcd4aa84edb79d40e3616918b710b8a3a277f4a8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 03:24:08 2011 +0200

s4/drs-tests: Inherit DrsDeleteObjectTestCase from DrsBaseTestCase

and remove duplicated functionality

commit e21039110cfa6303f2f7de14918d4492298ad996
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 18 02:54:50 2011 +0200

s4/drs-tests: Add a base class to hold common functionality for all DRS 
python tests

---

Summary of changes:
 source4/scripting/python/samba/tests/__init__.py |   17 +++-
 source4/torture/drs/python/delete_object.py  |   46 +-
 source4/torture/drs/python/drs_base.py   |  111 ++
 source4/torture/drs/python/fsmo.py   |   37 +---
 source4/torture/drs/python/repl_schema.py|   47 +-
 source4/torture/drs/python/replica_sync.py   |   91 ++
 6 files changed, 223 insertions(+), 126 deletions(-)
 create mode 100644 source4/torture/drs/python/drs_base.py
 create mode 100644 source4/torture/drs/python/replica_sync.py


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/tests/__init__.py 
b/source4/scripting/python/samba/tests/__init__.py
index d6b962c..58e4130 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -121,6 +121,19 @@ class ValidNetbiosNameTests(TestCase):
 self.assertFalse(samba.valid_netbios_name(*BLA))
 
 
+class BlackboxProcessError(subprocess.CalledProcessError):
+This exception is raised when a process run

[SCM] Samba Shared Repository - branch master updated

2011-02-15 Thread Kamen Mazdrashki
The branch, master has been updated
   via  aaae316 s4-ldb_modules/operational: Make use of 
dsdb_module_reference_dn() function
  from  fa36577 s4:sam.py - add another description test case

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


- Log -
commit aaae3164b5220f42b5524cb030ebfd17e88bd32e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Feb 15 16:09:37 2011 +0200

s4-ldb_modules/operational: Make use of dsdb_module_reference_dn() function

it does exactly what we need here

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Feb 15 16:55:32 CET 2011 on sn-devel-104

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/operational.c |   21 -
 1 files changed, 4 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/operational.c 
b/source4/dsdb/samdb/ldb_modules/operational.c
index 1df56e8..3f2977d 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -438,15 +438,13 @@ static int construct_msds_isrodc_with_computer_dn(struct 
ldb_module *module,
  struct ldb_message *msg,
  struct ldb_request *parent)
 {
-   struct ldb_context *ldb;
-   const char *attr[] = { serverReferenceBL, NULL };
-   struct ldb_result *res;
int ret;
struct ldb_dn *server_dn;
 
-   ret = dsdb_module_search_dn(module, msg, res, msg-dn, attr,
-   DSDB_FLAG_NEXT_MODULE, parent);
-   if (ret == LDB_ERR_NO_SUCH_OBJECT) {
+   ret = dsdb_module_reference_dn(module, msg, msg-dn, 
serverReferenceBL,
+  server_dn, parent);
+   if (ret == LDB_ERR_NO_SUCH_OBJECT || ret == LDB_ERR_NO_SUCH_ATTRIBUTE) {
+   /* it's OK if we can't find serverReferenceBL attribute */
DEBUG(4,(__location__ : Can't get serverReferenceBL for %s \n,
 ldb_dn_get_linearized(msg-dn)));
return LDB_SUCCESS;
@@ -454,17 +452,6 @@ static int construct_msds_isrodc_with_computer_dn(struct 
ldb_module *module,
return ret;
}
 
-   ldb = ldb_module_get_ctx(module);
-   if (!ldb) {
-   return LDB_SUCCESS;
-   }
-
-   server_dn = ldb_msg_find_attr_as_dn(ldb, msg, res-msgs[0], 
serverReferenceBL);
-   if (!server_dn) {
-   DEBUG(4,(__location__ : Can't find serverReferenceBL for %s 
\n,
-ldb_dn_get_linearized(res-msgs[0]-dn)));
-   return LDB_SUCCESS;
-   }
return construct_msds_isrodc_with_server_dn(module, msg, server_dn, 
parent);
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-02-14 Thread Kamen Mazdrashki
The branch, master has been updated
   via  850bf67 s4-ldb_modules/acl: Use ntds_guid for SPN check only we 
have a DC object
   via  3134895 s4-ldb_modules/acl: Get correct NTDSDSA objectGUID to check 
SPN for
   via  7397207 s4-ldb_modules/util: Implement 
dsdb_module_find_ntdsguid_for_computer()
   via  6110887 s4/ldb_modules/acl.c: Fix calculation for samAccountName 
string len
  from  b3ea56a s3-librpc: no need to globally include endpointmapper 
headers.

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


- Log -
commit 850bf67c452bcb8570e2fb0af77296754bec98cc
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Feb 14 11:41:19 2011 +0200

s4-ldb_modules/acl: Use ntds_guid for SPN check only we have a DC object

ntds_guid is NULL otherwise as it doesn't make sense for
not a DC object

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Feb 14 13:15:31 CET 2011 on sn-devel-104

commit 313489507593c7798d41f8cace48e7cc59228a0d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Feb 14 11:35:48 2011 +0200

s4-ldb_modules/acl: Get correct NTDSDSA objectGUID to check SPN for

commit 73972072d7c02ea8eaadd99be4361d7ee0e04d4a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Feb 14 11:34:32 2011 +0200

s4-ldb_modules/util: Implement dsdb_module_find_ntdsguid_for_computer()

as a counterpart for samdb_find_ntdsguid_for_computer()
to be used in LDB modules

commit 6110887802e8912b2a1d17f0bde9d77c8f12ea87
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 11 05:42:28 2011 +0200

s4/ldb_modules/acl.c: Fix calculation for samAccountName string len

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl.c  |   32 +++-
 source4/dsdb/samdb/ldb_modules/util.c |   30 ++
 2 files changed, 53 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/acl.c 
b/source4/dsdb/samdb/ldb_modules/acl.c
index 69ff2aa..a96ea37 100644
--- a/source4/dsdb/samdb/ldb_modules/acl.c
+++ b/source4/dsdb/samdb/ldb_modules/acl.c
@@ -450,7 +450,6 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx,
char *serviceType;
char *serviceName;
const char *realm;
-   const char *guid_str;
const char *forest_name = samdb_forest_name(ldb, mem_ctx);
const char *base_domain = samdb_default_domain_name(ldb, mem_ctx);
struct loadparm_context *lp_ctx = talloc_get_type(ldb_get_opaque(ldb, 
loadparm),
@@ -475,9 +474,6 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx,
instanceName = principal-name.name_string.val[1];
serviceType = principal-name.name_string.val[0];
realm = krb5_principal_get_realm(krb_ctx, principal);
-   guid_str = talloc_asprintf(mem_ctx,%s._msdcs.%s,
-  ntds_guid,
-  forest_name);
if (principal-name.name_string.len == 3) {
serviceName = principal-name.name_string.val[2];
} else {
@@ -507,17 +503,20 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx,
}
/* instanceName can be samAccountName without $ or dnsHostName
 * or ntds_guid._msdcs.forest_domain for DC objects */
-   if (strncasecmp(instanceName, samAccountName, strlen(samAccountName - 
1)) == 0) {
+   if (strncasecmp(instanceName, samAccountName, strlen(samAccountName) - 
1) == 0) {
goto success;
} else if (strcasecmp(instanceName, dnsHostName) == 0) {
goto success;
} else if (is_dc) {
+   const char *guid_str;
+   guid_str = talloc_asprintf(mem_ctx,%s._msdcs.%s,
+  ntds_guid,
+  forest_name);
if (strcasecmp(instanceName, guid_str) == 0) {
goto success;
}
-   } else {
-   goto fail;
}
+
 fail:
krb5_free_principal(krb_ctx, principal);
krb5_free_context(krb_ctx);
@@ -549,8 +548,8 @@ static int acl_check_spn(TALLOC_CTX *mem_ctx,
const char *samAccountName;
const char *dnsHostName;
const char *netbios_name;
-   const struct GUID *ntds = samdb_ntds_objectGUID(ldb);
-   const char *ntds_guid = GUID_string(tmp_ctx, ntds);
+   struct GUID ntds;
+   char *ntds_guid = NULL;
 
static const char *acl_attrs[] = {
samAccountName,
@@ -562,6 +561,7 @@ static int acl_check_spn(TALLOC_CTX *mem_ctx,
nETBIOSName,
NULL
};
+
/* if we have wp, we can do whatever we like */
if (acl_check_access_on_attribute(module,
  tmp_ctx

[SCM] Samba Shared Repository - branch master updated

2011-02-09 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4d058ca s4/tests: Implement a blackbox test for 'samba-tool drs' 
command
   via  099644f s4/tests: Move command line processing into separate method 
to be reused
   via  6b15746 s4/tests: Implement BlackboxTestCase.check_output() method
   via  d0867e5 s4/samba-tool/drs: Make use of Command.message() method 
instead of using 'print'
   via  ad48c70 s4/samba-tool/drs: Move get_dsServiceName function at 
module level to be re-used
   via  f3db67e s4/samba-tool: 'drs options' command implementation
  from  6c89bb8 waf Remove debugging hacks left in the top level build

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


- Log -
commit 4d058ca7c043e7d28385bec21c9e1d7575895625
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Feb 9 03:40:52 2011 +0200

s4/tests: Implement a blackbox test for 'samba-tool drs' command

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Feb  9 11:45:30 CET 2011 on sn-devel-104

commit 099644f0a7d16d865a39cfab069ab762dc26377f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Feb 9 03:40:17 2011 +0200

s4/tests: Move command line processing into separate method to be reused

commit 6b1574636a8493d043795b7f397657846a637f28
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Feb 9 03:01:16 2011 +0200

s4/tests: Implement BlackboxTestCase.check_output() method

I am going to need this to check if output is OK (kind of)

commit d0867e5c6c164fdd927a7e961d60287a8bd7e9f5
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Feb 9 03:00:06 2011 +0200

s4/samba-tool/drs: Make use of Command.message() method instead of using 
'print'

commit ad48c70db61a5e35a85a317c4c0f4a179a2aae77
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Feb 7 14:13:06 2011 +0200

s4/samba-tool/drs: Move get_dsServiceName function at module level to be 
re-used

commit f3db67e14fd9ebcf5720e82b125d2939fdc2ac17
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Feb 4 04:14:13 2011 +0200

s4/samba-tool: 'drs options' command implementation

Current implementation handle only one flag change per call

---

Summary of changes:
 source4/scripting/python/samba/netcmd/drs.py   |  152 ++--
 source4/scripting/python/samba/tests/__init__.py   |   13 ++-
 .../python/samba/tests/blackbox/samba_tool_drs.py  |  100 +
 source4/selftest/tests.py  |1 +
 4 files changed, 223 insertions(+), 43 deletions(-)
 create mode 100644 
source4/scripting/python/samba/tests/blackbox/samba_tool_drs.py


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/drs.py 
b/source4/scripting/python/samba/netcmd/drs.py
index 740bd20..7dea9de 100644
--- a/source4/scripting/python/samba/netcmd/drs.py
+++ b/source4/scripting/python/samba/netcmd/drs.py
@@ -83,6 +83,12 @@ def drs_parse_ntds_dn(ntds_dn):
 return (site, server)
 
 
+def get_dsServiceName(samdb):
+'''get the NTDS DN from the rootDSE'''
+res = samdb.search(base=, scope=ldb.SCOPE_BASE, attrs=[dsServiceName])
+return res[0][dsServiceName][0]
+
+
 class cmd_drs_showrepl(Command):
 show replication status
 
@@ -98,22 +104,18 @@ class cmd_drs_showrepl(Command):
 
 def print_neighbour(self, n):
 '''print one set of neighbour information'''
-print(%s % n.naming_context_dn)
+self.message(%s % n.naming_context_dn)
 try:
 (site, server) = drs_parse_ntds_dn(n.source_dsa_obj_dn)
-print(\t%s\%s via RPC % (site, server))
+self.message(\t%s\%s via RPC % (site, server))
 except RuntimeError:
-print(\tNTDS DN: %s % n.source_dsa_obj_dn)
-print(\t\tDSA object GUID: %s % n.source_dsa_obj_guid)
-print(\t\tLast attempt @ %s %s % (nttime2string(n.last_attempt), 
drs_errmsg(n.result_last_attempt)))
-print(\t\t%u consecutive failure(s). % n.consecutive_sync_failures)
-print(\t\tLast success @ %s % nttime2string(n.last_success))
-print()
-
-def get_dsServiceName(ctx):
-'''get the NTDS DN from the rootDSE'''
-res = ctx.samdb.search(base=, scope=ldb.SCOPE_BASE, 
attrs=[dsServiceName])
-return res[0][dsServiceName][0]
+self.message(\tNTDS DN: %s % n.source_dsa_obj_dn)
+self.message(\t\tDSA object GUID: %s % n.source_dsa_obj_guid)
+self.message(\t\tLast attempt @ %s %s % 
(nttime2string(n.last_attempt),
+   
drs_errmsg(n.result_last_attempt)))
+self.message(\t\t%u consecutive failure(s). % 
n.consecutive_sync_failures)
+self.message(\t\tLast success @ %s % nttime2string(n.last_success))
+self.message()
 
 def drsuapi_ReplicaInfo(ctx, info_type

[SCM] Samba Shared Repository - branch master updated

2011-02-02 Thread Kamen Mazdrashki
The branch, master has been updated
   via  da3a2c6 s4/samba-tool: Add --sync-forced flag to 'drs replicate' 
command
  from  f19c1e3 s4-dsdb Add tests to ensure we don't break the rootDSE 
function levels again

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


- Log -
commit da3a2c68b0a789685f051a21579cafa71651618d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Feb 2 07:02:06 2011 +0200

s4/samba-tool: Add --sync-forced flag to 'drs replicate' command

We are going to need this to trigger replication when
inbound replication is disabled for a given DC

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Feb  2 09:03:22 CET 2011 on sn-devel-104

---

Summary of changes:
 source4/scripting/python/samba/netcmd/drs.py |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/drs.py 
b/source4/scripting/python/samba/netcmd/drs.py
index f0cde79..740bd20 100644
--- a/source4/scripting/python/samba/netcmd/drs.py
+++ b/source4/scripting/python/samba/netcmd/drs.py
@@ -247,9 +247,10 @@ class cmd_drs_replicate(Command):
 
 takes_options = [
 Option(--add-ref, help=use ADD_REF to add to repsTo on source, 
action=store_true),
+Option(--sync-forced, help=use SYNC_FORCED to force inbound 
replication, action=store_true),
 ]
 
-def run(self, DEST_DC, SOURCE_DC, NC, add_ref=False,
+def run(self, DEST_DC, SOURCE_DC, NC, add_ref=False, sync_forced=False,
 sambaopts=None,
 credopts=None, versionopts=None, server=None):
 
@@ -288,6 +289,8 @@ class cmd_drs_replicate(Command):
 req1.options |= drsuapi.DRSUAPI_DRS_WRIT_REP
 if add_ref:
 req1.options |= drsuapi.DRSUAPI_DRS_ADD_REF
+if sync_forced:
+req1.options |= drsuapi.DRSUAPI_DRS_SYNC_FORCED
 req1.source_dsa_guid = misc.GUID(source_dsa_guid)
 
 try:


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-01-25 Thread Kamen Mazdrashki
The branch, master has been updated
   via  6e22637 s4-test/delete_object: Remove global ldb connections
  from  932911e s4:ldap.py - check the write protection on LSA objects

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


- Log -
commit 6e2263749ab108baf7543a651123041427af96db
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Jan 22 03:22:48 2011 +0200

s4-test/delete_object: Remove global ldb connections

Make it more xUnit compliant

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Jan 25 21:30:19 CET 2011 on sn-devel-104

---

Summary of changes:
 source4/torture/drs/python/delete_object.py |   33 +-
 1 files changed, 7 insertions(+), 26 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/python/delete_object.py 
b/source4/torture/drs/python/delete_object.py
index 0693898..ccc412e 100644
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -42,35 +42,16 @@ import samba.tests
 
 class DrsDeleteObjectTestCase(samba.tests.TestCase):
 
-# RootDSE msg for DC1
-info_dc1 = None
-ldb_dc1 = None
-# RootDSE msg for DC1
-info_dc2 = None
-ldb_dc2 = None
-
 def setUp(self):
 super(DrsDeleteObjectTestCase, self).setUp()
 
-# connect to DCs singleton
-if self.ldb_dc1 is None:
-DrsDeleteObjectTestCase.dc1 = samba.tests.env_get_var_value(DC1)
-DrsDeleteObjectTestCase.ldb_dc1 = 
samba.tests.connect_samdb(self.dc1, ldap_only=True)
-if self.ldb_dc2 is None:
-DrsDeleteObjectTestCase.dc2 = samba.tests.env_get_var_value(DC2)
-DrsDeleteObjectTestCase.ldb_dc2 = 
samba.tests.connect_samdb(self.dc2, ldap_only=True)
-
-# fetch rootDSEs
-if self.info_dc1 is None:
-ldb = self.ldb_dc1
-res = ldb.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
-self.assertEquals(len(res), 1)
-DrsDeleteObjectTestCase.info_dc1 = res[0]
-if self.info_dc2 is None:
-ldb = self.ldb_dc2
-res = ldb.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
-self.assertEquals(len(res), 1)
-DrsDeleteObjectTestCase.info_dc2 = res[0]
+# connect to DCs
+url_dc = samba.tests.env_get_var_value(DC1)
+(self.ldb_dc1, self.info_dc1) = samba.tests.connect_samdb_ex(url_dc,
+ 
ldap_only=True)
+url_dc = samba.tests.env_get_var_value(DC2)
+(self.ldb_dc2, self.info_dc2) = samba.tests.connect_samdb_ex(url_dc,
+ 
ldap_only=True)
 
 # cache some of RootDSE props
 self.schema_dn = self.info_dc1[schemaNamingContext][0]


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-01-22 Thread Kamen Mazdrashki
The branch, master has been updated
   via  585e9a0 s4-repl_meta_data: replmd_update_is_newer() should not 
return true if metadata stamps are equal
   via  0ce93ad s4-repl_meta_data: Print out what is wrong when we fail to 
modify object
   via  0aa118f s4-repl_meta_data: We should not use USNs in metadata 
comparisons
  from  6ee39a2 s3-torture: fix uninitialized status code.

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


- Log -
commit 585e9a0ab0e0673f1222a4e26d94c90fb6e88331
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jan 21 22:51:05 2011 +0200

s4-repl_meta_data: replmd_update_is_newer() should not return true if 
metadata stamps are equal

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sat Jan 22 12:22:30 CET 2011 on sn-devel-104

commit 0ce93ad2bc91fd7cbe2f71d00a323a827b9457b1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jan 21 02:39:23 2011 +0200

s4-repl_meta_data: Print out what is wrong when we fail to modify object

commit 0aa118f22bb2e810e5c530c743c48dcb7bde92cc
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jan 21 02:38:25 2011 +0200

s4-repl_meta_data: We should not use USNs in metadata comparisons

If object is changed by same DC, then version should be incremented

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |   18 --
 1 files changed, 4 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 2cc52b9..87327e5 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -372,6 +372,7 @@ static int replmd_op_callback(struct ldb_request *req, 
struct ldb_reply *ares)
controls = ldb_controls_except_specified(ares-controls, ares, 
partition_ctrl);
 
if (ares-error != LDB_SUCCESS) {
+   DEBUG(0,(%s failure. Error is: %s\n, __FUNCTION__, 
ldb_strerror(ares-error)));
return ldb_module_done(ac-req, controls,
ares-response, ares-error);
}
@@ -2946,23 +2947,16 @@ static bool replmd_update_is_newer(const struct GUID 
*current_invocation_id,
   const struct GUID *update_invocation_id,
   uint32_t current_version,
   uint32_t update_version,
-  uint32_t current_usn,
-  uint32_t update_usn,
   NTTIME current_change_time,
   NTTIME update_change_time)
 {
-   if (GUID_compare(update_invocation_id, current_invocation_id) == 0) {
-   if (update_usn != current_usn) {
-   return update_usn = current_usn;
-   }
-   }
if (update_version != current_version) {
-   return update_version = current_version;
+   return update_version  current_version;
}
if (update_change_time != current_change_time) {
-   return update_change_time = current_change_time;
+   return update_change_time  current_change_time;
}
-   return GUID_compare(update_invocation_id, current_invocation_id) = 0;
+   return GUID_compare(update_invocation_id, current_invocation_id)  0;
 }
 
 static bool replmd_replPropertyMetaData1_is_newer(struct replPropertyMetaData1 
*cur_m,
@@ -2972,8 +2966,6 @@ static bool replmd_replPropertyMetaData1_is_newer(struct 
replPropertyMetaData1 *
  new_m-originating_invocation_id,
  cur_m-version,
  new_m-version,
- cur_m-originating_usn,
- new_m-originating_usn,
  cur_m-originating_change_time,
  new_m-originating_change_time);
 }
@@ -4004,8 +3996,6 @@ linked_attributes[0]:

la-meta_data.originating_invocation_id,
version,
la-meta_data.version,
-   originating_usn,
-   la-meta_data.originating_usn,
change_time,

la-meta_data.originating_change_time)) {
DEBUG(3,(Discarding older DRS linked attribute update 
to %s on %s from %s\n,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-01-17 Thread Kamen Mazdrashki
The branch, master has been updated
   via  1667ff7 s4-ldb_ldif: Take into account LDB_FLG_SHOW_BINARY
   via  fb0df53 s4-ldb_ldif: Don't check for LDB_FLG_SHOW_BINARY in 
ldb_should_b64_encode
  from  622ef6a s4-provision: Fixed owner/group for hard-coded Sites 
descriptor.

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


- Log -
commit 1667ff79caa91d6bd97df127fb4a3b3d0fa5c3a1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jan 18 00:51:30 2011 +0200

s4-ldb_ldif: Take into account LDB_FLG_SHOW_BINARY

when user requires binary data to be displayed
using samba user-friendly ldif handlers

Found using following test search:
bin/ldbsearch -H st/dc/private/sam.ldb -b CN=Deleted 
Objects,DC=samba,DC=example,DC=com \
 (objectGUID=97b52eac-6d89-434d-b935-1e5f2e086ffc) replPropertyMetaData 
--show-deleted --show-binary

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Jan 18 00:40:01 CET 2011 on sn-devel-104

commit fb0df534f46ccee8d541d5512abbcc9cd8247e53
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jan 18 00:49:17 2011 +0200

s4-ldb_ldif: Don't check for LDB_FLG_SHOW_BINARY in ldb_should_b64_encode

LDB_FLG_SHOW_BINARY is data representation flag and should
not modify behavior of data checking functions.

This lead to a bug in lib/ldb/ldb_tdb/ldb_index.c as ltdb_index_key()
function relies on ldb_should_b64_encode function to determine
how to process index keys.

Found using following test search:
bin/ldbsearch -H st/dc/private/sam.ldb -b CN=Deleted 
Objects,DC=samba,DC=example,DC=com \
 (objectGUID=97b52eac-6d89-434d-b935-1e5f2e086ffc) replPropertyMetaData 
--show-deleted --show-binary

---

Summary of changes:
 source4/lib/ldb/common/ldb_ldif.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb_ldif.c 
b/source4/lib/ldb/common/ldb_ldif.c
index 2628d4d..f837012 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -190,10 +190,6 @@ int ldb_should_b64_encode(struct ldb_context *ldb, const 
struct ldb_val *val)
unsigned int i;
uint8_t *p = val-data;
 
-   if (ldb-flags  LDB_FLG_SHOW_BINARY) {
-   return 0;
-   }
-
if (val-length == 0) {
return 0;
}
@@ -333,11 +329,14 @@ int ldb_ldif_write(struct ldb_context *ldb,
 
for (j=0;jmsg-elements[i].num_values;j++) {
struct ldb_val v;
+   bool use_b64_encode;
ret = a-syntax-ldif_write_fn(ldb, mem_ctx, 
msg-elements[i].values[j], v);
if (ret != LDB_SUCCESS) {
v = msg-elements[i].values[j];
}
-   if (ret != LDB_SUCCESS || ldb_should_b64_encode(ldb, 
v)) {
+   use_b64_encode = !(ldb-flags  LDB_FLG_SHOW_BINARY)
+ldb_should_b64_encode(ldb, v);
+   if (ret != LDB_SUCCESS || use_b64_encode) {
ret = fprintf_fn(private_data, %s:: , 
 msg-elements[i].name);
CHECK_RET;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  33a57db s4-pydsdb: Use local memory context in 
py_dsdb_get_oid_from_attid()
  from  e1d3de3 dnspython: Merge in new upstream.

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


- Log -
commit 33a57db3a542c364eb82499e5765a2caef00af33
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Dec 20 11:39:26 2010 +0200

s4-pydsdb: Use local memory context in py_dsdb_get_oid_from_attid()

This version reverts changes from commit 
b974966cc2b4d0b5b0d83206070b5f7c5c6495d1
and is what Matthieu Patou had commited in 
d784ecec555a3d9737e6f4b3894f27904d2b833c
with added reference to the schema cache.

I think referencing schema here is the right thing to be done
as thus we garantee that schema cache will stay in memory
for the time our function is executed

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Dec 20 12:01:53 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/pydsdb.c |   20 
 1 files changed, 16 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index af03504..1a51b86 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -249,25 +249,37 @@ static PyObject *py_dsdb_get_oid_from_attid(PyObject 
*self, PyObject *args)
const char *oid;
PyObject *ret;
WERROR status;
+   TALLOC_CTX *mem_ctx;
 
if (!PyArg_ParseTuple(args, Oi, py_ldb, attid))
return NULL;
 
PyErr_LDB_OR_RAISE(py_ldb, ldb);
 
-   schema = dsdb_get_schema(ldb, NULL);
+   mem_ctx = talloc_new(NULL);
+   if (!mem_ctx) {
+   PyErr_NoMemory();
+   return NULL;
+   }
 
+   schema = dsdb_get_schema(ldb, mem_ctx);
if (!schema) {
PyErr_SetString(PyExc_RuntimeError, Failed to find a schema 
from ldb \n);
+   talloc_free(mem_ctx);
return NULL;
}

status = dsdb_schema_pfm_oid_from_attid(schema-prefixmap, attid,
-   NULL, oid);
-   PyErr_WERROR_IS_ERR_RAISE(status);
+   mem_ctx, oid);
+   if (!W_ERROR_IS_OK(status)) {
+   PyErr_SetWERROR(status);
+   talloc_free(mem_ctx);
+   return NULL;
+   }
 
ret = PyString_FromString(oid);
-   talloc_free(discard_const_p(char, oid));
+
+   talloc_free(mem_ctx);
 
return ret;
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-17 Thread Kamen Mazdrashki
The branch, master has been updated
   via  839fe07 s4-drepl: Reference current Schema cache into 
working_schema context
   via  b4476d5 s4-drepl: Fix log message to be shown on its own line
  from  16d6da8 Move checks inside file_set_sparse() to allow it to be 
called from anywhere.

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


- Log -
commit 839fe073594c68d1317828ab4087fd52dc801ad2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 17 22:26:03 2010 +0200

s4-drepl: Reference current Schema cache into working_schema context

working_schema is a shallow copy of current schema and thus
depends on part of it. So we want it to be around as long as
working_schema is used.

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Fri Dec 17 23:34:29 CET 2010 on sn-devel-104

commit b4476d5f7d434de2936346bedcac932f5294eeb0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 17 22:12:30 2010 +0200

s4-drepl: Fix log message to be shown on its own line

---

Summary of changes:
 source4/dsdb/repl/drepl_out_helpers.c  |2 +-
 source4/dsdb/repl/replicated_objects.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_out_helpers.c 
b/source4/dsdb/repl/drepl_out_helpers.c
index 6bb2516..c46134e 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -602,7 +602,7 @@ static void 
dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req
   drsuapi-gensec_skey,
   state, working_schema);
if (!W_ERROR_IS_OK(status)) {
-   DEBUG(0,(Failed to create working schema: %s,
+   DEBUG(0,(Failed to create working schema: %s\n,
 win_errstr(status)));
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index f3b6356..d01d3c1 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -476,7 +476,7 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context 
*ldb,
 */
if (working_schema) {
/* store current schema so we can fall back in case of failure 
*/
-   cur_schema = dsdb_get_schema(ldb, objects);
+   cur_schema = dsdb_get_schema(ldb, working_schema);
 
ret = dsdb_reference_schema(ldb, working_schema, false);
if (ret != LDB_SUCCESS) {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-17 Thread Kamen Mazdrashki
The branch, master has been updated
   via  7157221 s4-drepl: During Schema replication, we need to save 
updated prefixMap if everything is OK
   via  5bc0848 s4-dsdb_schema: Copy info needed for Schema refresh in 
dsdb_schema_copy_shallow
   via  214b129 s4-devel/pfm_verify: Extend the tool to verify schemaInfo 
attribute value
   via  bd6f9ef s4-drepl: Make refreshed schema a global one
  from  09a2f14 pyrpc: Add prototype for init function.

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


- Log -
commit 7157221da5bc6787b08ab26c9e83c08208b41d8a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Dec 18 05:30:08 2010 +0200

s4-drepl: During Schema replication, we need to save updated prefixMap if 
everything is OK

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sat Dec 18 05:53:48 CET 2010 on sn-devel-104

commit 5bc0848fc73f96879fdb5d398272ead7fee39157
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Dec 18 05:29:20 2010 +0200

s4-dsdb_schema: Copy info needed for Schema refresh in 
dsdb_schema_copy_shallow

Just 'refresh_fn' and 'loaded_from_module' are copied.
I left 'reload_seq_number' set to 0 intentionally, so that
this Schema cache will looks like a very old one to ,refresh_fn'.
This way, if this shallow copy is attached to LDB, it will be
refreshed as soon as possible by 'refresh_fn'.

commit 214b12973d71fc9c2b6221fe9f41d1e725e96612
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Dec 18 05:21:09 2010 +0200

s4-devel/pfm_verify: Extend the tool to verify schemaInfo attribute value

commit bd6f9efc1e993d41d14da3ac56307ed424745153
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Dec 16 22:31:28 2010 +0200

s4-drepl: Make refreshed schema a global one

We need to do this as dsdb_reference_schema() function
clears use_global_schema ldb flag.

Basically what is going to happen is that after dsdb_reference_schema()
global_schema pointer will continue to point at old schema cache,
while dsdb_schema for LDB will point at the working_schema.

After replication is done, we reset dsdb_schema for the ldb
with an updated Schema cache, but this leaves global_schema pointer
with its old value, which is not up to date.
So we need to call dsdb_make_schema_global() again so that global_schema
points to a valid Schema cache.

---

Summary of changes:
 source4/dsdb/repl/replicated_objects.c |   25 
 source4/dsdb/schema/schema_init.c  |4 ++
 source4/scripting/devel/pfm_verify.py  |   49 
 3 files changed, 72 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index d01d3c1..0def815 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -445,6 +445,7 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context 
*ldb,
  struct dsdb_extended_replicated_objects 
*objects,
  uint64_t *notify_uSN)
 {
+   WERROR werr;
struct ldb_result *ext_res;
struct dsdb_schema *cur_schema = NULL;
int ret;
@@ -493,6 +494,7 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context 
*ldb,
/* restore previous schema */
if (cur_schema ) {
dsdb_reference_schema(ldb, cur_schema, false);
+   dsdb_make_schema_global(ldb, cur_schema);
}
 
DEBUG(0,(Failed to apply records: %s: %s\n,
@@ -502,11 +504,29 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context 
*ldb,
}
talloc_free(ext_res);
 
+   /* Save our updated prefixMap */
+   if (working_schema) {
+   werr = dsdb_write_prefixes_from_schema_to_ldb(working_schema,
+ ldb,
+ working_schema);
+   if (!W_ERROR_IS_OK(werr)) {
+   /* restore previous schema */
+   if (cur_schema ) {
+   dsdb_reference_schema(ldb, cur_schema, false);
+   dsdb_make_schema_global(ldb, cur_schema);
+   }
+   DEBUG(0,(Failed to save updated prefixMap: %s\n,
+win_errstr(werr)));
+   return werr;
+   }
+   }
+
ret = ldb_transaction_prepare_commit(ldb);
if (ret != LDB_SUCCESS) {
/* restore previous schema */
if (cur_schema ) {
dsdb_reference_schema(ldb, cur_schema, false

[SCM] Samba Shared Repository - branch master updated

2010-12-15 Thread Kamen Mazdrashki
The branch, master has been updated
   via  2e259de s4-dsdb/tests/python: Explicitly pass comamnd line 
LoadParm() instance to system_session()
  from  4a1ce3b s4-dns: implemented parsing and storing of DNS records from 
bind

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


- Log -
commit 2e259de0849becd73a76841186c303984feff083
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 15 15:16:54 2010 +0200

s4-dsdb/tests/python: Explicitly pass comamnd line LoadParm() instance to 
system_session()

Otherwise system_session() creates a LoadParm() instance
which resets certain global parameters to their defaults
from smb.conf (log level for instance)

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Dec 15 15:10:47 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/tests/python/acl.py|2 +-
 source4/dsdb/tests/python/deletetest.py |2 +-
 source4/dsdb/tests/python/ldap.py   |4 ++--
 source4/dsdb/tests/python/ldap_schema.py|2 +-
 source4/dsdb/tests/python/ldap_syntaxes.py  |2 +-
 source4/dsdb/tests/python/passwords.py  |2 +-
 source4/dsdb/tests/python/sam.py|2 +-
 source4/dsdb/tests/python/sec_descriptor.py |2 +-
 source4/dsdb/tests/python/urgent_replication.py |2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py
index d336fa9..85018b0 100755
--- a/source4/dsdb/tests/python/acl.py
+++ b/source4/dsdb/tests/python/acl.py
@@ -1518,7 +1518,7 @@ class AclExtendedTests(AclTests):
 
 if not :// in host:
 host = ldap://%s; % host
-ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(lp), lp=lp)
 
 runner = SubunitTestRunner()
 rc = 0
diff --git a/source4/dsdb/tests/python/deletetest.py 
b/source4/dsdb/tests/python/deletetest.py
index 4ed125d..9125795 100755
--- a/source4/dsdb/tests/python/deletetest.py
+++ b/source4/dsdb/tests/python/deletetest.py
@@ -379,7 +379,7 @@ if not :// in host:
 else:
 host = ldap://%s; % host
 
-ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(lp), lp=lp)
 
 runner = SubunitTestRunner()
 rc = 0
diff --git a/source4/dsdb/tests/python/ldap.py 
b/source4/dsdb/tests/python/ldap.py
index f23de8d..810289e 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -2647,10 +2647,10 @@ if not :// in host:
 else:
 host = ldap://%s; % host
 
-ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
+ldb = SamDB(host, credentials=creds, session_info=system_session(lp), lp=lp)
 if not tdb:// in host:
 gc_ldb = Ldb(%s:3268 % host, credentials=creds,
- session_info=system_session(), lp=lp)
+ session_info=system_session(lp), lp=lp)
 else:
 gc_ldb = None
 
diff --git a/source4/dsdb/tests/python/ldap_schema.py 
b/source4/dsdb/tests/python/ldap_schema.py
index 64da563..3dcbb72 100755
--- a/source4/dsdb/tests/python/ldap_schema.py
+++ b/source4/dsdb/tests/python/ldap_schema.py
@@ -567,7 +567,7 @@ if host.startswith(ldap://;):
 # user 'paged_search' module when connecting remotely
 ldb_options = [modules:paged_searches]
 
-ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp, 
options=ldb_options)
+ldb = SamDB(host, credentials=creds, session_info=system_session(lp), lp=lp, 
options=ldb_options)
 
 runner = SubunitTestRunner()
 rc = 0
diff --git a/source4/dsdb/tests/python/ldap_syntaxes.py 
b/source4/dsdb/tests/python/ldap_syntaxes.py
index 54198d7..63296c8 100644
--- a/source4/dsdb/tests/python/ldap_syntaxes.py
+++ b/source4/dsdb/tests/python/ldap_syntaxes.py
@@ -376,7 +376,7 @@ name:  + object_name + 
 self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
 pass
 
-ldb = samba.tests.connect_samdb(host, credentials=creds, 
session_info=system_session(), lp=lp)
+ldb = samba.tests.connect_samdb(host, credentials=creds, 
session_info=system_session(lp), lp=lp)
 runner = SubunitTestRunner()
 rc = 0
 if not runner.run(unittest.makeSuite(SyntaxTests)).wasSuccessful():
diff --git a/source4/dsdb/tests/python/passwords.py 
b/source4/dsdb/tests/python/passwords.py
index e43298e..28a0776 100755
--- a/source4/dsdb/tests/python/passwords.py
+++ b/source4/dsdb/tests/python/passwords.py
@@ -919,7 +919,7 @@ if not :// in host:
 else:
 host = ldap://%s; % host
 
-ldb = SamDB(url=host, session_info=system_session(), credentials=creds, lp=lp)
+ldb = SamDB(url=host, session_info=system_session(lp), credentials=creds, 
lp=lp)
 
 # Gets

[SCM] Samba Shared Repository - branch master updated

2010-12-14 Thread Kamen Mazdrashki
The branch, master has been updated
   via  3bc1cf9 s4-test/repl_schema: remove unused and commented out code
   via  9c78bdf s4-test/repl_schema: Make sure every object is with unique 
name
   via  dda73b8 s4-dsdb_schema: Handle remote ATTIDs based on msDs-IntId 
value
   via  52f7e38 s4-schema_syntax: Log error message when 
_dsdb_syntax_OID_oid_drsuapi_to_ldb() fails
   via  0a9f780 s4-drepl: We won't need a working schema for empty replicas 
sent.
   via  2b74838 s4-dsdb_schema: We need base_dn in Schema's shallow copy too
   via  3a8fa09 s4-schema_syntax: We should use make_ATTID function when 
converting remote-ATTID to local one
   via  18744a9 s4-drepl: User working schema for commiting objects when 
replicating Schema NC
   via  c94e5d4 s4-repl: Allow dsdb_replicated_objects_commit() to use 
different schema while committing objects
   via  afee8a2 s4-schema_syntax: Use remote prefixMap to map remote ATTID 
to local one
   via  efcc3c0 s4-test/repl_schema: use 'top' as default base class for 
our test classSchema objects
   via  1379075 s4-test/repl_schema: New test to test a classSchema with 
custom attribute
   via  79e1a71 s4-dsdb_schema: Seize using global_schema when referencing 
new schema for an LDB
  from  4bcedda s3-waf: libwbclient does not depend on talloc anymore.

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


- Log -
commit 3bc1cf94e3a0febe8d3d53229aa49c3d8eb8c1b6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 15 00:24:23 2010 +0200

s4-test/repl_schema: remove unused and commented out code

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Dec 15 01:37:10 CET 2010 on sn-devel-104

commit 9c78bdfd478ab6229f48de1aa907818151840da4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Dec 13 20:15:26 2010 +0200

s4-test/repl_schema: Make sure every object is with unique name

This way, test writer don't have to be careful to choose
unique objects suffix

commit dda73b85e6e7102a2de6a020f1271140bf8f3aaf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Dec 11 01:59:05 2010 +0200

s4-dsdb_schema: Handle remote ATTIDs based on msDs-IntId value

If we get such an msDs-IntId value, then we should just use it,
there is no mapping available for such values

commit 52f7e38d6a350cfd645371c82a8c2b189cf7531f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 04:22:58 2010 +0200

s4-schema_syntax: Log error message when 
_dsdb_syntax_OID_oid_drsuapi_to_ldb() fails

I haven't found a way to test this function during replication so far,
but when I do, it will be useful to notice this error in the log file

commit 0a9f780d26d8d193081915f4f3aff7b7f8335a28
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 04:17:09 2010 +0200

s4-drepl: We won't need a working schema for empty replicas sent.

Without this check, receiving empty replica leads to a situation
where we left with a working_schema attached to the ldb.

The problem here is that working_schema is not fully functional
schema cache and keeping it attached to the ldb may lead
to modules failing to accomplish their jobs

commit 2b74838c14f4ee77236634c7b10b8ac26eff40fa
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 04:08:58 2010 +0200

s4-dsdb_schema: We need base_dn in Schema's shallow copy too

commit 3a8fa09c4f1691346dadf975bc456e696b09ef65
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 04:03:00 2010 +0200

s4-schema_syntax: We should use make_ATTID function when converting 
remote-ATTID to local one

We may have no prefix for the remote ATTID (remote OID strictly speaking)
So this is the place for us to update our local prefixMap
adding a prefix for the numeric OID we've recived

commit 18744a95312666cad2c646c2bb550da4277968c1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 03:55:24 2010 +0200

s4-drepl: User working schema for commiting objects when replicating Schema 
NC

commit c94e5d44385d23172a8776e4c12d71e30c9c6616
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Dec 10 02:55:30 2010 +0200

s4-repl: Allow dsdb_replicated_objects_commit() to use different schema 
while committing objects

working_schema is to be used while committing a Schema replica.

When we replicate Schema, then we most probably won't be
able to convert all replicated objects using the current
Schema cache (as we don't know anything about those new objects).

Thus, during Schema replication, we make a temporary
working_schema that contains both our current Schema +
all objects we get on the wire.
When we commit those new objects, we should use our working_schema
(by setting it to the ldb), and after all changes are commited,
we can refresh the schema

[SCM] Samba Shared Repository - branch master updated

2010-12-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  af5649d s4-repl_meta_data: Print function name when we can't find 
attribute in Schema cache
   via  05e77f5 s4-linked_attributes: Give more info where an error occured
   via  be0a2a6 s4-repl_meta_data: Remove duplicated check
   via  be27a9d s4-schema_load: Strip a pointless check
  from  654e010 lib/util:tests/time.c - test_timestring - fix it on 
Solaris

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


- Log -
commit af5649d5f87e0c8b85eb950a253a4e65cca8ccd0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Dec 6 00:17:43 2010 +0200

s4-repl_meta_data: Print function name when we can't find attribute in 
Schema cache

Same error message is printed by linked_attributes.c module
and it was really hard to tell where the error occurred

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Dec  6 00:05:59 CET 2010 on sn-devel-104

commit 05e77f52d701b5f8b87de7c89eda6f4076722e24
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Dec 5 17:19:44 2010 +0200

s4-linked_attributes: Give more info where an error occured

We have exact same error messages at different locations
and it is little bit hard to tell where the error came from
from the log.

commit be0a2a68914aa9cecb9d32361750b2f50af6cc06
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Dec 5 17:11:28 2010 +0200

s4-repl_meta_data: Remove duplicated check

commit be27a9dc42cb950443a77e44fdfbd4e5019893aa
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Dec 4 23:03:21 2010 +0200

s4-schema_load: Strip a pointless check

If *schema is NULL, then dsdb_schema_from_ldb_results()
call should have failed

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/linked_attributes.c |   11 ---
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c|5 ++---
 source4/dsdb/samdb/ldb_modules/schema_load.c   |4 +---
 3 files changed, 11 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c 
b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 6045525..ebbc7c6 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -223,7 +223,9 @@ static int linked_attributes_add(struct ldb_module *module, 
struct ldb_request *
= dsdb_attribute_by_lDAPDisplayName(ac-schema, 
el-name);
if (!schema_attr) {
ldb_asprintf_errstring(ldb,
-  attribute %s is not a valid 
attribute in schema, el-name);
+  %s: attribute %s is not a valid 
attribute in schema,
+  __FUNCTION__,
+  el-name);
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
/* We have a valid attribute, now find out if it is a forward 
link */
@@ -325,7 +327,8 @@ static int la_mod_search_callback(struct ldb_request *req, 
struct ldb_reply *are
schema_attr = 
dsdb_attribute_by_lDAPDisplayName(ac-schema, rc-el[i].name);
if (!schema_attr) {
ldb_asprintf_errstring(ldb,
-   attribute %s is not a valid attribute 
in schema,
+   %s: attribute %s is not a valid 
attribute in schema,
+   __FUNCTION__,
rc-el[i].name);
talloc_free(ares);
return ldb_module_done(ac-req, NULL, NULL,
@@ -454,7 +457,9 @@ static int linked_attributes_modify(struct ldb_module 
*module, struct ldb_reques
= dsdb_attribute_by_lDAPDisplayName(ac-schema, 
el-name);
if (!schema_attr) {
ldb_asprintf_errstring(ldb,
-  attribute %s is not a valid 
attribute in schema, el-name);
+  %s: attribute %s is not a valid 
attribute in schema,
+  __FUNCTION__,
+  el-name);
return LDB_ERR_OBJECT_CLASS_VIOLATION;
}
/* We have a valid attribute, now find out if it is a forward 
link
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 3a27e7b..2bdb7af 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2081,7 +2081,8 @@ static

[SCM] Samba Shared Repository - branch master updated

2010-12-02 Thread Kamen Mazdrashki
The branch, master has been updated
   via  03b078c s4-dsdb/syntax: Map remote ATTIDs for Class OID syntax
   via  c1fef7e s4-test/repl_schema: Test class inheritance through 
subClassOf
   via  5bc1185 s4-dsdb_syntax: Be a little bit more chatty when we can't 
an ATTID in our cache
   via  1b70700 s4-test/fsmo: Remove unused imports
   via  ad1ea5e s4-test/delete_object: Remove unused imports
   via  28f4711 s4-test/repl_schema: Make ERR_NO_SUCH_OBJECT visible to us
   via  ebdbf9b s4-test/repl_schema: Test classSchema and attributeSchema 
replication in separate tests
   via  d8e5624 s4-dsdb/descriptor: comment typo
  from  7a5e47b s4:auth/sam.c-authsam_expand_nested_groups - don't fail 
if we've memberships on non-SAM objects

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


- Log -
commit 03b078c5677c94468386323e5910137d422360ef
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Dec 2 02:57:06 2010 +0200

s4-dsdb/syntax: Map remote ATTIDs for Class OID syntax

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Thu Dec  2 18:47:59 CET 2010 on sn-devel-104

commit c1fef7efc7bfdd03049511cbfad8395439660912
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Dec 2 01:01:20 2010 +0200

s4-test/repl_schema: Test class inheritance through subClassOf

commit 5bc11855f6d1b9ae4a7a653028f0614e797dd974
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Dec 2 00:32:10 2010 +0200

s4-dsdb_syntax: Be a little bit more chatty when we can't an ATTID in our 
cache

commit 1b7070039f9e88b8ab0683cc9d1650c2feda7484
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Dec 2 00:30:46 2010 +0200

s4-test/fsmo: Remove unused imports

commit ad1ea5e1421763061d98f5a4fe07888f69a597bb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 1 21:13:54 2010 +0200

s4-test/delete_object: Remove unused imports

commit 28f47112d73502204b3571cbdbe32f24e128309e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 1 21:01:47 2010 +0200

s4-test/repl_schema: Make ERR_NO_SUCH_OBJECT visible to us

We've lost this import somehow, now it is back in :)

commit ebdbf9bd900f710459804410a4cb2e4504384e42
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 1 20:22:06 2010 +0200

s4-test/repl_schema: Test classSchema and attributeSchema replication in 
separate tests

commit d8e56245c064011902910dcef8f2e18eebaf0810
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 1 20:16:00 2010 +0200

s4-dsdb/descriptor: comment typo

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/descriptor.c |2 +-
 source4/dsdb/schema/schema_syntax.c |   10 +-
 source4/torture/drs/python/delete_object.py |7 ++--
 source4/torture/drs/python/fsmo.py  |2 -
 source4/torture/drs/python/repl_schema.py   |   44 +++
 5 files changed, 58 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c 
b/source4/dsdb/samdb/ldb_modules/descriptor.c
index baf00ad..0ea91ba 100644
--- a/source4/dsdb/samdb/ldb_modules/descriptor.c
+++ b/source4/dsdb/samdb/ldb_modules/descriptor.c
@@ -601,7 +601,7 @@ static int descriptor_do_mod(struct descriptor_context *ac)
if (ac-sd_val != NULL) {
ac-sd_element-values[0] = *sd;
} else if (sd_control2 != NULL) {
-   /* In this branche we really do force the recalculation
+   /* In this branch we really do force the recalculation
 * of the SD */
ldb_msg_remove_attr(ac-msg, nTSecurityDescriptor);
 
diff --git a/source4/dsdb/schema/schema_syntax.c 
b/source4/dsdb/schema/schema_syntax.c
index ab37f66..2f8f9a5 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -984,8 +984,15 @@ static WERROR _dsdb_syntax_OID_obj_drsuapi_to_ldb(const 
struct dsdb_syntax_ctx *
 
v = IVAL(in-value_ctr.values[i].blob-data, 0);
 
+   /* convert remote ATTID to local ATTID */
+   if (!dsdb_syntax_attid_from_remote_attid(ctx, mem_ctx, v, v)) {
+   DEBUG(1,(__location__ : Failed to map remote ATTID to 
local ATTID!\n));
+   return WERR_FOOBAR;
+   }
+
c = dsdb_class_by_governsID_id(ctx-schema, v);
if (!c) {
+   DEBUG(1,(__location__ : Unknown governsID 0x%08X\n, 
v));
return WERR_FOOBAR;
}
 
@@ -1032,12 +1039,13 @@ static WERROR 
_dsdb_syntax_OID_attr_drsuapi_to_ldb(const struct dsdb_syntax_ctx
 
/* convert remote ATTID to local ATTID */
if (!dsdb_syntax_attid_from_remote_attid(ctx, mem_ctx

[SCM] Samba Shared Repository - branch master updated

2010-12-01 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4cd16dd s4-ranged_result.c: Fix memory context for ranged 
attributes handling
  from  6e27ff3 s3 docs: Reword posix locking text to answer a common 
question

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


- Log -
commit 4cd16dde148662700311501e62ba3ee9bf80765a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Dec 1 11:04:19 2010 +0200

s4-ranged_result.c: Fix memory context for ranged attributes handling

Pair-Programmed-With: Zahari Zahariev zahari.zahar...@postpath.com

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Dec  1 11:45:48 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/ranged_results.c |   19 +++
 1 files changed, 15 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c 
b/source4/dsdb/samdb/ldb_modules/ranged_results.c
index b3e79d0..f8e8db6 100644
--- a/source4/dsdb/samdb/ldb_modules/ranged_results.c
+++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c
@@ -59,6 +59,7 @@ static int rr_search_callback(struct ldb_request *req, struct 
ldb_reply *ares)
struct ldb_context *ldb;
struct rr_context *ac;
unsigned int i, j;
+   TALLOC_CTX *temp_ctx;
 
ac = talloc_get_type(req-context, struct rr_context);
ldb = ldb_module_get_ctx(ac-module);
@@ -83,6 +84,13 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)
 
/* LDB_REPLY_ENTRY */
 
+   temp_ctx = talloc_new(ac-req);
+   if (!temp_ctx) {
+   ldb_module_oom(ac-module);
+   return ldb_module_done(ac-req, NULL, NULL,
+  LDB_ERR_OPERATIONS_ERROR);
+   }
+
/* Find those that are range requests from the attribute list */
for (i = 0; ac-req-op.search.attrs[i]; i++) {
char *p, *new_attr;
@@ -90,6 +98,7 @@ static int rr_search_callback(struct ldb_request *req, struct 
ldb_reply *ares)
unsigned int start, end, orig_num_values;
struct ldb_message_element *el;
struct ldb_val *orig_values;
+
p = strchr(ac-req-op.search.attrs[i], ';');
if (!p) {
continue;
@@ -104,7 +113,7 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)
continue;
}
}
-   new_attr = talloc_strndup(ac-req,
+   new_attr = talloc_strndup(temp_ctx,
  ac-req-op.search.attrs[i],
  (size_t)(p - 
ac-req-op.search.attrs[i]));
 
@@ -124,7 +133,7 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)
end_str = *;
end = el-num_values - 1;
} else {
-   end_str = talloc_asprintf(el, %u, end);
+   end_str = talloc_asprintf(temp_ctx, %u, end);
if (!end_str) {
ldb_oom(ldb);
return ldb_module_done(ac-req, NULL, NULL,
@@ -148,7 +157,7 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)

el-num_values = 0;

-   el-values = talloc_array(el, struct ldb_val, (end - 
start) + 1);
+   el-values = talloc_array(ares-message-elements, 
struct ldb_val, (end - start) + 1);
if (!el-values) {
ldb_oom(ldb);
return ldb_module_done(ac-req, NULL, NULL,
@@ -159,7 +168,7 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)
el-num_values++;
}
}
-   el-name = talloc_asprintf(el, %s;range=%u-%s, el-name, 
start, end_str);
+   el-name = talloc_asprintf(el-values, %s;range=%u-%s, 
el-name, start, end_str);
if (!el-name) {
ldb_oom(ldb);
return ldb_module_done(ac-req, NULL, NULL,
@@ -167,6 +176,8 @@ static int rr_search_callback(struct ldb_request *req, 
struct ldb_reply *ares)
}
}
 
+   talloc_free(temp_ctx);
+
return ldb_module_send_entry(ac-req, ares-message, ares-controls);
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-01 Thread Kamen Mazdrashki
The branch, master has been updated
   via  6803a72 s4-test/schema: Extend the test to replicate a Class with 
Attribute with mayContain relation
   via  23b4408 s4-dsdb/syntax: Map remote ATTIDs for Attribute OID syntax
   via  29f9249 s4-dsdb/syntax: Implement Remote-ATTID to Local-ATTID 
mapping function
   via  cf8ffc3 s4-dreplsrv: Use working_schema when replicating from 
Schema NC
   via  a42e267 s4-dsdb/schema: Implement multi-pass working schema 
creation function
   via  fcc26c5 s4-dsdb/schema: Add Schema shallow copy function
   via  16bd9dd s4-dsdb/prefixMap: Add prefixMap shallow copy function
   via  4041791 s4-repl: Let dsdb_replicated_objects_convert() to accept 
schema from caller
  from  4cd16dd s4-ranged_result.c: Fix memory context for ranged 
attributes handling

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


- Log -
commit 6803a72d1595db6c25ff2a42f7ed5dd7a8be574f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 30 12:17:03 2010 +0200

s4-test/schema: Extend the test to replicate a Class with Attribute with 
mayContain relation

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Dec  1 13:30:45 CET 2010 on sn-devel-104

commit 23b4408a6210363a11c4df12b6b737f94026d20d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 30 12:15:53 2010 +0200

s4-dsdb/syntax: Map remote ATTIDs for Attribute OID syntax

commit 29f9249bd64a1873149e3857483c64b897deac13
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 30 12:13:16 2010 +0200

s4-dsdb/syntax: Implement Remote-ATTID to Local-ATTID mapping function

commit cf8ffc37b42b9b880ba1a0058bd5d0ab984f82b6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 30 01:38:16 2010 +0200

s4-dreplsrv: Use working_schema when replicating from Schema NC

Schema is changed and it is quite possible we won't be able
to decode replicated objects using current Schema cache we have.

Thus, when replicating Schema, we will make a temporary Schema
cache, working_schema, so that we can fully decode objects
we recieve.

commit a42e267105544e63ae28a3c40d96c0ff36b2d070
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 29 14:00:42 2010 +0200

s4-dsdb/schema: Implement multi-pass working schema creation function

It is heavily based on implementation in libnet_vampire_cb_apply_schema()
function, except that it actually creates a new copy of the supplied
initial_schema + resolving all incoming objects and add them to
supplied initial_schema.

We are going to need this 'working_schema' later so we are able
to fully resolve all objects we receive on wire during DRS replication.

Working schema created is to be used only as an index to search in.
It is not supposed to be set to an ldb_context as it doesn't
contain all information for classSchema and attributeSchema objects.

commit fcc26c5d59b1f7519a9a813fd70d1139c9f6976c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 29 13:28:33 2010 +0200

s4-dsdb/schema: Add Schema shallow copy function

commit 16bd9dd7aef2e92771cffc7be55d4f35687c0e64
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 29 13:28:00 2010 +0200

s4-dsdb/prefixMap: Add prefixMap shallow copy function

commit 4041791d01b10b250dab5b356f0477fb8a40907e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Nov 26 02:38:39 2010 +0200

s4-repl: Let dsdb_replicated_objects_convert() to accept schema from caller

This allows us to use schema that is different than the one
set to 'ldb' to decode objects.

---

Summary of changes:
 source4/dsdb/repl/drepl_out_helpers.c |   30 ++
 source4/dsdb/repl/replicated_objects.c|  145 +++--
 source4/dsdb/schema/schema_init.c |   57 +++
 source4/dsdb/schema/schema_prefixmap.c|   17 
 source4/dsdb/schema/schema_syntax.c   |   41 
 source4/libnet/libnet_vampire.c   |9 ++
 source4/torture/drs/python/repl_schema.py |   12 ++-
 source4/torture/drs/rpc/dssync.c  |1 +
 8 files changed, 303 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_out_helpers.c 
b/source4/dsdb/repl/drepl_out_helpers.c
index 2cbf008..f02fae9 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -541,6 +541,8 @@ static void 
dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req
struct dreplsrv_service *service = state-op-service;
struct dreplsrv_partition *partition = state-op-source_dsa-partition;
struct dreplsrv_drsuapi_connection *drsuapi = 
state-op-source_dsa-conn-drsuapi;
+   struct dsdb_schema *schema;
+   struct dsdb_schema *working_schema

[SCM] Samba Shared Repository - branch master updated

2010-11-27 Thread Kamen Mazdrashki
The branch, master has been updated
   via  092e923 s4-tests/bind.py: Use samba.tests.connect_samdb() instead 
of directly using SamDB class
  from  60bf020 s4-samba-tool: support help, and show description of 
commands

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


- Log -
commit 092e923e2bfdbc78fa6a551222d778bc1b936a6f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 28 03:05:05 2010 +0200

s4-tests/bind.py: Use samba.tests.connect_samdb() instead of directly using 
SamDB class

connect_samdb() functino will correctly handle things like:
- session_info param - it will create system_session() using supplied
  LoadParm parameter and thus avoiding creation of multiple LoadParm
  instances (LoadParm() will mask certain command line supplied options)
- host url will be prefixed with ldap:// automatically

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun Nov 28 03:00:41 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/auth/credentials/tests/bind.py |   17 ++---
 1 files changed, 10 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/credentials/tests/bind.py 
b/source4/auth/credentials/tests/bind.py
index 8c93319..a10c919 100755
--- a/source4/auth/credentials/tests/bind.py
+++ b/source4/auth/credentials/tests/bind.py
@@ -106,7 +106,8 @@ unicodePwd::  + 
base64.b64encode(\p...@ssw0rd\.encode('utf-16-le')) + 
 creds_machine.set_bind_dn(self.computer_dn)
 creds_machine.set_password(self.password)
 print BindTest with:  + creds_machine.get_bind_dn()
-ldb_machine = SamDB(host, credentials=creds_machine, 
session_info=system_session(), lp=lp)
+ldb_machine = samba.tests.connect_samdb(host, 
credentials=creds_machine,
+lp=lp, ldap_only=True)
 res = ldb_machine.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
 
 def test_user_account_bind(self):
@@ -122,26 +123,28 @@ unicodePwd::  + 
base64.b64encode(\p...@ssw0rd\.encode('utf-16-le')) + 
 creds_user1.set_bind_dn(self.username + @ + creds.get_realm())
 creds_user1.set_password(self.password)
 print BindTest with:  + creds_user1.get_bind_dn()
-ldb_user1 = SamDB(host, credentials=creds_user1, 
session_info=system_session(), lp=lp)
+ldb_user1 = samba.tests.connect_samdb(host, credentials=creds_user1,
+  lp=lp, ldap_only=True)
 res = ldb_user1.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
 
 # do a simple bind and search with the user account in format 
domain\user
 creds_user2.set_bind_dn(creds.get_domain() + \\ + self.username)
 creds_user2.set_password(self.password)
 print BindTest with:  + creds_user2.get_bind_dn()
-ldb_user2 = SamDB(host, credentials=creds_user2, lp=lp)
+ldb_user2 = samba.tests.connect_samdb(host, credentials=creds_user2,
+  lp=lp, ldap_only=True)
 res = ldb_user2.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
 
 # do a simple bind and search with the user account DN
 creds_user3.set_bind_dn(str(user_dn))
 creds_user3.set_password(self.password)
 print BindTest with:  + creds_user3.get_bind_dn()
-ldb_user3 = SamDB(host, credentials=creds_user3, 
session_info=system_session(), lp=lp)
+ldb_user3 = samba.tests.connect_samdb(host, credentials=creds_user3,
+  lp=lp, ldap_only=True)
 res = ldb_user3.search(base=, expression=, scope=SCOPE_BASE, 
attrs=[*])
 
-if not :// in host:
-host = ldap://%s; % host
-ldb = SamDB(host, credentials=creds, session_info=system_session(), lp=lp)
+
+ldb = samba.tests.connect_samdb(host, credentials=creds, lp=lp, ldap_only=True)
 
 runner = SubunitTestRunner()
 rc = 0


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-11-23 Thread Kamen Mazdrashki
The branch, master has been updated
   via  58f6a37 s4-test/repl_schema: Refactor the test a little bit to
   via  1b58074 s4-tests: Make all DRS python tests to start with 
samba4.drs.* prefix
   via  9e24db1 s4-pfm_verify: Explicitly pass LoadParm() instance to 
system_session() function
  from  ff82220 s4-tests: Modified sec_descriptor.py to use samdb.newuser 
instead of custom methods.

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


- Log -
commit 58f6a37f645c8c025923aa38cd9445ae2e0d8d0e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 23 17:15:21 2010 +0200

s4-test/repl_schema: Refactor the test a little bit to

- Cleanup imports
- make sure we have testtools and subunit imported
- use dictionaries instead of LDIFs for schema modification
  so now callers for _make_class can easily add new attributes
  for created class
- simplify a little bit classSchema creation
- test attributeSchema replication

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Nov 23 18:44:46 CET 2010 on sn-devel-104

commit 1b5807455783653ca5dd1ae715f9cef455545407
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Nov 10 06:15:19 2010 +0200

s4-tests: Make all DRS python tests to start with samba4.drs.* prefix

commit 9e24db1f2b8ba0cbef0ac9bda587a754ee2ab254
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 23 17:19:29 2010 +0200

s4-pfm_verify: Explicitly pass LoadParm() instance to system_session() 
function

Otherwise system_session() creates a LoadParm() instance
wich resets certain params to their defaults from smb.conf
(log level for instance)

---

Summary of changes:
 source4/scripting/devel/pfm_verify.py |2 +-
 source4/selftest/tests.py |6 +-
 source4/torture/drs/python/repl_schema.py |   90 +++--
 3 files changed, 63 insertions(+), 35 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/devel/pfm_verify.py 
b/source4/scripting/devel/pfm_verify.py
index 2f7be2b..a7314d9 100755
--- a/source4/scripting/devel/pfm_verify.py
+++ b/source4/scripting/devel/pfm_verify.py
@@ -134,7 +134,7 @@ if __name__ == __main__:
 server = args[0]
 
 samdb = SamDB(url=ldap://%s; % server,
-  session_info=system_session(),
+  session_info=system_session(lp),
   credentials=creds, lp=lp)
 
 drs_pfm = _drs_fetch_pfm(server, samdb, creds, lp)
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 1d1d517..bd743d2 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -512,9 +512,9 @@ plantestsuite(samba4.blackbox.spn.py(dc:local), 
dc:local, [PYTHON=%s % pyt
 plantestsuite(samba4.ldap.bind(dc), dc, [python, 
os.path.join(samba4srcdir, auth/credentials/tests/bind.py), '$SERVER', 
'-U$USERNAME%$PASSWORD'])
 
 # DRS python tests
-plantestsuite(samba4.drs_delete_object.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'delete_object', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
-plantestsuite(samba4.drs_fsmo.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'fsmo', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
-plantestsuite(samba4.drs_repl_schema.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'repl_schema', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+plantestsuite(samba4.drs.delete_object.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'delete_object', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+plantestsuite(samba4.drs.fsmo.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'fsmo', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+plantestsuite(samba4.drs.repl_schema.python(vampire_dc), vampire_dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'torture/drs/python'), 'DC1=$DC_SERVER', 'DC2=$VAMPIRE_DC_SERVER', subunitrun, 
'repl_schema', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 
 # This makes sure we test the rid allocation code
 t = RPC-SAMR-LARGE-DC
diff --git a/source4/torture/drs/python/repl_schema.py 
b/source4/torture/drs/python/repl_schema.py
index 4016ed2..16f00ac 100644
--- a/source4/torture/drs/python/repl_schema.py
+++ b/source4/torture/drs/python/repl_schema.py
@@ -33,11 +33,14 @@ import random

[SCM] Samba Shared Repository - branch master updated

2010-11-22 Thread Kamen Mazdrashki
The branch, master has been updated
   via  b85dfce s4-test/repl_schema: Remote global ldb connections
   via  9c2bd08 s4-tests: Wrap connect_samdb() into a connect_samdb_ex() 
helper
   via  bc6ba4b s4-samba.tests: Explicitly pass LoadParm() instance to 
system_session() function
   via  6965d1e s4-pfm_verify: fix usage string
  from  f01360e s3-net: use dns_errstr() when dns commands fail.

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


- Log -
commit b85dfce74511dac7e623076ef13bf6d3e9f71a20
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 22 15:06:36 2010 +0200

s4-test/repl_schema: Remote global ldb connections

Although unlikely, Jelmer pointed out that using persistent
SamDB connections between test may interfere with tests
behaviour (and is not xUnit compliant anyway)

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Nov 22 15:24:03 CET 2010 on sn-devel-104

commit 9c2bd08498fe6f2caebd42d8a165d282913825bb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 22 15:03:59 2010 +0200

s4-tests: Wrap connect_samdb() into a connect_samdb_ex() helper

Thus caller will be able to connect to SamDB and fetch
RootDSE info in a single step

commit bc6ba4b04cf063fa01199c2a605b48fa9ecd2055
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 22 00:28:45 2010 +0200

s4-samba.tests: Explicitly pass LoadParm() instance to system_session() 
function

Otherwise system_session() creates a LoadParm() instance
wich resets certain params to their defaults from smb.conf
(log level for instance)

commit 6965d1eba55913e17910cd0a49217be20046724d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 21 22:38:14 2010 +0200

s4-pfm_verify: fix usage string

Thanks Tridge!

---

Summary of changes:
 source4/scripting/devel/pfm_verify.py|2 +-
 source4/scripting/python/samba/tests/__init__.py |   20 +-
 source4/torture/drs/python/repl_schema.py|   32 +-
 3 files changed, 27 insertions(+), 27 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/devel/pfm_verify.py 
b/source4/scripting/devel/pfm_verify.py
index dbd3d88..2f7be2b 100755
--- a/source4/scripting/devel/pfm_verify.py
+++ b/source4/scripting/devel/pfm_verify.py
@@ -110,7 +110,7 @@ def _pfm_verify(drs_pfm, ldb_pfm):
 ### main code ###
 if __name__ == __main__:
 # command line parsing
-parser = OptionParser(getncchanges [options] server)
+parser = OptionParser(pfm_verify.py [options] server)
 sambaopts = options.SambaOptions(parser)
 parser.add_option_group(sambaopts)
 credopts = options.CredentialsOptionsDouble(parser)
diff --git a/source4/scripting/python/samba/tests/__init__.py 
b/source4/scripting/python/samba/tests/__init__.py
index 7a5c2aa..0519fd8 100644
--- a/source4/scripting/python/samba/tests/__init__.py
+++ b/source4/scripting/python/samba/tests/__init__.py
@@ -146,7 +146,7 @@ def connect_samdb(samdb_url, lp=None, session_info=None,
 if not lp:
 lp=env_loadparm()
 if not session_info:
-session_info=samba.auth.system_session()
+session_info=samba.auth.system_session(lp)
 if not credentials:
 credentials=cmdline_credentials
 
@@ -157,3 +157,21 @@ def connect_samdb(samdb_url, lp=None, session_info=None,
  credentials=credentials,
  flags=flags,
  options=ldb_options)
+
+def connect_samdb_ex(samdb_url, lp=None, session_info=None,
+ credentials=None, flags=0, ldb_options=None, 
ldap_only=False):
+Connects to samdb_url database
+
+:param samdb_url: Url for database to connect to.
+:param lp: Optional loadparm object
+:param session_info: Optional session information
+:param credentials: Optional credentials, defaults to anonymous.
+:param flags: Optional LDB flags
+:param ldap_only: If set, only remote LDAP connection will be created.
+:return: (sam_db_connection, rootDse_record) tuple
+
+sam_db = connect_samdb(samdb_url, lp, session_info, credentials, 
+   flags, ldb_options, ldap_only)
+# fetch RootDse
+res = sam_db.search(base=, expression=, scope=ldb.SCOPE_BASE, 
attrs=[*])
+return (sam_db, res[0])
diff --git a/source4/torture/drs/python/repl_schema.py 
b/source4/torture/drs/python/repl_schema.py
index 78759e1..4016ed2 100644
--- a/source4/torture/drs/python/repl_schema.py
+++ b/source4/torture/drs/python/repl_schema.py
@@ -44,21 +44,19 @@ import samba.tests
 
 class DrsReplSchemaTestCase(samba.tests.TestCase):
 
-# RootDSE msg for DC1
-info_dc1 = None
-ldb_dc1 = None
-# RootDSE msg for DC1
-info_dc2 = None
-ldb_dc2 = None
 # prefix for all

[SCM] Samba Shared Repository - branch master updated

2010-11-18 Thread Kamen Mazdrashki
The branch, master has been updated
   via  ab379dd s4-ldb.python: Use $SELFTEST_PREFIX/tmp as a temporary 
directory for testing
   via  05c0bfa s4-ldb.python: add test for ldb.Message.from_dict() method
   via  a403d77 s4-pyldb: ldb.Message.from_dict class method to create 
LdbMessage object from dictionary
   via  a09a41f s4-pyldb: Move code to create a ldb_message from a Python 
Dictionary object into a separate function
   via  c29a8c7 s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE 
search
   via  b4809e4 s4-pyldb_util: Move ldb Type searching into separate 
function
   via  88e4601 s4-pyldb: Few miss-alignments aligned
   via  72fcfed s4-pyldb: Move PyLdbMessage_FromMessage() in PyMessage 
group of functions
   via  d42ea32 s4-pyldb: Fix wrong type of 'self' parameter
  from  f992dbb s4-tests: Modified descriptor tests to use pyldb api to 
retrieve configuration and schema dn.

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


- Log -
commit ab379ddd516bf2b77ccf77f542faf6e694ab5d4d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 18 21:42:26 2010 +0200

s4-ldb.python: Use $SELFTEST_PREFIX/tmp as a temporary directory for testing

This way we won't flood /tmp directory with temp files

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Thu Nov 18 23:11:18 CET 2010 on sn-devel-104

commit 05c0bface19e8dfb395da82de6b889744768f8c6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 18 17:46:33 2010 +0200

s4-ldb.python: add test for ldb.Message.from_dict() method

commit a403de94ffdcdb57045e8a4755aced0e8484
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 18 22:11:30 2010 +0200

s4-pyldb: ldb.Message.from_dict class method to create LdbMessage object 
from dictionary

commit a09a41f300a4d721c117a95822d272cc5866ac92
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 18 22:09:01 2010 +0200

s4-pyldb: Move code to create a ldb_message from a Python Dictionary object 
into a separate function

commit c29a8c7ec55b6961a51f52bf75671f7af8abf2df
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 15 07:41:59 2010 +0200

s4-samdb.py: Use ldb.get_default_basedn() to avoid RootDSE search

commit b4809e4a8240de5faa311bf55ade3d63fd376aa5
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 15 07:41:50 2010 +0200

s4-pyldb_util: Move ldb Type searching into separate function

commit 88e460190014880d6e4a4eae063a773d9ff5a09c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 15 05:30:54 2010 +0200

s4-pyldb: Few miss-alignments aligned

commit 72fcfedd89b3b8c41b527c4f25fdac518e20c8f2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 15 04:53:05 2010 +0200

s4-pyldb: Move PyLdbMessage_FromMessage() in PyMessage group of functions

commit d42ea3263af581bc3c533ad83b71710fa0b2fa39
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 15 04:20:31 2010 +0200

s4-pyldb: Fix wrong type of 'self' parameter

---

Summary of changes:
 source4/lib/ldb/pyldb.c |  182 +--
 source4/lib/ldb/pyldb.h |2 +-
 source4/lib/ldb/pyldb_util.c|   46 +---
 source4/lib/ldb/tests/python/api.py |   24 -
 source4/scripting/python/samba/samdb.py |7 +-
 5 files changed, 179 insertions(+), 82 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 1f5bd1e..d4b6300 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -48,8 +48,8 @@ static void PyErr_SetLdbError(PyObject *error, int ret, 
struct ldb_context *ldb_
return; /* Python exception should already be set, just keep 
that */
 
PyErr_SetObject(error, 
-   Py_BuildValue(discard_const_p(char, 
(i,s)), ret, 
- ldb_ctx == 
NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx)));
+   Py_BuildValue(discard_const_p(char, (i,s)), ret,
+ ldb_ctx == 
NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx)));
 }
 
 static PyObject *PyExc_LdbError;
@@ -64,8 +64,8 @@ PyAPI_DATA(PyTypeObject) PyLdbTree;
 static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx);
 
 static PyObject *PyObject_FromLdbValue(struct ldb_context *ldb_ctx, 
-  struct 
ldb_message_element *el, 
-  struct ldb_val *val)
+  struct ldb_message_element *el,
+  struct ldb_val *val)
 {
struct ldb_val new_val;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
@@ -95,8 +95,7 @@ static PyObject *PyLdbResult_FromResult(struct

[SCM] Samba Shared Repository - branch master updated

2010-11-16 Thread Kamen Mazdrashki
The branch, master has been updated
   via  cce6627 s4-schema_load: Don't clean in_transaction flag until 
transaction is really finished
  from  0f29042 s4:subtree_rename LDB module - make use of 
dsdb_find_nc_root

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


- Log -
commit cce662763efc2843c3dffeb1d43c12e641ce9949
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 11 23:25:35 2010 +0200

s4-schema_load: Don't clean in_transaction flag until transaction is really 
finished

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Nov 16 11:00:35 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/schema_load.c |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c 
b/source4/dsdb/samdb/ldb_modules/schema_load.c
index 086b2bf..ddc3b3f 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -318,25 +318,24 @@ static int schema_load_start_transaction(struct 
ldb_module *module)
return ldb_next_start_trans(module);
 }
 
-static int schema_load_del_transaction(struct ldb_module *module)
+static int schema_load_end_transaction(struct ldb_module *module)
 {
struct schema_load_private_data *private_data =
talloc_get_type(ldb_module_get_private(module), struct 
schema_load_private_data);
 
private_data-in_transaction = false;
 
-   return ldb_next_del_trans(module);
+   return ldb_next_end_trans(module);
 }
 
-static int schema_load_prepare_commit(struct ldb_module *module)
+static int schema_load_del_transaction(struct ldb_module *module)
 {
-   int ret;
struct schema_load_private_data *private_data =
talloc_get_type(ldb_module_get_private(module), struct 
schema_load_private_data);
 
-   ret = ldb_next_prepare_commit(module);
private_data-in_transaction = false;
-   return ret;
+
+   return ldb_next_del_trans(module);
 }
 
 static int schema_load_extended(struct ldb_module *module, struct ldb_request 
*req)
@@ -359,7 +358,7 @@ static const struct ldb_module_ops 
ldb_schema_load_module_ops = {
.init_context   = schema_load_init,
.extended   = schema_load_extended,
.start_transaction = schema_load_start_transaction,
-   .prepare_commit= schema_load_prepare_commit,
+   .end_transaction   = schema_load_end_transaction,
.del_transaction   = schema_load_del_transaction,
 };
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-11-11 Thread Kamen Mazdrashki
The branch, master has been updated
   via  dcd346c s4-tests: Make repl_schema.py test part of Samba4 test suite
   via  0868a15 s4-repl: Propagate remote prefixMap in DRSUAPI data 
conversion functions
   via  2d0cb54 s4-dsdb_syntax: Warning message that we can't find 
requested ATTID in Schema Cache
   via  3ab7552 s4-prefixMap: dsdb_schema_pfm_oid_from_attid() to use const 
prefixMap
   via  e772518 s4-dsdb_syntax: Use remote prefixMap to handle generic 
cases in drsuapi_to_ldb conversions
   via  f65c840 s4-dsdb_syntax: Add remote prefixMap member for dsdb_syntax 
conversions
   via  a8495d3 s4-repl: dsdb_extended_replicated_objects_convert - 
dsdb_replicated_objects_convert/
   via  227e8dc s4-repl: dsdb_extended_replicated_objects_commit - 
dsdb_replicated_objects_commit
   via  28f41c1 s4-repl: dsdb_convert_object - dsdb_origin_object_convert
   via  7ada90e s4-test: repl_schema - Make sure LdbError and 
ERR_NO_SUCH_OBJECT are visible
  from  beaf14e s3: Well... Fix a stupid error

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


- Log -
commit dcd346c0e541246260507c96283eefaef23edebb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Nov 10 06:14:20 2010 +0200

s4-tests: Make repl_schema.py test part of Samba4 test suite

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Thu Nov 11 19:38:18 UTC 2010 on sn-devel-104

commit 0868a1598220e2ed73aefcd9ec3517a38704ac9e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Nov 10 03:45:22 2010 +0200

s4-repl: Propagate remote prefixMap in DRSUAPI data conversion functions

commit 2d0cb54ceb8f568f233533ada007822ffb40ee3d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Nov 10 02:32:29 2010 +0200

s4-dsdb_syntax: Warning message that we can't find requested ATTID in 
Schema Cache

commit 3ab75524ee11f9121f41b3d4dd452ecdf9847e67
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 9 04:36:24 2010 +0200

s4-prefixMap: dsdb_schema_pfm_oid_from_attid() to use const prefixMap

It is not supposed to change supplied prefixMap

commit e772518a64f1f616ba6c00a8ee45cffd228bd8b3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 9 04:12:57 2010 +0200

s4-dsdb_syntax: Use remote prefixMap to handle generic cases in 
drsuapi_to_ldb conversions

commit f65c8402998c0759aac1ff27234a5e841a3bba37
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 9 04:12:16 2010 +0200

s4-dsdb_syntax: Add remote prefixMap member for dsdb_syntax conversions

commit a8495d380ef93f8d236d521c8b1b8bf76f689acf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 7 23:04:33 2010 +0200

s4-repl: dsdb_extended_replicated_objects_convert - 
dsdb_replicated_objects_convert/

It is part of dsdb_replicated_* family of functions

commit 227e8dcfcfeeb5721e4f23c2bc183fd63c5bbe30
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 7 22:51:11 2010 +0200

s4-repl: dsdb_extended_replicated_objects_commit - 
dsdb_replicated_objects_commit

It is part of dsdb_replicated_* family of functions

commit 28f41c166a77c0d69f0b1eb3e0d811fb66e696a4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 7 21:47:39 2010 +0200

s4-repl: dsdb_convert_object - dsdb_origin_object_convert

It is used in dsdb_origin_objects_commit() func,
hence the dsdb_origin_ prefix

commit 7ada90ec2956fc8fc744676496e847f1a4d2f163
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 11 20:19:47 2010 +0200

s4-test: repl_schema - Make sure LdbError and ERR_NO_SUCH_OBJECT are visible

---

Summary of changes:
 source4/dsdb/repl/drepl_out_helpers.c |   28 ++--
 source4/dsdb/repl/replicated_objects.c|   66 ++---
 source4/dsdb/schema/schema.h  |3 +
 source4/dsdb/schema/schema_prefixmap.c|3 +-
 source4/dsdb/schema/schema_syntax.c   |   14 +-
 source4/libnet/libnet_vampire.c   |   60 +++---
 source4/selftest/tests.py |1 +
 source4/torture/drs/python/repl_schema.py |1 +
 source4/torture/drs/rpc/dssync.c  |   18 
 9 files changed, 117 insertions(+), 77 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_out_helpers.c 
b/source4/dsdb/repl/drepl_out_helpers.c
index f83cdda..b99f126 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -580,17 +580,17 @@ static void 
dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req
return;
}
 
-   status = dsdb_extended_replicated_objects_convert(service-samdb,
- partition-nc.dn,
- mapping_ctr

[SCM] Samba Shared Repository - branch master updated

2010-11-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  7e3419f s4-pyldb: Handle internal errors in py_ldb_contains() 
properly
   via  38585a7 s4-pydsdb: py_dsdb_am_rodc() may call samdb_rodc() only 
once to get the job done :)
   via  d073c5f s4-pydsdb: py_dsdb_load_partition_usn() - simplify error 
handling in
   via  89440dd s4-pydsdb-py_samdb_ntds_objectGUID(): Avoid potential 
memory leak
   via  06b0596 s4-pydsdb-py_dsdb_get_oid_from_attid(): Avoid potential 
memory leak
   via  ad5a399 s4-pydsdb.c: Fix small memory leak in 
py_samdb_set_domain_sid()
  from  4b978b3 s4/syntax: Add tests for DN+String and DN+Binary

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


- Log -
commit 7e3419f32f0a46cbd4926cbc98bf54da27749d31
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Nov 9 00:21:57 2010 +0200

s4-pyldb: Handle internal errors in py_ldb_contains() properly

It is an exceptional condition for ldb_search() to return
more than one results during SCOPE_BASE search on DN

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Nov 10 09:02:00 UTC 2010 on sn-devel-104

commit 38585a74905185e87494c7326d248495b5e01e49
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 23:57:31 2010 +0200

s4-pydsdb: py_dsdb_am_rodc() may call samdb_rodc() only once to get the job 
done :)

commit d073c5f23ae6563a65af73fd6dc6099011da
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 23:50:23 2010 +0200

s4-pydsdb: py_dsdb_load_partition_usn() - simplify error handling in

and print on which partition error has occured

commit 89440dd617eb4ff64cda8bf97f1f22ddf94bf717
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 23:40:14 2010 +0200

s4-pydsdb-py_samdb_ntds_objectGUID(): Avoid potential memory leak

in case py_ldb is not a valid LDB

commit 06b0596537e66ed928b24af059ada0472a375f3b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 23:36:09 2010 +0200

s4-pydsdb-py_dsdb_get_oid_from_attid(): Avoid potential memory leak

in case py_ldb is not a valid LDB

commit ad5a399d54fba103822ba9cbea4515d52eafd1fe
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 23:09:44 2010 +0200

s4-pydsdb.c: Fix small memory leak in py_samdb_set_domain_sid()

---

Summary of changes:
 source4/dsdb/pydsdb.c   |   26 ++
 source4/lib/ldb/pyldb.c |   13 +
 2 files changed, 23 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index 2471548..16a4cd4 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -134,6 +134,7 @@ static PyObject *py_samdb_set_domain_sid(PyLdbObject *self, 
PyObject *args)
sid = dom_sid_parse_talloc(NULL, PyString_AsString(py_sid));
 
ret = samdb_set_domain_sid(ldb, sid);
+   talloc_free(sid);
if (!ret) {
PyErr_SetString(PyExc_RuntimeError, set_domain_sid failed);
return NULL;
@@ -244,14 +245,14 @@ static PyObject *py_dsdb_get_oid_from_attid(PyObject 
*self, PyObject *args)
if (!PyArg_ParseTuple(args, Oi, py_ldb, attid))
return NULL;
 
+   PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
   PyErr_NoMemory();
   return NULL;
}
 
-   PyErr_LDB_OR_RAISE(py_ldb, ldb);
-
schema = dsdb_get_schema(ldb, NULL);
 
if (!schema) {
@@ -413,19 +414,18 @@ static PyObject *py_samdb_ntds_objectGUID(PyObject *self, 
PyObject *args)
TALLOC_CTX *mem_ctx;
const struct GUID *guid;
 
-   mem_ctx = talloc_new(NULL);
-   if (mem_ctx == NULL) {
-   PyErr_NoMemory();
-   return NULL;
-   }
-
if (!PyArg_ParseTuple(args, O, py_ldb)) {
-   talloc_free(mem_ctx);
return NULL;
}
 
PyErr_LDB_OR_RAISE(py_ldb, ldb);
 
+   mem_ctx = talloc_new(NULL);
+   if (mem_ctx == NULL) {
+   PyErr_NoMemory();
+   return NULL;
+   }
+
guid = samdb_ntds_objectGUID(ldb);
if (guid == NULL) {
PyErr_SetString(PyExc_RuntimeError, Failed to find NTDS GUID);
@@ -483,8 +483,10 @@ static PyObject *py_dsdb_load_partition_usn(PyObject 
*self, PyObject *args)
 
ret = dsdb_load_partition_usn(ldb, dn, highest_uSN, urgent_uSN);
if (ret != LDB_SUCCESS) {
-  char *errstr = talloc_asprintf(mem_ctx, Failed to load partition 
uSN - %s, ldb_errstring(ldb));
-  PyErr_SetString(PyExc_RuntimeError, errstr);
+  PyErr_Format(PyExc_RuntimeError,
+   Failed to load partition [%s] uSN - %s,
+   ldb_dn_get_linearized(dn),
+   ldb_errstring

[SCM] Samba Shared Repository - branch master updated

2010-11-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  0aeb08e s4-attid: Uppercase ATTID type constants
   via  ee34e2c s4-test: Initial implementation for Schema replication 
black box test
  from  3a5f030 Second part of fix for bug # - When requesting lookups 
for BUILTIN sids, winbindd allocates new uids/gids in error.

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


- Log -
commit 0aeb08e2eb1725ef41b6796a55a020520d13c6f7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 8 16:27:22 2010 +0200

s4-attid: Uppercase ATTID type constants

Thanks Metze for noting this!

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Nov  8 23:06:41 UTC 2010 on sn-devel-104

commit ee34e2c94bccb90f6518c401192c5f04ae509d25
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Nov 7 04:41:50 2010 +0200

s4-test: Initial implementation for Schema replication black box test

---

Summary of changes:
 source4/dsdb/schema/prefixmap.h   |8 +-
 source4/dsdb/schema/schema_prefixmap.c|   10 +-
 source4/dsdb/schema/schema_query.c|2 +-
 source4/torture/drs/python/repl_schema.py |  174 +
 4 files changed, 184 insertions(+), 10 deletions(-)
 create mode 100644 source4/torture/drs/python/repl_schema.py


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/prefixmap.h b/source4/dsdb/schema/prefixmap.h
index 74acecb..339a221 100644
--- a/source4/dsdb/schema/prefixmap.h
+++ b/source4/dsdb/schema/prefixmap.h
@@ -27,10 +27,10 @@
  * Ref: MS-ADTS, 3.1.1.2.6 ATTRTYP
  */
 enum dsdb_attid_type {
-   dsdb_attid_type_pfm = 1,/* attid in [0x..0x7FFF] */
-   dsdb_attid_type_intid = 2,  /* attid in [0x8000..0xBFFF] */
-   dsdb_attid_type_reserved = 3,   /* attid in [0xC000..0xFFFE] */
-   dsdb_attid_type_internal = 4,   /* attid in [0x..0x] */
+   DSDB_ATTID_TYPE_PFM = 1,/* attid in [0x..0x7FFF] */
+   DSDB_ATTID_TYPE_INTID = 2,  /* attid in [0x8000..0xBFFF] */
+   DSDB_ATTID_TYPE_RESERVED = 3,   /* attid in [0xC000..0xFFFE] */
+   DSDB_ATTID_TYPE_INTERNAL = 4,   /* attid in [0x..0x] */
 };
 
 /**
diff --git a/source4/dsdb/schema/schema_prefixmap.c 
b/source4/dsdb/schema/schema_prefixmap.c
index 1892050..371ec88 100644
--- a/source4/dsdb/schema/schema_prefixmap.c
+++ b/source4/dsdb/schema/schema_prefixmap.c
@@ -32,16 +32,16 @@
 enum dsdb_attid_type dsdb_pfm_get_attid_type(uint32_t attid)
 {
if (attid = 0x7FFF) {
-   return dsdb_attid_type_pfm;
+   return DSDB_ATTID_TYPE_PFM;
}
else if (attid = 0xBFFF) {
-   return dsdb_attid_type_intid;
+   return DSDB_ATTID_TYPE_INTID;
}
else if (attid = 0xFFFE) {
-   return dsdb_attid_type_reserved;
+   return DSDB_ATTID_TYPE_RESERVED;
}
else {
-   return dsdb_attid_type_internal;
+   return DSDB_ATTID_TYPE_INTERNAL;
}
 }
 
@@ -361,7 +361,7 @@ WERROR dsdb_schema_pfm_oid_from_attid(struct 
dsdb_schema_prefixmap *pfm, uint32_
WERROR werr = WERR_OK;
 
/* sanity check for attid requested */
-   if (dsdb_pfm_get_attid_type(attid) != dsdb_attid_type_pfm) {
+   if (dsdb_pfm_get_attid_type(attid) != DSDB_ATTID_TYPE_PFM) {
return WERR_INVALID_PARAMETER;
}
 
diff --git a/source4/dsdb/schema/schema_query.c 
b/source4/dsdb/schema/schema_query.c
index 8ea79ff..c92d273 100644
--- a/source4/dsdb/schema/schema_query.c
+++ b/source4/dsdb/schema/schema_query.c
@@ -64,7 +64,7 @@ const struct dsdb_attribute 
*dsdb_attribute_by_attributeID_id(const struct dsdb_
if (id == 0x) return NULL;
 
/* check for msDS-IntId type attribute */
-   if (dsdb_pfm_get_attid_type(id) == dsdb_attid_type_intid) {
+   if (dsdb_pfm_get_attid_type(id) == DSDB_ATTID_TYPE_INTID) {
BINARY_ARRAY_SEARCH_P(schema-attributes_by_msDS_IntId,
  schema-num_int_id_attr, msDS_IntId, id, 
uint32_cmp, c);
return c;
diff --git a/source4/torture/drs/python/repl_schema.py 
b/source4/torture/drs/python/repl_schema.py
new file mode 100644
index 000..b407dfb
--- /dev/null
+++ b/source4/torture/drs/python/repl_schema.py
@@ -0,0 +1,174 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Tests various schema replication scenarios
+#
+# Copyright (C) Kamen Mazdrashki kame...@samba.org 2010
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version

[SCM] Samba Shared Repository - branch master updated

2010-11-04 Thread Kamen Mazdrashki
The branch, master has been updated
   via  78b05a3 s4-ldb_module.h: use LDB error code for ldb_error() macro 
rather than LDB_DEBUG_FATAL
   via  e7aa7a0 s4-devel: Verify prefixMap is saved correctly in LDB on disk
  from  c4dab7d urgent_replication: forbid empty subunit output.

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


- Log -
commit 78b05a3116b26e57f43f2d27038d8688f245d33e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Nov 4 03:27:10 2010 +0200

s4-ldb_module.h: use LDB error code for ldb_error() macro rather than 
LDB_DEBUG_FATAL

We end up calling ldb_error_at() which expects an LDB error,
but LDB_DEBUG_FATAL is not such code. It is actually equal to LDB_SUCCESS.

Thus the effect is that we report a *fatal* error, but return
LDB_SUCCESS in many places.

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Thu Nov  4 12:57:33 UTC 2010 on sn-devel-104

commit e7aa7a0c3305240b2d89db81141c5d383e75adc8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Nov 3 23:43:21 2010 +0200

s4-devel: Verify prefixMap is saved correctly in LDB on disk

---

Summary of changes:
 source4/lib/ldb/include/ldb_module.h  |2 +-
 source4/scripting/devel/pfm_verify.py |  146 +
 2 files changed, 147 insertions(+), 1 deletions(-)
 create mode 100755 source4/scripting/devel/pfm_verify.py


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/include/ldb_module.h 
b/source4/lib/ldb/include/ldb_module.h
index e88c887..50c606b 100644
--- a/source4/lib/ldb/include/ldb_module.h
+++ b/source4/lib/ldb/include/ldb_module.h
@@ -78,7 +78,7 @@ void ldb_debug_end(struct ldb_context *ldb, enum 
ldb_debug_level level);
 
 #define ldb_error(ldb, ecode, reason) ldb_error_at(ldb, ecode, reason, 
__FILE__, __LINE__)
 
-#define ldb_oom(ldb) ldb_error(ldb, LDB_DEBUG_FATAL, ldb out of memory)
+#define ldb_oom(ldb) ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, ldb out of 
memory)
 #define ldb_module_oom(module) ldb_oom(ldb_module_get_ctx(module))
 #define ldb_operr(ldb) ldb_error(ldb, LDB_ERR_OPERATIONS_ERROR, operations 
error)
 
diff --git a/source4/scripting/devel/pfm_verify.py 
b/source4/scripting/devel/pfm_verify.py
new file mode 100755
index 000..76fb8e4
--- /dev/null
+++ b/source4/scripting/devel/pfm_verify.py
@@ -0,0 +1,146 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# script to verify cached prefixMap on remote
+# server against the prefixMap stored in Schema NC
+#
+# Copyright (C) Kamen Mazdrashki kame...@samba.org 2010
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+
+import os
+import sys
+from optparse import OptionParser
+
+sys.path.insert(0, bin/python)
+
+import samba
+import samba.getopt as options
+from ldb import SCOPE_BASE, SCOPE_SUBTREE
+from samba.dcerpc import drsuapi, misc, drsblobs
+from samba.drs_utils import drs_DsBind
+from samba.samdb import SamDB
+from samba.auth import system_session
+from samba.ndr import ndr_pack, ndr_unpack
+
+
+def _samdb_fetch_pfm(samdb):
+Fetch prefixMap stored in SamDB using LDB connection
+res = samdb.search(base=samdb.get_schema_basedn(), expression=, 
scope=SCOPE_BASE, attrs=[*])
+assert len(res) == 1
+pfm = ndr_unpack(drsblobs.prefixMapBlob,
+ str(res[0]['prefixMap']))
+return pfm.ctr
+
+def _drs_fetch_pfm(server, samdb, creds, lp):
+Fetch prefixMap using DRS interface
+binding_str = ncacn_ip_tcp:%s[print,seal] % server
+
+drs = drsuapi.drsuapi(binding_str, lp, creds)
+drs_handle = drs_DsBind(drs)
+print DRS Handle: %s % drs_handle
+
+req8 = drsuapi.DsGetNCChangesRequest8()
+
+dest_dsa = misc.GUID(9c637462-5b8c-4467-aef2-bdb1f57bc4ef)
+replica_flags = 0
+
+req8.destination_dsa_guid = dest_dsa
+req8.source_dsa_invocation_id = misc.GUID(samdb.get_invocation_id())
+req8.naming_context = drsuapi.DsReplicaObjectIdentifier()
+req8.naming_context.dn = unicode(samdb.get_schema_basedn())
+req8.highwatermark = drsuapi.DsReplicaHighWaterMark()
+req8.highwatermark.tmp_highest_usn = 0
+req8.highwatermark.reserved_usn = 0
+req8.highwatermark.highest_usn = 0
+req8.uptodateness_vector = None
+req8.replica_flags

[SCM] Samba Shared Repository - branch master updated

2010-10-31 Thread Kamen Mazdrashki
The branch, master has been updated
   via  a2d787d s4-dsdb_schema: Use DRSUAPI_ATTID_INVALID instead of 
0x magic value
   via  9221c38 s4-druspia.idl: rename DRSUAPI_ATTID_NONE to 
DRSUAPI_ATTID_INVALID
   via  717b115 idl: Use DRSUAPI_ATTID_ prefix instead of 
DRSUAPI_ATTRIBUTE_ for ATTID values
  from  fb6f12b s4-server: avoid using environ as it is not portable

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


- Log -
commit a2d787d95d1f20aa2c080c2281bcf213728dfbc4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Nov 1 00:46:58 2010 +0200

s4-dsdb_schema: Use DRSUAPI_ATTID_INVALID instead of 0x magic value

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Nov  1 00:36:20 UTC 2010 on sn-devel-104

commit 9221c38e1673bb2b54b971401f1d2f348aecbeca
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 29 23:46:05 2010 +0300

s4-druspia.idl: rename DRSUAPI_ATTID_NONE to DRSUAPI_ATTID_INVALID

0x is actually an invalid value for an ATTID
and *_INVALID will make it more easy to notice in logs

commit 717b1158a6a4e94c0a37623731d398723a24eed8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 29 02:22:35 2010 +0300

idl: Use DRSUAPI_ATTID_ prefix instead of DRSUAPI_ATTRIBUTE_ for ATTID 
values

Those values are actually ATTID values and such, they are used
for ATTIDs for Attributes, Classes and Syntaxes.

---

Summary of changes:
 libcli/drsuapi/repl_decrypt.c   |   44 +++---
 librpc/idl/drsuapi.idl  |  173 ---
 librpc/ndr/ndr_drsuapi.c|   48 +++---
 source3/libnet/libnet_dssync_keytab.c   |   16 +-
 source4/dsdb/repl/replicated_objects.c  |2 +-
 source4/dsdb/samdb/ldb_modules/operational.c|2 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |8 +-
 source4/dsdb/samdb/ldb_modules/resolve_oids.c   |   48 +++---
 source4/dsdb/schema/schema_init.c   |6 +-
 source4/dsdb/schema/schema_syntax.c |  116 
 source4/libnet/libnet_become_dc.c   |   24 ++--
 source4/rpc_server/drsuapi/drsutil.c|   22 ++--
 source4/rpc_server/drsuapi/getncchanges.c   |6 +-
 source4/torture/drs/rpc/dssync.c|   22 ++--
 14 files changed, 269 insertions(+), 268 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/drsuapi/repl_decrypt.c b/libcli/drsuapi/repl_decrypt.c
index 924e799..6fff2fe 100644
--- a/libcli/drsuapi/repl_decrypt.c
+++ b/libcli/drsuapi/repl_decrypt.c
@@ -146,19 +146,19 @@ WERROR drsuapi_decrypt_attribute(TALLOC_CTX *mem_ctx,
}
 
switch (attr-attid) {
-   case DRSUAPI_ATTRIBUTE_dBCSPwd:
-   case DRSUAPI_ATTRIBUTE_unicodePwd:
-   case DRSUAPI_ATTRIBUTE_ntPwdHistory:
-   case DRSUAPI_ATTRIBUTE_lmPwdHistory:
+   case DRSUAPI_ATTID_dBCSPwd:
+   case DRSUAPI_ATTID_unicodePwd:
+   case DRSUAPI_ATTID_ntPwdHistory:
+   case DRSUAPI_ATTID_lmPwdHistory:
rid_crypt = true;
break;
-   case DRSUAPI_ATTRIBUTE_supplementalCredentials:
-   case DRSUAPI_ATTRIBUTE_priorValue:
-   case DRSUAPI_ATTRIBUTE_currentValue:
-   case DRSUAPI_ATTRIBUTE_trustAuthOutgoing:
-   case DRSUAPI_ATTRIBUTE_trustAuthIncoming:
-   case DRSUAPI_ATTRIBUTE_initialAuthOutgoing:
-   case DRSUAPI_ATTRIBUTE_initialAuthIncoming:
+   case DRSUAPI_ATTID_supplementalCredentials:
+   case DRSUAPI_ATTID_priorValue:
+   case DRSUAPI_ATTID_currentValue:
+   case DRSUAPI_ATTID_trustAuthOutgoing:
+   case DRSUAPI_ATTID_trustAuthIncoming:
+   case DRSUAPI_ATTID_initialAuthOutgoing:
+   case DRSUAPI_ATTID_initialAuthIncoming:
break;
default:
return WERR_OK;
@@ -308,19 +308,19 @@ WERROR drsuapi_encrypt_attribute(TALLOC_CTX *mem_ctx,
}
 
switch (attr-attid) {
-   case DRSUAPI_ATTRIBUTE_dBCSPwd:
-   case DRSUAPI_ATTRIBUTE_unicodePwd:
-   case DRSUAPI_ATTRIBUTE_ntPwdHistory:
-   case DRSUAPI_ATTRIBUTE_lmPwdHistory:
+   case DRSUAPI_ATTID_dBCSPwd:
+   case DRSUAPI_ATTID_unicodePwd:
+   case DRSUAPI_ATTID_ntPwdHistory:
+   case DRSUAPI_ATTID_lmPwdHistory:
rid_crypt = true;
break;
-   case DRSUAPI_ATTRIBUTE_supplementalCredentials:
-   case DRSUAPI_ATTRIBUTE_priorValue:
-   case DRSUAPI_ATTRIBUTE_currentValue:
-   case DRSUAPI_ATTRIBUTE_trustAuthOutgoing:
-   case DRSUAPI_ATTRIBUTE_trustAuthIncoming:
-   case DRSUAPI_ATTRIBUTE_initialAuthOutgoing:
-   case DRSUAPI_ATTRIBUTE_initialAuthIncoming:
+   case DRSUAPI_ATTID_supplementalCredentials:
+   case DRSUAPI_ATTID_priorValue:
+   case DRSUAPI_ATTID_currentValue

[SCM] Samba Shared Repository - branch master updated

2010-10-29 Thread Kamen Mazdrashki
The branch, master has been updated
   via  c5c6935 s4-drs_tests: drs_util_DsAttributeId_to_string() is not 
used anymore
   via  07240e9 s4-resolve_oids: Remove redundant check - 
resolve_oids_need_value() handle this
   via  6b188fb s4-schema_init: we should be able to resolve Syntax OIDs 
with prefixMap we have
   via  72189ae s4-pfm_test: Use single instance of global testing data to 
test with
   via  fbc3fc2 s4-pfm-test: Enrich and fix comment primary for testing data
  from  4a11cad build: add the -fno-common flags to fix the link pb on mac 
os X

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


- Log -
commit c5c69359d9d18c9b9be29b0442567cf19f7810a0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 29 01:54:51 2010 +0300

s4-drs_tests: drs_util_DsAttributeId_to_string() is not used anymore

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Fri Oct 29 09:54:01 UTC 2010 on sn-devel-104

commit 07240e97f859e2b46c1fc19c2fa7f5254ee05ccb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 29 01:18:31 2010 +0300

s4-resolve_oids: Remove redundant check - resolve_oids_need_value() handle 
this

commit 6b188fbad47f04f3a9b8979a04a0f70d10b4ada9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 27 22:29:40 2010 +0300

s4-schema_init: we should be able to resolve Syntax OIDs with prefixMap we 
have

If Syntax OID is not in the prefixMap then we are getting
an unknown Attribute Syntax (which we can't handle anyway)

commit 72189aef8d4c898b0537e1fb5a1493454feaef57
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 27 22:21:50 2010 +0300

s4-pfm_test: Use single instance of global testing data to test with

commit fbc3fc2e5f2910aa2ce324de541ca98d72b6f702
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 27 22:12:11 2010 +0300

s4-pfm-test: Enrich and fix comment primary for testing data

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/resolve_oids.c |4 -
 source4/dsdb/schema/schema_init.c |6 +-
 source4/torture/drs/drs_util.c|   74 
 source4/torture/drs/unit/prefixmap_tests.c|   93 ++---
 4 files changed, 39 insertions(+), 138 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/resolve_oids.c 
b/source4/dsdb/samdb/ldb_modules/resolve_oids.c
index 350364b..4f5c35e 100644
--- a/source4/dsdb/samdb/ldb_modules/resolve_oids.c
+++ b/source4/dsdb/samdb/ldb_modules/resolve_oids.c
@@ -156,10 +156,6 @@ static int resolve_oids_parse_tree_need(struct ldb_context 
*ldb,
return LDB_ERR_COMPARE_FALSE;
}
 
-   if (a-syntax-oMSyntax != 6) {
-   return LDB_ERR_COMPARE_FALSE;
-   }
-
return resolve_oids_need_value(ldb, schema, a, valp);
 }
 
diff --git a/source4/dsdb/schema/schema_init.c 
b/source4/dsdb/schema/schema_init.c
index 4e1c14d..836b2ae 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -594,9 +594,9 @@ WERROR dsdb_attribute_from_ldb(struct ldb_context *ldb,
/* set an invalid value */
attr-attributeSyntax_id = 0x;
} else {
-   status = dsdb_schema_pfm_make_attid(schema-prefixmap,
-   attr-attributeSyntax_oid,
-   attr-attributeSyntax_id);
+   status = dsdb_schema_pfm_attid_from_oid(schema-prefixmap,
+   
attr-attributeSyntax_oid,
+   
attr-attributeSyntax_id);
if (!W_ERROR_IS_OK(status)) {
DEBUG(0,(%s: '%s': unable to map attributeSyntax_ %s: 
%s\n,
__location__, attr-lDAPDisplayName, 
attr-attributeSyntax_oid,
diff --git a/source4/torture/drs/drs_util.c b/source4/torture/drs/drs_util.c
index ba90cde..6de758e 100644
--- a/source4/torture/drs/drs_util.c
+++ b/source4/torture/drs/drs_util.c
@@ -94,80 +94,6 @@ bool drs_util_oid_from_attid(struct torture_context *tctx,
return true;
 }
 
-/**
- * Utility function to convert drsuapi_DsAttributeId to String
- */
-const char * drs_util_DsAttributeId_to_string(enum drsuapi_DsAttributeId r)
-{
-   const char *val = NULL;
-
-   switch (r) {
-   case DRSUAPI_ATTRIBUTE_objectClass: val = 
DRSUAPI_ATTRIBUTE_objectClass; break;
-   case DRSUAPI_ATTRIBUTE_description: val = 
DRSUAPI_ATTRIBUTE_description; break;
-   case DRSUAPI_ATTRIBUTE_member: val = DRSUAPI_ATTRIBUTE_member; break;
-   case DRSUAPI_ATTRIBUTE_instanceType: val = 
DRSUAPI_ATTRIBUTE_instanceType; break;
-   case DRSUAPI_ATTRIBUTE_whenCreated: val

[SCM] Samba Shared Repository - branch master updated

2010-10-26 Thread Kamen Mazdrashki
The branch, master has been updated
   via  e5ebc48 s4-dsdb_syntax: *_OID_oid_ldb_to_drsuapi() functions should 
use
   via  6a6c7c9 s4-pfm_test: no need to test created prefixMap contents 
here - it already tested
   via  45e1c0c s4-pfm_test: Tests for dsdb_schema_pfm_attid_from_oid()
   via  0fc2427 s4-prefixMap: split dsdb_schema_make_attid() function into 
read-only and
   via  5e108fc s4-prefixmap: Use WERR_NOT_FOUND when OID is not found in 
current prefixMap
  from  d8e246c Add a script for formating test result of st/subunit

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


- Log -
commit e5ebc486975cc172d9547b34151204c58f0d14c2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 26 22:14:43 2010 +0300

s4-dsdb_syntax: *_OID_oid_ldb_to_drsuapi() functions should use

dsdb_schema_pfm_attid_from_oid() instead of
dsdb_schema_pfm_make_attid() as those functions are
supposed to return ATTIDs only for OIDs we already know about
(i.e. are in prefixMap)

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Oct 26 22:44:36 UTC 2010 on sn-devel-104

commit 6a6c7c9aa2a8a04d6c1b6c6c8c5841efa4cb8e09
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 26 21:20:11 2010 +0300

s4-pfm_test: no need to test created prefixMap contents here - it already 
tested

commit 45e1c0c151b6a98858a6cc580ded6a151afc
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 26 21:17:55 2010 +0300

s4-pfm_test: Tests for dsdb_schema_pfm_attid_from_oid()

commit 0fc2427224c2826e5ee0b09631ae77d0b08b5ba9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 26 18:33:32 2010 +0300

s4-prefixMap: split dsdb_schema_make_attid() function into read-only and

read-write functions.
dsdb_schema_make_attid() may change prefixMap implicitly
and this is not always desired behavior.
The problem was that
(1) callers had no control on this behavior
(2) callers had no way to know wheter prefixMap has been
changed which can lead to hard to find bugs like
prefixMap is changed in read operation

commit 5e108fc5f94e6a08083f8852a59fc4b79b198af8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 22 16:22:08 2010 +0300

s4-prefixmap: Use WERR_NOT_FOUND when OID is not found in current prefixMap

rather than WERR_DS_NO_MSDS_INTID.
WERR_DS_NO_MSDS_INTID is intended to be used for msDsIntId
attribute values handling

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/schema_data.c |2 +-
 source4/dsdb/schema/schema_init.c|2 +-
 source4/dsdb/schema/schema_prefixmap.c   |   41 -
 source4/dsdb/schema/schema_syntax.c  |   12 ++--
 source4/torture/drs/unit/prefixmap_tests.c   |  120 +-
 5 files changed, 164 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/schema_data.c 
b/source4/dsdb/samdb/ldb_modules/schema_data.c
index 7b7d7d0..4818a54 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_data.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_data.c
@@ -191,7 +191,7 @@ static int schema_data_add(struct ldb_module *module, 
struct ldb_request *req)
status = dsdb_schema_pfm_find_oid(schema-prefixmap, oid, NULL);
if (!W_ERROR_IS_OK(status)) {
/* check for internal errors */
-   if (!W_ERROR_EQUAL(WERR_DS_NO_MSDS_INTID, status)) {
+   if (!W_ERROR_EQUAL(status, WERR_NOT_FOUND)) {
ldb_debug_set(ldb, LDB_DEBUG_ERROR,
  schema_data_add: failed to map %s[%s]: 
%s\n,
  oid_attr, oid, win_errstr(status));
diff --git a/source4/dsdb/schema/schema_init.c 
b/source4/dsdb/schema/schema_init.c
index d80f209..4e1c14d 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -233,7 +233,7 @@ WERROR dsdb_create_prefix_mapping(struct ldb_context *ldb, 
struct dsdb_schema *s
/* prefix found*/
talloc_free(mem_ctx);
return status;
-   } else if (!W_ERROR_EQUAL(WERR_DS_NO_MSDS_INTID, status)) {
+   } else if (!W_ERROR_EQUAL(status, WERR_NOT_FOUND)) {
/* error */
DEBUG(0,(dsdb_create_prefix_mapping: dsdb_find_prefix_for_oid: 
%s\n,
win_errstr(status)));
diff --git a/source4/dsdb/schema/schema_prefixmap.c 
b/source4/dsdb/schema/schema_prefixmap.c
index 79894fe..1892050 100644
--- a/source4/dsdb/schema/schema_prefixmap.c
+++ b/source4/dsdb/schema/schema_prefixmap.c
@@ -229,7 +229,7 @@ WERROR dsdb_schema_pfm_find_binary_oid(const struct 
dsdb_schema_prefixmap *pfm,
}
}
 
-   return WERR_DS_NO_MSDS_INTID;
+   return

[SCM] Samba Shared Repository - branch master updated

2010-10-25 Thread Kamen Mazdrashki
The branch, master has been updated
   via  8bc2b54 s4-test: Extend DRS-msDSIntId test to verify Configuration 
NC replica also
  from  e567d6c s4:samldb LDB module - other indentation fixes on error 
messages

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


- Log -
commit 8bc2b54c7237697d8fddcec9a02d742c81c83699
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Oct 9 06:47:20 2010 +0300

s4-test: Extend DRS-msDSIntId test to verify Configuration NC replica also

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Oct 25 13:13:48 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/torture/drs/rpc/msds_intid.c |   35 +
 1 files changed, 30 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/rpc/msds_intid.c 
b/source4/torture/drs/rpc/msds_intid.c
index a6e7dc5..9fc141f 100644
--- a/source4/torture/drs/rpc/msds_intid.c
+++ b/source4/torture/drs/rpc/msds_intid.c
@@ -559,12 +559,14 @@ static bool test_dsintid_schema(struct torture_context 
*tctx, struct DsIntIdTest
 }
 
 /**
- * Fetch Domain NC and check ATTID values returned.
- * When Domain partition is replicated, ATTID
+ * Fetch non-Schema NC and check ATTID values returned.
+ * When non-Schema partition is replicated, ATTID
  * should be msDS-IntId value for the attribute
  * if this value exists
  */
-static bool test_dsintid_domain(struct torture_context *tctx, struct 
DsIntIdTestCtx *ctx)
+static bool _test_dsintid(struct torture_context *tctx,
+ struct DsIntIdTestCtx *ctx,
+ const char *nc_dn_str)
 {
uint32_t i;
const struct dsdb_schema *ldap_schema;
@@ -580,8 +582,8 @@ static bool test_dsintid_domain(struct torture_context 
*tctx, struct DsIntIdTest
torture_assert(tctx, mem_ctx, Not enough memory);
 
/* fetch whole Schema partition */
-   torture_comment(tctx, Fetch partition: %s\n, ctx-domain_dn);
-   if (!_test_GetNCChanges(tctx, ctx-dsa_bind, ctx-domain_dn, mem_ctx, 
ctr6)) {
+   torture_comment(tctx, Fetch partition: %s\n, nc_dn_str);
+   if (!_test_GetNCChanges(tctx, ctx-dsa_bind, nc_dn_str, mem_ctx, 
ctr6)) {
torture_fail(tctx, _test_GetNCChanges() failed);
}
 
@@ -643,6 +645,28 @@ static bool test_dsintid_domain(struct torture_context 
*tctx, struct DsIntIdTest
return true;
 }
 
+/**
+ * Fetch Domain NC and check ATTID values returned.
+ * When Domain partition is replicated, ATTID
+ * should be msDS-IntId value for the attribute
+ * if this value exists
+ */
+static bool test_dsintid_configuration(struct torture_context *tctx, struct 
DsIntIdTestCtx *ctx)
+{
+   return _test_dsintid(tctx, ctx, ctx-config_dn);
+}
+
+/**
+ * Fetch Configuration NC and check ATTID values returned.
+ * When Configuration partition is replicated, ATTID
+ * should be msDS-IntId value for the attribute
+ * if this value exists
+ */
+static bool test_dsintid_domain(struct torture_context *tctx, struct 
DsIntIdTestCtx *ctx)
+{
+   return _test_dsintid(tctx, ctx, ctx-domain_dn);
+}
+
 
 /**
  * DSSYNC test case setup
@@ -708,5 +732,6 @@ void torture_drs_rpc_dsintid_tcase(struct torture_suite 
*suite)
  torture_dsintid_tcase_teardown);
 
test = torture_tcase_add_simple_test(tcase, Schema, 
(run_func)test_dsintid_schema);
+   test = torture_tcase_add_simple_test(tcase, Configuration, 
(run_func)test_dsintid_configuration);
test = torture_tcase_add_simple_test(tcase, Domain, 
(run_func)test_dsintid_domain);
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-24 Thread Kamen Mazdrashki
The branch, master has been updated
   via  9e7bcaa s4-test: Print correct partition DN in msDSIntId test
  from  7b3dbbd s4:dsdb - remove some calls of samdb_msg_add_string when 
we have talloc'ed strings

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


- Log -
commit 9e7bcaab2dc9a73c8251431fa4573d1d1ba32561
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Oct 9 06:04:52 2010 +0300

s4-test: Print correct partition DN in msDSIntId test

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun Oct 24 20:45:21 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/torture/drs/rpc/msds_intid.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/rpc/msds_intid.c 
b/source4/torture/drs/rpc/msds_intid.c
index 2b2fa5e..a6e7dc5 100644
--- a/source4/torture/drs/rpc/msds_intid.c
+++ b/source4/torture/drs/rpc/msds_intid.c
@@ -580,7 +580,7 @@ static bool test_dsintid_domain(struct torture_context 
*tctx, struct DsIntIdTest
torture_assert(tctx, mem_ctx, Not enough memory);
 
/* fetch whole Schema partition */
-   torture_comment(tctx, Fetch partition: %s\n, ctx-schema_dn);
+   torture_comment(tctx, Fetch partition: %s\n, ctx-domain_dn);
if (!_test_GetNCChanges(tctx, ctx-dsa_bind, ctx-domain_dn, mem_ctx, 
ctr6)) {
torture_fail(tctx, _test_GetNCChanges() failed);
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-22 Thread Kamen Mazdrashki
The branch, master has been updated
   via  d46ca0e s4-dsdb_syntax: Setup String(Case Sensitive) syntax
  from  a8b9568 Wrap security_token_has_privilege() with a check for 
lp_enable_privileges(). Needed to maintain compatibility with smb.conf manpage.

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


- Log -
commit d46ca0eb801f2664cedb17c50a9a94e58ebdb0b6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Oct 23 00:13:09 2010 +0300

s4-dsdb_syntax: Setup String(Case Sensitive) syntax

Currently it is mapped to Octet String LDAP syntax
for comparison purposes.

According to LDAP rfc we should be using same comparison
as Directory String (LDB_SYNTAX_DIRECTORY_STRING), but case sensitive.
But according to ms docs binary compare should do the job:
http://msdn.microsoft.com/en-us/library/cc223200(v=PROT.10).aspx

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Fri Oct 22 22:19:50 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/schema/schema_syntax.c |   13 ++---
 1 files changed, 10 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_syntax.c 
b/source4/dsdb/schema/schema_syntax.c
index d6e4527..2f68ea2 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -2393,9 +2393,16 @@ static const struct dsdb_syntax dsdb_syntaxes[] = {
.ldap_oid   = 1.2.840.113556.1.4.1362,
.oMSyntax   = 27,
.attributeSyntax_oid= 2.5.5.3,
-   .drsuapi_to_ldb = dsdb_syntax_FOOBAR_drsuapi_to_ldb,
-   .ldb_to_drsuapi = dsdb_syntax_FOOBAR_ldb_to_drsuapi,
-   .validate_ldb   = dsdb_syntax_FOOBAR_validate_ldb,
+   .drsuapi_to_ldb = dsdb_syntax_DATA_BLOB_drsuapi_to_ldb,
+   .ldb_to_drsuapi = dsdb_syntax_DATA_BLOB_ldb_to_drsuapi,
+   .validate_ldb   = dsdb_syntax_DATA_BLOB_validate_ldb,
+   .equality   = caseExactMatch,
+   .substring  = caseExactSubstringsMatch,
+   /* TODO (kim): according to LDAP rfc we should be using same 
comparison
+* as Directory String (LDB_SYNTAX_DIRECTORY_STRING), but case 
sensitive.
+* But according to ms docs binary compare should do the job:
+* 
http://msdn.microsoft.com/en-us/library/cc223200(v=PROT.10).aspx */
+   .ldb_syntax = LDB_SYNTAX_OCTET_STRING,
},{
.name   = String(Unicode),
.ldap_oid   = LDB_SYNTAX_DIRECTORY_STRING,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-21 Thread Kamen Mazdrashki
The branch, master has been updated
   via  2a00138 s4-dsdb/schema_syntax: Separate validation for numericoid 
OID values
   via  14cb61d asn1_tests: Implement negative unit-tests for 
ber_write_OID_String()
   via  6b63ad6 asn1: ber_write_OID_String() to be more picky about 
supplied OID
  from  c74ef7a waf: Mark the replacement zlib private so that it can build 
on machine without a system zlib

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


- Log -
commit 2a001381e88b18b8612cdc2a40d9ea3c825548ea
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 20 13:49:46 2010 +0300

s4-dsdb/schema_syntax: Separate validation for numericoid OID values

This implementation doesn't use prefixMap/Schema to validate
numericoid OIDs. We may not have this OID yet, so I see no point
checking schema for if we have it.

Side effect of using prefixMap/Schema for validating numericoids
is that we mistakenly add the OID to the prefixMap.
This led to a corrupted prefixMap in LDB.

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Thu Oct 21 23:32:26 UTC 2010 on sn-devel-104

commit 14cb61da8fe4fb24c3e066e5731d0be00ddb893b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 20 13:46:34 2010 +0300

asn1_tests: Implement negative unit-tests for ber_write_OID_String()

commit 6b63ad6ff1bfcb7fcfb3e0f3cd4636ff222ab88f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 20 13:45:59 2010 +0300

asn1: ber_write_OID_String() to be more picky about supplied OID

Now function will check for invalid OID handling cases where:
 - sub-identifier has invalid characters (non-digit)
 - 'dot' separator found on unexpected place. For instance
'.' at start or end of the OID. Two '.' in a row.

---

Summary of changes:
 lib/util/asn1.c |5 +++
 lib/util/tests/asn1_tests.c |   22 +++
 source4/dsdb/schema/schema_syntax.c |   50 --
 3 files changed, 74 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 2a71f2f..21d4bd4 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -221,10 +221,12 @@ bool ber_write_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB 
*blob, const char *OID)
char *newp;
int i;
 
+   if (!isdigit(*p)) return false;
v = strtoul(p, newp, 10);
if (newp[0] != '.') return false;
p = newp + 1;
 
+   if (!isdigit(*p)) return false;
v2 = strtoul(p, newp, 10);
if (newp[0] != '.') return false;
p = newp + 1;
@@ -237,9 +239,12 @@ bool ber_write_OID_String(TALLOC_CTX *mem_ctx, DATA_BLOB 
*blob, const char *OID)
 
i = 1;
while (*p) {
+   if (!isdigit(*p)) return false;
v = strtoul(p, newp, 10);
if (newp[0] == '.') {
p = newp + 1;
+   /* check for empty last component */
+   if (!*p) return false;
} else if (newp[0] == '\0') {
p = newp;
} else {
diff --git a/lib/util/tests/asn1_tests.c b/lib/util/tests/asn1_tests.c
index b11e9d5..97f7756 100644
--- a/lib/util/tests/asn1_tests.c
+++ b/lib/util/tests/asn1_tests.c
@@ -64,6 +64,17 @@ static const struct oid_data oid_data_ok[] = {
},
 };
 
+/* Data for successful OIDs conversions */
+static const char *oid_data_err[] = {
+   , /* empty OID */
+   .2.5.4.130,   /* first sub-identifier is empty */
+   2.5.4.130.,   /* last sub-identifier is empty */
+   2..5.4.130,   /* second sub-identifier is empty */
+   2.5..4.130,   /* third sub-identifier is empty */
+   2.abc.4.130,  /* invalid sub-identifier */
+   2.5abc.4.130, /* invalid sub-identifier (alpha-numeric)*/
+};
+
 /* Data for successful Partial OIDs conversions */
 static const struct oid_data partial_oid_data_ok[] = {
{
@@ -104,6 +115,7 @@ static bool test_ber_write_OID_String(struct 
torture_context *tctx)
 
mem_ctx = talloc_new(tctx);
 
+   /* check for valid OIDs */
for (i = 0; i  ARRAY_SIZE(oid_data_ok); i++) {
torture_assert(tctx, ber_write_OID_String(mem_ctx, blob, 
data[i].oid),
ber_write_OID_String failed);
@@ -117,6 +129,16 @@ static bool test_ber_write_OID_String(struct 
torture_context *tctx)
data[i].oid, data[i].bin_oid));
}
 
+   /* check for invalid OIDs */
+   for (i = 0; i  ARRAY_SIZE(oid_data_err); i++) {
+   torture_assert(tctx,
+  !ber_write_OID_String(mem_ctx, blob, 
oid_data_err[i

[SCM] Samba Shared Repository - branch master updated

2010-10-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  71ac92b s4-schema_init: Print more info about syntax we fail to 
recognize
   via  099b005 asn1_tests.c: Make test data static const
   via  d057ca3 lib/util/asn1.c: comment spelling
  from  0941099 ldb:ldb_index.c - fix some memory leaks

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


- Log -
commit 71ac92b67391d826b015fc4cffb104918d14594b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 20 13:43:00 2010 +0300

s4-schema_init: Print more info about syntax we fail to recognize

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Oct 20 13:54:01 UTC 2010 on sn-devel-104

commit 099b0057bed73c3c7a2cf7d0123c8a1daaf53ed0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Oct 18 03:50:20 2010 +0300

asn1_tests.c: Make test data static const

commit d057ca3e3fba8190030929cbd41ef9a61440a78c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Oct 18 03:49:21 2010 +0300

lib/util/asn1.c: comment spelling

---

Summary of changes:
 lib/util/asn1.c   |2 +-
 lib/util/tests/asn1_tests.c   |   12 ++--
 source4/dsdb/schema/schema_init.c |6 --
 3 files changed, 11 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 7635ce2..2a71f2f 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -282,7 +282,7 @@ bool ber_write_partial_OID_String(TALLOC_CTX *mem_ctx, 
DATA_BLOB *blob, const ch
return false;
}
 
-   /* Add partially endcoded subidentifier */
+   /* Add partially encoded sub-identifier */
if (p) {
DATA_BLOB tmp_blob = strhex_to_data_blob(tmp_ctx, p);
data_blob_append(mem_ctx, blob, tmp_blob.data, tmp_blob.length);
diff --git a/lib/util/tests/asn1_tests.c b/lib/util/tests/asn1_tests.c
index 25c8222..b11e9d5 100644
--- a/lib/util/tests/asn1_tests.c
+++ b/lib/util/tests/asn1_tests.c
@@ -29,7 +29,7 @@ struct oid_data {
 };
 
 /* Data for successful OIDs conversions */
-struct oid_data oid_data_ok[] = {
+static const struct oid_data oid_data_ok[] = {
{
.oid = 2.5.4.0,
.bin_oid = 550400
@@ -65,7 +65,7 @@ struct oid_data oid_data_ok[] = {
 };
 
 /* Data for successful Partial OIDs conversions */
-struct oid_data partial_oid_data_ok[] = {
+static const struct oid_data partial_oid_data_ok[] = {
{
.oid = 2.5.4.130:0x81,
.bin_oid = 5504810281
@@ -100,7 +100,7 @@ static bool test_ber_write_OID_String(struct 
torture_context *tctx)
char *hex_str;
DATA_BLOB blob;
TALLOC_CTX *mem_ctx;
-   struct oid_data *data = oid_data_ok;
+   const struct oid_data *data = oid_data_ok;
 
mem_ctx = talloc_new(tctx);
 
@@ -129,7 +129,7 @@ static bool test_ber_read_OID_String(struct torture_context 
*tctx)
const char *oid;
DATA_BLOB oid_blob;
TALLOC_CTX *mem_ctx;
-   struct oid_data *data = oid_data_ok;
+   const struct oid_data *data = oid_data_ok;
 
mem_ctx = talloc_new(tctx);
 
@@ -157,7 +157,7 @@ static bool test_ber_write_partial_OID_String(struct 
torture_context *tctx)
char *hex_str;
DATA_BLOB blob;
TALLOC_CTX *mem_ctx;
-   struct oid_data *data = oid_data_ok;
+   const struct oid_data *data = oid_data_ok;
 
mem_ctx = talloc_new(tctx);
 
@@ -202,7 +202,7 @@ static bool test_ber_read_partial_OID_String(struct 
torture_context *tctx)
const char *oid;
DATA_BLOB oid_blob;
TALLOC_CTX *mem_ctx;
-   struct oid_data *data = oid_data_ok;
+   const struct oid_data *data = oid_data_ok;
 
mem_ctx = talloc_new(tctx);
 
diff --git a/source4/dsdb/schema/schema_init.c 
b/source4/dsdb/schema/schema_init.c
index 6dbf9ba..d80f209 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -631,8 +631,10 @@ WERROR dsdb_attribute_from_ldb(struct ldb_context *ldb,
}
 
if (dsdb_schema_setup_ldb_schema_attribute(ldb, attr) != LDB_SUCCESS) {
-   DEBUG(0,(__location__ : Unknown schema syntax for %s\n,
-attr-lDAPDisplayName));
+   DEBUG(0,(__location__ : Unknown schema syntax for %s - 
ldb_syntax: %s, ldap_oid: %s\n,
+attr-lDAPDisplayName,
+attr-syntax-ldb_syntax,
+attr-syntax-ldap_oid));
return WERR_DS_ATT_SCHEMA_REQ_SYNTAX;
}
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  c0b9526 pytalloc: use talloc_unlink() to free py_talloc objects
  from  feb6034 talloc: make header C++ safe

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


- Log -
commit c0b9526aaf29442f85f62232e22aecfb484b1576
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 8 04:21:07 2010 +0300

pytalloc: use talloc_unlink() to free py_talloc objects

Those type of objects are referenced every time we assign
them to other py_talloc objects, which leads to runtime
warnings that we are trying to free an object with references

Wrap talloc_unlink() in SMB_ASSERT() to ensure we catch possible failure

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Oct 20 21:37:06 UTC 2010 on sn-devel-104

---

Summary of changes:
 lib/talloc/pytalloc.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index b0b7394..ae59b69 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -21,6 +21,8 @@
 #include replace.h
 #include talloc.h
 #include pytalloc.h
+#include lib/util/debug.h
+#include lib/util/util.h
 
 /**
  * Simple dealloc for talloc-wrapping PyObjects
@@ -28,7 +30,7 @@
 void py_talloc_dealloc(PyObject* self)
 {
py_talloc_Object *obj = (py_talloc_Object *)self;
-   talloc_free(obj-talloc_ctx);
+   SMB_ASSERT(talloc_unlink(NULL, obj-talloc_ctx) != -1);
obj-talloc_ctx = NULL;
self-ob_type-tp_free(self);
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  f827fcd s4-libnet_vampire: Remove unused self_corrected_schema
   via  b44135a s4-libnet_vampire use a linked list to handle schema 
objects pending conversion
   via  837af1c s4-vampire: Optimize Schema decoding conversion
   via  0440741 s4-vampire: Initial implementation for multi-pass schema 
decoding from DRS data
   via  20029aa s4-dsdb-repl: Print what the error code for failure is
   via  81e5e23 s4-dsdb: Make dsdb_setup_sorted_accessors() public
  from  c15e919 wafsamba: Clarify needs_python argument name, use 
pyembed/pyext where applicable.

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


- Log -
commit f827fcd0e0f91b6aca113ec94e09e293f119cba8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Oct 3 04:29:08 2010 +0300

s4-libnet_vampire: Remove unused self_corrected_schema

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sun Oct 10 10:40:38 UTC 2010 on sn-devel-104

commit b44135ac737499052f54e72b4076ef5561852d35
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Sep 27 08:50:54 2010 +1000

s4-libnet_vampire use a linked list to handle schema objects pending 
conversion

commit 837af1c29ae6ecebf483706e14b3190fdf4988c8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Sep 25 13:26:03 2010 +0300

s4-vampire: Optimize Schema decoding conversion

memmove() is removed and I am using the beginning
of the list for storage for failed objects

commit 0440741473a87d184055942586c5f68de153fa2f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 24 22:56:36 2010 +0300

s4-vampire: Initial implementation for multi-pass schema decoding from DRS 
data

We can't decode all schema object in just one (or even two)
passes when Schema tree has more levels of inheritance.

commit 20029aac31d1952b8307d4f0c3c628f17562af51
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 24 00:47:37 2010 +0300

s4-dsdb-repl: Print what the error code for failure is

commit 81e5e23683ebbb48bb3a2b2db306f47234cdfe09
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 24 00:46:50 2010 +0300

s4-dsdb: Make dsdb_setup_sorted_accessors() public

We are going to need it while converting DRS schema.

---

Summary of changes:
 source4/dsdb/repl/replicated_objects.c |4 +-
 source4/dsdb/schema/schema_set.c   |4 +-
 source4/libnet/libnet_vampire.c|  176 +--
 3 files changed, 101 insertions(+), 83 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index 0beb53c..10b13a8 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -271,7 +271,9 @@ WERROR dsdb_extended_replicated_objects_convert(struct 
ldb_context *ldb,
out-objects, out-objects[i]);
if (!W_ERROR_IS_OK(status)) {
talloc_free(out);
-   DEBUG(0,(Failed to convert object %s\n, 
cur-object.identifier-dn));
+   DEBUG(0,(Failed to convert object %s: %s\n,
+cur-object.identifier-dn,
+win_errstr(status)));
return status;
}
}
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 344e9bb..4a4466a 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -264,8 +264,8 @@ static void dsdb_sorted_accessors_free(struct dsdb_schema 
*schema)
 /*
   create the sorted accessor arrays for the schema
  */
-static int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
-  struct dsdb_schema *schema)
+int dsdb_setup_sorted_accessors(struct ldb_context *ldb,
+   struct dsdb_schema *schema)
 {
struct dsdb_class *cur;
struct dsdb_attribute *a;
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index adcb010..6a94f07 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -68,9 +68,6 @@ struct libnet_vampire_cb_state {
 * converted, because we may not know them yet */
struct dsdb_schema *self_made_schema;
 
-   /* 2nd pass, with full ID-OID-name table */
-   struct dsdb_schema *self_corrected_schema;
-
/* prefixMap in LDB format, from the remote DRS server */
DATA_BLOB prefixmap_blob;
const struct dsdb_schema *schema;
@@ -222,9 +219,17 @@ NTSTATUS libnet_vampire_cb_check_options(void 
*private_data,
 static NTSTATUS libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state 
*s

[SCM] Samba Shared Repository - branch master updated

2010-10-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  76a8ae9 pytalloc: Fix warning that we are subtracting void* pointers
  from  615482a s3: Hang the isilon kernel oplocks off the NULL context

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


- Log -
commit 76a8ae9e0db0340bfa96c428d55afe9b885977e0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 8 04:19:30 2010 +0300

pytalloc: Fix warning that we are subtracting void* pointers

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Fri Oct  8 23:36:54 UTC 2010 on sn-devel-104

---

Summary of changes:
 lib/talloc/pytalloc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index bea6961..b0b7394 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -109,7 +109,7 @@ int py_talloc_default_cmp(PyObject *_obj1, PyObject *_obj2)
if (obj1-ob_type != obj2-ob_type)
return (obj1-ob_type - obj2-ob_type);
 
-   return (py_talloc_get_ptr(obj1) - py_talloc_get_ptr(obj2));
+   return ((char *)py_talloc_get_ptr(obj1) - (char 
*)py_talloc_get_ptr(obj2));
 }
 
 static void py_cobject_talloc_free(void *ptr)


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  2d2dbf5 s4-test-msds_intid: Verify ATTIDs for Linked Attributes
   via  6853883 s4-test-msds_intid: Simplify parameters for 
_make_error_message() function
  from  9e1e581 More neccessary const.

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


- Log -
commit 2d2dbf53ee110bfcd2f193d3e5c8d0e27759c4f3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Oct 9 05:40:32 2010 +0300

s4-test-msds_intid: Verify ATTIDs for Linked Attributes

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sat Oct  9 03:43:34 UTC 2010 on sn-devel-104

commit 6853883f3f171c69b28a0888548aaa464e163ac7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Oct 9 04:22:24 2010 +0300

s4-test-msds_intid: Simplify parameters for _make_error_message() function

so it can be used in more places - when checking for
Linked Attributes ATTIDs for instance

---

Summary of changes:
 source4/torture/drs/rpc/msds_intid.c |   73 +-
 1 files changed, 63 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/rpc/msds_intid.c 
b/source4/torture/drs/rpc/msds_intid.c
index ea5bdc6..2b2fa5e 100644
--- a/source4/torture/drs/rpc/msds_intid.c
+++ b/source4/torture/drs/rpc/msds_intid.c
@@ -460,17 +460,17 @@ static bool _test_GetNCChanges(struct torture_context 
*tctx,
 }
 
 static char * _make_error_message(TALLOC_CTX *mem_ctx,
-  const struct dsdb_attribute *dsdb_attr,
-  const struct drsuapi_DsReplicaAttribute 
*drs_attr,
-  const struct 
drsuapi_DsReplicaObjectListItemEx *drs_obj)
+ enum drsuapi_DsAttributeId drs_attid,
+ const struct dsdb_attribute *dsdb_attr,
+ const struct 
drsuapi_DsReplicaObjectIdentifier *identifier)
 {
return talloc_asprintf(mem_ctx, \nInvalid ATTID for %1$s (%2$s)\n
drs_attid:  %3$11d (0x%3$08X)\n
msDS_IntId: %4$11d (0x%4$08X)\n
attributeId_id: %5$11d (0x%5$08X),
   dsdb_attr-lDAPDisplayName,
-  drs_obj-object.identifier-dn,
-  drs_attr-attid,
+  identifier-dn,
+  drs_attid,
   dsdb_attr-msDS_IntId,
   dsdb_attr-attributeID_id);
 }
@@ -489,6 +489,7 @@ static bool test_dsintid_schema(struct torture_context 
*tctx, struct DsIntIdTest
const struct drsuapi_DsReplicaAttribute *drs_attr;
const struct drsuapi_DsReplicaAttributeCtr *attr_ctr;
const struct drsuapi_DsReplicaObjectListItemEx *cur;
+   const struct drsuapi_DsReplicaLinkedAttribute *la;
TALLOC_CTX *mem_ctx;
 
mem_ctx = talloc_new(ctx);
@@ -518,15 +519,40 @@ static bool test_dsintid_schema(struct torture_context 
*tctx, struct DsIntIdTest
 
torture_assert(tctx,
   drs_attr-attid == 
dsdb_attr-attributeID_id,
-  _make_error_message(ctx, dsdb_attr, 
drs_attr, cur))
+  _make_error_message(ctx, drs_attr-attid,
+  dsdb_attr,
+  
cur-object.identifier));
if (dsdb_attr-msDS_IntId) {
torture_assert(tctx,
-  drs_attr-attid != 
dsdb_attr-msDS_IntId,
-  _make_error_message(ctx, 
dsdb_attr, drs_attr, cur))
+  drs_attr-attid != 
dsdb_attr-msDS_IntId,
+  _make_error_message(ctx, 
drs_attr-attid,
+  dsdb_attr,
+  
cur-object.identifier));
}
}
}
 
+   /* verify ATTIDs for Linked Attributes */
+   torture_comment(tctx, Verify ATTIDs for Linked Attributes (%u)\n,
+   ctr6-linked_attributes_count);
+   for (i = 0; i  ctr6-linked_attributes_count; i++) {
+   la = ctr6-linked_attributes[i];
+   dsdb_attr = dsdb_attribute_by_attributeID_id(ldap_schema, 
la-attid);
+
+   torture_assert(tctx,
+  la-attid == dsdb_attr-attributeID_id,
+  _make_error_message(ctx, la-attid

[SCM] Samba Shared Repository - branch master updated

2010-10-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  5218bcf s4-provision: Reset debuglevel after provision take 
place
   via  fb0add6 s4-libnet_vampire: Reparent result.lp_ctx - we have already 
referenced it
   via  9c27099 s4-test: Fix PYTHONPATH for python.drs_ tests
   via  dd380e3 s4-test: Use absolute path for 'samba4srcdir'
  from  4aa8aaa s3-waf: convert NSS_INFO into a subsystem.

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


- Log -
commit 5218bcf76fb30560741cf5511ff38d7dd93e0f18
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Oct 3 04:33:02 2010 +0300

s4-provision: Reset debuglevel after provision take place

Otherwise provision resets our current debug level and
we don't get debug messages we may expect onwards

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Oct  5 11:32:50 UTC 2010 on sn-devel-104

commit fb0add66055f68edc849e29b3609e268b9c7a766
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Oct 3 04:30:14 2010 +0300

s4-libnet_vampire: Reparent result.lp_ctx - we have already referenced it

which leads to warning that we are trying to steal
a context with references

commit 9c27099715b248206c2d5ca9e7db22532ad9f994
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 5 02:47:08 2010 +0300

s4-test: Fix PYTHONPATH for python.drs_ tests

commit dd380e34598639cfdbe447462972fff03e44b805
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 5 02:45:38 2010 +0300

s4-test: Use absolute path for 'samba4srcdir'

---

Summary of changes:
 source4/libnet/libnet_vampire.c |2 +-
 source4/scripting/python/samba/provision.py |   16 +---
 source4/selftest/tests.py   |6 +++---
 3 files changed, 13 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index 1b6a8dd..adcb010 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -173,7 +173,7 @@ NTSTATUS libnet_vampire_cb_prepare_db(void *private_data,
}
 
s-ldb = talloc_steal(s, result.samdb);
-   s-lp_ctx = talloc_steal(s, result.lp_ctx);
+   s-lp_ctx = talloc_reparent(talloc_parent(result.lp_ctx), s, 
result.lp_ctx);
s-provision_schema = dsdb_get_schema(s-ldb, s);
s-server_dn_str = talloc_steal(s, p-dest_dsa-server_dn_str);
 
diff --git a/source4/scripting/python/samba/provision.py 
b/source4/scripting/python/samba/provision.py
index 96e7aa5..99e2e13 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1727,13 +1727,15 @@ def provision_become_dc(setup_dir=None,
 logger = logging.getLogger(provision)
 samba.set_debug_level(debuglevel)
 
-return provision(setup_dir, logger, system_session(), None,
-  smbconf=smbconf, targetdir=targetdir, samdb_fill=FILL_DRS,
-  realm=realm, rootdn=rootdn, domaindn=domaindn, schemadn=schemadn,
-  configdn=configdn, serverdn=serverdn, domain=domain,
-  hostname=hostname, hostip=127.0.0.1, domainsid=domainsid,
-  machinepass=machinepass, serverrole=domain controller,
-  sitename=sitename)
+res = provision(setup_dir, logger, system_session(), None,
+smbconf=smbconf, targetdir=targetdir, samdb_fill=FILL_DRS,
+realm=realm, rootdn=rootdn, domaindn=domaindn, 
schemadn=schemadn,
+configdn=configdn, serverdn=serverdn, domain=domain,
+hostname=hostname, hostip=127.0.0.1, domainsid=domainsid,
+machinepass=machinepass, serverrole=domain controller,
+sitename=sitename)
+res.lp.set(debuglevel, str(debuglevel))
+return res
 
 
 def create_phpldapadmin_config(path, setup_path, ldapi_uri):
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 5a2880a..7f59365 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -126,7 +126,7 @@ def plansmbtorturetestsuite(name, env, options):
 plantestsuite_loadlist(modname, env, cmdline)
 
 
-samba4srcdir = os.path.normpath(os.path.join(os.path.dirname(__file__), ..))
+samba4srcdir = 
os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ..))
 builddir = os.getenv(BUILDDIR, samba4srcdir)
 samba4bindir = os.path.normpath(os.path.join(builddir, bin))
 smb4torture = binpath(smbtorture)
@@ -495,8 +495,8 @@ plantestsuite(samba4.blackbox.group.py, none, 
[PYTHON=%s % python, os.path
 plantestsuite(samba4.blackbox.spn.py(dc:local), dc:local, [PYTHON=%s % 
python, os.path.join(samba4srcdir, setup/tests/blackbox_spn.sh), 
'$PREFIX/dc'])
 
 # DRS python tests
-plantestsuite(samba4.drs_delete_object.python(vampire_dc

[SCM] Samba Shared Repository - branch master updated

2010-10-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  95c6c9b heimdal-com_err: fix the build for systems with older 
'com_err' library
  from  cef5a36 selftest: make it more obvious we only expect the printjob 
tests to fail.

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


- Log -
commit 95c6c9b69bcc7bed3a733a355dfa502b7aebd92b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Oct 5 23:08:24 2010 +0300

heimdal-com_err: fix the build for systems with older 'com_err' library

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Tue Oct  5 21:36:41 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/heimdal_build/wscript_configure |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/heimdal_build/wscript_configure 
b/source4/heimdal_build/wscript_configure
index 74b1794..8a5ac93 100644
--- a/source4/heimdal_build/wscript_configure
+++ b/source4/heimdal_build/wscript_configure
@@ -60,7 +60,7 @@ conf.CHECK_STRUCTURE_MEMBER('DIR', 'dd_fd', 
define='HAVE_DIR_DD_FD',  headers='d
 
 conf.DEFINE('SAMBA4_INTERNAL_HEIMDAL', 1)
 
-if conf.CHECK_BUNDLED_SYSTEM('com_err', checkfunctions='com_err', 
headers='com_err.h'):
+if conf.CHECK_BUNDLED_SYSTEM('com_err',  minversion='1.41.11', 
checkfunctions='com_err com_right_r', headers='com_err.h com_right.h'):
 conf.define('USING_SYSTEM_COM_ERR', 1)
 
 if conf.find_program('compile_et', var='COMPILE_ET'):


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  ee881c9 s4-test: Fix PYTHONPATH for samba4.schemaInfo.python(dc) 
test
  from  77622ac Fix crash in SMB2 rename found by gentest. We must always 
have an lcomp in the destination struct for a rename, so set the flag 
appropriately.

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


- Log -
commit ee881c9d077bbd2a158bacc6676dcabf4f81ed34
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Oct 6 05:12:58 2010 +0300

s4-test: Fix PYTHONPATH for samba4.schemaInfo.python(dc) test

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Wed Oct  6 02:54:56 UTC 2010 on sn-devel-104

---

Summary of changes:
 source4/selftest/tests.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 7f59365..c6ba750 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -470,7 +470,7 @@ planpythontestsuite(none, subunit)
 planpythontestsuite(dc:local, samba.tests.dcerpc.rpcecho)
 plantestsuite_idlist(samba.tests.dcerpc.registry, dc:local, [subunitrun, 
'-U$USERNAME%$PASSWORD', samba.tests.dcerpc.registry])
 plantestsuite(samba4.ldap.python(dc), dc, [python, 
os.path.join(samba4srcdir, dsdb/tests/python/ldap.py), '$SERVER', 
'-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'])
-plantestsuite(samba4.schemaInfo.python(dc), dc, 
['PYTHONPATH=$PYTHONPATH:$samba4srcdir/dsdb/tests/python/', subunitrun, 
'dsdb_schema_info', '-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
+plantestsuite(samba4.schemaInfo.python(dc), dc, 
['PYTHONPATH=$PYTHONPATH:%s' % os.path.join(samba4srcdir, 
'dsdb/tests/python'), subunitrun, 'dsdb_schema_info', 
'-U$DOMAIN/$DC_USERNAME%$DC_PASSWORD'])
 plantestsuite(samba4.urgent_replication.python(dc), dc, [python, 
os.path.join(samba4srcdir, dsdb/tests/python/urgent_replication.py), 
'$PREFIX_ABS/dc/private/sam.ldb'])
 for env in [dc, fl2000dc, fl2003dc, fl2008r2dc]:
 plantestsuite(samba4.ldap_schema.python(%s) % env, env, [python, 
os.path.join(samba4srcdir, dsdb/tests/python/ldap_schema.py), '$SERVER', 
'-U$USERNAME%$PASSWORD', '-W', '$DOMAIN'])


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-10-02 Thread Kamen Mazdrashki
The branch, master has been updated
   via  197a151 s4-ldapcmp.py: Don't guess credentials for second 
Credentials object
   via  da0f3bd s4-getopt.py: Make Anonymous creds when no credentials
   via  d385d9a s4-test-fsmo.py: Implement kind of busy-wait for role 
transfer
   via  657d4d8 s4-test-dsdb_schema_info.py: Get rid of global module 
variables
   via  83a1515 s4-test-dsdb_schema_info.py: Simplify connection SamDB
   via  2a23f0d s4-test-fsmo.py: Use common implementation for 
env_get_var_value()
   via  c05180c s4-test-delete_object.py: Use common implementation for 
env_get_var_value()
   via  302e1d2 s4-python-test: Common implementation for getting 
environment variable value
   via  6546127 s4-python-samba: Remove trailing ';'s
   via  6bc7c01 s4-test-fsmo.py: Use common implementation for 
connect_samdb()
   via  98e4d27 s4-test-delete_object.py: Use common implementation for 
connect_samdb()
   via  7acbb73 s4-python-test: Implement global connect_samdb() function
   via  46ac1c3 s4-samba.samdb: Fix masking names from outer context
   via  0cb476f s4-python-samba: 'file' is a built-in
   via  edfb8c6 s4-samba.samdb: Fix leading indention and trailing ';'
   via  e9620c5 s4-python-samba: Fix few cosmetics
  from  24f1893 s3: Attempt to fix the non-ads build

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


- Log -
commit 197a1514d62494cc8b862d169c841a26e04b8925
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 1 03:30:50 2010 +0300

s4-ldapcmp.py: Don't guess credentials for second Credentials object

This allow us to fallback to first credentials given.

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Sat Oct  2 23:05:20 UTC 2010 on sn-devel-104

commit da0f3bd2291e561fd8b6f0fafd4bf6cb52dad722
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Oct 1 03:29:33 2010 +0300

s4-getopt.py: Make Anonymous creds when no credentials

are supplied on command line and caller doesn't want us
to guess credentials from environment

commit d385d9a3178c6cc705f7cccf6688ba9b60571e96
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Sep 30 21:42:17 2010 +0300

s4-test-fsmo.py: Implement kind of busy-wait for role transfer

This allows us not to hard code timeout we are going to wait for
before failing the test - if DCs are not very busy, we won't wait
at all (speeds up 'make test' by a minute also)

Maximum timeout to wait for is set to 20 secs currently,
which should be enough even for slow machines and tested
DCs being under load

commit 657d4d88124f3a6b48e543abadd37948c426dca9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 15:56:23 2010 +0300

s4-test-dsdb_schema_info.py: Get rid of global module variables

commit 83a15155ebb3399117ce0da7d4e0faa1b72199f9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 15:51:11 2010 +0300

s4-test-dsdb_schema_info.py: Simplify connection SamDB

by using samba.tests.connect_samdb() helper

commit 2a23f0d524298c2cc78f36a2f5b45560ec36747f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 16:00:43 2010 +0300

s4-test-fsmo.py: Use common implementation for env_get_var_value()

commit c05180caa78eac0beb26c6791afd8642a97853e6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 16:00:04 2010 +0300

s4-test-delete_object.py: Use common implementation for env_get_var_value()

commit 302e1d29d82570ec32fd066bb9038649a67d148b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 14:53:12 2010 +0300

s4-python-test: Common implementation for getting environment variable value

Unit-test based python tests require certain input parameters
to be set in environment, otherwise they can't be run

commit 6546127b6420361469112325d3ec2e2d19ed864c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 04:31:02 2010 +0300

s4-python-samba: Remove trailing ';'s

commit 6bc7c015fb510756dce4ada4831ca094a5d07a61
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 03:02:11 2010 +0300

s4-test-fsmo.py: Use common implementation for connect_samdb()

Connections are restricted to LDAP only (remote),
as this test can't be run against local LDBs

commit 98e4d2702aa98d0cf89d3240276f2b5d6e841d45
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 03:00:18 2010 +0300

s4-test-delete_object.py: Use common implementation for connect_samdb()

Connections are restricted to LDAP only (remote),
as this test can't be run against local LDBs

commit 7acbb7346fdf96f25b3c465dd070b86694beb12b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 29 02:58:23 2010 +0300

s4-python-test: Implement global connect_samdb() function

This helper makes proper ldb url to connect to
and is a shorthand

[SCM] Samba Shared Repository - branch master updated

2010-09-25 Thread Kamen Mazdrashki
The branch, master has been updated
   via  f1b3c4d s4-possibleinferiors.py: Fix usage of 'paged_search' module 
for remote LDB connections
   via  1178560 s4-fsmo.py: Fix usage of 'paged_search' module for remote 
LDB connections
   via  cf57771 s4-delete_object.py: Fix usage of 'paged_search' module for 
remote LDB connections
   via  04826b6 s4-sec_descriptor.py: Fix usage of 'paged_search' module 
for remote LDB connections
   via  7a7068f s4-ldap_schema.py: Remove unused LDB connection to GC port
   via  8780d29 s4-dsdb_schema_info.py: Fix usage of 'paged_search' module 
for remote LDB connections
   via  7e1e7b1 s4-ldapcmp: Fix usage of 'paged_search' module for remote 
LDB connections
   via  9e6fa85 s4-ldapcmp: Extend ldapcmp to be able to compare more than 
one context at a time
  from  dda1dd6 s3: Avoid an explicit ZERO_STRUCT

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


- Log -
commit f1b3c4dd387ac04615c3443d5de1059d2dc59ba4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 02:13:39 2010 +0300

s4-possibleinferiors.py: Fix usage of 'paged_search' module for remote LDB 
connections

commit 11785600be99f3a5b6edeef6f9efe4898abeb3d8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:21:19 2010 +0300

s4-fsmo.py: Fix usage of 'paged_search' module for remote LDB connections

commit cf5777111616a2f5239b19b5b95974dd47136c48
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:20:20 2010 +0300

s4-delete_object.py: Fix usage of 'paged_search' module for remote LDB 
connections

commit 04826b65f6699bb6455aa1f2800a26400567d339
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:18:35 2010 +0300

s4-sec_descriptor.py: Fix usage of 'paged_search' module for remote LDB 
connections

commit 7a7068f2ed6a21e6eab06021a3262217fe0afaf8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:13:39 2010 +0300

s4-ldap_schema.py: Remove unused LDB connection to GC port

commit 8780d2934bee14664e44643f70c90b609acda6b0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:11:08 2010 +0300

s4-dsdb_schema_info.py: Fix usage of 'paged_search' module for remote LDB 
connections

commit 7e1e7b16f6c2184554c429e039227efd6c7ed839
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 00:10:24 2010 +0300

s4-ldapcmp: Fix usage of 'paged_search' module for remote LDB connections

commit 9e6fa8553cb7ca7fece76646c30f7fcb2a86a83a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 26 02:25:03 2010 +0300

s4-ldapcmp: Extend ldapcmp to be able to compare more than one context at a 
time

If no arguments given, ldapcmp will compare all NCs

---

Summary of changes:
 .../samdb/ldb_modules/tests/possibleinferiors.py   |8 +++-
 source4/dsdb/tests/python/dsdb_schema_info.py  |   13 +++--
 source4/dsdb/tests/python/ldap_schema.py   |5 --
 source4/dsdb/tests/python/sec_descriptor.py|   10 +++-
 source4/scripting/devel/ldapcmp|   58 
 source4/torture/drs/python/delete_object.py|5 +-
 source4/torture/drs/python/fsmo.py |5 +-
 7 files changed, 65 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py 
b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
index 3324d4b..c1e935f 100755
--- a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
+++ b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
@@ -59,7 +59,13 @@ def uniq_list(alist):
 lp_ctx = sambaopts.get_loadparm()
 
 creds = credopts.get_credentials(lp_ctx)
-db = Ldb(url, credentials=creds, lp=lp_ctx, options=[modules:paged_searches])
+
+ldb_options = []
+# use 'paged_search' module when connecting remotely
+if url.lower().startswith(ldap://;):
+ldb_options = [modules:paged_searches]
+
+db = Ldb(url, credentials=creds, lp=lp_ctx, options=ldb_options)
 
 # get the rootDSE
 res = db.search(base=, expression=,
diff --git a/source4/dsdb/tests/python/dsdb_schema_info.py 
b/source4/dsdb/tests/python/dsdb_schema_info.py
index ff3c7f9..893cd4c 100755
--- a/source4/dsdb/tests/python/dsdb_schema_info.py
+++ b/source4/dsdb/tests/python/dsdb_schema_info.py
@@ -203,11 +203,12 @@ if not :// in ldb_url:
 ldb_url = tdb://%s % ldb_url
 else:
 ldb_url = ldap://%s; % ldb_url
-# user 'paged_search' module when connecting remotely
-ldb_options = [modules:paged_searches]
+# use 'paged_search' module when connecting remotely
+if ldb_url.lower().startswith(ldap://;):
+ldb_options = [modules:paged_searches]
 
 ldb = SamDB(url=ldb_url,
-  lp=samba.tests.env_loadparm(),
-  session_info=system_session(),
-  credentials

[SCM] Samba Shared Repository - branch master updated

2010-09-22 Thread Kamen Mazdrashki
The branch, master has been updated
   via  0027af0 s4-drs-test: Relax a check that may possibly fail
   via  e3b81c6 s4-ldapcmp: Enable comparisons between LDBs too
  from  e12e661 s4-selftest: Move more tests to scripting/python, 
simplifies running of tests.

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


- Log -
commit 0027af02d2d0114b2e1e06b49e590db1efe38879
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 22 03:57:30 2010 +0300

s4-drs-test: Relax a check that may possibly fail

This check may fail due to automatic replication between DCs
during the test execution.
Ideally we should block automatic replications (somehow)
during this test. But until then, we need just to skip
this check, it is not *that* important anyway

commit e3b81c6062c9b82d246ac8103c07c246e2a72250
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 22 03:24:01 2010 +0300

s4-ldapcmp: Enable comparisons between LDBs too

This will enable us to compare two LDBs or and LDB with running
AD server. Comparing LDB against running running server
may come into handy when one want to see if 'net vampire'
command does what it does the right way

---

Summary of changes:
 source4/scripting/devel/ldapcmp |   15 ---
 source4/torture/drs/python/delete_object.py |8 +++-
 2 files changed, 19 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/devel/ldapcmp b/source4/scripting/devel/ldapcmp
index edf37d3..689c202 100755
--- a/source4/scripting/devel/ldapcmp
+++ b/source4/scripting/devel/ldapcmp
@@ -43,10 +43,19 @@ summary = {}
 class LDAPBase(object):
 
 def __init__(self, host, cmd_opts, creds, lp):
+ldb_options = []
+samdb_url = host
 if not :// in host:
-self.host = ldap://; + host + :389
-self.ldb = Ldb(self.host, credentials=creds, lp=lp,
- options=[modules:paged_searches])
+if os.path.isfile(host):
+samdb_url = tdb://%s % host
+else:
+samdb_url = ldap://%s:389; % host
+# user 'paged_search' module when connecting remotely
+ldb_options = [modules:paged_searches]
+self.ldb = Ldb(url=samdb_url,
+   credentials=creds,
+   lp=lp,
+   options=ldb_options)
 self.two_domains = cmd_opts.two
 self.quiet = cmd_opts.quiet
 self.host = host
diff --git a/source4/torture/drs/python/delete_object.py 
b/source4/torture/drs/python/delete_object.py
index 20f8530..d494204 100644
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -184,7 +184,13 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 # check user info on DC1 - should be deleted
 self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, 
is_deleted=True)
 # check user info on DC2 - should be valid user
-self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, 
is_deleted=False)
+try:
+self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, 
is_deleted=False)
+except self.failureException:
+print (Checking for not isDeleted user on %s failed, 
+   probably because a replication took place. 
+   Ideally we should block automatic replications during this 
test, 
+   but until then, just ignore the error % self.dnsname_dc2)
 
 # trigger replication from DC2 to DC1
 # to check if deleted object gets restored


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-09-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4752a6b s4-test: yet another test for ATTID-ot-OID conversion
   via  f06d987 s4-dsdb-schema_prefixmap: return 
WERR_DS_NO_ATTRIBUTE_OR_VALUE when ATTID is not found
   via  395b09c s4-dsdb-schema_prefixmap: Print debug message when internal 
failure occurs
   via  0740d0a s4-devel-getncchanges: Add common Samba options as a group 
to be displayed
  from  d0a6c32 s3-nmbd: move SYNC_DNS to nmbd.h

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


- Log -
commit 4752a6b6d7767a62f322ee3d8e3a412e7699fcea
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Sep 20 21:28:06 2010 +0300

s4-test: yet another test for ATTID-ot-OID conversion

Test with a valid ATTID for prefixMap lookups,
but supplied ATTID is with index not to be found
in the test prefixMap

commit f06d98764a455981c664512acc423715dec3d7a4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Sep 20 20:52:48 2010 +0300

s4-dsdb-schema_prefixmap: return WERR_DS_NO_ATTRIBUTE_OR_VALUE when ATTID 
is not found

rather than WERR_INTERNAL_ERROR - it is not internal error!

commit 395b09c1b6ac9df42202966d90b1a121712df418
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Sep 20 21:31:20 2010 +0300

s4-dsdb-schema_prefixmap: Print debug message when internal failure occurs

commit 0740d0ae85870a6b392cb3ab6cbc3fb36ed3714c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Sep 20 21:31:11 2010 +0300

s4-devel-getncchanges: Add common Samba options as a group to be displayed

Those options are processed but never shown with --help argument

---

Summary of changes:
 source4/dsdb/schema/schema_prefixmap.c |7 ++-
 source4/scripting/devel/getncchanges   |1 +
 source4/torture/drs/unit/prefixmap_tests.c |9 +++--
 3 files changed, 14 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_prefixmap.c 
b/source4/dsdb/schema/schema_prefixmap.c
index 8105f12..79894fe 100644
--- a/source4/dsdb/schema/schema_prefixmap.c
+++ b/source4/dsdb/schema/schema_prefixmap.c
@@ -188,6 +188,7 @@ static WERROR _dsdb_pfm_make_binary_oid(const char 
*full_oid, TALLOC_CTX *mem_ct
 
/* encode oid in BER format */
if (!ber_write_OID_String(mem_ctx, _bin_oid, full_oid)) {
+   DEBUG(0,(ber_write_OID_String() failed for %s\n, full_oid));
return WERR_INTERNAL_ERROR;
}
 
@@ -341,7 +342,9 @@ WERROR dsdb_schema_pfm_oid_from_attid(struct 
dsdb_schema_prefixmap *pfm, uint32_
}
 
if (!pfm_entry) {
-   return WERR_INTERNAL_ERROR;
+   DEBUG(1,(Failed to find prefixMap entry for ATTID = 0x%08X 
(%d)\n,
+attid, attid));
+   return WERR_DS_NO_ATTRIBUTE_OR_VALUE;
}
 
/* copy oid prefix making enough room */
@@ -363,6 +366,8 @@ WERROR dsdb_schema_pfm_oid_from_attid(struct 
dsdb_schema_prefixmap *pfm, uint32_
}
 
if (!ber_read_OID_String(mem_ctx, bin_oid, _oid)) {
+   DEBUG(0,(ber_read_OID_String() failed for %s\n,
+hex_encode_talloc(bin_oid.data, bin_oid.data, 
bin_oid.length)));
werr = WERR_INTERNAL_ERROR;
}
 
diff --git a/source4/scripting/devel/getncchanges 
b/source4/scripting/devel/getncchanges
index 7656c22..99f14ea 100755
--- a/source4/scripting/devel/getncchanges
+++ b/source4/scripting/devel/getncchanges
@@ -54,6 +54,7 @@ def do_DsBind(drs):
 if __name__ == __main__:
 parser = OptionParser(getncchanges [options] server)
 sambaopts = options.SambaOptions(parser)
+parser.add_option_group(sambaopts)
 credopts = options.CredentialsOptionsDouble(parser)
 parser.add_option_group(credopts)
 
diff --git a/source4/torture/drs/unit/prefixmap_tests.c 
b/source4/torture/drs/unit/prefixmap_tests.c
index a4521eb..a954399 100644
--- a/source4/torture/drs/unit/prefixmap_tests.c
+++ b/source4/torture/drs/unit/prefixmap_tests.c
@@ -394,8 +394,13 @@ static bool 
torture_drs_unit_pfm_oid_from_attid_check_attid(struct torture_conte
const char *oid;
 
/* Test with valid prefixMap attid */
-   werr = dsdb_schema_pfm_oid_from_attid(priv-pfm_full, 0x, tctx, 
oid);
-   torture_assert_werr_ok(tctx, werr, Testing prefixMap type attid = 
0x000);
+   werr = dsdb_schema_pfm_oid_from_attid(priv-pfm_full, 0x00010001, tctx, 
oid);
+   torture_assert_werr_ok(tctx, werr, Testing prefixMap type attid = 
0x00010001);
+
+   /* Test with valid attid but invalid index */
+   werr = dsdb_schema_pfm_oid_from_attid(priv-pfm_full, 0x01110001, tctx, 
oid);
+   torture_assert_werr_equal(tctx, werr, WERR_DS_NO_ATTRIBUTE_OR_VALUE,
+ Testing invalid-index attid = 0x01110001

[SCM] Samba Shared Repository - branch master updated

2010-09-18 Thread Kamen Mazdrashki
The branch, master has been updated
   via  d76bb4a s4-drs: Check for schema changes only in case we are *not* 
applying Schema replica
   via  1fac1f0 werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro
   via  c3489a7 s4-ldapcmp: Fix options parsing for common Samba options
  from  78b6265 s3:rpc_client: remove unused rpc_pipe_set_hnd_state()

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


- Log -
commit d76bb4ac409ff7f95776302bb436c7dec55adb26
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Sep 18 15:09:22 2010 +0300

s4-drs: Check for schema changes only in case we are *not* applying Schema 
replica

This fixes the problem when we fail to replicate with
a partner DC that has a newer Schema with attributeSchema
objects with OIDs that we don't have in our local prefixMap.

commit 1fac1f0d2882ae9ac81a02fa6d9957f6cb3fb88d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Sep 18 02:28:29 2010 +0300

werror: Add W_ERROR_HAVE_NO_MEMORY_AND_FREE() macro

commit c3489a7918758848953f00cee6a36519cd059daf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Sep 18 00:44:17 2010 +0300

s4-ldapcmp: Fix options parsing for common Samba options

And also set 'creds2' to be equal to 'creds' in case
username2 paramater is not supplied on cmd line

---

Summary of changes:
 libcli/util/werror.h   |7 +++
 source4/dsdb/repl/replicated_objects.c |   27 +++
 source4/scripting/devel/ldapcmp|   14 ++
 3 files changed, 36 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/util/werror.h b/libcli/util/werror.h
index 3b717d2..d89cd9c 100644
--- a/libcli/util/werror.h
+++ b/libcli/util/werror.h
@@ -48,6 +48,13 @@ typedef uint32_t WERROR;
}\
 } while (0)
 
+#define W_ERROR_HAVE_NO_MEMORY_AND_FREE(x, ctx) do { \
+   if (!(x)) {\
+   talloc_free(ctx); \
+   return WERR_NOMEM;\
+   }\
+} while (0)
+
 #define W_ERROR_IS_OK_RETURN(x) do { \
if (W_ERROR_IS_OK(x)) {\
return x;\
diff --git a/source4/dsdb/repl/replicated_objects.c 
b/source4/dsdb/repl/replicated_objects.c
index 838dc84..0beb53c 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -197,7 +197,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb,
 }
 
 WERROR dsdb_extended_replicated_objects_convert(struct ldb_context *ldb,
-   const char *partition_dn,
+   const char *partition_dn_str,
const struct 
drsuapi_DsReplicaOIDMapping_Ctr *mapping_ctr,
uint32_t object_count,
const struct 
drsuapi_DsReplicaObjectListItemEx *first_object,
@@ -210,6 +210,7 @@ WERROR dsdb_extended_replicated_objects_convert(struct 
ldb_context *ldb,
struct 
dsdb_extended_replicated_objects **objects)
 {
WERROR status;
+   struct ldb_dn *partition_dn;
const struct dsdb_schema *schema;
struct dsdb_extended_replicated_objects *out;
const struct drsuapi_DsReplicaObjectListItemEx *cur;
@@ -226,14 +227,24 @@ WERROR dsdb_extended_replicated_objects_convert(struct 
ldb_context *ldb,
return WERR_DS_SCHEMA_NOT_LOADED;
}
 
-   status = dsdb_schema_pfm_contains_drsuapi_pfm(schema-prefixmap, 
mapping_ctr);
-   if (!W_ERROR_IS_OK(status)) {
-   talloc_free(out);
-   return status;
+   partition_dn = ldb_dn_new(out, ldb, partition_dn_str);
+   W_ERROR_HAVE_NO_MEMORY_AND_FREE(partition_dn, out);
+
+   if (ldb_dn_compare(partition_dn, ldb_get_schema_basedn(ldb)) != 0) {
+   /*
+* check for schema changes in case
+* we are not replicating Schema NC
+*/
+   status = dsdb_schema_info_cmp(schema, mapping_ctr);
+   if (!W_ERROR_IS_OK(status)) {
+   DEBUG(1,(Remote schema has changed while replicating 
%s\n,
+partition_dn_str));
+   talloc_free(out);
+   return status;
+   }
}
 
-   out-partition_dn   = ldb_dn_new(out, ldb, partition_dn);
-   W_ERROR_HAVE_NO_MEMORY(out-partition_dn);
+   out-partition_dn   = partition_dn;
 
out-source_dsa = source_dsa;
out-uptodateness_vector= uptodateness_vector;
@@ -242,7 +253,7 @@ WERROR dsdb_extended_replicated_objects_convert(struct 
ldb_context *ldb,
out-objects= talloc_array(out

[SCM] Samba Shared Repository - branch master updated

2010-09-17 Thread Kamen Mazdrashki
The branch, master has been updated
   via  311744a s4-test: Add unit test for dsdb_schema_info_cmp()
   via  9256b5f s4-schema: Helper func to compare schemaInfo signitures
   via  1295da9 s4-schema: use dsdb_schema_info_blob_is_valid() to verify 
schemaInfo blob
   via  aedefd3 s4-prefixMap: use dsdb_schema_info_blob_is_valid() for 
schemaInfo blob validation
   via  e691b1f s4-dsdb: Add dsdb_schema_info_blob_is_valid() to verify 
schemaInfo blobls
   via  c79861a s4-pyrpc: Print location and type name we got when checking 
for types
  from  e2d6b64 Fix array size of  a memmber of struct cli_ulogoff_state

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


- Log -
commit 311744a1312d4be51c0d50a71884f604ea2e3b99
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 17 05:28:36 2010 +0300

s4-test: Add unit test for dsdb_schema_info_cmp()

commit 9256b5f22677cc265b0560a15c0e0a719ba3138d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 17 02:54:46 2010 +0300

s4-schema: Helper func to compare schemaInfo signitures

commit 1295da92f9a5272b73a0abcecb680f7c0d5bc854
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 17 02:48:50 2010 +0300

s4-schema: use dsdb_schema_info_blob_is_valid() to verify schemaInfo blob

instead of parsing it.

commit aedefd3e99f36d11e49e6fbf51cb16ceffec13c4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 17 02:45:59 2010 +0300

s4-prefixMap: use dsdb_schema_info_blob_is_valid() for schemaInfo blob 
validation

This fixes a leaking dsdb_schema_info object also.

commit e691b1fd276bbf26961a23a5c450e96f16da5d4e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 17 02:37:46 2010 +0300

s4-dsdb: Add dsdb_schema_info_blob_is_valid() to verify schemaInfo blobls

commit c79861a14e671ea037f550dbf5c2ae9e84fb3803
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Sep 16 02:17:34 2010 +0300

s4-pyrpc: Print location and type name we got when checking for types

---

Summary of changes:
 source4/dsdb/schema/schema_info_attr.c  |   75 +---
 source4/dsdb/schema/schema_init.c   |   15 ++---
 source4/dsdb/schema/schema_prefixmap.c  |6 +-
 source4/librpc/rpc/pyrpc.h  |2 +-
 source4/torture/drs/unit/schemainfo_tests.c |   81 +++
 5 files changed, 155 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_info_attr.c 
b/source4/dsdb/schema/schema_info_attr.c
index a9c5e93..0b5d50b 100644
--- a/source4/dsdb/schema/schema_info_attr.c
+++ b/source4/dsdb/schema/schema_info_attr.c
@@ -70,6 +70,28 @@ WERROR dsdb_schema_info_blob_new(TALLOC_CTX *mem_ctx, 
DATA_BLOB *_schema_info_bl
 
 
 /**
+ * Verify the 'blob' is a valid schemaInfo blob
+ */
+bool dsdb_schema_info_blob_is_valid(const DATA_BLOB *blob)
+{
+   if (!blob || !blob-data) {
+   return false;
+   }
+
+   /* schemaInfo blob must be 21 bytes long */
+   if (blob-length != 21) {
+   return false;
+   }
+
+   /* schemaInfo blob should start with 0xFF */
+   if (blob-data[0] != 0xFF) {
+   return false;
+   }
+
+   return true;
+}
+
+/**
  * Parse schemaInfo structure from a data_blob
  * (DATA_BLOB or ldb_val).
  * Suitable for parsing blobs that comes from
@@ -83,16 +105,8 @@ WERROR dsdb_schema_info_from_blob(const DATA_BLOB *blob,
struct dsdb_schema_info *schema_info;
struct schemaInfoBlob schema_info_blob;
 
-   if (!blob || !blob-data) {
-   return WERR_INVALID_PARAMETER;
-   }
-
-   if (blob-length != 21) {
-   return WERR_INVALID_PARAMETER;
-   }
-
-   /* schemaInfo blob should start with 0xFF */
-   if (blob-data[0] != 0xFF) {
+   /* verify schemaInfo blob is valid */
+   if (!dsdb_schema_info_blob_is_valid(blob)) {
return WERR_INVALID_PARAMETER;
}
 
@@ -150,6 +164,47 @@ WERROR dsdb_blob_from_schema_info(const struct 
dsdb_schema_info *schema_info,
return WERR_OK;
 }
 
+/**
+ * Compares schemaInfo signatures in dsdb_schema and prefixMap.
+ * NOTE: At present function compares schemaInfo values
+ * as string without taking into account schemVersion field
+ *
+ * @return WERR_OK if schemaInfos are equal
+ *WERR_DS_DRA_SCHEMA_MISMATCH if schemaInfos are different
+ */
+WERROR dsdb_schema_info_cmp(const struct dsdb_schema *schema,
+   const struct drsuapi_DsReplicaOIDMapping_Ctr *ctr)
+{
+   bool bres;
+   DATA_BLOB blob;
+   char *schema_info_str;
+   struct drsuapi_DsReplicaOIDMapping *mapping;
+
+   /* we should have at least schemaInfo element */
+   if (ctr-num_mappings  1) {
+   return WERR_INVALID_PARAMETER

[SCM] Samba Shared Repository - branch master updated

2010-09-15 Thread Kamen Mazdrashki
The branch, master has been updated
   via  7f1db0d s4-drs: Wait DsReplicaSync for as long as it takes to 
complete
   via  7b20b79 s4-irpc: Don't install endtime-timer in case timeout is 
INFINITE for the call
   via  ee169d7 s4-irpc: Add 'timeout' param for 
dcesrv_irpc_forward_rpc_call() call
   via  839ed05 s4-irpc: Add value for infinite timeout for IRPC calls
  from  aa7df7b s3/printing: make clock jump save and use monotonic time 
for cache timeout

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


- Log -
commit 7f1db0d8df6c5b68c9eb9a2d578ce79a43ce0719
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 15 16:45:37 2010 +0300

s4-drs: Wait DsReplicaSync for as long as it takes to complete

In case the caller wants sync execution, we should
not cancel the call for internal timeout reason,
but rather wait for its execution

commit 7b20b795ab024fda4e159852b60d829f7ae793c7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 15 16:53:48 2010 +0300

s4-irpc: Don't install endtime-timer in case timeout is INFINITE for the 
call

commit ee169d73479a5e8672d56617f2ad9cfac254f8bf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 15 16:41:47 2010 +0300

s4-irpc: Add 'timeout' param for dcesrv_irpc_forward_rpc_call() call

It is to be used when caller wants to explicitly
specify the timeout for the call

commit 839ed051fc4fe62b9b2ce008898b538509769f88
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 15 14:22:27 2010 +0300

s4-irpc: Add value for infinite timeout for IRPC calls

---

Summary of changes:
 source4/lib/messaging/irpc.h|4 ++-
 source4/lib/messaging/messaging.c   |9 +--
 source4/rpc_server/common/forward.c |   10 ++--
 source4/rpc_server/drsuapi/dcesrv_drsuapi.c |   29 +++---
 4 files changed, 41 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/messaging/irpc.h b/source4/lib/messaging/irpc.h
index 2a76461..3c7edcc 100644
--- a/source4/lib/messaging/irpc.h
+++ b/source4/lib/messaging/irpc.h
@@ -43,7 +43,9 @@ struct irpc_message {
 };
 
 /* don't allow calls to take too long */
-#define IRPC_CALL_TIMEOUT 10
+#define IRPC_CALL_TIMEOUT  10
+/* wait for the calls as long as it takes */
+#define IRPC_CALL_TIMEOUT_INF  0
 
 
 /* the server function type */
diff --git a/source4/lib/messaging/messaging.c 
b/source4/lib/messaging/messaging.c
index c33db82..d880c63 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -1139,9 +1139,12 @@ static struct tevent_req 
*irpc_bh_raw_call_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
 
-   ok = tevent_req_set_endtime(req, ev, timeval_current_ofs(hs-timeout, 
0));
-   if (!ok) {
-   return tevent_req_post(req, ev);
+   if (hs-timeout != IRPC_CALL_TIMEOUT_INF) {
+   /* set timeout-callback in case caller wants that */
+   ok = tevent_req_set_endtime(req, ev, 
timeval_current_ofs(hs-timeout, 0));
+   if (!ok) {
+   return tevent_req_post(req, ev);
+   }
}
 
return req;
diff --git a/source4/rpc_server/common/forward.c 
b/source4/rpc_server/common/forward.c
index 51e7507..c983ac3 100644
--- a/source4/rpc_server/common/forward.c
+++ b/source4/rpc_server/common/forward.c
@@ -57,13 +57,14 @@ static void dcesrv_irpc_forward_callback(struct tevent_req 
*subreq)
 
 
 
-/*
-  forward a RPC call using IRPC to another task
+/**
+ * Forward a RPC call using IRPC to another task
  */
 void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state *dce_call, 
TALLOC_CTX *mem_ctx,
  void *r, uint32_t callid,
  const struct ndr_interface_table *ndr_table,
- const char *dest_task, const char *opname)
+ const char *dest_task, const char *opname,
+ uint32_t timeout)
 {
struct dcesrv_forward_state *st;
struct dcerpc_binding_handle *binding_handle;
@@ -96,6 +97,9 @@ void dcesrv_irpc_forward_rpc_call(struct dcesrv_call_state 
*dce_call, TALLOC_CTX
return;
}
 
+   /* reset timeout for the handle */
+   dcerpc_binding_handle_set_timeout(binding_handle, timeout);
+
/* forward the call */
subreq = dcerpc_binding_handle_call_send(st, dce_call-event_ctx,
 binding_handle,
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c 
b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 95113dd..9d388b2 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -29,6

[SCM] Samba Shared Repository - branch master updated

2010-09-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  25dd9fa s4-drs: return DRSUAPI_EXOP_ERR_SUCCESS in extended_ret
   via  611cd51 s4-drs: Hanlde extended operations only once
   via  d08439d s4-dreplsrv: fix 'dn' for partition object being created
   via  750300a s4-drs-fsmo: try to dispatch ops in queue as soon as 
possible
   via  62b5274 s4/fsmo: Added python tests for schema master transfer op
   via  c34cae8 s4-fsmo: update FSMO changes for recent IRPC work
   via  ab01ce6 s4/drs: update repsFrom only when we are not in 
getncchanges extended op
   via  36e663a s4-ldap: Added support for FSMO role transfer via LDAP by 
modify on rootDSE
   via  5ba2858 s4-rpc: Added handling of fsmo role transfer to GetNCChanges
   via  0229ac4 s4-irpc: Added internal rpc call DREPL_TAKEFSMOROLE
   via  657b703 s4-drs: Implementation of GetNCChanges extended op 6 - fsmo 
role transfer
   via  c8794d2 s4-drs: Refactored drepl_service and send_ridalloc_request 
so that the structures can be used for other extended ops
  from  19a3633 s4/torture: use time_mono for deltas in lock test

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


- Log -
commit 25dd9fae66f4dd65692b8161da499aaca104f434
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 10 02:05:27 2010 +0300

s4-drs: return DRSUAPI_EXOP_ERR_SUCCESS in extended_ret

in case we are handling extended operation.

It seems that windows accept both DRSUAPI_EXOP_ERR_SUCCESS
and DRSUAPI_EXOP_ERR_NONE, but Samba is a little bit
more picky on this.

commit 611cd51096a8de8fdf43d0c9b639314bd7ebd2c2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 10 02:02:56 2010 +0300

s4-drs: Hanlde extended operations only once

Most of extended operations I know of work like:
1. do extended operation
2. collect a set of objects to return and start replication cycle
3. continue returning object as we have no more to give

This way we ensure we are doing 1. only once

commit d08439d42b4a04279e74bc3625cb672eb22007fe
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 10 01:59:21 2010 +0300

s4-dreplsrv: fix 'dn' for partition object being created

commit 750300aedf0bd59b704e222f82ff1d114d2b5da7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 10 01:58:07 2010 +0300

s4-drs-fsmo: try to dispatch ops in queue as soon as possible

In most cases this will transfer of schema master role to
look like a synchronous operation.

commit 62b52748273b6d02d9acb3efe4956db4735b4322
Author: Anatoliy Atanasov anatoliy.atana...@postpath.com
Date:   Wed Sep 8 10:25:54 2010 +0300

s4/fsmo: Added python tests for schema master transfer op

commit c34cae81fee5e3b68746f9da97496bf056ff9d55
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Sep 9 16:16:05 2010 +1000

s4-fsmo: update FSMO changes for recent IRPC work

the IRPC API has changed

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit ab01ce6e963b8251bdd3200bcfcf2a37068d3319
Author: Anatoliy Atanasov anatoliy.atana...@postpath.com
Date:   Thu Aug 26 11:19:24 2010 +0300

s4/drs: update repsFrom only when we are not in getncchanges extended op

commit 36e663ad712c062805f6b17c45c2ae7fa5141dd9
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Thu Aug 26 11:09:58 2010 +0300

s4-ldap: Added support for FSMO role transfer via LDAP by modify on rootDSE

GetNCChanges with the corresponding extended operation is initiated and 
added to
the queue when a modify request is received on becomeSchemaMaster, 
becomeRidMaster,
becomeNamingMaster, becomeInfrastructureMaster and becomePDC attributes in
rootDSE.

commit 5ba2858b0271feecf3f7bc5bee7577d0e181563d
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Thu Aug 26 10:59:02 2010 +0300

s4-rpc: Added handling of fsmo role transfer to GetNCChanges

This adds support for DRSUAPI_EXOP_FSMO_REQ_ROLE, 
DRSUAPI_EXOP_FSMO_RID_REQ_ROLE
and DRSUAPI_EXOP_FSMO_REQ_PDC.
Developed in collaboration with Anatoliy Atanasov 
anatoliy.atana...@postpath.com

commit 0229ac455dbe3125d72c0371d03c592b460526f3
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Wed Aug 25 00:26:28 2010 +0300

s4-irpc: Added internal rpc call DREPL_TAKEFSMOROLE

It schedules a getncchanges with extended op 6, to be used when a modify 
request on
becomeROLEMaster atteibute on rootDSE is received.

commit 657b7039c38e97af9dbacafb5ab7a5966f52eaea
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Wed Aug 25 00:22:16 2010 +0300

s4-drs: Implementation of GetNCChanges extended op 6 - fsmo role transfer

Basically the candidate owner makes a getncchanges call with extended op 6 
when they want to
become the new owner. The current owner then updates the corresponding 
fSMORoleOwner attribute
in its database with the new

[SCM] Samba Shared Repository - branch master updated

2010-09-09 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4f5dd3f s4-dreplsrv: Do allocations on long-living context so that 
callback gets called
   via  118df59 s4-drs-test: Add 'reset' and 'replace' tests for 
drsuapi_DsReplicaUpdateRefs
   via  3593298 s4-dreplsrv: Call dreplsrv_out_operation::callback in case 
we fail to even run the operation
   via  7ee3418 s4-dsdb/repl/drepl_out_pull.c: Remove unused code
   via  ef56945 s4-drepl_service.c: Update (C)
   via  3fa3bc7 s4-drepsrv: Dump more info when drepl_replica_sync() fails
  from  81e97c0 s3-printing: Make missing auth_serversupplied_info const.

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


- Log -
commit 4f5dd3f93b96429baa85ec3ef730ea4bdc2b7945
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Sep 9 01:43:01 2010 +0300

s4-dreplsrv: Do allocations on long-living context so that callback gets 
called

commit 118df599ce139d72f77692415ab38efaebf0245c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Sep 9 00:55:51 2010 +0300

s4-drs-test: Add 'reset' and 'replace' tests for drsuapi_DsReplicaUpdateRefs

At first I got the impression we are not handling those cases,
but after those tests surprisingly passed I saw that
we have correct behavior implemented in a helper function.

So I decided to commit those tests in case someone change the
strange-looking check for DRSUAPI_DRS_ADD_REF flag in
a function that handles delete operation :)

commit 3593298c7e095b0935bffe05e3b1e190abf91707
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 8 01:07:44 2010 +0300

s4-dreplsrv: Call dreplsrv_out_operation::callback in case we fail to even 
run the operation

Operation was scheduled already, so we need to call
the callback function for it to be able to do its job.

For instance, if we are blocking an rpc call until an
operation is completed and there is no memory, then
client will be blocked without knowing what is going on
with the server.

commit 7ee34182dffdf497bdad5a1e155bc2ca80d7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Sep 7 22:24:24 2010 +0300

s4-dsdb/repl/drepl_out_pull.c: Remove unused code

commit ef56945d0e33aebb089789906b9d037852c9b028
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Sep 7 22:18:53 2010 +0300

s4-drepl_service.c: Update (C)

and remove few trailing white spaces

commit 3fa3bc7ebaa2f8a5bacb7766329e89ab4e36f644
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Sep 7 21:22:47 2010 +0300

s4-drepsrv: Dump more info when drepl_replica_sync() fails

There are many spots where this function may fail
and I find it very useful to know where exactly function
fails and what are the input parameters during testing.

REPLICA_SYNC_FAIL() macro now dumps an error message
so we may remove extra DEBUG() dump in implementation.

---

Summary of changes:
 source4/dsdb/kcc/kcc_periodic.c|2 +-
 source4/dsdb/repl/drepl_out_pull.c |   51 --
 source4/dsdb/repl/drepl_service.c  |   71 +++-
 source4/torture/rpc/drsuapi.c  |   32 ++--
 4 files changed, 75 insertions(+), 81 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c
index 28ff404..a79c848 100644
--- a/source4/dsdb/kcc/kcc_periodic.c
+++ b/source4/dsdb/kcc/kcc_periodic.c
@@ -113,7 +113,7 @@ static void kccsrv_notify_drepl_server(struct 
kccsrv_service *s,
struct dcerpc_binding_handle *irpc_handle;
struct tevent_req *subreq;
 
-   state = talloc_zero(mem_ctx, struct kccsrv_notify_drepl_server_state);
+   state = talloc_zero(s, struct kccsrv_notify_drepl_server_state);
if (state == NULL) {
return;
}
diff --git a/source4/dsdb/repl/drepl_out_pull.c 
b/source4/dsdb/repl/drepl_out_pull.c
index db77a4e..21f986a 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -89,49 +89,6 @@ WERROR dreplsrv_schedule_pull_replication(struct 
dreplsrv_service *s, TALLOC_CTX
 }
 
 
-/* force an immediate of the specified partition by GUID  */
-WERROR dreplsrv_schedule_partition_pull_by_guid(struct dreplsrv_service *s, 
TALLOC_CTX *mem_ctx,
-   struct GUID *guid)
-{
-   struct dreplsrv_partition *p;
-   
-   for (p = s-partitions; p; p = p-next) {
-   if (GUID_compare(p-nc.guid, guid) == 0) {
-   return dreplsrv_schedule_partition_pull(s, p, mem_ctx);
-   }
-   }
-
-   return WERR_NOT_FOUND;
-}
-
-/* force an immediate of the specified partition by Naming Context */
-WERROR dreplsrv_schedule_partition_pull_by_nc(struct dreplsrv_service *s

[SCM] Samba Shared Repository - branch master updated

2010-09-07 Thread Kamen Mazdrashki
The branch, master has been updated
   via  e64e398 s4-dreplsrv: Run NC replication synchronously if requested
   via  3f109f8 s4-drs: Dump exact error when failure occurs during 
DsReplicaUpdateRefs call
  from  7612760 s3: Prune the printername cache when a printer is deleted

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


- Log -
commit e64e3985688e57a882e0e128b256ec5f84c6f67a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Sep 7 17:00:20 2010 +0300

s4-dreplsrv: Run NC replication synchronously if requested

commit 3f109f8fd7bdd2cc691beb78463fba7a469e2a3d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Sep 6 14:33:14 2010 +0300

s4-drs: Dump exact error when failure occurs during DsReplicaUpdateRefs call

---

Summary of changes:
 source4/dsdb/repl/drepl_service.c   |  149 --
 source4/rpc_server/drsuapi/updaterefs.c |   16 ++--
 2 files changed, 129 insertions(+), 36 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_service.c 
b/source4/dsdb/repl/drepl_service.c
index 5babbcb..7d4a88c 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -34,6 +34,21 @@
 #include librpc/gen_ndr/ndr_irpc.h
 #include param/param.h
 
+/**
+ * Call-back data for _drepl_replica_sync_done_cb()
+ */
+struct drepl_replica_sync_cb_data {
+   struct irpc_message *msg;
+   struct drsuapi_DsReplicaSync *r;
+
+   /* number of ops left to be completed */
+   int ops_count;
+
+   /* last failure error code */
+   WERROR werr_last_failure;
+};
+
+
 static WERROR dreplsrv_init_creds(struct dreplsrv_service *service)
 {
service-system_session_info = system_session(service-task-lp_ctx);
@@ -104,6 +119,92 @@ static WERROR dreplsrv_connect_samdb(struct 
dreplsrv_service *service, struct lo
 }
 
 
+/**
+ * Callback for dreplsrv_out_operation operation completion.
+ *
+ * We just need to complete a waiting IRPC message here.
+ * In case pull operation has failed,
+ * caller of this callback will dump
+ * failure information.
+ *
+ * NOTE: cb_data is allocated in IRPC msg's context
+ * and will be freed during irpc_send_reply() call.
+ */
+static void _drepl_replica_sync_done_cb(struct dreplsrv_service *service,
+   WERROR werr,
+   enum drsuapi_DsExtendedError ext_err,
+   void *cb_data)
+{
+   struct drepl_replica_sync_cb_data *data = talloc_get_type(cb_data,
+ struct 
drepl_replica_sync_cb_data);
+   struct irpc_message *msg = data-msg;
+   struct drsuapi_DsReplicaSync *r = data-r;
+
+   /* store last bad result */
+   if (W_ERROR_IS_OK(werr)) {
+   data-werr_last_failure = werr;
+   }
+
+   /* decrement pending ops count */
+   data-ops_count--;
+
+   if (data-ops_count == 0) {
+   /* Return result to client */
+   r-out.result = data-werr_last_failure;
+
+   /* complete IRPC message */
+   irpc_send_reply(msg, NT_STATUS_OK);
+   }
+}
+
+/**
+ * Helper to schedule a replication operation with a source DSA.
+ * If 'data' is valid pointer, then a callback
+ * for the operation is passed and 'data-msg' is
+ * marked as 'deferred' - defer_reply = true
+ */
+static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
+ struct dreplsrv_partition_source_dsa 
*dsa,
+ struct 
drsuapi_DsReplicaObjectIdentifier *nc,
+ struct drepl_replica_sync_cb_data 
*data,
+ TALLOC_CTX *mem_ctx)
+{
+   WERROR werr;
+   dreplsrv_fsmo_callback_t fn_callback = NULL;
+
+   if (data) {
+   fn_callback = _drepl_replica_sync_done_cb;
+   }
+
+   /* schedule replication item */
+   werr = dreplsrv_schedule_partition_pull_source(service, dsa,
+  DRSUAPI_EXOP_NONE, 0,
+  fn_callback, data);
+   if (!W_ERROR_IS_OK(werr)) {
+   DEBUG(0,(%s: failed setup of sync of partition (%s, %s, %s) - 
%s\n,
+__FUNCTION__,
+GUID_string(mem_ctx, nc-guid),
+nc-dn,
+dsa-repsFrom1-other_info-dns_name,
+win_errstr(werr)));
+   return werr;
+   }
+   /* log we've scheduled a replication item */
+   DEBUG(3,(%s: forcing sync of partition (%s, %s, %s)\n,
+__FUNCTION__,
+GUID_string(mem_ctx, nc-guid),
+nc

[SCM] Samba Shared Repository - branch master updated

2010-09-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  35aed17 s4-test: refactor API-DELETEUSER test a little to:
   via  dea5c7b s4-idl: redefine dreplsrv_refresh() to be alike other RPC 
function definitions
  from  cf616ec wafsamba: Create bin/defaukt/modules if it does not yet 
exist.

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


- Log -
commit 35aed17b2651bc6dd9be415f8b8060357ee78ecb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 5 23:28:06 2010 +0300

s4-test: refactor API-DELETEUSER test a little to:

 - fail torture_context in case libnet_DeleteUser() has failed
 - make use of torture_assert_* macros to track down where failur occured
 - use only one memory context internally

commit dea5c7b9486f7d4cbefd563a4e366c2fb3ccbf8f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Sep 5 22:54:05 2010 +0300

s4-idl: redefine dreplsrv_refresh() to be alike other RPC function 
definitions

Sorry for the 'custom' definition first time

---

Summary of changes:
 source4/dsdb/repl/drepl_service.c|2 +-
 source4/librpc/idl/irpc.idl  |4 +--
 source4/torture/libnet/libnet_user.c |   52 +++---
 3 files changed, 25 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_service.c 
b/source4/dsdb/repl/drepl_service.c
index 252ec5f..5babbcb 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -244,7 +244,7 @@ static NTSTATUS dreplsrv_refresh(struct irpc_message *msg,
struct dreplsrv_service *s = talloc_get_type(msg-private_data,
 struct dreplsrv_service);
 
-   r-out.werr = dreplsrv_refresh_partitions(s);
+   r-out.result = dreplsrv_refresh_partitions(s);
 
return NT_STATUS_OK;
 }
diff --git a/source4/librpc/idl/irpc.idl b/source4/librpc/idl/irpc.idl
index 220cecf..35204db 100644
--- a/source4/librpc/idl/irpc.idl
+++ b/source4/librpc/idl/irpc.idl
@@ -156,7 +156,5 @@ import misc.idl, security.idl, nbt.idl;
 * @param partition_dn Partition to refresh cacheh for.
 * If empy/NULL, refresh all partitions.
 */
-   void dreplsrv_refresh(
-   [out] WERROR werr
-   );
+   WERROR dreplsrv_refresh();
 }
diff --git a/source4/torture/libnet/libnet_user.c 
b/source4/torture/libnet/libnet_user.c
index c5af5ed..64f57d5 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -80,55 +80,49 @@ bool torture_deleteuser(struct torture_context *torture)
 {
NTSTATUS status;
struct dcerpc_pipe *p;
-   TALLOC_CTX *prep_mem_ctx, *mem_ctx;
+   TALLOC_CTX *mem_ctx;
struct policy_handle h;
struct lsa_String domain_name;
const char *name = TEST_USERNAME;
struct libnet_context *ctx = NULL;
struct libnet_DeleteUser req;
-   bool ret = true;
-
-   prep_mem_ctx = talloc_init(prepare test_deleteuser);
-
-   req.in.user_name = TEST_USERNAME;
-   req.in.domain_name = lpcfg_workgroup(torture-lp_ctx);
+   bool ret = false;
 
status = torture_rpc_connection(torture,
p,
ndr_table_samr);
-   if (!NT_STATUS_IS_OK(status)) {
-   ret = false;
-   goto done;
-   }
+   torture_assert_ntstatus_ok(torture, status, torture_rpc_connection() 
failed);
+
+   mem_ctx = talloc_init(torture_deleteuser);
 
+   /*
+* Pre-create a user to be deleted later
+*/
domain_name.string = lpcfg_workgroup(torture-lp_ctx);
-   if (!test_domain_open(torture, p-binding_handle, domain_name, 
prep_mem_ctx, h, NULL)) {
-   ret = false;
-   goto done;
-   }
+   ret = test_domain_open(torture, p-binding_handle, domain_name, 
mem_ctx, h, NULL);
+   torture_assert_goto(torture, ret, ret, done, test_domain_open() 
failed);
 
-   if (!test_user_create(torture, p-binding_handle, prep_mem_ctx, h, 
name, NULL)) {
-   ret = false;
-   goto done;
-   }
+   ret = test_user_create(torture, p-binding_handle, mem_ctx, h, name, 
NULL);
+   torture_assert_goto(torture, ret, ret, done, test_user_create() 
failed);
 
-   mem_ctx = talloc_init(test_deleteuser);
+   /*
+* Delete the user using libnet layer
+*/
+   ret = test_libnet_context_init(torture, true, ctx);
+   torture_assert_goto(torture, ret, ret, done, 
test_libnet_context_init() failed);
 
-   if (!test_libnet_context_init(torture, true, ctx)) {
-   return false;
-   }
+   req.in.user_name = TEST_USERNAME;
+   req.in.domain_name = lpcfg_workgroup(torture-lp_ctx

[SCM] Samba Shared Repository - branch master updated

2010-09-03 Thread Kamen Mazdrashki
The branch, master has been updated
   via  fdffa90 s4-drs: A quick fix for DRSUAPI_EXOP_FSMO_RID_ALLOC 
extended_op handling
   via  65b21c0 s4-dreplsrv: Refactor drepl_replica_sync() to behave as 
described in MS-DRSR
   via  715743b s4-dreplsrv: Helpers to locate source DSA in a partition by 
GUID or DNS name
   via  3691e6c s4-dreplsrv: Helper to find NC by DN or GUID or SID
   via  5685fb6 s4-dreplsrv: Add caller-specific data parameter for 
dreplsrv_fsmo_callback_t
  from  cf728f8 s3-spoolss: fix some debug statements.

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


- Log -
commit fdffa90ef99e10b963ecec73a65e18ecb6cec932
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 3 06:20:49 2010 +0300

s4-drs: A quick fix for DRSUAPI_EXOP_FSMO_RID_ALLOC extended_op handling

When DRSUAPI_EXOP_FSMO_RID_ALLOC extended op is handled
in DsGetNCChanges() stub, we need to returned a well know set of
object - see: [ms-adts], 3.1.1.5.1.7

With this hack we are going to return just objects modified
during RID allocation procedure - i.e. RID Manager$, RID Set for
computer object and computer object itself.

Which is a close approximation of what we are expected to return.

commit 65b21c056217b03ad0e0aa321bc9d85e048d2ee6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Sep 3 04:29:02 2010 +0300

s4-dreplsrv: Refactor drepl_replica_sync() to behave as described in MS-DRSR

see: MS-DRSR - 4.1.23.2

Note: Synchronious replication not implemented yet.

commit 715743b38dec1968dce843573a12947407d74324
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 31 04:16:18 2010 +0300

s4-dreplsrv: Helpers to locate source DSA in a partition by GUID or DNS name

commit 3691e6c97b2187730d42a2bb79ecc06f37aab344
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 31 04:15:37 2010 +0300

s4-dreplsrv: Helper to find NC by DN or GUID or SID

commit 5685fb64e4f4660d586e57c59800d0f374d10749
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 31 00:01:25 2010 +0300

s4-dreplsrv: Add caller-specific data parameter for dreplsrv_fsmo_callback_t

It is to be used when we need to preserve a state
to be used in tha callback when dreplsrv_out_operation is completed

---

Summary of changes:
 source4/dsdb/repl/drepl_out_pull.c|   10 ++-
 source4/dsdb/repl/drepl_partitions.c  |   73 ++
 source4/dsdb/repl/drepl_ridalloc.c|5 +-
 source4/dsdb/repl/drepl_service.c |  119 +++--
 source4/dsdb/repl/drepl_service.h |6 +-
 source4/rpc_server/drsuapi/getncchanges.c |9 ++
 6 files changed, 207 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_out_pull.c 
b/source4/dsdb/repl/drepl_out_pull.c
index e9b57a1..db77a4e 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -38,7 +38,8 @@ WERROR dreplsrv_schedule_partition_pull_source(struct 
dreplsrv_service *s,
   struct 
dreplsrv_partition_source_dsa *source,
   enum drsuapi_DsExtendedOperation 
extended_op,
   uint64_t fsmo_info,
-  dreplsrv_fsmo_callback_t 
callback)
+  dreplsrv_fsmo_callback_t 
callback,
+  void *cb_data)
 {
struct dreplsrv_out_operation *op;
 
@@ -50,6 +51,7 @@ WERROR dreplsrv_schedule_partition_pull_source(struct 
dreplsrv_service *s,
op-extended_op = extended_op;
op-fsmo_info   = fsmo_info;
op-callback= callback;
+   op-cb_data = cb_data;
 
DLIST_ADD_END(s-ops.pending, op, struct dreplsrv_out_operation *);
 
@@ -64,7 +66,9 @@ static WERROR dreplsrv_schedule_partition_pull(struct 
dreplsrv_service *s,
struct dreplsrv_partition_source_dsa *cur;
 
for (cur = p-sources; cur; cur = cur-next) {
-   status = dreplsrv_schedule_partition_pull_source(s, cur, 
DRSUAPI_EXOP_NONE, 0, NULL);
+   status = dreplsrv_schedule_partition_pull_source(s, cur,
+
DRSUAPI_EXOP_NONE, 0,
+NULL, NULL);
W_ERROR_NOT_OK_RETURN(status);
}
 
@@ -160,7 +164,7 @@ static void dreplsrv_pending_op_callback(struct tevent_req 
*subreq)
 
 done:
if (op-callback) {
-   op-callback(s, rf-result_last_attempt, op-extended_ret);
+   op-callback(s, rf-result_last_attempt, op-extended_ret, 
op-cb_data);
}
talloc_free(op);
s

[SCM] Samba Shared Repository - branch master updated

2010-09-01 Thread Kamen Mazdrashki
The branch, master has been updated
   via  97246f7 s4-test-dssync: Print the reason for skipping FetchNT4Data 
test
  from  5b875a8 s3: Print the IP of the server that stopped responding

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


- Log -
commit 97246f7bbd4f1df1002b606051bfb2dde4977e4a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Sep 1 01:42:56 2010 +0300

s4-test-dssync: Print the reason for skipping FetchNT4Data test

---

Summary of changes:
 source4/torture/drs/rpc/dssync.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/rpc/dssync.c b/source4/torture/drs/rpc/dssync.c
index 2285dfc..c7b6708 100644
--- a/source4/torture/drs/rpc/dssync.c
+++ b/source4/torture/drs/rpc/dssync.c
@@ -954,17 +954,20 @@ static bool test_FetchNT4Data(struct torture_context 
*tctx,
 
status = 
dcerpc_drsuapi_DsGetNT4ChangeLog_r(ctx-new_dc.drsuapi.drs_handle, ctx, r);
if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
-   torture_skip(tctx, DsGetNT4ChangeLog not supported by 
target server);
+   torture_skip(tctx,
+DsGetNT4ChangeLog not supported: 
NT_STATUS_NOT_IMPLEMENTED);
} else if (!NT_STATUS_IS_OK(status)) {
const char *errstr = nt_errstr(status);
if (NT_STATUS_EQUAL(status, 
NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE)) {
-   torture_skip(tctx, DsGetNT4ChangeLog not 
supported by target server);
+   torture_skip(tctx,
+DsGetNT4ChangeLog not supported: 
NT_STATUS_RPC_PROCNUM_OUT_OF_RANGE);
}
torture_fail(tctx,
 talloc_asprintf(tctx, 
dcerpc_drsuapi_DsGetNT4ChangeLog failed - %s\n,
 errstr));
} else if (W_ERROR_EQUAL(r.out.result, 
WERR_INVALID_DOMAIN_ROLE)) {
-   torture_skip(tctx, DsGetNT4ChangeLog not supported by 
target server);
+   torture_skip(tctx,
+DsGetNT4ChangeLog not supported: 
WERR_INVALID_DOMAIN_ROLE);
} else if (!W_ERROR_IS_OK(r.out.result)) {
torture_fail(tctx,
 talloc_asprintf(tctx, DsGetNT4ChangeLog 
failed - %s\n,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-08-30 Thread Kamen Mazdrashki
The branch, master has been updated
   via  0e87461 s4-drs-test: Skip a check that may possibly fail
   via  5c5e5ff s4-util: Print more informative error messages in 'net drs 
replicate'
   via  0007203 s4-drs-test: Use dns hostnames to run 'net drs replicate' 
command
  from  11a3d78 librpc/ndr: correctly implement ndr_charset_length()

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


- Log -
commit 0e87461dfb90a17d2774572ebd04650decf1c8da
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Aug 30 02:40:04 2010 +0300

s4-drs-test: Skip a check that may possibly fail

This check may fail due to automatic replication between DCs
during the test execution.
Ideally we should block automatic replications (somehow)
during this test. But until then, we need just to skip
this check, it is not *that* important anyway

commit 5c5e5ff6077d544fc6a75f423ff6f14715fb4256
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Aug 29 19:47:40 2010 +0300

s4-util: Print more informative error messages in 'net drs replicate'

commit 0007203978eaf3b570d00862a95fecd1193e3f85
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Aug 29 17:17:47 2010 +0300

s4-drs-test: Use dns hostnames to run 'net drs replicate' command

---

Summary of changes:
 source4/torture/drs/python/delete_object.py |   18 --
 source4/utils/net/drs/net_drs_replicate.c   |   17 +
 2 files changed, 25 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/python/delete_object.py 
b/source4/torture/drs/python/delete_object.py
index ee17c91..20f8530 100644
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -147,9 +147,9 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
and vice versa so both DCs are synchronized
before test_ReplicateDeteleteObject test
 # replicate Domain NC on DC2 from DC1
-self._net_drs_replicate(DC=self.dc2, fromDC=self.dc1)
+self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
 # replicate Domain NC on DC1 from DC2
-self._net_drs_replicate(DC=self.dc1, fromDC=self.dc2)
+self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2)
 pass
 
 def test_ReplicateDeteleteObject(self):
@@ -177,7 +177,7 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, 
is_deleted=False)
 
 # trigger replication from DC1 to DC2
-self._net_drs_replicate(DC=self.dc2, fromDC=self.dc1)
+self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
 
 # delete user on DC1
 self.ldb_dc1.delete(user_dn)
@@ -188,15 +188,21 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 
 # trigger replication from DC2 to DC1
 # to check if deleted object gets restored
-self._net_drs_replicate(DC=self.dc1, fromDC=self.dc2)
+self._net_drs_replicate(DC=self.dnsname_dc1, fromDC=self.dnsname_dc2)
 # check user info on DC1 - should be deleted
 self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, 
is_deleted=True)
 # check user info on DC2 - should be valid user
-self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, 
is_deleted=False)
+try:
+self._check_user(sam_ldb=self.ldb_dc2, user_orig=user_orig, 
is_deleted=False)
+except self.failureException:
+print (Checking for not isDeleted user on %s failed, 
+   probably because a replication took place. 
+   Ideally we should block automatic replications during this 
test, 
+   but until then, just ignore the error % self.dnsname_dc2)
 
 # trigger replication from DC1 to DC2
 # to check if deleted object is replicated
-self._net_drs_replicate(DC=self.dc2, fromDC=self.dc1)
+self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1)
 # check user info on DC1 - should be deleted
 self._check_user(sam_ldb=self.ldb_dc1, user_orig=user_orig, 
is_deleted=True)
 # check user info on DC2 - should be deleted
diff --git a/source4/utils/net/drs/net_drs_replicate.c 
b/source4/utils/net/drs/net_drs_replicate.c
index 1e28c73..a661d2b 100644
--- a/source4/utils/net/drs/net_drs_replicate.c
+++ b/source4/utils/net/drs/net_drs_replicate.c
@@ -35,6 +35,7 @@ net_drs_server_dn_from_dc_name(struct net_drs_context 
*drs_ctx,
const char *dc_name)
 {
int ldb_err;
+   char *filter;
struct ldb_dn *dn;
struct ldb_dn *server_dn = NULL;
struct ldb_result *ldb_res;
@@ -57,17 +58,25 @@ net_drs_server_dn_from_dc_name

[SCM] Samba Shared Repository - branch master updated

2010-08-29 Thread Kamen Mazdrashki
The branch, master has been updated
   via  b5ed9c2 s4-kcc: Notify dreplsrv that Topology has changed
   via  b954834 s4-dreplsrv: Implement irpc stub to be used to force 
dreplsrv to update internal cache
   via  53551a7 s4-dreplsrv: Move partition cache update before scheduling 
another set of replications
   via  d15a7d9 s4-testenv: Synchronize DCs after 'net vampire'
   via  a052497 s4-kcc: Assert when unexpected repsFromToBlob version is 
passed
  from  d1d2997 s3: Remove an unused macro

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


- Log -
commit b5ed9c2c4d7cec930a9bb4d1a79561d012879bd1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Aug 28 20:02:13 2010 +0300

s4-kcc: Notify dreplsrv that Topology has changed

commit b954834ad1a60f006d0d391f17edbcaac9ed48f2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Aug 28 20:00:39 2010 +0300

s4-dreplsrv: Implement irpc stub to be used to force dreplsrv to update 
internal cache

This IRPC calls is to be used whenever repsFrom/repsTo are
changed by administrative tool or KCC (i.e. Topology changes).

At present, only KCC may change topology.

commit 53551a76c5b6bdcbb2e039ee98f4a712fbc6e8cb
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Aug 28 02:26:00 2010 +0300

s4-dreplsrv: Move partition cache update before scheduling another set of 
replications

commit d15a7d9099f4eef8e1a82d0935cca8cfab542e5c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Aug 28 01:30:09 2010 +0300

s4-testenv: Synchronize DCs after 'net vampire'

During 'net vampire', vampired DC adds information in its own
database, se we need to force replicate vampired_dc to the
first DC to be sure everything is in sync prior starting tests

commit a052497c7427ba7212fbc6a5d0053990dcf0c0dc
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Aug 27 17:25:56 2010 +0300

s4-kcc: Assert when unexpected repsFromToBlob version is passed

At present we only support v1 structures (Win2k3 and earlier),
so it is good to make it obvious.
In case we start supporting v2 we will be able to notice this
function should be refactored right away

---

Summary of changes:
 selftest/target/Samba4.pm  |   24 
 source4/dsdb/kcc/kcc_periodic.c|   35 +--
 source4/dsdb/repl/drepl_periodic.c |   10 +++---
 source4/dsdb/repl/drepl_service.c  |   20 
 source4/librpc/idl/irpc.idl|   11 +++
 5 files changed, 95 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index f0da581..4072524 100644
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -1327,6 +1327,30 @@ sub setup_vampire_dc($$$)
 
$self-{vars}-{vampire_dc} = $env;
 
+   # force replicated DC to update repsTo/repsFrom
+   # for vampired partitions
+   my $net = $self-bindir_path(net);
+   my $cmd = ;
+   $cmd .= 
SOCKET_WRAPPER_DEFAULT_IFACE=\$env-{SOCKET_WRAPPER_DEFAULT_IFACE}\;
+   $cmd .=  KRB5_CONFIG=\$env-{KRB5_CONFIG}\;
+   $cmd .=  $net drs kcc $env-{DC_SERVER};
+   $cmd .=  -U$dc_vars-{DC_USERNAME}\%$dc_vars-{DC_PASSWORD};
+   system($cmd) == 0 or die(Failed to exec kcc\n$cmd);
+
+   # as 'vampired' dc may add data in its local replica
+   # we need to synchronize data between DCs
+   my $base_dn = DC=.join(,DC=, split(/\./, $dc_vars-{REALM}));
+   $cmd = 
SOCKET_WRAPPER_DEFAULT_IFACE=\$env-{SOCKET_WRAPPER_DEFAULT_IFACE}\;
+   $cmd .=  KRB5_CONFIG=\$env-{KRB5_CONFIG}\;
+   $cmd .=  $net drs replicate $env-{DC_SERVER} 
$env-{VAMPIRE_DC_SERVER};
+   $cmd .=  -U$dc_vars-{DC_USERNAME}\%$dc_vars-{DC_PASSWORD};
+   # replicate Configuration NC
+   my $cmd_repl = $cmd \CN=Configuration,$base_dn\;
+   system($cmd_repl) == 0 or die(Failed to replicate\n$cmd_repl);
+   # replicate Default NC
+   $cmd_repl = $cmd \$base_dn\;
+   system($cmd_repl) == 0 or die(Failed to replicate\n$cmd_repl);
+
return $env;
 }
 
diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c
index 3f37208..0955c99 100644
--- a/source4/dsdb/kcc/kcc_periodic.c
+++ b/source4/dsdb/kcc/kcc_periodic.c
@@ -33,6 +33,7 @@
 #include librpc/gen_ndr/ndr_misc.h
 #include librpc/gen_ndr/ndr_drsuapi.h
 #include librpc/gen_ndr/ndr_drsblobs.h
+#include librpc/gen_ndr/ndr_irpc.h
 #include param/param.h
 
 /*
@@ -59,11 +60,13 @@ static bool reps_in_list(struct repsFromToBlob *r, struct 
repsFromToBlob *reps,
 static bool check_MasterNC(struct kccsrv_partition *p, struct repsFromToBlob 
*r,
   struct ldb_result *res)
 {
-   struct repsFromTo1 *r1;
-   r1 = r-ctr.ctr1;
+   struct

[SCM] Samba Shared Repository - branch master updated

2010-08-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  7e936e3... s4-ndr_basic.c: Fix ndr_*_hyper() when [bigendian] data 
is processed
   via  26efea1... s4-drsuapi: Implement custom printing for drsuapi 
protocol for
  from  f35811b... s3: Use sconn-client_id in session_claim

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


- Log -
commit 7e936e3122aed539b348bc5deea1732b65d94950
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Aug 20 21:58:22 2010 +0300

s4-ndr_basic.c: Fix ndr_*_hyper() when [bigendian] data is processed

commit 26efea195ae3d5a26b1152923f114cd841e89b5f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 19 15:52:49 2010 +0300

s4-drsuapi: Implement custom printing for drsuapi protocol for

drsuapi_DsReplicaAttribute and drsuapi_DsAttributeValueCtr objects

This makes tracing what data has been transferred much easier

---

Summary of changes:
 librpc/idl/drsuapi.idl   |2 +-
 librpc/ndr/ndr_basic.c   |6 +++
 librpc/ndr/ndr_drsuapi.c |  107 ++
 3 files changed, 114 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index 8540057..9010efc 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -562,7 +562,7 @@ interface drsuapi
[flag(NDR_REMAINING)] DATA_BLOB binary;
} drsuapi_DsReplicaObjectIdentifier3Binary;
 
-   typedef [public] struct {
+   typedef [public,noprint] struct {
drsuapi_DsAttributeId attid;
drsuapi_DsAttributeValueCtr value_ctr;
} drsuapi_DsReplicaAttribute;
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index 0becf38..58d4e46 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -252,6 +252,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull_dlong(struct ndr_pull 
*ndr, int ndr_flags, i
 _PUBLIC_ enum ndr_err_code ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, 
uint64_t *v)
 {
NDR_PULL_ALIGN(ndr, 8);
+   if (NDR_BE(ndr)) {
+   return ndr_pull_udlongr(ndr, ndr_flags, v);
+   }
return ndr_pull_udlong(ndr, ndr_flags, v);
 }
 
@@ -549,6 +552,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_dlong(struct ndr_push 
*ndr, int ndr_flags, i
 _PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, 
uint64_t v)
 {
NDR_PUSH_ALIGN(ndr, 8);
+   if (NDR_BE(ndr)) {
+   return ndr_push_udlongr(ndr, NDR_SCALARS, v);
+   }
return ndr_push_udlong(ndr, NDR_SCALARS, v);
 }
 
diff --git a/librpc/ndr/ndr_drsuapi.c b/librpc/ndr/ndr_drsuapi.c
index 0cc3e52..9cde737 100644
--- a/librpc/ndr/ndr_drsuapi.c
+++ b/librpc/ndr/ndr_drsuapi.c
@@ -86,6 +86,113 @@ _PUBLIC_ void ndr_print_drsuapi_DsReplicaOID(struct 
ndr_print *ndr, const char *
ndr-depth--;
 }
 
+static void _print_drsuapi_DsAttributeValue_attid(struct ndr_print *ndr, const 
char *name,
+ const struct 
drsuapi_DsAttributeValue *r)
+{
+   uint32_t v;
+
+   ndr_print_struct(ndr, name, drsuapi_DsAttributeValue);
+   ndr-depth++;
+   v = IVAL(r-blob-data, 0);
+   ndr_print_uint32(ndr, attid, v);
+   ndr-depth--;
+}
+
+static void _print_drsuapi_DsAttributeValue_str(struct ndr_print *ndr, const 
char *name,
+   const struct 
drsuapi_DsAttributeValue *r)
+{
+   char *str;
+
+   ndr_print_struct(ndr, name, drsuapi_DsAttributeValue);
+   ndr-depth++;
+   if (!convert_string_talloc(ndr,
+  CH_UTF16, CH_UNIX,
+  r-blob-data,
+  r-blob-length,
+  (void **)str, NULL, false)) {
+   ndr_print_string(ndr, string, INVALID CONVERSION);
+   } else {
+   ndr_print_string(ndr, string, str);
+   talloc_free(str);
+   }
+   ndr-depth--;
+}
+
+static void _print_drsuapi_DsAttributeValueCtr(struct ndr_print *ndr,
+  const char *name,
+  const struct 
drsuapi_DsAttributeValueCtr *r,
+  void (*print_val_fn)(struct 
ndr_print *ndr, const char *name, const struct drsuapi_DsAttributeValue *r))
+{
+   uint32_t cntr_values_1;
+   ndr_print_struct(ndr, name, drsuapi_DsAttributeValueCtr);
+   ndr-depth++;
+   ndr_print_uint32(ndr, num_values, r-num_values);
+   ndr_print_ptr(ndr, values, r-values);
+   ndr-depth++;
+   if (r-values) {
+   ndr-print(ndr, %s: ARRAY(%d), values, (int)r-num_values);
+   ndr-depth++;
+   for 
(cntr_values_1=0;cntr_values_1r-num_values;cntr_values_1

[SCM] Samba Shared Repository - branch master updated

2010-08-18 Thread Kamen Mazdrashki
The branch, master has been updated
   via  89899f5... s4-drs: ATTIDs for deleted attributes should be based on 
msDs-IntId value if it exists
   via  e050274... s4-test: make better error message for ATTID checks
   via  c3cf388... s4-test: Change attribute syntax and value for 
readability
   via  a46ead0... s4-test: Enable drs.rpc.msdsintid test case - it should 
be passing now
   via  6950724... s4-dsdb: No need for dsdb_syntax_one_DN_drsuapi_to_ldb() 
to be public
   via  6a51afc... s4-drs: GetNCChanges() to return correct (in AD-way) 
ATTIDs
   via  35d886d... s4-dsdb-syntax: ATTID should be msDs-IntId value for the 
attributeSchema object
   via  fffc98f... s4: fix few comment typos
   via  d01804d... s4-schema_syntax.c: Fix white spaces and alignment
   via  c5ec1f3... s4-dsdb: Use dsdb_syntax_ctx in *_drsuapi_to_ldb 
functions
   via  b5af7b9... s4-dsdb: Use dsdb_syntax_ctx in *_ldb_to_drsuapi 
functions
   via  ca80918... s4-dsdb: Use dsdb_syntax_ctx in *_validate_ldb functions
   via  b7d1586... s4-dsdb: Add context structure for dsdb_syntax 
conversion functions
   via  20a8481... s4-test-dssync: remove unused variable
  from  da25541... Fix bug 7626 - Typo in configure 
samba_cv__CC_NEGATIVE_ENUM_VALUES two underscores.

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


- Log -
commit 89899f55dc1fb137a0adfd734c87b65039f598a4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 19 03:17:36 2010 +0300

s4-drs: ATTIDs for deleted attributes should be based on msDs-IntId value 
if it exists

commit e05027401f4733e43b62148fa5c59559f49b4c1b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 19 03:08:29 2010 +0300

s4-test: make better error message for ATTID checks

commit c3cf388eaf322b7646aa464774baa324be81a56d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 19 02:47:14 2010 +0300

s4-test: Change attribute syntax and value for readability

When it comes to read logs and dumping data received
Octet String syntax comes in handy

commit a46ead0724f54a6034913fe5d1da077140d58133
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Aug 18 13:21:10 2010 +0300

s4-test: Enable drs.rpc.msdsintid test case - it should be passing now

commit 695072478d5d5bd476524228fc09cde200abcf6b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Aug 18 03:19:45 2010 +0300

s4-dsdb: No need for dsdb_syntax_one_DN_drsuapi_to_ldb() to be public

It is intended to be used in schema_syntax.c module

commit 6a51afcfdbcbce7813fb59c0655e4178268ca70e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Aug 18 03:52:48 2010 +0300

s4-drs: GetNCChanges() to return correct (in AD-way) ATTIDs

Depending on which NC is being replicated, GetNCChanges() returns
either ATTID based on local prefixMap or msDs-IntId value of
the attributeSchema class for the attribute being replicated.

If set, msDs-IntId value is always returned when replicating
object form NC other than Schema NC.
Objects in Schema NC replica always use prefixMap based ATTIDs.

commit 35d886db176123b3ef3a0436463f59edcaed1322
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Aug 18 03:06:53 2010 +0300

s4-dsdb-syntax: ATTID should be msDs-IntId value for the attributeSchema 
object

in case object replicated is not in Schema NC and attributeSchema
object has msDs-IntId attribute value set

commit fffc98f33e333b8711da053e5cd5ddcc601cd275
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 04:48:24 2010 +0300

s4: fix few comment typos

commit d01804dda9d1e1793f3e1d2f863ced7e900c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 04:44:52 2010 +0300

s4-schema_syntax.c: Fix white spaces and alignment

commit c5ec1f3d9246f5737279340bf1755baf542d982b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 04:20:46 2010 +0300

s4-dsdb: Use dsdb_syntax_ctx in *_drsuapi_to_ldb functions

commit b5af7b9a1eb70db949c83fe6b55e402b82a2a9a4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 04:12:54 2010 +0300

s4-dsdb: Use dsdb_syntax_ctx in *_ldb_to_drsuapi functions

commit ca809186137e259060032ef61d9d3e93cddad298
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 03:58:26 2010 +0300

s4-dsdb: Use dsdb_syntax_ctx in *_validate_ldb functions

commit b7d1586ccd05a78a4fae512c54fa39dda408e08b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 17 03:21:46 2010 +0300

s4-dsdb: Add context structure for dsdb_syntax conversion functions

This structure is intended to hold context-dependent data.

Syntax-conversion and object-conversion functions need
that data to convert objects and attributes from drs-to-ldb
and ldb-to-drs correctly.

For instance: ATTID value depends on whether we are converting
object from

[SCM] Samba Shared Repository - branch master updated

2010-08-14 Thread Kamen Mazdrashki
The branch, master has been updated
   via  887b730... s4-test: Add drs.rpc.msDSIntId test to knownfail tests
   via  776a3cd... s4-test: Run all DRS-RPC.* tests in ncacn_ip_tcp_tests 
tests group
   via  e58aed2... s4-drs-test: Make the two DRS test suite a top-level 
test suites
  from  d6ccd4c... s4:ldap_backend.c - fix a DS error code after WERROR 
change

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


- Log -
commit 887b7306a779509d9929d18d0ca91b17d510fd5b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Aug 11 01:54:05 2010 +0300

s4-test: Add drs.rpc.msDSIntId test to knownfail tests

commit 776a3cdc08cb6220656c3b4b7f782d87677e29c0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Aug 13 23:42:34 2010 +0300

s4-test: Run all DRS-RPC.* tests in ncacn_ip_tcp_tests tests group

Andrew, please check.

commit e58aed25fcc2a4f4ed5b4c167fc8f954c5d471f5
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Aug 13 22:30:39 2010 +0300

s4-drs-test: Make the two DRS test suite a top-level test suites

so that test cases gets visible with smbtorture --list

---

Summary of changes:
 source4/selftest/knownfail |1 +
 source4/selftest/tests.sh  |6 +++---
 source4/torture/drs/drs_init.c |   37 +
 3 files changed, 25 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/selftest/knownfail b/source4/selftest/knownfail
index 674501f..1b0fce7 100644
--- a/source4/selftest/knownfail
+++ b/source4/selftest/knownfail
@@ -78,3 +78,4 @@ samba4.smb2.acls.*.OWNER
 samba4.smb2.compound.*.RELATED1
 samba4.smb2.compound.*.RELATED2
 samba4.smb2.compound.*.INVALID2
+samba4.drs.rpc.msdsintid # not working yet
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index bc4543c..b34eb02 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -166,7 +166,8 @@ fi
 # that they stay passing
 ncacn_np_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-SAMSYNC RPC-SAMBA3-SESSIONKEY 
RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-LSA RPC-SAMBA3-BIND RPC-SAMBA3-NETLOGON 
RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT
 ncalrpc_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-DRSUAPI RPC-ASYNCBIND RPC-LSALOOKUP 
RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT
-ncacn_ip_tcp_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-ASYNCBIND RPC-LSALOOKUP 
RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT RPC-OBJECTUUID DRS-RPC-DSSYNC
+drs_rpc_tests=`$smb4torture --list | grep '^DRS-RPC'`
+ncacn_ip_tcp_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-ASYNCBIND RPC-LSALOOKUP 
RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT RPC-OBJECTUUID $drs_rpc_tests
 slow_ncacn_np_tests=RPC-SAMLOGON RPC-SAMR RPC-SAMR-USERS RPC-SAMR-LARGE-DC 
RPC-SAMR-USERS-PRIVILEGES RPC-SAMR-PASSWORDS RPC-SAMR-PASSWORDS-PWDLASTSET
 slow_ncalrpc_tests=RPC-SAMR RPC-SAMR-PASSWORDS
 slow_ncacn_ip_tcp_tests=RPC-SAMR RPC-SAMR-PASSWORDS RPC-CRACKNAMES
@@ -175,8 +176,7 @@ all_tests=$ncalrpc_tests $ncacn_np_tests 
$ncacn_ip_tcp_tests $slow_ncalrpc_test
 
 # Make sure all tests get run
 rpc_tests=`$smb4torture --list | grep '^RPC-'`
-drs_rpc_tests=`$smb4torture --list | grep '^DRS-RPC'`
-rpc_tests_list=${rpc_tests} ${drs_rpc_tests}
+rpc_tests_list=${rpc_tests}
 for t in $rpc_tests_list
 do
echo $all_tests | grep $t   /dev/null
diff --git a/source4/torture/drs/drs_init.c b/source4/torture/drs/drs_init.c
index 6c1f1a0..e6b1d61 100644
--- a/source4/torture/drs/drs_init.c
+++ b/source4/torture/drs/drs_init.c
@@ -28,30 +28,34 @@
 /**
  * DRSUAPI tests to be executed remotely
  */
-static struct torture_suite * torture_drs_rpc_suite(TALLOC_CTX *mem_ctx)
+static struct torture_suite * torture_drs_rpc_suite(TALLOC_CTX *mem_ctx,
+const char *suite_name)
 {
-   struct torture_suite *suite = torture_suite_create(
-   talloc_autofree_context(),
-   RPC);
+   struct torture_suite *suite = torture_suite_create(mem_ctx, suite_name);
 
torture_drs_rpc_dssync_tcase(suite);
torture_drs_rpc_dsintid_tcase(suite);
 
+   suite-description = talloc_strdup(suite,
+  DRSUAPI RPC Tests Suite);
+
return suite;
 }
 
 /**
  * DRSUAPI tests to be executed remotely
  */
-static struct torture_suite * torture_drs_unit_suite(TALLOC_CTX *mem_ctx)
+static struct torture_suite * torture_drs_unit_suite(TALLOC_CTX *mem_ctx,
+ const char *suite_name)
 {
-   struct torture_suite

[SCM] Samba Shared Repository - branch master updated

2010-08-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  03bfd42... s4-test: Implement DRS-RPC-msDSIntId test case
   via  d595f07... s4-dsdb: fix attributes_by_msDS_IntId index sorting
   via  06f5985... s4-test: Move dsdb_schema loading into public function
   via  c30f9bd... s4-test: Move RPC-DSSYNC test in DRS-RPC test suite
   via  da074f1... s4-test: Move dssync.c to torture/drs/rpc
   via  f3c0689... s4-test: strip trailing white-spaces
  from  067b572... s4:objectclass LDB module - weak the check for the 
rIDSet delete constraint

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


- Log -
commit 03bfd4290f70ab2de46ccd82a429fda57c8c6bb9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 10 01:08:19 2010 +0300

s4-test: Implement DRS-RPC-msDSIntId test case

commit d595f070f6ab7c6c8732c3c3a4ca39d37bcca3b4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 10 21:05:47 2010 +0300

s4-dsdb: fix attributes_by_msDS_IntId index sorting

commit 06f59855a7b4fcc6f4957d9e1a8e29e387397b50
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Aug 7 12:52:07 2010 +0300

s4-test: Move dsdb_schema loading into public function

I will use this function for tests implementation later

commit c30f9bd7345cddd85502eb9d099279606959f447
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 5 04:55:04 2010 +0300

s4-test: Move RPC-DSSYNC test in DRS-RPC test suite

commit da074f10e3900413a134ee8143c68f05563da13f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 5 18:37:24 2010 +0300

s4-test: Move dssync.c to torture/drs/rpc

commit f3c06892eccac1169a73615637bf82bf956ce523
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Aug 5 18:35:35 2010 +0300

s4-test: strip trailing white-spaces

---

Summary of changes:
 source4/dsdb/schema/schema_set.c |6 +-
 source4/selftest/tests.sh|2 +-
 source4/torture/drs/drs_init.c   |3 +
 source4/torture/drs/drs_util.c   |   94 +++
 source4/torture/drs/rpc/dssync.c | 1064 
 source4/torture/drs/rpc/msds_intid.c |  643 +++
 source4/torture/drs/wscript_build|2 +-
 source4/torture/rpc/dssync.c | 1120 --
 source4/torture/rpc/rpc.c|1 -
 source4/torture/wscript_build|2 +-
 10 files changed, 1812 insertions(+), 1125 deletions(-)
 create mode 100644 source4/torture/drs/rpc/dssync.c
 create mode 100644 source4/torture/drs/rpc/msds_intid.c
 delete mode 100644 source4/torture/rpc/dssync.c


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index b8ed7ca..344e9bb 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -230,6 +230,10 @@ static int dsdb_compare_attribute_by_attributeID_id(struct 
dsdb_attribute **a1,
 {
return uint32_cmp((*a1)-attributeID_id, (*a2)-attributeID_id);
 }
+static int dsdb_compare_attribute_by_msDS_IntId(struct dsdb_attribute **a1, 
struct dsdb_attribute **a2)
+{
+   return uint32_cmp((*a1)-msDS_IntId, (*a2)-msDS_IntId);
+}
 static int dsdb_compare_attribute_by_attributeID_oid(struct dsdb_attribute 
**a1, struct dsdb_attribute **a2)
 {
return strcasecmp((*a1)-attributeID_oid, (*a2)-attributeID_oid);
@@ -345,7 +349,7 @@ static int dsdb_setup_sorted_accessors(struct ldb_context 
*ldb,
/* sort the arrays */
TYPESAFE_QSORT(schema-attributes_by_lDAPDisplayName, 
schema-num_attributes, dsdb_compare_attribute_by_lDAPDisplayName);
TYPESAFE_QSORT(schema-attributes_by_attributeID_id, 
schema-num_attributes, dsdb_compare_attribute_by_attributeID_id);
-   TYPESAFE_QSORT(schema-attributes_by_msDS_IntId, 
schema-num_int_id_attr, dsdb_compare_attribute_by_attributeID_id);
+   TYPESAFE_QSORT(schema-attributes_by_msDS_IntId, 
schema-num_int_id_attr, dsdb_compare_attribute_by_msDS_IntId);
TYPESAFE_QSORT(schema-attributes_by_attributeID_oid, 
schema-num_attributes, dsdb_compare_attribute_by_attributeID_oid);
TYPESAFE_QSORT(schema-attributes_by_linkID, schema-num_attributes, 
dsdb_compare_attribute_by_linkID);
 
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index 1dd507e..bc4543c 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -166,7 +166,7 @@ fi
 # that they stay passing
 ncacn_np_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-HANDLES RPC-SAMSYNC RPC-SAMBA3-SESSIONKEY 
RPC-SAMBA3-GETUSERNAME RPC-SAMBA3-LSA RPC-SAMBA3-BIND RPC-SAMBA3-NETLOGON 
RPC-ASYNCBIND RPC-LSALOOKUP RPC-LSA-GETUSER RPC-SCHANNEL2 RPC-AUTHCONTEXT
 ncalrpc_tests=RPC-SCHANNEL RPC-JOIN RPC-LSA RPC-DSSETUP RPC-ALTERCONTEXT 
RPC-MULTIBIND RPC-NETLOGON RPC-DRSUAPI RPC-ASYNCBIND RPC-LSALOOKUP

[SCM] Samba Website Repository - branch master updated

2010-08-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  5fc2cdd... team/index.html - Add myself to team members list
  from  17547fb... Added 3smil at request of Daniel Muller i...@3mil.com.

http://gitweb.samba.org/?p=samba-web.git;a=shortlog;h=master


- Log -
commit 5fc2cdd1db0079676372d9e9a44037fab27de339
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Aug 8 22:28:34 2010 +0300

team/index.html - Add myself to team members list

---

Summary of changes:
 team/index.html |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/team/index.html b/team/index.html
index c8f8a92..77745a0 100755
--- a/team/index.html
+++ b/team/index.html
@@ -84,6 +84,7 @@ mailing list/a and start contributing to the development of 
Samba./p
 lia href=mailto:m...@samba.org;Matthias Dieter Wallnouml;fer/a/li
 lia href=mailto:m...@samba.org;Michael Warfield/a/li
 lia href=mailto:boy...@samba.org;Bo Yang/a/li
+lia href=mailto:kame...@samba.org;Kamen Mazdrashki/a/li
 /ul
 /td
 /tr


-- 
Samba Website Repository


[SCM] Samba Shared Repository - branch master updated

2010-08-02 Thread Kamen Mazdrashki
The branch, master has been updated
   via  f827904... s4-schema: More verbose error log when subClassOf is not 
found in schema
   via  a268e08... s4: fix comment typos
  from  eab6d8c... s3-spoolss: remove duplicate (and incorrect) header.

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


- Log -
commit f8279045964cd0140be23b436ead1169096a8d18
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 3 04:26:57 2010 +0300

s4-schema: More verbose error log when subClassOf is not found in schema

Error message show failing classSchema object
but not the specific value for the failure,
which makes diagnostics by log files really hard.

commit a268e0846f1bc37a3dd63d2085884edc91b83e2a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Aug 3 04:14:45 2010 +0300

s4: fix comment typos

---

Summary of changes:
 source4/dsdb/schema/schema_inferiors.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_inferiors.c 
b/source4/dsdb/schema/schema_inferiors.c
index b3f5f31..d2c134e 100644
--- a/source4/dsdb/schema/schema_inferiors.c
+++ b/source4/dsdb/schema/schema_inferiors.c
@@ -1,5 +1,5 @@
 /* 
-   Unix SMB/CIFS mplementation.
+   Unix SMB/CIFS implementation.
 
implement possibleInferiors calculation

@@ -49,7 +49,7 @@ static const char **schema_supclasses(const struct 
dsdb_schema *schema,
return NULL;
}
 
-   /* Cope with 'top SUP top', ie top is subClassOf top */ 
+   /* Cope with 'top SUP top', i.e. top is subClassOf top */
if (schema_class-subClassOf 
strcmp(schema_class-lDAPDisplayName, schema_class-subClassOf) == 
0) {
schema_class-supclasses = list;
@@ -163,7 +163,9 @@ static int schema_create_subclasses(const struct 
dsdb_schema *schema)
struct dsdb_class *schema_class2 = discard_const_p(struct 
dsdb_class,
dsdb_class_by_lDAPDisplayName(schema, 
schema_class-subClassOf));
if (schema_class2 == NULL) {
-   DEBUG(0,(ERROR: no subClassOf for '%s'\n, 
schema_class-lDAPDisplayName));
+   DEBUG(0,(ERROR: no subClassOf '%s' for '%s'\n,
+schema_class-subClassOf,
+schema_class-lDAPDisplayName));
return LDB_ERR_OPERATIONS_ERROR;
}
if (schema_class2  schema_class != schema_class2) {
@@ -181,7 +183,7 @@ static int schema_create_subclasses(const struct 
dsdb_schema *schema)
for (schema_class=schema-classes; schema_class; 
schema_class=schema_class-next) {
schema_class-subclasses = 
str_list_unique(schema_subclasses_recurse(schema, schema_class));
 
-   /* Initilise the subClass order, to ensure we can't have 
uninitilised sort on the subClass hirarchy */
+   /* Initialize the subClass order, to ensure we can't have 
uninitialized sort on the subClass hierarchy */
schema_class-subClass_order = 0;
}
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-07-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  39d287e... s4-test: Expand DSSYNC test to be executed against all 
partitions
   via  bd6f77e... s4-test-dssync: Issue warning in case we have diffrences 
in link attributes
   via  5bf54f1... s4-test: Simplify test_GetInfo() - we have what we need 
through LDB connection
   via  88f1798... s4-ldb: use TALLOC_CTX type instead of 'void'
  from  e8ac4a8... s3-dcerpc: Try to fix build when gssapi_ext.h is not 
available

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


- Log -
commit 39d287ec67d9c33b17c8809ac34d3c09f72f689d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jul 16 22:52:45 2010 +0300

s4-test: Expand DSSYNC test to be executed against all partitions

It is still possible to supply specific partition
to test with on command line using
--option=dssync:partition={PARTITION_DN}

commit bd6f77ee0bb5f73ade9e7a20eef650f9be98096d
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Jul 14 05:10:34 2010 +0300

s4-test-dssync: Issue warning in case we have diffrences in link attributes

In case differences in messages are:
 1. Attributes with different values, i.e. 'replace'
 2. Those attributes are back-link attributes
then we just warn about those differences.

It turns out windows doesn't send all values for back-link
attributes in replicated_object but in linked_attributes.

I consider this as workaround for the problem.
A better solution might be to merge linked_attribute values
into replacted_objects before comparing those with LDB result
(although this will work for Win2k8 and latter)

commit 5bf54f17bd1c9067437088456f16b6dd504efc14
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Jul 14 03:42:56 2010 +0300

s4-test: Simplify test_GetInfo() - we have what we need through LDB 
connection

we have already opened.

Added 'config_dn' and 'schema_dn' members which are to be used
later for extending the test_FetchData() to be executed
against every partition in case partition is not specified explicitly.

DsSyncText.site_name was removed also as it is not used anymore

commit 88f17981001c509c4844304b5a120540ae2963f6
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 13 02:37:58 2010 +0300

s4-ldb: use TALLOC_CTX type instead of 'void'

---

Summary of changes:
 source4/lib/ldb/common/ldb.c  |   14 +-
 source4/lib/ldb/common/ldb_controls.c |2 +-
 source4/lib/ldb/common/ldb_dn.c   |   28 +++---
 source4/lib/ldb/common/ldb_ldif.c |6 +-
 source4/lib/ldb/common/ldb_msg.c  |6 +-
 source4/lib/ldb/common/ldb_parse.c|   26 ++--
 source4/lib/ldb/common/ldb_utf8.c |6 +-
 source4/lib/ldb/include/ldb.h |6 +-
 source4/lib/ldb/include/ldb_private.h |4 +-
 source4/torture/rpc/dssync.c  |  194 -
 10 files changed, 143 insertions(+), 149 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 3a0ca46..2642b33 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -995,7 +995,7 @@ int ldb_op_default_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 
 int ldb_build_search_req_ex(struct ldb_request **ret_req,
struct ldb_context *ldb,
-   void *mem_ctx,
+   TALLOC_CTX *mem_ctx,
struct ldb_dn *base,
enum ldb_scope scope,
struct ldb_parse_tree *tree,
@@ -1053,7 +1053,7 @@ int ldb_build_search_req_ex(struct ldb_request **ret_req,
 
 int ldb_build_search_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
-   void *mem_ctx,
+   TALLOC_CTX *mem_ctx,
struct ldb_dn *base,
enum ldb_scope scope,
const char *expression,
@@ -1083,7 +1083,7 @@ int ldb_build_search_req(struct ldb_request **ret_req,
 
 int ldb_build_add_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
-   void *mem_ctx,
+   TALLOC_CTX *mem_ctx,
const struct ldb_message *message,
struct ldb_control **controls,
void *context,
@@ -1125,7 +1125,7 @@ int ldb_build_add_req(struct ldb_request **ret_req,
 
 int ldb_build_mod_req(struct ldb_request **ret_req,
struct ldb_context *ldb,
-   void *mem_ctx,
+   TALLOC_CTX *mem_ctx,
const struct ldb_message *message,
struct ldb_control **controls

[SCM] Samba Shared Repository - branch master updated

2010-07-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  6a0d366... s4: fix warning: unused variable ‘i’
  from  966641b... s3-dcerpc: Use dcerpc_pull_dcerpc_auth in 
api_pipe_bind_auth3()

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


- Log -
commit 6a0d3665e2a2cd9cbae4096c82418f9b0406161f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jul 8 21:04:13 2010 +0300

s4: fix warning: unused variable ‘i’

---

Summary of changes:
 source4/lib/ldb/common/ldb_modules.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb_modules.c 
b/source4/lib/ldb/common/ldb_modules.c
index e4e2c15..a0e8b7e 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -399,7 +399,6 @@ int ldb_load_modules(struct ldb_context *ldb, const char 
*options[])
 {
const char *modules_string;
const char **modules = NULL;
-   unsigned int i;
int ret;
TALLOC_CTX *mem_ctx = talloc_new(ldb);
if (!mem_ctx) {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-07-07 Thread Kamen Mazdrashki
The branch, master has been updated
   via  609b865... s4-dsdb/util: Reorder DSDB_FLAG_* checks
   via  0c4bbb7... s4-dsdb: Implement module switching in 
dsdb_module_search_dn()
   via  62a0f11... s4-source4/dsdb/samdb/ldb_modules/acl.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  02f0c6d... s4-source4/dsdb/samdb/ldb_modules/linked_attributes.c 
Use DSDB_FLAG_NEXT_MODULE flag
   via  0d2116a... s4-source4/dsdb/samdb/ldb_modules/naming_fsmo.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  b18ab82... s4-source4/dsdb/samdb/ldb_modules/operational.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  7694b19... s4-source4/dsdb/samdb/ldb_modules/partition_init.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  b627159... s4-source4/dsdb/samdb/ldb_modules/pdc_fsmo.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  2ee1437... s4-source4/dsdb/samdb/ldb_modules/repl_meta_data.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  d7bcac5... s4-source4/dsdb/samdb/ldb_modules/ridalloc.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  dc72073... s4-source4/dsdb/samdb/ldb_modules/samba_dsdb.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  8c7a6a8... s4-source4/dsdb/samdb/ldb_modules/schema_load.c Use 
DSDB_FLAG_NEXT_MODULE flag
   via  64c31b7... s4-source4/dsdb/samdb/ldb_modules/util.c Use 
DSDB_FLAG_NEXT_MODULE flag
  from  76a084f... s3-winbindd: Fix child logfile handling which broke with 
c67cff0372.

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


- Log -
commit 609b8656910eccbb409b58050c306798be22a078
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 04:06:23 2010 +0300

s4-dsdb/util: Reorder DSDB_FLAG_* checks

On good thing about having more clear function interfaces
(and forcing callers to specify clearly what they want)
is that now I can execute following search:
git grep DSDB_FLAG_NEXT_MODULE | wc -l

This showed that DSDB_FLAG_NEXT_MODULE flag is about 6 times
more frequently used than DSDB_FLAG_OWN_MODULE.
So this should reduce branch prediction by six times
in this part of the code, right :)

commit 0c4bbb7106cc2d49052eb85f995dc991b578d885
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:31:17 2010 +0300

s4-dsdb: Implement module switching in dsdb_module_search_dn()

This allows caller to choose from where to start DN search

commit 62a0f11dcbc0dbc7dbb78442d933c0fccee2282b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:26:03 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/acl.c Use DSDB_FLAG_NEXT_MODULE flag

commit 02f0c6d1ebaee211e1749c14bb351c1eaebf3948
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:25:41 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/linked_attributes.c Use 
DSDB_FLAG_NEXT_MODULE flag

commit 0d2116a42396546eb0de11cac6794d257e5a224e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:25:28 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/naming_fsmo.c Use DSDB_FLAG_NEXT_MODULE 
flag

commit b18ab826043c16adf5aafdb89e4a57be90ff8acf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:25:11 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/operational.c Use DSDB_FLAG_NEXT_MODULE 
flag

commit 7694b1964f0e51c5f312ef16b9f4d07d0c273bb2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:24:59 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/partition_init.c Use 
DSDB_FLAG_NEXT_MODULE flag

commit b62715964a6060c002f0d6ae4ef42d8e296fc582
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:24:15 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/pdc_fsmo.c Use DSDB_FLAG_NEXT_MODULE flag

commit 2ee14378c3b9e46a71b50a37a18ae0bb2705f131
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:23:58 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/repl_meta_data.c Use 
DSDB_FLAG_NEXT_MODULE flag

commit d7bcac5a9f39a325d984269f7e8651870dcb82ab
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:23:43 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/ridalloc.c Use DSDB_FLAG_NEXT_MODULE flag

commit dc720739ab8d966c6d7d5064281740b6b35b77bf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:23:21 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/samba_dsdb.c Use DSDB_FLAG_NEXT_MODULE 
flag

commit 8c7a6a8dc77fa239aca2283583d3fc858cfb8505
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:22:28 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/schema_load.c Use DSDB_FLAG_NEXT_MODULE 
flag

commit 64c31b7e0ae2085658ad8f5df7791b0343239276
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jul 6 03:22:09 2010 +0300

s4-source4/dsdb/samdb/ldb_modules/util.c Use DSDB_FLAG_NEXT_MODULE flag

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl.c   |   17 --
 source4/dsdb/samdb/ldb_modules/linked_attributes.c |5 +-
 source4/dsdb

[SCM] Samba Shared Repository - branch master updated

2010-07-05 Thread Kamen Mazdrashki
The branch, master has been updated
   via  4a0edb5... DNS objects should not be ignored
  from  3255a7c... s3-waf: fix the build.

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


- Log -
commit 4a0edb597caf7ffa9a1f7f6a44a90fecefb30dc1
Author: Zahari Zahariev zahari.zahar...@postpath.com
Date:   Mon Jul 5 17:55:11 2010 +0300

DNS objects should not be ignored

Recently I have found that after vampireing from a clean Windows
server we have the same DNS objects in the ldb. So ldapcmp has to
no longer ignore them.

Signed-off-by: Kamen Mazdrashki kame...@samba.org

---

Summary of changes:
 source4/scripting/devel/ldapcmp |   30 +-
 1 files changed, 9 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/devel/ldapcmp b/source4/scripting/devel/ldapcmp
index 19ebff2..be0f126 100755
--- a/source4/scripting/devel/ldapcmp
+++ b/source4/scripting/devel/ldapcmp
@@ -7,7 +7,7 @@
 # that have to be provided sheould be able to read objects in any of the
 # above partitions.
 
-# Copyright (C) Zahari Zahariev zahari.zahar...@postpath.com 2009
+# Copyright (C) Zahari Zahariev zahari.zahar...@postpath.com 2009, 2010
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -54,12 +54,13 @@ class LDAPBase(object):
 self.domain_name = re.sub([Dd][Cc]=, , self.base_dn).replace(,, 
.)
 self.domain_sid_bin = self.get_object_sid(self.base_dn)
 #
-#print @, self.host
-#print @, self.base_dn
-#print @, self.domain_netbios
-#print @, self.server_names
-#print @, self.domain_name
-#print @, self.domain_sid_bin
+# Log some domain controller specific place-holers that are being used
+# when compare content of two DCs. Uncomment for DEBUG purposes.
+#print \n@ %s % self.host
+#print ${DOMAIN_DN}: %s % self.base_dn
+#print ${DOMAIN_NETBIOS}: %s % self.domain_netbios
+#print ${SERVERNAME}: %s % self.server_names
+#print ${DOMAIN_NAME}: %s % self.domain_name
 
 def find_servers(self):
 
@@ -394,7 +395,7 @@ class LDAPBundel(object):
 def __eq__(self, other):
 res = True
 if self.size != other.size:
-self.log( \n* Lists have different size: %s != %s % (self.size, 
other.size) )
+self.log( \n* DN lists have different size: %s != %s % 
(self.size, other.size) )
 res = False
 #
 title= \n* DNs found only in %s: % self.con.host
@@ -483,19 +484,6 @@ class LDAPBundel(object):
 #
 global summary
 #
-title = \n* Ignored (DNS related) DNs in %s: % self.con.host
-for x in dn_list:
-xx = .join(re.findall([Cc][Nn]=.*?,, x)) \
-+ .join(re.findall([Oo][Uu]=.*?,, x)) \
-+ .join(re.findall([Dd][Cc]=.*?,, x)) + 
re.search(([Dd][Cc]=[\w]+$), x).group()
-if x != xx:
-if title:
-self.log( title )
-title = None
-self.log( 4*  + x )
-dn_list[dn_list.index(x)] = 
-#
-dn_list = [x for x in dn_list if x]
 return dn_list
 
 def print_summary(self):


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-06-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  1e8876a... s4/repl_meta_data: remove duplicated (and commented out) 
log
   via  12bc68d... s4/ndr: Fix tuncating of constant to a 'long' type
  from  e637124... s4:lib/registry/ldb.c - add a missing brace

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


- Log -
commit 1e8876a4f1b49a614bc478ae68b067e8cf6aec62
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 28 20:46:39 2010 +0300

s4/repl_meta_data: remove duplicated (and commented out) log

commit 12bc68d4d0d62c72c3a2b86a38c20238b6e387d7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 28 20:43:11 2010 +0300

s4/ndr: Fix tuncating of constant to a 'long' type

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |6 --
 source4/torture/ndr/drsblobs.c  |4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 98a3c16..1e4d5ac 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2895,12 +2895,6 @@ static int replmd_replicated_apply_merge(struct 
replmd_replicated_request *ar)
DEBUG(4,(replmd_replicated_request rename %s = %s\n,
  ldb_dn_get_linearized(ar-search_msg-dn),
  ldb_dn_get_linearized(msg-dn)));
-/*
-   ldb_debug(ldb, LDB_DEBUG_TRACE,
- replmd_replicated_request rename %s = %s\n,
- ldb_dn_get_linearized(ar-search_msg-dn),
- ldb_dn_get_linearized(msg-dn));
-*/
/* pass rename to the next module
 * so it doesn't appear as an originating update */
ret = dsdb_module_rename(ar-module,
diff --git a/source4/torture/ndr/drsblobs.c b/source4/torture/ndr/drsblobs.c
index 926c757..689762a 100644
--- a/source4/torture/ndr/drsblobs.c
+++ b/source4/torture/ndr/drsblobs.c
@@ -41,13 +41,13 @@ static bool forest_trust_info_check_out(struct 
torture_context *tctx,
torture_assert_int_equal(tctx, r-count, 2, count);
torture_assert_int_equal(tctx, r-records[0].record_size, 0x0018, 
record size);
torture_assert_int_equal(tctx, r-records[0].record.flags, 0, record 
flags);
-   torture_assert_u64_equal(tctx, r-records[0].record.timestamp, 
0x9BD5AF0001CACA3E, record timestamp);
+   torture_assert_u64_equal(tctx, r-records[0].record.timestamp, 
INT64_C(0x9BD5AF0001CACA3E), record timestamp);
torture_assert_int_equal(tctx, r-records[0].record.type, 
FOREST_TRUST_TOP_LEVEL_NAME, record type);
torture_assert_int_equal(tctx, r-records[0].record.data.name.size, 7, 
record name size);
torture_assert_str_equal(tctx, r-records[0].record.data.name.string, 
f2.test, record name string);
torture_assert_int_equal(tctx, r-records[1].record_size, 0x003a, 
record size);
torture_assert_int_equal(tctx, r-records[1].record.flags, 0, record 
flags);
-   torture_assert_u64_equal(tctx, r-records[1].record.timestamp, 
0x9BD5AF0001CACA3E, record timestamp);
+   torture_assert_u64_equal(tctx, r-records[1].record.timestamp, 
INT64_C(0x9BD5AF0001CACA3E), record timestamp);
torture_assert_int_equal(tctx, r-records[1].record.type, 
FOREST_TRUST_DOMAIN_INFO, record type);
torture_assert_int_equal(tctx, r-records[1].record.data.info.sid_size, 
0x0018, record info sid_size);
torture_assert_sid_equal(tctx, r-records[1].record.data.info.sid, 
dom_sid_parse_talloc(tctx, S-1-5-21-677661288-1956808876-2402106903), record 
info sid);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-06-27 Thread Kamen Mazdrashki
The branch, master has been updated
   via  a0bb31d... s4/test: Run DrsDeleteObjectTestCase as part of S4 
testing
   via  431386f... s4/drs: re-implement 'renaming' object replication
   via  4655643... s4/drs-test: Add few comments in DrsDeleteObjectTestCase 
test
  from  6f6365d... s4:rpc_server/srvsvc/dcesrv_srvsvc.c - remove 
unreachable code

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


- Log -
commit a0bb31df5d48ddd346728971ff4e0506b8304d9a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 28 04:37:37 2010 +0300

s4/test: Run DrsDeleteObjectTestCase as part of S4 testing

I put this test in the end of the list of tests as it
runs with 'vampire_dc' environment running.

Currently there are tests that are failing when we have
2 DCs constantly replicating in the test environment
(this, of course, should be fixed in the near future)

commit 431386f3278bfa6fa9b74db9a8a40fd300621c2b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 28 04:33:40 2010 +0300

s4/drs: re-implement 'renaming' object replication

We should rename objects only after we make sure, that
changes on the partner DC are newer than what we have.
This fixes a bug, when we have following situation with 2 DCs:
- we have an object O on the two DCs
- we rename (delete) object O on DC1
- DC1 replicates from DC2
In the above scenario, object O will be renamed back
to its original name (i.e. it will be restored).

Now, we check that DC2 state is older than what we have,
so nothing happens with object's DN.

commit 46556432c067bfd651e79ecd370ff3d18ae83bd7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 28 04:27:27 2010 +0300

s4/drs-test: Add few comments in DrsDeleteObjectTestCase test

Also remove unused code

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |   71 +--
 source4/selftest/tests.sh   |3 +
 source4/torture/drs/python/delete_object.py |   13 +++-
 3 files changed, 66 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 8994ee4..0a5655a 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2827,6 +2827,21 @@ static bool replmd_replPropertyMetaData1_is_newer(struct 
replPropertyMetaData1 *
  new_m-originating_change_time);
 }
 
+static struct replPropertyMetaData1 *
+replmd_replPropertyMetaData1_find_attid(struct replPropertyMetaDataBlob 
*md_blob,
+enum drsuapi_DsAttributeId attid)
+{
+   int i;
+   struct replPropertyMetaDataCtr1 *rpmd_ctr = md_blob-ctr.ctr1;
+
+   for (i = 0; i  rpmd_ctr-count; i++) {
+   if (rpmd_ctr-array[i].attid == attid) {
+   return rpmd_ctr-array[i];
+   }
+   }
+   return NULL;
+}
+
 static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
 {
struct ldb_context *ldb;
@@ -2838,6 +2853,8 @@ static int replmd_replicated_apply_merge(struct 
replmd_replicated_request *ar)
const struct ldb_val *omd_value;
struct replPropertyMetaDataBlob nmd;
struct ldb_val nmd_value;
+   struct replPropertyMetaData1 *md_remote;
+   struct replPropertyMetaData1 *md_local;
unsigned int i;
uint32_t j,ni=0;
unsigned int removed_attrs = 0;
@@ -2849,24 +2866,6 @@ static int replmd_replicated_apply_merge(struct 
replmd_replicated_request *ar)
ZERO_STRUCT(omd);
omd.version = 1;
 
-   /*
-* TODO: check repl data is correct after a rename
-*/
-   if (ldb_dn_compare(msg-dn, ar-search_msg-dn) != 0) {
-   ldb_debug(ldb, LDB_DEBUG_TRACE, replmd_replicated_request 
rename %s = %s\n,
- ldb_dn_get_linearized(ar-search_msg-dn),
- ldb_dn_get_linearized(msg-dn));
-   if (dsdb_module_rename(ar-module,
-  ar-search_msg-dn, msg-dn,
-  DSDB_FLAG_OWN_MODULE) != LDB_SUCCESS) {
-   ldb_debug(ldb, LDB_DEBUG_FATAL, 
replmd_replicated_request rename %s = %s failed - %s\n,
- ldb_dn_get_linearized(ar-search_msg-dn),
- ldb_dn_get_linearized(msg-dn),
- ldb_errstring(ldb));
-   return replmd_replicated_request_werror(ar, 
WERR_DS_DRA_DB_ERROR);
-   }
-   }
-
/* find existing meta data */
omd_value = ldb_msg_find_ldb_val(ar-search_msg

[SCM] Samba Shared Repository - branch master updated

2010-06-25 Thread Kamen Mazdrashki
The branch, master has been updated
   via  2f7fe9d... s4/net-drs: Fix error messages typo and formatting
   via  0c8ffc9... s4/drs-test: Fix whitespaces and permissions for 
delete_object.py test
  from  e40afe9... Move UCS2 macros to common code

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


- Log -
commit 2f7fe9db023022c03e104dcc43a39f20bf5c804b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 25 15:56:35 2010 +0300

s4/net-drs: Fix error messages typo and formatting

commit 0c8ffc9f15bdd66b3a6971691aadf76b245e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 25 14:56:03 2010 +0300

s4/drs-test: Fix whitespaces and permissions for delete_object.py test

Sorry I've  missed to do this before

---

Summary of changes:
 source4/torture/drs/python/delete_object.py |   10 +-
 source4/utils/net/drs/net_drs_showrepl.c|   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)
 mode change 100755 = 100644 source4/torture/drs/python/delete_object.py


Changeset truncated at 500 lines:

diff --git a/source4/torture/drs/python/delete_object.py 
b/source4/torture/drs/python/delete_object.py
old mode 100755
new mode 100644
index 6b75b80..29c7565
--- a/source4/torture/drs/python/delete_object.py
+++ b/source4/torture/drs/python/delete_object.py
@@ -101,7 +101,7 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 
 def _make_username(self):
 return DrsDelObjUser_ + time.strftime(%s, time.gmtime())
-
+
 def _check_user(self, sam_ldb, user_orig, is_deleted):
 # search the user by guid as it may be deleted
 guid_str = self._GUID_string(user_orig[objectGUID][0])
@@ -120,7 +120,7 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 self.assertEquals(user_cur[isDeleted][0],TRUE)
 self.assertTrue(not(objectCategory in user_cur))
 self.assertTrue(not(sAMAccountType in user_cur))
-self.assertTrue(dodn in str(user_cur[dn]), 
+self.assertTrue(dodn in str(user_cur[dn]),
 User %s is deleted but it is not located under 
%s! % (name_orig, dodn))
 self.assertEquals(name_cur, name_orig + \nDEL: + guid_str)
 else:
@@ -135,10 +135,10 @@ class DrsDeleteObjectTestCase(samba.tests.TestCase):
 net_cmd = os.path.abspath(./bin/net)
 # make command line credentials string
 creds = samba.tests.cmdline_credentials
-cmd_line_auth = -U%s/%s%%%s % (creds.get_domain(), 
+cmd_line_auth = -U%s/%s%%%s % (creds.get_domain(),
  creds.get_username(), 
creds.get_password())
 # bin/net drs replicate Dest_DC_NAME Src_DC_NAME Naming Context
-cmd_line = %s drs replicate %s %s %s %s % (net_cmd, DC, fromDC, 
+cmd_line = %s drs replicate %s %s %s %s % (net_cmd, DC, fromDC,
  self.domain_dn, 
cmd_line_auth)
 ret = os.system(cmd_line)
 self.assertEquals(ret, 0, Replicating %s from %s has failed! % (DC, 
fromDC))
@@ -213,7 +213,7 @@ def connect_samdb(samdb_url):
 samdb_url = ldap://%s; % samdb_url
 # user 'paged_search' module when connecting remotely
 ldb_options = [modules:paged_searches]
-
+
 return SamDB(url=samdb_url,
  lp=samba.tests.env_loadparm(),
  session_info=system_session(),
diff --git a/source4/utils/net/drs/net_drs_showrepl.c 
b/source4/utils/net/drs/net_drs_showrepl.c
index b5d355e..d429df4 100644
--- a/source4/utils/net/drs/net_drs_showrepl.c
+++ b/source4/utils/net/drs/net_drs_showrepl.c
@@ -126,7 +126,7 @@ static bool net_drs_showrepl_print_dc_info(struct 
net_drs_context *drs_ctx)
 
/* parse NTDS Settings DN */
if (!net_drs_parse_ntds_dn(dn, mem_ctx, dc_name, site_name, NULL)) {
-   d_printf(Unexptected: Failed to parse %s DN!\n,
+   d_printf(Unexpected: Failed to parse %s DN!\n,
 ldb_dn_get_linearized(dn));
goto failed;
}
@@ -224,7 +224,7 @@ static bool net_drs_exec_DsReplicaGetInfo(struct 
net_drs_context *drs_ctx,
}
 
if (info_type != info_type_got) {
-   d_printf(DsReplicaGetInfo: Error requested info %d, got info 
%d,
+   d_printf(DsReplicaGetInfo: Error requested info %d, got info 
%d.\n,
 info_type, info_type_got);
return false;
}
@@ -302,7 +302,7 @@ static bool net_drs_showrepl_print_inbound_neihbors(struct 
net_drs_context *drs_
bret = net_drs_exec_DsReplicaGetInfo(drs_ctx,
 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS, 
replica_info);
if (!bret) {
-   d_printf(DsReplicaGetInfo() failed

[SCM] Samba Shared Repository - branch master updated

2010-06-24 Thread Kamen Mazdrashki
The branch, master has been updated
   via  163ed44... s4/drs: DsReplicaSync should search partition to Sync
   via  e40635c... s4/utils: fix few 'net drs replicate' error messages
   via  0dd6a75... s4/drs-test: Tests Deleted objects replication
  from  e0aa54d... selftest: Store the output of the last test run in 
st/subunit.

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


- Log -
commit 163ed44903fd6d9bf3047d0987bcbb8f0a28e7e2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 25 04:34:42 2010 +0300

s4/drs: DsReplicaSync should search partition to Sync

by any valid DSName attribute given, be it - partition DN,
partition GUID or partition SID

commit e40635c48d4b5853cbf463455e2ec90178375100
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 25 04:31:41 2010 +0300

s4/utils: fix few 'net drs replicate' error messages

mainly for the output to be more informative

commit 0dd6a759ed41960500e0869bfe96d93b2d11f50a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 25 04:30:21 2010 +0300

s4/drs-test: Tests Deleted objects replication

Tests how deleted objects are replicated between two DCs.
Currently the test exploits following vulnerabilities:
 - DsReplicaSync is not correctly implemented
 - a 'deleted object' is restored (kind of) in case DC1 replicates
   from DC2 before the 'deleted object' is replicated

---

Summary of changes:
 source4/dsdb/repl/drepl_out_pull.c  |   29 
 source4/dsdb/repl/drepl_service.c   |   15 +-
 source4/torture/drs/python/delete_object.py |  222 +++
 source4/utils/net/drs/net_drs_replicate.c   |   14 +-
 4 files changed, 268 insertions(+), 12 deletions(-)
 create mode 100755 source4/torture/drs/python/delete_object.py


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_out_pull.c 
b/source4/dsdb/repl/drepl_out_pull.c
index 329b298..c82b48d 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -32,6 +32,7 @@
 #include librpc/gen_ndr/ndr_drsuapi.h
 #include librpc/gen_ndr/ndr_drsblobs.h
 #include libcli/composite/composite.h
+#include libcli/security/dom_sid.h
 
 WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
   struct 
dreplsrv_partition_source_dsa *source,
@@ -99,6 +100,34 @@ WERROR dreplsrv_schedule_partition_pull_by_guid(struct 
dreplsrv_service *s, TALL
return WERR_NOT_FOUND;
 }
 
+/* force an immediate of the specified partition by Naming Context */
+WERROR dreplsrv_schedule_partition_pull_by_nc(struct dreplsrv_service *s, 
TALLOC_CTX *mem_ctx,
+ struct 
drsuapi_DsReplicaObjectIdentifier *nc)
+{
+   struct dreplsrv_partition *p;
+   bool valid_sid, valid_guid;
+   struct dom_sid null_sid;
+   ZERO_STRUCT(null_sid);
+
+   valid_sid  = !dom_sid_equal(null_sid, nc-sid);
+   valid_guid = !GUID_all_zero(nc-guid);
+
+   if (!valid_sid  !valid_guid  !nc-dn) {
+   return WERR_DS_DRA_INVALID_PARAMETER;
+   }
+
+   for (p = s-partitions; p; p = p-next) {
+   if ((valid_guid  GUID_equal(p-nc.guid, nc-guid))
+   || strequal(p-nc.dn, nc-dn)
+   || (valid_sid  dom_sid_equal(p-nc.sid, nc-sid))) {
+   return dreplsrv_schedule_partition_pull(s, p, mem_ctx);
+   }
+   }
+
+   return WERR_DS_DRA_BAD_NC;
+}
+
+
 static void dreplsrv_pending_op_callback(struct tevent_req *subreq)
 {
struct dreplsrv_out_operation *op = tevent_req_callback_data(subreq,
diff --git a/source4/dsdb/repl/drepl_service.c 
b/source4/dsdb/repl/drepl_service.c
index 59436d6..e48ae3e 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -110,16 +110,19 @@ static NTSTATUS drepl_replica_sync(struct irpc_message 
*msg,
 {
struct dreplsrv_service *service = talloc_get_type(msg-private_data,
   struct 
dreplsrv_service);
-   struct GUID *guid = r-in.req-req1.naming_context-guid;
+   struct drsuapi_DsReplicaObjectIdentifier *nc = 
r-in.req-req1.naming_context;
 
-   r-out.result = dreplsrv_schedule_partition_pull_by_guid(service, msg, 
guid);
+   r-out.result = dreplsrv_schedule_partition_pull_by_nc(service, msg, 
nc);
if (W_ERROR_IS_OK(r-out.result)) {
-   DEBUG(3,(drepl_replica_sync: forcing sync of partition %s\n,
-GUID_string(msg, guid)));
+   DEBUG(3,(drepl_replica_sync: forcing sync of partition (%s, 
%s)\n,
+GUID_string(msg, nc-guid),
+nc-dn));
dreplsrv_run_pending_ops(service

[SCM] Samba Shared Repository - branch master updated

2010-06-21 Thread Kamen Mazdrashki
The branch, master has been updated
   via  efe65cd... s4/dsdb-test: fix usage comment
   via  acebfcb... s4/test: fix DC password in selftest-vars.sh
  from  c668b21... s4 torture: RAW-SFILEINFO display warning instead of 
error on unsupported info level

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


- Log -
commit efe65cd7b707c3ba5b321016829da431d6905415
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jun 22 04:42:15 2010 +0300

s4/dsdb-test: fix usage comment

commit acebfcb93897657a28f0a4588a19abcf5356ebcf
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jun 22 04:41:49 2010 +0300

s4/test: fix DC password in selftest-vars.sh

---

Summary of changes:
 source4/lib/ldb/tests/python/dsdb_schema_info.py |4 ++--
 source4/scripting/devel/selftest-vars.sh |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/tests/python/dsdb_schema_info.py 
b/source4/lib/ldb/tests/python/dsdb_schema_info.py
index 56d9b11..4d136aa 100755
--- a/source4/lib/ldb/tests/python/dsdb_schema_info.py
+++ b/source4/lib/ldb/tests/python/dsdb_schema_info.py
@@ -20,9 +20,9 @@
 
 #
 # Usage:
-#  export TARGET_DC=target_dc_or_local_samdb_url
+#  export DC_SERVER=target_dc_or_local_samdb_url
 #  export SUBUNITRUN=$samba4srcdir/scripting/bin/subunitrun
-#  PYTHONPATH=$samba4srcdir/torture/libnet/python $SUBUNITRUN 
dsdb_schema_info -Ukma-exch.devel/Administrator%333
+#  PYTHONPATH=$PYTHONPATH:$samba4srcdir/lib/ldb/tests/python $SUBUNITRUN 
dsdb_schema_info -U$DOMAIN/$DC_USERNAME%$DC_PASSWORD
 #
 
 import sys
diff --git a/source4/scripting/devel/selftest-vars.sh 
b/source4/scripting/devel/selftest-vars.sh
index 0932b62..ca99ced 100644
--- a/source4/scripting/devel/selftest-vars.sh
+++ b/source4/scripting/devel/selftest-vars.sh
@@ -39,9 +39,9 @@ export TLS_ENABLED=yes
 export DC_NETBIOSALIAS=localdc
 export DC_NETBIOSNAME=localdc1
 export DC_SERVER=localdc1
-export DC_PASSWORD=locDCpass0
+export DC_PASSWORD=locDCpass1
 export PYTHONPATH=$PWD/bin/python
-export PASSWORD=locDCpass0
+export PASSWORD=locDCpass1
 export LDB_MODULES_PATH=$PWD/bin/modules/ldb
 export NETBIOSALIAS=localdc
 export SMB_CONF_PATH=$PWD/st/dc/etc/smb.conf


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-06-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  3aa8853... s4/dsdb: msg_idx-dn should be allocated in msg_idx mem 
context
   via  cc7e2c1... s4/dsdb: Move schema accessors cleanup in separate 
function
   via  267645c... s4/dsdb-schema: Index attributes on msDS-IntId value
  from  ecbe9a7... s4:kdc/db-glue.c - remove unreachable code

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


- Log -
commit 3aa8853f58b32c5430cd03164a0c2bc26c1b04c0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Jun 20 23:31:43 2010 +0300

s4/dsdb: msg_idx-dn should be allocated in msg_idx mem context

commit cc7e2c10f2b944fd7eac4ff11e9d48fac0043030
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Jun 19 12:30:36 2010 +0300

s4/dsdb: Move schema accessors cleanup in separate function

This way dsdb_setup_sorted_accessors() will
free memory allocated for accessor arrays correctly
in case of failure,

commit 267645ca55f7825e87a098c9dc51f132aac1f452
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Jun 19 00:00:08 2010 +0300

s4/dsdb-schema: Index attributes on msDS-IntId value

O(n) search for dsdb_attribute by msDS-IntId value was
replaced by binary-search in ordered index.

I've choosen the approach of separate index on msDS-IntId values
as I think it is more clear what we are searching for.
And it should little bit faster as we can clearly determine
in which index to perform the search based on ATTID value -
ATTIDs based on prefixMap and ATTIDs based on msDS-IntId
are in separate ranges.

Other way to implement this index was to merge msDS-IntId values
in attributeID_id index.
This led me to a shorted but not so obvious implementation.

---

Summary of changes:
 source4/dsdb/schema/schema.h   |2 +
 source4/dsdb/schema/schema_query.c |8 ++---
 source4/dsdb/schema/schema_set.c   |   62 +---
 3 files changed, 48 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema.h b/source4/dsdb/schema/schema.h
index 0cbc218..34423be 100644
--- a/source4/dsdb/schema/schema.h
+++ b/source4/dsdb/schema/schema.h
@@ -209,6 +209,8 @@ struct dsdb_schema {
struct dsdb_attribute **attributes_by_attributeID_id;
struct dsdb_attribute **attributes_by_attributeID_oid;
struct dsdb_attribute **attributes_by_linkID;
+   uint32_t num_int_id_attr;
+   struct dsdb_attribute **attributes_by_msDS_IntId;
 
struct {
bool we_are_master;
diff --git a/source4/dsdb/schema/schema_query.c 
b/source4/dsdb/schema/schema_query.c
index 4ff8418..8ea79ff 100644
--- a/source4/dsdb/schema/schema_query.c
+++ b/source4/dsdb/schema/schema_query.c
@@ -65,11 +65,9 @@ const struct dsdb_attribute 
*dsdb_attribute_by_attributeID_id(const struct dsdb_
 
/* check for msDS-IntId type attribute */
if (dsdb_pfm_get_attid_type(id) == dsdb_attid_type_intid) {
-   for (c = schema-attributes; c; c = c-next) {
-   if (c-msDS_IntId == id) {
-   return c;
-   }
-   }
+   BINARY_ARRAY_SEARCH_P(schema-attributes_by_msDS_IntId,
+ schema-num_int_id_attr, msDS_IntId, id, 
uint32_cmp, c);
+   return c;
}
 
BINARY_ARRAY_SEARCH_P(schema-attributes_by_attributeID_id,
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 5ecbad2..0e04f5b 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -83,7 +83,7 @@ static int dsdb_schema_set_attributes(struct ldb_context 
*ldb, struct dsdb_schem
ldb_oom(ldb);
goto op_error;
}
-   msg_idx-dn = ldb_dn_new(msg, ldb, @INDEXLIST);
+   msg_idx-dn = ldb_dn_new(msg_idx, ldb, @INDEXLIST);
if (!msg_idx-dn) {
ldb_oom(ldb);
goto op_error;
@@ -221,6 +221,24 @@ static int dsdb_compare_attribute_by_linkID(struct 
dsdb_attribute **a1, struct d
return uint32_cmp((*a1)-linkID, (*a2)-linkID);
 }
 
+/**
+ * Clean up Classes and Attributes accessor arrays
+ */
+static void dsdb_sorted_accessors_free(struct dsdb_schema *schema)
+{
+   /* free classes accessors */
+   TALLOC_FREE(schema-classes_by_lDAPDisplayName);
+   TALLOC_FREE(schema-classes_by_governsID_id);
+   TALLOC_FREE(schema-classes_by_governsID_oid);
+   TALLOC_FREE(schema-classes_by_cn);
+   /* free attribute accessors */
+   TALLOC_FREE(schema-attributes_by_lDAPDisplayName);
+   TALLOC_FREE(schema-attributes_by_attributeID_id);
+   TALLOC_FREE(schema-attributes_by_msDS_IntId);
+   TALLOC_FREE(schema-attributes_by_attributeID_oid

[SCM] Samba Shared Repository - branch master updated

2010-06-11 Thread Kamen Mazdrashki
The branch, master has been updated
   via  c65eb48... s4/test-libnet: Re-align code a bit - more readable this 
way IMO
   via  9baa730... s4/test-libnet: Refactor test_group_create() a little to:
   via  6eecb96... s4/test-libnet: Refactor test_user_create() little bit 
to:
   via  a735c1a... s4/test-libnet: add few comments for utility functions
   via  84fb3ed... s4/test-libnet: Move LSA close handle function to a 
common location
   via  8714f13... s4/test-libnet: remove unused code
   via  7168b1c... s4/test-libnet: Fix compile-time warning
  from  e3c9594... Adjusted ACL tests to use encripted connection.

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


- Log -
commit c65eb4852c2c401149b840884e76a21ff7cd37c7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 16:02:10 2010 +0300

s4/test-libnet: Re-align code a bit - more readable this way IMO

commit 9baa73053e9119991d3ad6c72b153a006e153b89
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 15:44:34 2010 +0300

s4/test-libnet: Refactor test_group_create() a little to:

- Close unused policy handle for created group
- re-align code - it is more readable this way IMHO

commit 6eecb968cb0eeea7212477dcee8148f093d8c88f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 15:37:12 2010 +0300

s4/test-libnet: Refactor test_user_create() little bit to:

- fix a flaw that user RID is not returned in case
  user is recreated
- close unused policy handle to created user
- do not take into account the result from
  test_samr_close_handle - we don't case

commit a735c1ade2573fadc84a0aae03cdaa1bddd43f90
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 15:30:09 2010 +0300

s4/test-libnet: add few comments for utility functions

commit 84fb3ed8a5e6cb253ec1e461185b0b68e57cf21a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 15:11:01 2010 +0300

s4/test-libnet: Move LSA close handle function to a common location

commit 8714f130e5de2738e8fd430385f236f2e360967e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 15:01:07 2010 +0300

s4/test-libnet: remove unused code

Pre-connecting SAMR and LSA pipes is implemented in
test_libnet_context_init() function

commit 7168b1c99ffa093fd62597762aef2dfc129875fa
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Jun 11 14:59:57 2010 +0300

s4/test-libnet: Fix compile-time warning

---

Summary of changes:
 source4/torture/libnet/libnet.c   |2 +-
 source4/torture/libnet/libnet_group.c |   30 ++--
 source4/torture/libnet/libnet_user.c  |   51 +
 source4/torture/libnet/utils.c|  127 +---
 4 files changed, 95 insertions(+), 115 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/libnet/libnet.c b/source4/torture/libnet/libnet.c
index 3dbd777..545f636 100644
--- a/source4/torture/libnet/libnet.c
+++ b/source4/torture/libnet/libnet.c
@@ -21,7 +21,7 @@
 #include torture/smbtorture.h
 #include librpc/rpc/dcerpc.h
 #include librpc/gen_ndr/lsa.h
-#include libnet/composite.h
+#include libnet/libnet.h
 #include torture/libnet/proto.h
 
 NTSTATUS torture_net_init(void)
diff --git a/source4/torture/libnet/libnet_group.c 
b/source4/torture/libnet/libnet_group.c
index 0d8249f..6acb3d2 100644
--- a/source4/torture/libnet/libnet_group.c
+++ b/source4/torture/libnet/libnet_group.c
@@ -32,25 +32,6 @@
 #define TEST_GROUPNAME  libnetgrouptest
 
 
-static bool test_lsa_close(struct torture_context *tctx,
-  struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
-  struct policy_handle *domain_handle)
-{
-   struct lsa_Close r;
-
-   r.in.handle = domain_handle;
-   r.out.handle = domain_handle;
-
-   torture_assert_ntstatus_ok(tctx,
-   dcerpc_lsa_Close_r(b, mem_ctx, r),
-   Close lsa domain failed);
-   torture_assert_ntstatus_ok(tctx, r.out.result,
-   Close lsa domain failed);
-
-   return true;
-}
-
-
 bool torture_groupinfo_api(struct torture_context *torture)
 {
const char *name = TEST_GROUPNAME;
@@ -102,7 +83,8 @@ bool torture_groupinfo_api(struct torture_context *torture)
goto done;
}
 
-   if (!test_group_cleanup(torture, ctx-samr.pipe-binding_handle, 
mem_ctx, ctx-samr.handle, TEST_GROUPNAME)) {
+   if (!test_group_cleanup(torture, ctx-samr.pipe-binding_handle,
+   mem_ctx, ctx-samr.handle, TEST_GROUPNAME)) {
torture_comment(torture, cleanup failed\n);
ret = false;
goto done;
@@ -152,7 +134,7 @@ bool torture_grouplist(struct torture_context *torture)
 
for (i = 0; i  req.out.count; i

[SCM] Samba Shared Repository - branch master updated

2010-06-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  1ceb0dd... s4/test: use test_libnet_context_init() function to 
create libnet_context
   via  d6d8ec8... s4/test: fix SEGFAULT in test_group_create when rid is 
NULL
   via  eda4926... s4/test-libnet: Helper func to initialize libnet_context
   via  85d7863... s4/test: Call test_user_cleanup with original RDN for 
the user
   via  61e5ac4... s4/test: Fix incorrect NTSTATUS comparison
   via  64a71d3... s4/test: remove create/delete group implementation in 
API-CREATEGROUP test
   via  d02c395... s4/test: Remove duplicated test_opendomain() 
functionality
   via  7135abc... s4/test: libnet_user tests should use common 
test_user_cleanup
   via  d1bcc23... s4/test: Refactor test_user_cleanup to be more robust
   via  1b8a8dd... s4/test: remove duplicated comment
  from  0962763... s3:misc make use of server_[event/messaging]_context 
directly

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


- Log -
commit 1ceb0dd92f1c1795264832eee0711612cc58d9a8
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jun 10 18:23:06 2010 +0300

s4/test: use test_libnet_context_init() function to create libnet_context

This way we ensure that LIBNET call will be issued against
the DC we are testing against

commit d6d8ec80f9fc713924df1c9b72ab0491bdf95bde
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jun 10 18:21:44 2010 +0300

s4/test: fix SEGFAULT in test_group_create when rid is NULL

Caller of this function may not need group RID and
in such case it passes NULL for rid parameter

commit eda49261205471a1e0c96ae4e1eda037edb11eba
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jun 10 13:12:08 2010 +0300

s4/test-libnet: Helper func to initialize libnet_context

and create rpc connections to SAMR and LSA pipes.
This function should be used in cases where we need
'deterministic' connection to the DC we are testing against.

The problem is that most of the test follow the pattern:
1. Connect to server supplied on command line
2. Create user/group through connection in 1.
3. Use 'fresh' libnet_context to query/alter the object in
   step 2.

In singe-DC environment this work well. But in multiple-DC
environment libnet may connect to another DC (step 3), not
the one we use in step 1 and 2. This leads to false error -
object created in step 2 is not found on DC we are querying
in step 3.

commit 85d7863b2c2420bd652d73ab4ec230f709acae73
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jun 10 02:02:06 2010 +0300

s4/test: Call test_user_cleanup with original RDN for the user

'name' var is changed during the test execution and should
contain samAccountName for the user, while test_user_cleanup()
expects account RDN to be passed

commit 61e5ac4a5a1d4a2bb59297cd28288ef1460d1ea4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Jun 10 01:59:51 2010 +0300

s4/test: Fix incorrect NTSTATUS comparison

In case group already exists, we should get NT_STATUS_GROUP_EXISTS.

commit 64a71d380cb88b19ecb8673dab07210514fc6a52
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jun 8 18:03:00 2010 +0300

s4/test: remove create/delete group implementation in API-CREATEGROUP test

We already have common implementation for create/delete
group in libnet/utils.c

commit d02c395abdee28a7eef2cbbbf2e183da8f707004
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Jun 8 15:44:00 2010 +0300

s4/test: Remove duplicated test_opendomain() functionality

We already have a nice common test_domain_open()
function in libnet/util.c

commit 7135abcd8d979b9f7149e74f80edf118dc98de51
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 7 18:44:14 2010 +0300

s4/test: libnet_user tests should use common test_user_cleanup

implementation instead of not-so-informative test_cleanup()

commit d1bcc23b2c4df54e42597647395ccd948e338195
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 7 18:33:35 2010 +0300

s4/test: Refactor test_user_cleanup to be more robust

We always call this function with user's account RDN
while samr_LookupNames() searches for samAccountName.

commit 1b8a8ddfe08bc4c083510ccf60e96079af952b74
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Jun 7 17:51:26 2010 +0300

s4/test: remove duplicated comment

---

Summary of changes:
 source4/torture/libnet/libnet_group.c |  180 ++---
 source4/torture/libnet/libnet_user.c  |  169 ---
 source4/torture/libnet/userman.c  |2 +-
 source4/torture/libnet/utils.c|  162 ++
 4 files changed, 177 insertions(+), 336 deletions(-)


Changeset truncated

[SCM] Samba Shared Repository - branch master updated

2010-05-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  c9c8de3... s4/test-libnet: Remove multiple test_samr_close() 
impelementations
   via  c742f59... s4/test-libnet-user: Remove test_createuser()
   via  0f22630... s4/test-libnet-utils: refactor test_user_create()
   via  8dedb4d... s4/test: remove local impl for open_domain and use 
common one
   via  fce4271... s4/test: remove torture/libnet/utils.h as we are using 
proto.h now
   via  1118c7b... s4/test: change prototype for test_opendomain()
   via  8e3a433... s4/test: Refactor test_opendomain to address following
   via  3a899e2... s4/test: make samr_close handle functio public
   via  cf79435... s4/test: refactor NET-USERINFO test to be more 'torture' 
friendly
   via  2053403... s4/test: test_userinfo/_async tests should use passed 
user_name param value
  from  f11cf62... s4:web_server/wsgi.c - provide a better out-of-memory 
handling for an asprintf call

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


- Log -
commit c9c8de3dcb19c96ee9fab7f462b28f3a2f1997a1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 22:14:39 2010 +0300

s4/test-libnet: Remove multiple test_samr_close() impelementations

We now have a nice common test_samr_close_handle() function to use

commit c742f59bd24a3a35732489aa013187c35edde0a2
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 21:20:03 2010 +0300

s4/test-libnet-user: Remove test_createuser()

We have same functionality already implemented by
test_user_create() in libnet/utils.c

commit 0f2263016fc7afd949af65e6e84b5c5455250191
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 17:59:25 2010 +0300

s4/test-libnet-utils: refactor test_user_create()

- param names made more clear what they stand for
- user RID out param is now optional, so that this function may
  be used in cases where we don't need user RID
- SAMR connection handle is closed as it is not used further
  (we should play nice with servers)

commit 8dedb4d06ec84224f1b491cb76edb87b37550c56
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 05:20:18 2010 +0300

s4/test: remove local impl for open_domain and use common one

commit fce427134d1a8fba216ff82d48d7f7cb6be7c3ce
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 05:14:47 2010 +0300

s4/test: remove torture/libnet/utils.h as we are using proto.h now

commit 1118c7b0e4d311becfcc0d6e3c53405649526a2c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 05:06:55 2010 +0300

s4/test: change prototype for test_opendomain()

- name changed to test_domain_open to be more alike athore functions
  in utils.c file
- output parameters moved to the end param list definition just
  after mem_ctx so it is somehow more clear those params are OUT

commit 8e3a433f93618d6cadc58c19b54b9255acccec6e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 05:04:56 2010 +0300

s4/test: Refactor test_opendomain to address following

- param names made more clear what they stand for
- dom_sid out param is now optional, so that this function may
  be used in cases where we don't need dom_sid
- SAMR connection handle is closed as it is not used further

commit 3a899e24d513de7c56363e39efb74b2c88c29854
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 28 04:45:40 2010 +0300

s4/test: make samr_close handle functio public

It is to be used further for closing opened handles when testing
using SAMR interface

commit cf794355456b82927cecfd183e49b47be6568385
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu May 27 17:24:10 2010 +0300

s4/test: refactor NET-USERINFO test to be more 'torture' friendly

Test may be further refactored to be converted as a test case
(what it is actually)

commit 2053403045cb8786abe778279a68b431b9c5977c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu May 27 17:10:31 2010 +0300

s4/test: test_userinfo/_async tests should use passed user_name param value

---

Summary of changes:
 source4/torture/libnet/groupinfo.c|4 +-
 source4/torture/libnet/groupman.c |4 +-
 source4/torture/libnet/libnet_group.c |   29 ++-
 source4/torture/libnet/libnet_user.c  |  157 +++-
 source4/torture/libnet/userinfo.c |   40 +++--
 source4/torture/libnet/userman.c  |   10 +-
 source4/torture/libnet/utils.c|  129 ---
 source4/torture/libnet/utils.h|   52 ---
 8 files changed, 139 insertions(+), 286 deletions(-)
 delete mode 100644 source4/torture/libnet/utils.h


Changeset truncated at 500 lines:

diff --git a/source4/torture/libnet/groupinfo.c 
b/source4/torture/libnet/groupinfo.c
index affd1e5..772427c 100644

[SCM] Samba Shared Repository - branch master updated

2010-05-26 Thread Kamen Mazdrashki
The branch, master has been updated
   via  c2021e4... s4/test: Connect SAMR and LDARPC pipes before calling 
libnet_ functions
   via  de60cbb... s4/test: remove unused code
   via  5444272... s4/test: make test_cleanup() in libnet_user library more 
robust
   via  bbdb838... s4/test: rename enum test_fields{} member names to be 
more descriptive
   via  644593d... s4/test: Replace hand-made field count to test
  from  2bca048... s3:configure: use the right AC_CACHE_CHECK variable

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


- Log -
commit c2021e4211ee1c4d840995d3adaf3e2494e35719
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 26 04:22:34 2010 +0300

s4/test: Connect SAMR and LDARPC pipes before calling libnet_ functions

In multi-DC environment, NBT name resolution may resolv
domain name to any of DCs.
This make this test to fail, as we are modifying the user account
on one DC and query user info immediately after that on another DC.

commit de60cbb6e75fb1f6fe42fd0e86204d304911d30c
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 26 13:32:13 2010 +0300

s4/test: remove unused code

There is no need anymore to modify samAccountName
of the testing user to original value as test_cleanup()
will spot the right samAccountName to delete

commit 5444272f89785b9c7a63b197b89bf8fc40c39284
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 26 13:27:07 2010 +0300

s4/test: make test_cleanup() in libnet_user library more robust

test_cleanup() is called always with RDN name of the user to be deleted.
When modify-user test fails however, we end up with a user
with RDN = libnetusertest and samAccountName = random_name.
This way we can not delete the user and the error message is
quite misleading (I've spent a *lot* of time trying to figure out
if the database is corrupted because of this error).

commit bbdb8384220f3fa51ded65d89fdab0496ad3da25
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue May 25 17:24:45 2010 +0300

s4/test: rename enum test_fields{} member names to be more descriptive

commit 644593d30ecddec27f0a48340d74db7cf164bfc3
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat May 22 05:03:16 2010 +0300

s4/test: Replace hand-made field count to test

This patch replaces hand-make count of fields to be tested
with defines for FIRST-LAST value for corresponding fields
to test with.

As a side-effect, 'acct_flags' is now included in tests.

---

Summary of changes:
 source4/torture/libnet/libnet_user.c |  170 --
 source4/torture/libnet/userman.c |   22 ++--
 source4/torture/libnet/usertest.h|   10 ++-
 3 files changed, 140 insertions(+), 62 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/libnet/libnet_user.c 
b/source4/torture/libnet/libnet_user.c
index 140282b..4bda763 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -27,8 +27,70 @@
 #include torture/rpc/torture_rpc.h
 #include torture/libnet/usertest.h
 #include param/param.h
+#include lib/ldb_wrap.h
+
+
+/**
+ * Find out user's samAccountName for given
+ * user RDN. We need samAccountName value
+ * when deleting users.
+ */
+static bool _get_account_name_for_user_rdn(struct torture_context *tctx,
+  struct dcerpc_binding_handle *b,
+  const char *user_rdn,
+  TALLOC_CTX *mem_ctx,
+  const char **_account_name)
+{
+   const char *url;
+   struct ldb_context *ldb;
+   TALLOC_CTX *tmp_ctx;
+   bool test_res = true;
+   struct dcerpc_pipe *p = talloc_get_type_abort(b-private_data, struct 
dcerpc_pipe);
+   int ldb_ret;
+   struct ldb_result *ldb_res;
+   const char *account_name = NULL;
+   static const char *attrs[] = {
+   samAccountName,
+   NULL
+   };
+
+   tmp_ctx = talloc_new(tctx);
+   torture_assert(tctx, tmp_ctx != NULL, Failed to create temporary mem 
context);
+
+   url = talloc_asprintf(tmp_ctx, ldap://%s/;, 
p-binding-target_hostname);
+   torture_assert_goto(tctx, url != NULL, test_res, done, Failed to 
allocate URL for ldb);
+
+   ldb = ldb_wrap_connect(tmp_ctx,
+  tctx-ev, tctx-lp_ctx,
+  url, NULL, cmdline_credentials, 0);
+   torture_assert_goto(tctx, ldb != NULL, test_res, done, Failed to make 
LDB connection);
+
+   ldb_ret = ldb_search(ldb, tmp_ctx, ldb_res,
+ldb_get_default_basedn(ldb), LDB_SCOPE_SUBTREE,
+attrs,
+((objectClass

[SCM] Samba Shared Repository - branch master updated

2010-05-21 Thread Kamen Mazdrashki
The branch, master has been updated
   via  a4719a4... s4-drsuapi: Sort ATTID definitions by ATTID value
   via  ffc4676... s4/drsuapi: Yet another set of predefined ATTIDs
  from  b6b3822... s4-torture: Improved the winreg symlink test.

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


- Log -
commit a4719a4e12c69f2602bb6063f635c66d3d4848a0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 21 05:36:35 2010 +0300

s4-drsuapi: Sort ATTID definitions by ATTID value

commit ffc46769b35083f35a8ff2309e4a066502af9441
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri May 21 05:27:04 2010 +0300

s4/drsuapi: Yet another set of predefined ATTIDs

---

Summary of changes:
 librpc/idl/drsuapi.idl |   15 +++
 1 files changed, 11 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index cd99038..8540057 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -390,6 +390,7 @@ interface drsuapi
DRSUAPI_ATTRIBUTE_instanceType  = 0x00020001,
DRSUAPI_ATTRIBUTE_whenCreated   = 0x00020002,
DRSUAPI_ATTRIBUTE_possSuperiors = 0x00020008,
+   DRSUAPI_ATTRIBUTE_displayName   = 0x0002000d,
DRSUAPI_ATTRIBUTE_hasMasterNCs  = 0x0002000e,
DRSUAPI_ATTRIBUTE_subClassOf= 0x00020015,
DRSUAPI_ATTRIBUTE_governsID = 0x00020016,
@@ -415,22 +416,28 @@ interface drsuapi
DRSUAPI_ATTRIBUTE_lDAPDisplayName   = 0x000201cc,
DRSUAPI_ATTRIBUTE_name  = 0x00090001,
DRSUAPI_ATTRIBUTE_userAccountControl= 0x00090008,
+   DRSUAPI_ATTRIBUTE_codePage  = 0x00090010,
+   DRSUAPI_ATTRIBUTE_countryCode   = 0x00090019,
DRSUAPI_ATTRIBUTE_currentValue  = 0x0009001b,
DRSUAPI_ATTRIBUTE_homeDirectory = 0x0009002c,
DRSUAPI_ATTRIBUTE_homeDrive = 0x0009002d,
-   DRSUAPI_ATTRIBUTE_scriptPath= 0x0009003e,
-   DRSUAPI_ATTRIBUTE_profilePath   = 0x0009008b,
-   DRSUAPI_ATTRIBUTE_objectSid = 0x00090092,
-   DRSUAPI_ATTRIBUTE_schemaIDGUID  = 0x00090094,
DRSUAPI_ATTRIBUTE_dBCSPwd   = 0x00090037,/* 
lmPwdHash */
+   DRSUAPI_ATTRIBUTE_scriptPath= 0x0009003e,
DRSUAPI_ATTRIBUTE_logonHours= 0x00090040,
DRSUAPI_ATTRIBUTE_userWorkstations  = 0x00090056,
DRSUAPI_ATTRIBUTE_unicodePwd= 0x0009005a,/* 
ntPwdHash */
DRSUAPI_ATTRIBUTE_ntPwdHistory  = 0x0009005e,
+   DRSUAPI_ATTRIBUTE_pwdLastSet= 0x00090060,
+   DRSUAPI_ATTRIBUTE_primaryGroupID= 0x00090062,
DRSUAPI_ATTRIBUTE_priorValue= 0x00090064,
DRSUAPI_ATTRIBUTE_supplementalCredentials   = 0x0009007d,
DRSUAPI_ATTRIBUTE_trustAuthIncoming = 0x00090081,
DRSUAPI_ATTRIBUTE_trustAuthOutgoing = 0x00090087,
+   DRSUAPI_ATTRIBUTE_profilePath   = 0x0009008b,
+   DRSUAPI_ATTRIBUTE_objectSid = 0x00090092,
+   DRSUAPI_ATTRIBUTE_schemaIDGUID  = 0x00090094,
+   DRSUAPI_ATTRIBUTE_comment   = 0x0009009C,/* 
User-Comment */
+   DRSUAPI_ATTRIBUTE_accountExpires= 0x0009009f,
DRSUAPI_ATTRIBUTE_lmPwdHistory  = 0x000900a0,
DRSUAPI_ATTRIBUTE_systemPossSuperiors   = 0x000900c3,
DRSUAPI_ATTRIBUTE_systemMayContain  = 0x000900c4,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-18 Thread Kamen Mazdrashki
The branch, master has been updated
   via  ad9050a... s4/drsuapi: Add another set of predefined ATTIDs
   via  799eb53... s4/metadata: fix whitespaces
   via  242b41a... s4/selftest: fix passwords in selftest-vars script
  from  6a90307... Fix our NTLMSSP implementation against the Microsoft 
torture tester.

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


- Log -
commit ad9050a6ff57d847ba7d95f2cb33353d369dc42b
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 19 02:29:20 2010 +0300

s4/drsuapi: Add another set of predefined ATTIDs

Very useful for debugging/dumping purposes

commit 799eb535a907ba6b6bad92d85d1ca7ac9f857dea
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 19 02:28:09 2010 +0300

s4/metadata: fix whitespaces

commit 242b41a3d8dfb5fd1cc1923e117f6d33bd145c55
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed May 19 02:18:17 2010 +0300

s4/selftest: fix passwords in selftest-vars script

---

Summary of changes:
 librpc/idl/drsuapi.idl  |6 +-
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |  142 +++---
 source4/scripting/devel/selftest-vars.sh|4 +-
 3 files changed, 78 insertions(+), 74 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index ef6ffef..cd99038 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -384,6 +384,7 @@ interface drsuapi
typedef [flag(NDR_PAHEX),v1_enum,public] enum {
DRSUAPI_ATTRIBUTE_objectClass   = 0x,
DRSUAPI_ATTRIBUTE_cn= 0x0003,
+   DRSUAPI_ATTRIBUTE_ou= 0x000b,
DRSUAPI_ATTRIBUTE_description   = 0x000d,
DRSUAPI_ATTRIBUTE_member= 0x001f,
DRSUAPI_ATTRIBUTE_instanceType  = 0x00020001,
@@ -401,6 +402,7 @@ interface drsuapi
DRSUAPI_ATTRIBUTE_rangeLower= 0x00020022,
DRSUAPI_ATTRIBUTE_rangeUpper= 0x00020023,
DRSUAPI_ATTRIBUTE_dMDLocation   = 0x00020024,
+   DRSUAPI_ATTRIBUTE_isDeleted = 0x00020030,
DRSUAPI_ATTRIBUTE_objectVersion = 0x0002004c,
DRSUAPI_ATTRIBUTE_invocationId  = 0x00020073,
DRSUAPI_ATTRIBUTE_showInAdvancedViewOnly= 0x000200a9,
@@ -449,13 +451,15 @@ interface drsuapi
DRSUAPI_ATTRIBUTE_userPrincipalName = 0x00090290,
DRSUAPI_ATTRIBUTE_groupType = 0x000902ee,
DRSUAPI_ATTRIBUTE_servicePrincipalName  = 0x00090303,
+   DRSUAPI_ATTRIBUTE_lastKnownParent   = 0x0009030d,
DRSUAPI_ATTRIBUTE_objectCategory= 0x0009030e,
DRSUAPI_ATTRIBUTE_gPLink= 0x0009037b,
DRSUAPI_ATTRIBUTE_transportAddressAttribute = 0x0009037f,
DRSUAPI_ATTRIBUTE_msDS_Behavior_Version = 0x000905b3,
DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber = 0x000906f6,
DRSUAPI_ATTRIBUTE_msDS_HasDomainNCs = 0x0009071c,
-   DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c,   

+   DRSUAPI_ATTRIBUTE_msDS_hasMasterNCs = 0x0009072c,
+   DRSUAPI_ATTRIBUTE_isRecycled= 0x0009080a,
DRSUAPI_ATTRIBUTE_NONE  = 0x
} drsuapi_DsAttributeId;
 
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 72ffd0e..db2415b 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -1,4 +1,4 @@
-/* 
+/*
ldb database library
 
Copyright (C) Simo Sorce  2004-2008
@@ -10,12 +10,12 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-   
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
-   
+
You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/.
 */
@@ -349,7 +349,7 @@ static int replmd_add_backlink(struct ldb_module *module, 
const struct dsdb_sche
 
 /*
  * Callback for most write

[SCM] Samba Shared Repository - branch master updated

2010-05-10 Thread Kamen Mazdrashki
The branch, master has been updated
   via  983606d... s4/tort: Add test for comparing special DNs
   via  1f3faea... s4/dn: handle case 'base' dn has no components
  from  7cf1a29... s4-smbtorture: add smbcli_rap_netoemchangepassword().

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


- Log -
commit 983606dbe0a23cab28d0f33a32a0e4ab0acf99a7
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat May 8 10:20:00 2010 +0300

s4/tort: Add test for comparing special DNs

commit 1f3faea0463782d16bdbfd34b3b51624aca2bc90
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat May 8 10:19:14 2010 +0300

s4/dn: handle case 'base' dn has no components

This could if the 'base' dn is special for example.

---

Summary of changes:
 source4/lib/ldb/common/ldb_dn.c |2 +-
 source4/torture/ldb/ldb.c   |   18 ++
 2 files changed, 19 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c
index d91e9d9..00646f6 100644
--- a/source4/lib/ldb/common/ldb_dn.c
+++ b/source4/lib/ldb/common/ldb_dn.c
@@ -1065,7 +1065,7 @@ int ldb_dn_compare_base(struct ldb_dn *base, struct 
ldb_dn *dn)
return (dn-comp_num - base-comp_num);
}
 
-   if (dn-comp_num == 0) {
+   if ((dn-comp_num == 0) || (base-comp_num == 0)) {
if (dn-special  base-special) {
return strcmp(base-linearized, dn-linearized);
} else if (dn-special) {
diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c
index dbfd96c..8bc6357 100644
--- a/source4/torture/ldb/ldb.c
+++ b/source4/torture/ldb/ldb.c
@@ -587,6 +587,7 @@ static bool torture_ldb_dn(struct torture_context *torture)
struct ldb_dn *dn;
struct ldb_dn *child_dn;
struct ldb_dn *typo_dn;
+   struct ldb_dn *special_dn;
struct ldb_val val;
 
torture_assert(torture, 
@@ -656,6 +657,23 @@ static bool torture_ldb_dn(struct torture_context *torture)
   ldb_dn_compare_base(dn, typo_dn) != 0,
   Base Comparison on dc=samba,dc=org and c=samba,dc=org 
should != 0);
 
+   /* Check comparisons with a special DN */
+   torture_assert(torture,
+  special_dn = ldb_dn_new(mem_ctx, ldb, @special_dn),
+  Failed to create 'special' DN);
+
+   torture_assert(torture,
+  ldb_dn_compare(dn, special_dn) != 0,
+  Comparison on dc=samba,dc=org and @special_dn should != 
0);
+
+   torture_assert(torture,
+  ldb_dn_compare_base(special_dn, dn)  0,
+  Base Comparison of @special_dn and dc=samba,dc=org 
should  0);
+
+   torture_assert(torture,
+  ldb_dn_compare_base(dn, special_dn)  0,
+  Base Comparison on dc=samba,dc=org and @special_dn 
should  0);
+
/* Check DN based on MS-ADTS:3.1.1.5.1.2 Naming Constraints*/
torture_assert(torture,
   dn = ldb_dn_new(mem_ctx, ldb, 
CN=New\nLine,DC=SAMBA,DC=org),


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-04-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  eed665d... s4/net_drs: Fix Connection name printed
   via  bf49ac9... s4/dsdb: dsdb_validate_invocation_id() should validate 
by objectGUID
  from  5197d76... s3: Make a debug msg more readable

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


- Log -
commit eed665d653828832ec57642126c4040c47dd6e90
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 26 15:48:18 2010 +0300

s4/net_drs: Fix Connection name printed

commit bf49ac99c94e4d937fd8d0532761b5635e372d84
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 26 00:22:53 2010 +0300

s4/dsdb: dsdb_validate_invocation_id() should validate by objectGUID

This function is used in DRSUpdateRefs() implementation where we
get DSA's objectGUID rather than invocationId

---

Summary of changes:
 source4/dsdb/common/util.c   |   36 +++---
 source4/rpc_server/drsuapi/updaterefs.c  |8 +++---
 source4/utils/net/drs/net_drs_showrepl.c |6 ++--
 3 files changed, 25 insertions(+), 25 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 60bcbe4..42619b9 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -3668,18 +3668,18 @@ const char *samdb_forest_name(struct ldb_context *ldb, 
TALLOC_CTX *mem_ctx)
 }
 
 /*
-   validate that an invocationID belongs to the specified user sid.
+   validate that an DSA GUID belongs to the specified user sid.
The user SID must be a domain controller account (either RODC or
RWDC)
  */
-int dsdb_validate_invocation_id(struct ldb_context *ldb,
-   const struct GUID *invocation_id,
-   const struct dom_sid *sid)
+int dsdb_validate_dsa_guid(struct ldb_context *ldb,
+  const struct GUID *dsa_guid,
+  const struct dom_sid *sid)
 {
/* strategy:
-   - find DN of record with the invocationID in the
- configuration partition
-- remote NTDS Settings component from DN
+   - find DN of record with the DSA GUID in the
+ configuration partition (objectGUID)
+- remove NTDS Settings component from DN
- do a base search on that DN for serverReference with
  extended-dn enabled
 - extract objectSID from resulting serverReference
@@ -3699,10 +3699,10 @@ int dsdb_validate_invocation_id(struct ldb_context *ldb,
config_dn = ldb_get_config_basedn(ldb);
 
ret = dsdb_search_one(ldb, tmp_ctx, msg, config_dn, LDB_SCOPE_SUBTREE,
- attrs1, 0, 
((invocationID=%s)(objectClass=nTDSDSA)), GUID_string(tmp_ctx, 
invocation_id));
+ attrs1, 0, 
((objectGUID=%s)(objectClass=nTDSDSA)), GUID_string(tmp_ctx, dsa_guid));
if (ret != LDB_SUCCESS) {
-   DEBUG(1,(__location__ : Failed to find invocationID %s for sid 
%s\n,
-GUID_string(tmp_ctx, invocation_id), 
dom_sid_string(tmp_ctx, sid)));
+   DEBUG(1,(__location__ : Failed to find DSA objectGUID %s for 
sid %s\n,
+GUID_string(tmp_ctx, dsa_guid), 
dom_sid_string(tmp_ctx, sid)));
talloc_free(tmp_ctx);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -3717,32 +3717,32 @@ int dsdb_validate_invocation_id(struct ldb_context *ldb,
  attrs2, DSDB_SEARCH_SHOW_EXTENDED_DN,
  (objectClass=server));
if (ret != LDB_SUCCESS) {
-   DEBUG(1,(__location__ : Failed to find server record for 
invocationID %s, sid %s\n,
-GUID_string(tmp_ctx, invocation_id), 
dom_sid_string(tmp_ctx, sid)));
+   DEBUG(1,(__location__ : Failed to find server record for DSA 
with objectGUID %s, sid %s\n,
+GUID_string(tmp_ctx, dsa_guid), 
dom_sid_string(tmp_ctx, sid)));
talloc_free(tmp_ctx);
return LDB_ERR_OPERATIONS_ERROR;
}
 
account_dn = ldb_msg_find_attr_as_dn(ldb, tmp_ctx, msg, 
serverReference);
if (account_dn == NULL) {
-   DEBUG(1,(__location__ : Failed to find account_dn for 
invocationID %s, sid %s\n,
-GUID_string(tmp_ctx, invocation_id), 
dom_sid_string(tmp_ctx, sid)));
+   DEBUG(1,(__location__ : Failed to find account_dn for DSA with 
objectGUID %s, sid %s\n,
+GUID_string(tmp_ctx, dsa_guid), 
dom_sid_string(tmp_ctx, sid)));
talloc_free(tmp_ctx);
return LDB_ERR_OPERATIONS_ERROR;
}
 
status = dsdb_get_extended_dn_sid(account_dn, sid2, SID);
if (!NT_STATUS_IS_OK(status

[SCM] Samba Shared Repository - branch master updated

2010-04-28 Thread Kamen Mazdrashki
The branch, master has been updated
   via  5a4ee75... s4/tort: Add simple unit test for dsdb_schema_info 
object creation
   via  59830d0... s4/dsdb: schemaInfo revision may be 0
   via  a843801... s4/dsdb: remove unused dsdb_schema_info_create() function
   via  2264d91... s4/dsdb: Update Schema cache with updated schemaInfo 
value
   via  e41eac9... s4/samldb: Create initial schemaInfo value if it doesn't 
exists yet
   via  546a727... s4/dsdb: Use default schemaInfo value when no such value 
is given
   via  da127d4... s4/test: schemaInfo may not to be set yet
   via  5bf12e1... Revert s4/dsdb: Set schemaInfo attribute value during 
provisioning
  from  2bf2373... idl: we only need ndr_rap.[ch] and rap.h

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


- Log -
commit 5a4ee75289e8394ea2f2de0b0415ed7f7ee54575
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sat Apr 24 01:21:15 2010 +0300

s4/tort: Add simple unit test for dsdb_schema_info object creation

commit 59830d0a6effa6509eae384f08cf3df32cd53359
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Apr 23 16:35:21 2010 +0300

s4/dsdb: schemaInfo revision may be 0

In case schemaInfo value is still not set, WinAD supplies
schemaInfo blob with revision = 0 and GUID_ZERO

commit a8438015cae6d426bf140feffec46e129688ec8e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Apr 23 15:37:10 2010 +0300

s4/dsdb: remove unused dsdb_schema_info_create() function

commit 2264d917ae626d6f2d8f5d2c128a4a95a405
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 22 18:11:39 2010 +0300

s4/dsdb: Update Schema cache with updated schemaInfo value

Error checking is simplified and my leave leeks.
I did it this way to make code more readable, and if we
get error in those lines, it will be WERR_NOMEM in which
case we are in a much deeper troubles than delayed freeing
of few bytes.

commit e41eac96afb1d6d465faeb1e4e9a669cff1b8bc1
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 22 17:59:22 2010 +0300

s4/samldb: Create initial schemaInfo value if it doesn't exists yet

commit 546a727bd326464c6fac3c6454e4e98314e0e75a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 22 17:24:15 2010 +0300

s4/dsdb: Use default schemaInfo value when no such value is given

Having no value for schemaInfo is totally OK as it turns out.
In such cases, we should use a default value with
all fields set to 0.

commit da127d44e31306b4865e682be362fd9672d8201f
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 22 04:39:04 2010 +0300

s4/test: schemaInfo may not to be set yet

On newly provisioned Forest schemaInfo is not initially set.
It should be created after firs Schema modification

commit 5bf12e101aa729619758c38af5c682b2cd06ea70
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 22 02:55:03 2010 +0300

Revert s4/dsdb: Set schemaInfo attribute value during provisioning

This reverts commit 8149094eddebd9a0e8b7c123c2ed54d00164bb26.

Windows implementation does not set schemaInfo attribute value
until first Schema update request.
This way, newly provisioned forest returns no schemaInfo value.

I think it won't be bad for us to have this value preset, but
I want to mimic Win AD behavior as close as possible.

---

Summary of changes:
 source4/dsdb/schema/schema_info_attr.c   |  162 -
 source4/dsdb/schema/schema_init.c|   14 +--
 source4/dsdb/schema/schema_set.c |5 +-
 source4/lib/ldb/tests/python/dsdb_schema_info.py |   22 ++-
 source4/scripting/python/pyglue.c|   26 
 source4/scripting/python/samba/__init__.py   |3 -
 source4/scripting/python/samba/provision.py  |2 -
 source4/torture/drs/unit/schemainfo_tests.c  |   89 ++--
 8 files changed, 125 insertions(+), 198 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/schema/schema_info_attr.c 
b/source4/dsdb/schema/schema_info_attr.c
index 132c72a..ac22eb9 100644
--- a/source4/dsdb/schema/schema_info_attr.c
+++ b/source4/dsdb/schema/schema_info_attr.c
@@ -30,6 +30,46 @@
 
 
 /**
+ * Creates and initializes new dsdb_schema_info value.
+ * Initial schemaInfo values is with:
+ *   revision = 0
+ *   invocationId = GUID_ZERO
+ */
+WERROR dsdb_schema_info_new(TALLOC_CTX *mem_ctx, struct dsdb_schema_info 
**_schema_info)
+{
+   struct dsdb_schema_info *schema_info;
+
+   schema_info = talloc_zero(mem_ctx, struct dsdb_schema_info);
+   W_ERROR_HAVE_NO_MEMORY(schema_info);
+
+   *_schema_info = schema_info;
+
+   return WERR_OK;
+}
+
+/**
+ * Creates and initializes new dsdb_schema_info blob value.
+ * Initial schemaInfo values

[SCM] Samba Shared Repository - branch master updated

2010-04-11 Thread Kamen Mazdrashki
The branch, master has been updated
   via  2179c6a... s4: fix a typo
   via  a62d041... s4/libnet: handle errors returned for DsAddEntry_v3 
properly
   via  cb0ad42... s4/libnet: Add few new lines in the debug log so it is 
readable again
   via  9f92d58... s4/libnet: Dump DRSUAPI_DIRERR_OK as unexpected
  from  8e95db9... s3: Move serverinfo_to_SamInfoX to auth/server_info.c

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


- Log -
commit 2179c6a8f843d9db5860b6c91d154d288f28d741
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Apr 11 18:43:56 2010 +0300

s4: fix a typo

commit a62d0419dee3d3fe8618baa71aa882c5bed54072
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Apr 11 17:27:30 2010 +0300

s4/libnet: handle errors returned for DsAddEntry_v3 properly

It turns out ms-docs are little bit misleading - in case of
no error, r-out.ctr-ctr3.err_data is not NULL, but
error information (r-out.ctr-ctr3.err_data-v1.info) is NULL!

commit cb0ad42a3d9d837cfc06f65baa6d8fa2d28a3ec9
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Apr 11 17:24:32 2010 +0300

s4/libnet: Add few new lines in the debug log so it is readable again

commit 9f92d586ca537ed093a1d68eacf94315da68a8ad
Author: Kamen Mazdrashki kame...@samba.org
Date:   Sun Apr 11 17:04:21 2010 +0300

s4/libnet: Dump DRSUAPI_DIRERR_OK as unexpected

Actually DRSUAPI_DIRERR_OK is not valid error to be returned.
I introduce it in the IDL so that I can use it in enum.
So it should be dumped as Unexpected error code

---

Summary of changes:
 source4/libnet/libnet_become_dc.c |   40 ++--
 source4/param/provision.c |2 +-
 2 files changed, 21 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/libnet/libnet_become_dc.c 
b/source4/libnet/libnet_become_dc.c
index 1c0bfbc..486416e 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -2285,11 +2285,12 @@ static void becomeDC_drsuapi1_add_entry_recv(struct 
tevent_req *subreq)
}
 
if (*r-out.level_out == 3) {
+   WERROR status;
union drsuapi_DsAddEntry_ErrData *err_data = 
r-out.ctr-ctr3.err_data;
 
/* check for errors */
-   if (err_data) {
-   WERROR status;
+   status = err_data ? err_data-v1.status : WERR_OK;
+   if (!W_ERROR_IS_OK(status)) {
struct drsuapi_DsAddEntryErrorInfo_Attr_V1 *attr_err;
struct drsuapi_DsAddEntry_AttrErrListItem_V1 
*attr_err_li;
struct drsuapi_DsAddEntryErrorInfo_Name_V1 *name_err;
@@ -2301,32 +2302,30 @@ static void becomeDC_drsuapi1_add_entry_recv(struct 
tevent_req *subreq)
return;
}
 
-   status = err_data-v1.status;
-
DEBUG(0,(DsAddEntry (R3) failed: 
-Errors: dir_err = %d, status = %s;,
+Errors: dir_err = %d, status = %s;\n,
 err_data-v1.dir_err,
 win_errstr(err_data-v1.status)));
 
if (!err_data-v1.info) {
+   DEBUG(0, (DsAddEntry (R3): no error info 
returned!\n,
+ err_data-v1.info));
composite_error(c, werror_to_ntstatus(status));
return;
}
 
/* dump more detailed error */
switch (err_data-v1.dir_err) {
-   case DRSUAPI_DIRERR_OK: /* mute compiler warnings */
-   break;
case DRSUAPI_DIRERR_ATTRIBUTE:
/* Dump attribute errors */
attr_err = err_data-v1.info-attr_err;
-   DEBUGADD(0,( Attribute Error: object = %s, 
count = %d;,
+   DEBUGADD(0,( Attribute Error: object = %s, 
count = %d;\n,
attr_err-id-dn,
attr_err-count));
attr_err_li = attr_err-first;
for (; attr_err_li; attr_err_li = 
attr_err_li-next) {
struct drsuapi_DsAddEntry_AttrErr_V1 
*err = attr_err_li-err_data;
-   DEBUGADD(0,( Error: err = %s, problem 
= 0x%08X, attid = 0x%08X;,
+   DEBUGADD(0,( Error: err = %s, problem 
= 0x%08X, attid = 0x%08X;\n

[SCM] Samba Shared Repository - branch master updated

2010-04-11 Thread Kamen Mazdrashki
The branch, master has been updated
   via  a9e4aba... s4/libnet: Allocate mem in supplied mem_ctx
   via  82b8bbd... s4/py_net: Source code formatting fix
  from  98942c8... build: use a common autogen-waf.sh for all builds

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


- Log -
commit a9e4abaa6e72425017953f95e2f22cc4af6d7455
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 12 03:45:12 2010 +0300

s4/libnet: Allocate mem in supplied mem_ctx

In this case, 'libnet_Vampire *r' may not be a pointer to
a talloced memory.

commit 82b8bbdfac3a9bf7daded97173d205764f14670a
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Apr 12 03:33:33 2010 +0300

s4/py_net: Source code formatting fix

---

Summary of changes:
 source4/libnet/libnet_vampire.c |4 ++--
 source4/libnet/py_net.c |   33 +
 2 files changed, 19 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index a276828..8d2393f 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -760,8 +760,8 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, 
TALLOC_CTX *mem_ctx,
return status;
}
 
-   r-out.domain_name = talloc_steal(r, join-out.domain_name);
-   r-out.domain_sid = dom_sid_dup(r, join-out.domain_sid);
+   r-out.domain_name = talloc_steal(mem_ctx, join-out.domain_name);
+   r-out.domain_sid = dom_sid_dup(mem_ctx, join-out.domain_sid);

/* commit the transaction now we know the secrets were written
 * out properly
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index f2fc771..ec41ca3 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -271,40 +271,41 @@ static PyObject *py_net_vampire(py_net_Object *self, 
PyObject *args, PyObject *k
const char *kwnames[] = { domain, target_dir, NULL };
NTSTATUS status;
TALLOC_CTX *mem_ctx;
-PyObject *ret;
+   PyObject *ret;
struct libnet_Vampire r;
 
-   if (!PyArg_ParseTupleAndKeywords(args, kwargs, s|s, 
discard_const_p(char *, kwnames), 
-
r.in.domain_name, r.in.targetdir))
+   if (!PyArg_ParseTupleAndKeywords(args, kwargs, s|s, 
discard_const_p(char *, kwnames),
+r.in.domain_name, r.in.targetdir)) {
return NULL;
+   }
 
r.in.netbios_name  = lp_netbios_name(self-libnet_ctx-lp_ctx);
r.out.error_string = NULL;
 
-mem_ctx = talloc_new(NULL);
-if (mem_ctx == NULL) {
-PyErr_NoMemory();
-return NULL;
-}
+   mem_ctx = talloc_new(NULL);
+   if (mem_ctx == NULL) {
+   PyErr_NoMemory();
+   return NULL;
+   }
 
status = libnet_Vampire(self-libnet_ctx, mem_ctx, r);
 
if (!NT_STATUS_IS_OK(status)) {
-PyErr_SetString(PyExc_RuntimeError, 
-r.out.error_string ? r.out.error_string : nt_errstr(status));
-talloc_free(mem_ctx);
+   PyErr_SetString(PyExc_RuntimeError,
+   r.out.error_string ? r.out.error_string : 
nt_errstr(status));
+   talloc_free(mem_ctx);
return NULL;
}
 
-ret = Py_BuildValue((sO), r.out.domain_name, 
py_dom_sid_FromSid(r.out.domain_sid));
+   ret = Py_BuildValue((sO), r.out.domain_name, 
py_dom_sid_FromSid(r.out.domain_sid));
 
-talloc_free(mem_ctx);
+   talloc_free(mem_ctx);
 
-return ret;
+   return ret;
 }
 
 static const char py_net_vampire_doc[] = vampire(domain, target_dir=None)\n
-Vampire a domain.;
+Vampire a domain.;
 
 static PyMethodDef net_obj_methods[] = {
{join, (PyCFunction)py_net_join, METH_VARARGS|METH_KEYWORDS, 
py_net_join_doc},
@@ -313,7 +314,7 @@ static PyMethodDef net_obj_methods[] = {
{time, (PyCFunction)py_net_time, METH_VARARGS|METH_KEYWORDS, 
py_net_time_doc},
{create_user, (PyCFunction)py_net_user_create, 
METH_VARARGS|METH_KEYWORDS, py_net_create_user_doc},
{delete_user, (PyCFunction)py_net_user_delete, 
METH_VARARGS|METH_KEYWORDS, py_net_delete_user_doc},
-{vampire, (PyCFunction)py_net_vampire, METH_VARARGS|METH_KEYWORDS, 
py_net_vampire_doc},
+   {vampire, (PyCFunction)py_net_vampire, METH_VARARGS|METH_KEYWORDS, 
py_net_vampire_doc},
{ NULL }
 };
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-04-09 Thread Kamen Mazdrashki
The branch, master has been updated
   via  8149094... s4/dsdb: Set schemaInfo attribute value during 
provisioning
   via  4ba2ac0... s4/dsdb: split writing of schemaInfo blob in two parts
   via  fbef33f... s4/dsdb: Let caller to control if valid invocationId is 
critical or zero-guid is acceptable
   via  2763a4a... s4/test: Add DRS-UNIT test suite to 'quicktests' list
   via  5363b6e... s4/dsdb: Use dsdb_schema_info object to create default 
schemaInfo values
   via  c3d7798... s4/dsdb: Use dsdb_schema_info object to verify 
schema_info blobs
   via  e5ef11f... s4/test: Use drsut_schemainfo_new() instead of 
SCHEMA_INFO_DEFAULT local define
   via  15921b6... s4/waf: add new files to WAF build
   via  6d439af... s4/samldb: schemaInfo attribute must be updated when 
adding new Schema object
   via  7f0da64... s4/test: add shemaInfo torture test to automated test 
suite
   via  08dd0d0... s4/schema: Torture test for schemaInfo implementation
   via  80d8f37... s4/was: Add 'drsblobs' Python module
   via  3629fb9... s4: Add 'drsblobs' Python module
   via  8dd5705... librpc/idl: Use [nopython] attr for types used in 
decode_PrimaryKerberos method
   via  2ea99c2... librpc/idl Use [nopython] on some drsblobs.idl 
'functions' as an example
   via  738ac53... pidl:python Allow 'nopython' to work
   via  526e62c... s4/tort: Unit test for schemaInfo implementation
   via  ae30cb9... torture: add torture_assert_goto() convenience macro
   via  9d1f8bc... s4/dsdb: dsdb_schema_info object implementation
   via  37a6b66... s4/dsdb: Define dsdb representation for schemaInfo 
attribute
   via  6e7be5f... s4/ldif: Handle Schema:schemaInfo blobs
   via  ffd1d7e... s4/idl: drsblobs IDL regeneration
   via  63e1aae... s4/idl: Schema:schemaInfo attribute description
  from  deccb6c... s4-krb5: Fix typos in comment.

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


- Log -
commit 8149094eddebd9a0e8b7c123c2ed54d00164bb26
Author: Kamen Mazdrashki kame...@samba.org
Date:   Fri Apr 9 10:48:20 2010 +0300

s4/dsdb: Set schemaInfo attribute value during provisioning

After provisioning new Forest, schemaInfo should be set
to a value with revision=1 and current invocation_id

commit 4ba2ac073d7a7859ab73f8b7f40d630ddbff8687
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 10:23:13 2010 +0300

s4/dsdb: split writing of schemaInfo blob in two parts

ldb_msg preparation is moved into separate function
so that it can be used for implementing schemaInfo
updates both on module stack (dsdb_module_... functions)
and directly on ldb_context

commit fbef33fb7369f57e6851d3766f87c953ca2d26bd
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 08:27:07 2010 +0300

s4/dsdb: Let caller to control if valid invocationId is critical or 
zero-guid is acceptable

commit 2763a4ac4e8c93701e00a3baa9fb2dfa24b776f4
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 05:32:59 2010 +0300

s4/test: Add DRS-UNIT test suite to 'quicktests' list

commit 5363b6e68b2eb432142b4c0d4972ea4def17c1be
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 05:31:35 2010 +0300

s4/dsdb: Use dsdb_schema_info object to create default schemaInfo values

commit c3d77989913a1ec270a50847922f6c1ffd7cbad0
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 05:30:16 2010 +0300

s4/dsdb: Use dsdb_schema_info object to verify schema_info blobs

commit e5ef11f4e29af77147dc21e6e8986ed091818566
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 05:27:59 2010 +0300

s4/test: Use drsut_schemainfo_new() instead of SCHEMA_INFO_DEFAULT local 
define

commit 15921b669e6c8ef7b6d90708edde7c6eb4009d36
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Apr 7 14:22:49 2010 +0300

s4/waf: add new files to WAF build

commit 6d439afbf77b15d34310144c473f6600148f7d84
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Apr 6 15:17:05 2010 +0300

s4/samldb: schemaInfo attribute must be updated when adding new Schema 
object

commit 7f0da64a4990f21f67afde192322a53bcb4438ce
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Apr 7 13:00:53 2010 +0300

s4/test: add shemaInfo torture test to automated test suite

commit 08dd0d0b54062c34643cf3b0fbaeabfc3d471782
Author: Kamen Mazdrashki kame...@samba.org
Date:   Wed Mar 31 04:18:06 2010 +0300

s4/schema: Torture test for schemaInfo implementation

This test checks if schemaInfo revision changes when an object
is added or modified in Schema.

Ref. [MS-ADTS], 3.1.1.2.1

commit 80d8f37b26c2919899ec3de9ec5b2c1079436c6e
Author: Kamen Mazdrashki kame...@samba.org
Date:   Thu Apr 8 10:51:36 2010 +0300

s4/was: Add 'drsblobs' Python module

commit 3629fb9927074154c15ac0d16cce187bc6b9e665
Author: Kamen Mazdrashki kame...@samba.org
Date

[SCM] Samba Shared Repository - branch master updated

2010-04-08 Thread Kamen Mazdrashki
The branch, master has been updated
   via  8126c78... s4/torture: Suppress Valgrind warnings
  from  8468137... s4-winreg: add winreg_DeleteKeyEx stub.

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


- Log -
commit 8126c78c76965fe6158fb8ef426abf256551e725
Author: Kamen Mazdrashki kame...@samba.org
Date:   Tue Mar 30 00:13:46 2010 +0300

s4/torture: Suppress Valgrind warnings

This patch suppresses two Valgrind warnings of type
xxx bytes in yy blocks are indirectly lost in loss record

---

Summary of changes:
 source4/torture/smbtorture.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 2aa340e..d3b1fea 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -641,7 +641,8 @@ int main(int argc,char *argv[])
 
results = torture_results_init(talloc_autofree_context(), ui_ops);
 
-   torture = torture_context_init(s4_event_context_init(NULL), results);
+   torture = 
torture_context_init(s4_event_context_init(talloc_autofree_context()),
+  results);
if (basedir != NULL) {
if (basedir[0] != '/') {
fprintf(stderr, Please specify an absolute path to 
--basedir\n);


-- 
Samba Shared Repository