[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Matthias Dieter Wallnöfer
The branch, master has been updated
   via  bd3e580 Revert lib/util:tests/time.c - test_timestring - fix it 
on Solaris
   via  619a49c lib/util/fault.c - fix pid_t printf warning on Solaris
   via  2664a67 s4:torture/locktest.c - fix pid_t printf warning on 
Solaris
   via  3b7e2ee s4:torture/locktest.c - fix one indentation
   via  0c8cf66 s4:client/client.c - fix Solaris warning by a type cast
   via  93d85ca s4:fix some shadowed declaration warnings on Solaris by 
renaming the symbols
  from  5845cc9 s4-dns: return the correct TTL

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


- Log -
commit bd3e5804a41fdfc8a43bebd95c53e4f0ff1d7a10
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:28:22 2010 +0100

Revert lib/util:tests/time.c - test_timestring - fix it on Solaris

This reverts commit 654e0102ddb0acaaf45fb55c15818722235fcc9f.
This should better be handled by the replace library.

Autobuild-User: Matthias Dieter Wallnöfer m...@samba.org
Autobuild-Date: Mon Dec  6 12:17:31 CET 2010 on sn-devel-104

commit 619a49c4219282bf8776183e76c1b4f0629a6d4c
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:27:05 2010 +0100

lib/util/fault.c - fix pid_t printf warning on Solaris

According to http://www.ibm.com/developerworks/linux/library/l-solar/;
it's generally a 32bit int - therefore this cast should fit.

commit 2664a67c86e817fec2392fa08698813a8800533d
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:24:55 2010 +0100

s4:torture/locktest.c - fix pid_t printf warning on Solaris

According to http://www.ibm.com/developerworks/linux/library/l-solar/;
it's generally a 32bit int - therefore this cast should fit.

commit 3b7e2ee5e4b6e15ddd24f781d389b9dbe88dc887
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:24:12 2010 +0100

s4:torture/locktest.c - fix one indentation

commit 0c8cf666fc3cd35961e6bc2862b67527b922731a
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:23:30 2010 +0100

s4:client/client.c - fix Solaris warning by a type cast

commit 93d85ca5fd57d87e720ab627865f0e5af25e07b5
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 11:06:27 2010 +0100

s4:fix some shadowed declaration warnings on Solaris by renaming the symbols

---

Summary of changes:
 lib/util/fault.c  |2 +-
 lib/util/tests/time.c |7 ++-
 libcli/security/access_check.h|2 +-
 source4/client/client.c   |2 +-
 source4/dsdb/common/dsdb_access.c |   11 ++-
 source4/dsdb/samdb/ldb_modules/acl_util.c |   25 +++--
 source4/lib/ldb/common/ldb_dn.c   |4 ++--
 source4/lib/ldb/include/ldb.h |2 +-
 source4/rpc_server/lsa/dcesrv_lsa.c   |2 +-
 source4/torture/locktest.c|4 ++--
 10 files changed, 32 insertions(+), 29 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/fault.c b/lib/util/fault.c
index 11b31d7..bbb3190 100644
--- a/lib/util/fault.c
+++ b/lib/util/fault.c
@@ -125,7 +125,7 @@ _PUBLIC_ _NORETURN_ void smb_panic(const char *why)
char pidstr[20];
char cmdstring[200];
safe_strcpy(cmdstring, panic_action, sizeof(cmdstring));
-   snprintf(pidstr, sizeof(pidstr), %u, getpid());
+   snprintf(pidstr, sizeof(pidstr), %d, (int) getpid());
all_string_sub(cmdstring, %PID%, pidstr, sizeof(cmdstring));
if (progname) {
all_string_sub(cmdstring, %PROG%, progname, 
sizeof(cmdstring));
diff --git a/lib/util/tests/time.c b/lib/util/tests/time.c
index 8b0a0c3..78e8121 100644
--- a/lib/util/tests/time.c
+++ b/lib/util/tests/time.c
@@ -64,7 +64,7 @@ static bool test_http_timestring(struct torture_context *tctx)
 
 static bool test_timestring(struct torture_context *tctx)
 {
-   const char *start = Thu Jan  1, *start2 = Thu Jan 01;
+   const char *start = Thu Jan  1;
char *result;
/*
 * Correct test for negative UTC offset.  Without the correction, the
@@ -77,10 +77,7 @@ static bool test_timestring(struct torture_context *tctx)
time_t utc_offset = mktime(local) - mktime(gmt);
 
result = timestring(tctx, 42 - (utc_offset  0 ? utc_offset : 0));
-   torture_assert(tctx,
-  (strncmp(start, result, strlen(start)) == 0) ||
-  (strncmp(start2, result, strlen(start2)) == 0),
-  result);
+   torture_assert(tctx, !strncmp(start, result, strlen(start)), result);
return true;
 }
 
diff --git a/libcli/security/access_check.h b/libcli/security/access_check.h
index 

[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Nadezhda Ivanova
The branch, master has been updated
   via  91bf913 s4-acl: Some optimisation of the aclread module
   via  3f1b153 s4-acl: Moved aclread module below descriptor and acl.
  from  bd3e580 Revert lib/util:tests/time.c - test_timestring - fix it 
on Solaris

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


- Log -
commit 91bf9133a62342e9aa640e30b8f3070eee9ecbc2
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Mon Dec 6 13:58:29 2010 +0200

s4-acl: Some optimisation of the aclread module

Modified the aclread module to now insert the attributes needed to perform 
access checks in the same request,
instead of doind a separate search per entry. Also, instanceType is now 
used to determine id the object has a parent
instead of parentGUID, which saves one additional search in operational.

Autobuild-User: Nadezhda Ivanova nivan...@samba.org
Autobuild-Date: Mon Dec  6 13:50:19 CET 2010 on sn-devel-104

commit 3f1b153132e2ca6ffcd9ca897f8d67eb4fdcf9b9
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Mon Dec 6 13:53:06 2010 +0200

s4-acl: Moved aclread module below descriptor and acl.

The aclread needs to be belod descriptor, as it needs to have the full 
nTsecurityDescriptor to make the
checks, and the descriptor module may filter out parts of it if 
SD_FLAGS_CONTROL is provided.

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl_read.c   |  133 +++
 source4/dsdb/samdb/ldb_modules/samba_dsdb.c |2 +-
 2 files changed, 76 insertions(+), 59 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c 
b/source4/dsdb/samdb/ldb_modules/acl_read.c
index 81f9bf6..0e9de9a 100644
--- a/source4/dsdb/samdb/ldb_modules/acl_read.c
+++ b/source4/dsdb/samdb/ldb_modules/acl_read.c
@@ -44,6 +44,9 @@ struct aclread_context {
struct ldb_request *req;
const char * const *attrs;
const struct dsdb_schema *schema;
+   bool sd;
+   bool instance_type;
+   bool object_sid;
 };
 
 struct aclread_private {
@@ -59,7 +62,7 @@ static int aclread_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 static const char *acl_attrs[] = {
 nTSecurityDescriptor,
 objectSid,
-parentGUID,
+insyanceType,
 NULL
 };
 int ret;
@@ -67,6 +70,8 @@ static int aclread_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 struct security_descriptor *sd;
 struct dom_sid *sid = NULL;
 TALLOC_CTX *tmp_ctx;
+uint32_t instanceType;
+
 ac = talloc_get_type(req-context, struct aclread_context);
 ldb = ldb_module_get_ctx(ac-module);
 if (!ares) {
@@ -79,60 +84,38 @@ static int aclread_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 tmp_ctx = talloc_new(ac);
 switch (ares-type) {
 case LDB_REPLY_ENTRY:
-ret = dsdb_module_search_dn(ac-module, tmp_ctx, acl_res, 
ares-message-dn,
-acl_attrs,
-DSDB_FLAG_NEXT_MODULE |
-DSDB_SEARCH_SHOW_DELETED);
-if (ret != LDB_SUCCESS) {
-goto fail;
-}
-ret = dsdb_get_sd_from_ldb_message(ldb, tmp_ctx, 
acl_res-msgs[0], sd);
+ret = dsdb_get_sd_from_ldb_message(ldb, tmp_ctx, 
ares-message, sd);
 if (ret != LDB_SUCCESS) {
 DEBUG(10, (acl_read: cannot get descriptor\n));
 ret = LDB_ERR_OPERATIONS_ERROR;
 goto fail;
 }
-sid = samdb_result_dom_sid(tmp_ctx, acl_res-msgs[0], 
objectSid);
-/* get the parent guid */
-parent = ldb_msg_find_element(acl_res-msgs[0], parentGUID);
-if (parent) {
-/* the object has a parent, so we have to check for 
visibility */
-struct GUID parent_guid = 
samdb_result_guid(acl_res-msgs[0], parentGUID);
-ret = dsdb_module_check_access_on_guid(ac-module,
-   tmp_ctx,
-   parent_guid,
-   SEC_ADS_LIST,
-   NULL);
-if (ret == LDB_ERR_INSUFFICIENT_ACCESS_RIGHTS) {
-talloc_free(tmp_ctx);
-return LDB_SUCCESS;
-} else if (ret != LDB_SUCCESS) {
-goto fail;
-   

[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Matthias Dieter Wallnöfer
The branch, master has been updated
   via  15a2eff s4:acl_read LDB module - fix attributes list
  from  91bf913 s4-acl: Some optimisation of the aclread module

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


- Log -
commit 15a2eff516fbde3498b88ff4c5adf6e1760d80c6
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Mon Dec 6 14:27:20 2010 +0100

s4:acl_read LDB module - fix attributes list

Autobuild-User: Matthias Dieter Wallnöfer m...@samba.org
Autobuild-Date: Mon Dec  6 15:11:44 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl_read.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c 
b/source4/dsdb/samdb/ldb_modules/acl_read.c
index 0e9de9a..5ee7c95 100644
--- a/source4/dsdb/samdb/ldb_modules/acl_read.c
+++ b/source4/dsdb/samdb/ldb_modules/acl_read.c
@@ -62,7 +62,7 @@ static int aclread_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 static const char *acl_attrs[] = {
 nTSecurityDescriptor,
 objectSid,
-insyanceType,
+instanceType,
 NULL
 };
 int ret;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Nadezhda Ivanova
The branch, master has been updated
   via  ec97c9f s4-acl: Remove unused variables from aclread module.
  from  15a2eff s4:acl_read LDB module - fix attributes list

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


- Log -
commit ec97c9f7c72bd1390d3e101c9060d9386602671e
Author: Nadezhda Ivanova nivan...@samba.org
Date:   Mon Dec 6 17:00:56 2010 +0200

s4-acl: Remove unused variables from aclread module.

Autobuild-User: Nadezhda Ivanova nivan...@samba.org
Autobuild-Date: Mon Dec  6 16:48:35 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl_read.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c 
b/source4/dsdb/samdb/ldb_modules/acl_read.c
index 5ee7c95..87144f9 100644
--- a/source4/dsdb/samdb/ldb_modules/acl_read.c
+++ b/source4/dsdb/samdb/ldb_modules/acl_read.c
@@ -57,14 +57,6 @@ static int aclread_callback(struct ldb_request *req, struct 
ldb_reply *ares)
 {
 struct ldb_context *ldb;
 struct aclread_context *ac;
-struct ldb_result *acl_res;
-struct ldb_message_element *parent;
-static const char *acl_attrs[] = {
-nTSecurityDescriptor,
-objectSid,
-instanceType,
-NULL
-};
 int ret;
 unsigned int i;
 struct security_descriptor *sd;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2010-12-06 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  a8da472 idtree: fix overflow for v. large ids on allocation and 
removal
  from  714c6c4 Updated french translations from Jean Delvare 
jdelv...@suse.de

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit a8da472643c9a9e7babdfcf7b77d1d8a3154101b
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Mon Dec 6 13:35:50 2010 +1030

idtree: fix overflow for v. large ids on allocation and removal

Chris Cowan tracked down a SEGV in sub_alloc: idp-level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a3a).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

Autobuild-User: Rusty Russell ru...@rustcorp.com.au
Autobuild-Date: Mon Dec  6 05:02:22 CET 2010 on sn-devel-104
(cherry picked from commit 521e96ca751df072e5c71d3844ed5708b79ac69d)

---

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


Changeset truncated at 500 lines:

diff --git a/lib/util/idtree.c b/lib/util/idtree.c
index 6611992..3648761 100644
--- a/lib/util/idtree.c
+++ b/lib/util/idtree.c
@@ -104,7 +104,7 @@ static int sub_alloc(struct idr_context *idp, void *ptr, 
int *starting_id)
 {
int n, m, sh;
struct idr_layer *p, *pn;
-   struct idr_layer *pa[MAX_LEVEL];
+   struct idr_layer *pa[MAX_LEVEL+1];
unsigned int l, id, oid;
uint32_t bm;
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Günther Deschner
The branch, master has been updated
   via  b73e4e3 s3-waf: add pam configure checks.
  from  ec97c9f s4-acl: Remove unused variables from aclread module.

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


- Log -
commit b73e4e36f5307316e2896d9731377f4252d0e444
Author: Günther Deschner g...@samba.org
Date:   Wed Dec 1 21:26:49 2010 +0100

s3-waf: add pam configure checks.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Mon Dec  6 17:34:45 CET 2010 on sn-devel-104

---

Summary of changes:
 source3/wscript |   71 +-
 1 files changed, 69 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/wscript b/source3/wscript
index 3354ec1..b91c6fa 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -743,8 +743,75 @@ return krb5_kt_resolve(context, WRFILE:api, keytab);
 conf.DEFINE('HAVE_ICONV', 1)
 
 if Options.options.with_pam:
-conf.CHECK_HEADERS('security/pam_appl.h security/pam_modules.h 
pam/pam_modules.h', together=True)
-conf.CHECK_FUNCS_IN('pam_start', 'pam', checklibc=True, 
headers='security/pam_appl.h')
+conf.CHECK_HEADERS('security/pam_appl.h pam/pam_appl.h')
+if not conf.CONFIG_SET('HAVE_SECURITY_PAM_APPL_H') and not 
conf.CONFIG_SET('HAVE_PAM_PAM_APPL_H'):
+print --with-pam=yes but pam_appl.h not found
+sys.exit(1)
+conf.CHECK_FUNCS_IN('pam_get_data', 'pam', mandatory=True)
+   conf.CHECK_HEADERS('security/pam_modules.h pam/pam_modules.h')
+   if not conf.CONFIG_SET('HAVE_SECURITY_PAM_MODULES_H') and not 
conf.CONFIG_SET('HAVE_PAM_PAM_MODULES_H'):
+print --with-pam=yes but pam_modules.h not found
+sys.exit(1)
+conf.CHECK_HEADERS('security/pam_ext.h security/_pam_macros.h')
+conf.CHECK_HEADERS('pam/pam_ext.h pam/_pam_macros.h')
+conf.CHECK_FUNCS_IN('pam_vsyslog', 'pam')
+   conf.CHECK_CODE('''
+#if defined(HAVE_SECURITY_PAM_APPL_H)
+#include security/pam_appl.h
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include pam/pam_appl.h
+#endif
+pam_set_item(0, PAM_RHOST, 0);
+''',
+'HAVE_PAM_RHOST',
+lib='pam',
+msg=Checking whether PAM_RHOST is available);
+   conf.CHECK_CODE('''
+#if defined(HAVE_SECURITY_PAM_APPL_H)
+#include security/pam_appl.h
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include pam/pam_appl.h
+#endif
+pam_set_item(0, PAM_TTY, 0);
+''',
+'HAVE_PAM_TTY',
+lib='pam',
+msg=Checking whether PAM_TTY is available);
+   conf.CHECK_CODE('''
+#if (!defined(LINUX))
+
+#define PAM_EXTERN extern
+#if defined(HAVE_SECURITY_PAM_APPL_H)
+#include security/pam_appl.h
+#elif defined(HAVE_PAM_PAM_APPL_H)
+#include pam/pam_appl.h
+#endif
+
+#endif
+
+#if defined(HAVE_SECURITY_PAM_MODULES_H)
+#include security/pam_modules.h
+#elif defined(HAVE_PAM_PAM_MODULES_H)
+#include pam/pam_modules.h
+#endif
+
+#if defined(HAVE_SECURITY__PAM_MACROS_H)
+#include security/_pam_macros.h
+#elif defined(HAVE_PAM__PAM_MACROS_H)
+#include pam/_pam_macros.h
+#endif
+
+#ifdef HAVE_SECURITY_PAM_EXT_H
+#include security/pam_ext.h
+#endif
+
+int i; i = PAM_RADIO_TYPE;
+''',
+'HAVE_PAM_RADIO_TYPE',
+lib='pam',
+msg=Checking whether PAM_RADIO_TYPE is available);
+conf.DEFINE('WITH_PAM', 1)
+conf.DEFINE('WITH_PAM_MODULES', 1)
 
 seteuid = False
 if not seteuid:


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2010-12-06 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  4520c99 s3: Fix bug 7843: Expand the local SAMs aliases
  from  a8da472 idtree: fix overflow for v. large ids on allocation and 
removal

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 4520c99f088f214a86fe9ab34618a5e7d5b49053
Author: Jeremy Allison j...@samba.org
Date:   Sun Dec 5 20:40:21 2010 +0100

s3: Fix bug 7843: Expand the local SAMs aliases

---

Summary of changes:
 source3/winbindd/wb_gettoken.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c
index 5755ffa..d1c8285 100644
--- a/source3/winbindd/wb_gettoken.c
+++ b/source3/winbindd/wb_gettoken.c
@@ -107,7 +107,7 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
/*
 * Expand our domain's aliases
 */
-   domain = find_our_domain();
+   domain = find_domain_from_sid_noinit(get_global_sam_sid());
if (domain == NULL) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
@@ -138,7 +138,7 @@ static void wb_gettoken_gotlocalgroups(struct tevent_req 
*subreq)
tevent_req_nterror(req, status);
return;
}
-   domain = find_our_domain();
+   domain = find_domain_from_sid_noinit(get_global_sam_sid());
if (!wb_add_rids_to_sids(state, state-num_sids, state-sids,
 domain-sid, num_rids, rids)) {
tevent_req_nterror(req, NT_STATUS_NO_MEMORY);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2010-12-06 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  f0454dd s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain
  from  4520c99 s3: Fix bug 7843: Expand the local SAMs aliases

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit f0454dd5d367fc83d4625b344cf3b51dabe9d8ae
Author: Volker Lendecke v...@samba.org
Date:   Sat Dec 4 20:31:36 2010 +0100

s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain

---

Summary of changes:
 source3/winbindd/winbindd_lookuprids.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_lookuprids.c 
b/source3/winbindd/winbindd_lookuprids.c
index 6e3d5c5..bd0a946 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -62,7 +62,7 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX 
*mem_ctx,
return tevent_req_post(req, ev);
}
 
-   domain = find_domain_from_sid_noinit(sid);
+   domain = find_lookup_domain_from_sid(sid);
if (domain == NULL) {
DEBUG(5, (Domain for sid %s not found\n,
  sid_string_dbg(sid)));


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2010-12-06 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  aa8dde6 s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the 
proper domain name
  from  f0454dd s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit aa8dde606ad6f052c674c3490836e802655e129b
Author: Volker Lendecke v...@samba.org
Date:   Sat Dec 4 20:16:00 2010 +0100

s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the proper domain name

---

Summary of changes:
 source3/librpc/idl/wbint.idl   |1 +
 source3/winbindd/winbindd_dual_srv.c   |2 ++
 source3/winbindd/winbindd_lookuprids.c |3 ++-
 3 files changed, 5 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/librpc/idl/wbint.idl b/source3/librpc/idl/wbint.idl
index 4ac3693..470fb8b 100644
--- a/source3/librpc/idl/wbint.idl
+++ b/source3/librpc/idl/wbint.idl
@@ -142,6 +142,7 @@ interface wbint
 
 NTSTATUS wbint_LookupRids(
[in] wbint_RidArray *rids,
+   [out,string,charset(UTF8)] char **domain_name,
[out] wbint_Principals *names
);
 
diff --git a/source3/winbindd/winbindd_dual_srv.c 
b/source3/winbindd/winbindd_dual_srv.c
index b661fb3..1501fd8 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -385,6 +385,8 @@ NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct 
wbint_LookupRids *r)
return status;
}
 
+   *r-out.domain_name = talloc_move(r-out.domain_name, domain_name);
+
result = talloc_array(p-mem_ctx, struct wbint_Principal,
  r-in.rids-num_rids);
if (result == NULL) {
diff --git a/source3/winbindd/winbindd_lookuprids.c 
b/source3/winbindd/winbindd_lookuprids.c
index bd0a946..5577ad4 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -84,7 +84,8 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX 
*mem_ctx,
}
 
subreq = dcerpc_wbint_LookupRids_send(
-   state, ev, domain-child.binding_handle, state-rids, 
state-names);
+   state, ev, domain-child.binding_handle, state-rids,
+   state-domain_name, state-names);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Jeremy Allison
The branch, master has been updated
   via  ab1b857 s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the 
proper domain name
   via  8f8d188 s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain
   via  cb496c6 s3: Fix bug 7843: Expand the local SAMs aliases
  from  b73e4e3 s3-waf: add pam configure checks.

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


- Log -
commit ab1b857f58f58dbc871fc444aa1dfefe4a3bfaeb
Author: Volker Lendecke v...@samba.org
Date:   Sat Dec 4 20:16:00 2010 +0100

s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the proper domain name

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Dec  6 21:18:07 CET 2010 on sn-devel-104

commit 8f8d188c195d1d587bfdc056b1c6845a046b6e35
Author: Volker Lendecke v...@samba.org
Date:   Sat Dec 4 20:31:36 2010 +0100

s3: Fix bug 7841: WINBINDD_LOOKUPRIDS asks the wrong domain

commit cb496c6d243854e309dcff23f832a5f88914b3cf
Author: Jeremy Allison j...@samba.org
Date:   Sun Dec 5 20:40:21 2010 +0100

s3: Fix bug 7843: Expand the local SAMs aliases

---

Summary of changes:
 source3/librpc/idl/wbint.idl   |1 +
 source3/winbindd/wb_gettoken.c |4 ++--
 source3/winbindd/winbindd_dual_srv.c   |2 ++
 source3/winbindd/winbindd_lookuprids.c |5 +++--
 4 files changed, 8 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/librpc/idl/wbint.idl b/source3/librpc/idl/wbint.idl
index 4ac3693..470fb8b 100644
--- a/source3/librpc/idl/wbint.idl
+++ b/source3/librpc/idl/wbint.idl
@@ -142,6 +142,7 @@ interface wbint
 
 NTSTATUS wbint_LookupRids(
[in] wbint_RidArray *rids,
+   [out,string,charset(UTF8)] char **domain_name,
[out] wbint_Principals *names
);
 
diff --git a/source3/winbindd/wb_gettoken.c b/source3/winbindd/wb_gettoken.c
index 5755ffa..d1c8285 100644
--- a/source3/winbindd/wb_gettoken.c
+++ b/source3/winbindd/wb_gettoken.c
@@ -107,7 +107,7 @@ static void wb_gettoken_gotgroups(struct tevent_req *subreq)
/*
 * Expand our domain's aliases
 */
-   domain = find_our_domain();
+   domain = find_domain_from_sid_noinit(get_global_sam_sid());
if (domain == NULL) {
tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
return;
@@ -138,7 +138,7 @@ static void wb_gettoken_gotlocalgroups(struct tevent_req 
*subreq)
tevent_req_nterror(req, status);
return;
}
-   domain = find_our_domain();
+   domain = find_domain_from_sid_noinit(get_global_sam_sid());
if (!wb_add_rids_to_sids(state, state-num_sids, state-sids,
 domain-sid, num_rids, rids)) {
tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
diff --git a/source3/winbindd/winbindd_dual_srv.c 
b/source3/winbindd/winbindd_dual_srv.c
index b661fb3..1501fd8 100644
--- a/source3/winbindd/winbindd_dual_srv.c
+++ b/source3/winbindd/winbindd_dual_srv.c
@@ -385,6 +385,8 @@ NTSTATUS _wbint_LookupRids(struct pipes_struct *p, struct 
wbint_LookupRids *r)
return status;
}
 
+   *r-out.domain_name = talloc_move(r-out.domain_name, domain_name);
+
result = talloc_array(p-mem_ctx, struct wbint_Principal,
  r-in.rids-num_rids);
if (result == NULL) {
diff --git a/source3/winbindd/winbindd_lookuprids.c 
b/source3/winbindd/winbindd_lookuprids.c
index 6e3d5c5..5577ad4 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -62,7 +62,7 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX 
*mem_ctx,
return tevent_req_post(req, ev);
}
 
-   domain = find_domain_from_sid_noinit(sid);
+   domain = find_lookup_domain_from_sid(sid);
if (domain == NULL) {
DEBUG(5, (Domain for sid %s not found\n,
  sid_string_dbg(sid)));
@@ -84,7 +84,8 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX 
*mem_ctx,
}
 
subreq = dcerpc_wbint_LookupRids_send(
-   state, ev, domain-child.binding_handle, state-rids, 
state-names);
+   state, ev, domain-child.binding_handle, state-rids,
+   state-domain_name, state-names);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2010-12-06 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  deaf310 s3: Fix bug 7844: Race in winbind
  from  aa8dde6 s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the 
proper domain name

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit deaf310bf9b7556b6b002e346381a732f58dd30a
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 6 12:45:21 2010 -0800

s3: Fix bug 7844: Race in winbind

If a child dies, the parent process right away closes the socket.
This is wrong, with tevent we still have events pending. This works
fine for epoll but does not for at least the FreeBSD select variant.
Tevent sticks a closed socket into the select masks. This then
returns an error EBADF. When this happens, the parent winbind dies
instead of forking a new child.

This moves the socket close from the SIGCHLD cleanup function to
the socket receiver. I could not reproduce the parent death anymore
and it did not create an obvious fd leak.

---

Summary of changes:
 source3/winbindd/winbindd_dual.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index cc9d6de..cdf53d0 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -138,7 +138,7 @@ static void wb_child_request_trigger(struct tevent_req *req,
req, struct wb_child_request_state);
struct tevent_req *subreq;
 
-   if ((state-child-pid == 0)  (!fork_domain_child(state-child))) {
+   if ((state-child-sock == -1)  (!fork_domain_child(state-child))) {
tevent_req_error(req, errno);
return;
}
@@ -168,6 +168,12 @@ static void wb_child_request_done(struct tevent_req 
*subreq)
ret = wb_simple_trans_recv(subreq, state, state-response, err);
TALLOC_FREE(subreq);
if (ret == -1) {
+   /*
+* The basic parent/child communication broke, close
+* our socket
+*/
+   close(state-child-sock);
+   state-child-sock = -1;
tevent_req_error(req, err);
return;
}
@@ -437,6 +443,7 @@ void setup_child(struct winbindd_domain *domain, struct 
winbindd_child *child,
  logname == NULL);
}
 
+   child-sock = -1;
child-domain = domain;
child-table = table;
child-queue = tevent_queue_create(NULL, winbind_child);
@@ -465,9 +472,6 @@ void winbind_child_died(pid_t pid)
/* This will be re-added in fork_domain_child() */
 
DLIST_REMOVE(winbindd_children, child);
-
-   close(child-sock);
-   child-sock = -1;
child-pid = 0;
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-06 Thread Jeremy Allison
The branch, master has been updated
   via  f7d9786 s3: Fix bug 7844: Race in winbind
  from  ab1b857 s3: Fix bug 7842: WINBIND_LOOKUPRIDS does not return the 
proper domain name

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


- Log -
commit f7d97868e4a5fe2c5f5a273311012022d45011bb
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 6 12:45:21 2010 -0800

s3: Fix bug 7844: Race in winbind

If a child dies, the parent process right away closes the socket.
This is wrong, with tevent we still have events pending. This works
fine for epoll but does not for at least the FreeBSD select variant.
Tevent sticks a closed socket into the select masks. This then
returns an error EBADF. When this happens, the parent winbind dies
instead of forking a new child.

This moves the socket close from the SIGCHLD cleanup function to
the socket receiver. I could not reproduce the parent death anymore
and it did not create an obvious fd leak.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Dec  6 23:21:02 CET 2010 on sn-devel-104

---

Summary of changes:
 source3/winbindd/winbindd_dual.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index cc9d6de..cdf53d0 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -138,7 +138,7 @@ static void wb_child_request_trigger(struct tevent_req *req,
req, struct wb_child_request_state);
struct tevent_req *subreq;
 
-   if ((state-child-pid == 0)  (!fork_domain_child(state-child))) {
+   if ((state-child-sock == -1)  (!fork_domain_child(state-child))) {
tevent_req_error(req, errno);
return;
}
@@ -168,6 +168,12 @@ static void wb_child_request_done(struct tevent_req 
*subreq)
ret = wb_simple_trans_recv(subreq, state, state-response, err);
TALLOC_FREE(subreq);
if (ret == -1) {
+   /*
+* The basic parent/child communication broke, close
+* our socket
+*/
+   close(state-child-sock);
+   state-child-sock = -1;
tevent_req_error(req, err);
return;
}
@@ -437,6 +443,7 @@ void setup_child(struct winbindd_domain *domain, struct 
winbindd_child *child,
  logname == NULL);
}
 
+   child-sock = -1;
child-domain = domain;
child-table = table;
child-queue = tevent_queue_create(NULL, winbind_child);
@@ -465,9 +472,6 @@ void winbind_child_died(pid_t pid)
/* This will be re-added in fork_domain_child() */
 
DLIST_REMOVE(winbindd_children, child);
-
-   close(child-sock);
-   child-sock = -1;
child-pid = 0;
 }
 


-- 
Samba Shared Repository


[SCM] CTDB repository - branch 1.2 updated - ctdb-1.9.1-264-g6ef0c82

2010-12-06 Thread Ronnie Sahlberg
The branch, 1.2 has been updated
   via  6ef0c8bdae6cf4163b05e2488a582230c5e4 (commit)
   via  d22e7e47a7f3d450bbbc2267322dadbdbf192e84 (commit)
   via  d1f621340aa79690edb23972cd84cb803beae0c3 (commit)
   via  0ff5779b599d91783cb2db8538c2430b186730f6 (commit)
   via  c63dab9763d45fd4f9be77b9c9f463bd457de808 (commit)
   via  930996d36fdc013ae13e74f91d01c572da2b920a (commit)
  from  b8847a665d2fc56d8f8c8a7d5110d7aafa85bb47 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2


- Log -
commit 6ef0c8bdae6cf4163b05e2488a582230c5e4
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Mon Dec 6 13:52:38 2010 +1030

idtree: fix overflow for v. large ids on allocation and removal

(Imported from SAMBA commit 09a6538969ac).

Chris Cowan tracked down a SEGV in sub_alloc: idp-level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a3a).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

commit d22e7e47a7f3d450bbbc2267322dadbdbf192e84
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:09:38 2010 +1100

Add a new header flag for migrated with data and set this to 1
when we migrate a non-empty record onto the node
or a non-empty record off the node

When we migrate a record back to the lmaster and yield the dmaster role,
inspect this flag if if it is still not set, we can delete the record from
the local database as soon as we have migrated it back to the lmaster.

commit d1f621340aa79690edb23972cd84cb803beae0c3
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:07:55 2010 +1100

add new command line functions
ctdb readkey dbid key
ctdb writekey dbid key value

these are mainly intended for debugging of databases and dmaster migration 
issues

commit 0ff5779b599d91783cb2db8538c2430b186730f6
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:06:20 2010 +1100

add a new ctdb_ltdb function to delete a record in a normal database

commit c63dab9763d45fd4f9be77b9c9f463bd457de808
Author: Michael Adam ob...@samba.org
Date:   Fri Dec 3 15:21:51 2010 +0100

server: when we migrate off a record with data, set the MIGRATED_WITH_DATA 
flag

commit 930996d36fdc013ae13e74f91d01c572da2b920a
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 18:34:49 2010 +1100

new version 1.2.14

---

Summary of changes:
 common/ctdb_ltdb.c |   19 
 include/ctdb_private.h |1 +
 lib/util/idtree.c  |2 +-
 packaging/RPM/ctdb.spec.in |8 +++-
 server/ctdb_call.c |   28 +++-
 tools/ctdb.c   |  103 
 6 files changed, 156 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index c9693e8..200cca4 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -194,3 +194,22 @@ int ctdb_ltdb_unlock(struct ctdb_db_context *ctdb_db, 
TDB_DATA key)
}
return ret;
 }
+
+
+/*
+  delete a record from a normal database
+*/
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key)
+{
+   struct ctdb_context *ctdb = ctdb_db-ctdb;
+
+   if (ctdb_db-persistent != 0) {
+   DEBUG(DEBUG_ERR,(Trying to delete emty record in persistent 
database\n));
+   return 0;
+   }
+   if (tdb_delete(ctdb_db-ltdb-tdb, key) != 0) {
+   DEBUG(DEBUG_ERR,(Failed to delete empty record.));
+   return -1;
+   }
+   return 0;
+}
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 0df5ca5..ec41270 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -647,6 +647,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
TALLOC_CTX *mem_ctx, TDB_DATA *data);
 int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, 
struct ctdb_ltdb_header *header, TDB_DATA data);
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key);
 int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb, 
struct ctdb_req_control *c,
TDB_DATA recdata);
diff --git a/lib/util/idtree.c b/lib/util/idtree.c
index 05c2295..09dc237 100644
--- a/lib/util/idtree.c
+++ b/lib/util/idtree.c
@@ -104,7 +104,7 @@ static int sub_alloc(struct idr_context *idp, void *ptr, 
int *starting_id)
 {
int n, m, sh;
struct idr_layer *p, *new;
-   struct idr_layer *pa[MAX_LEVEL];
+   struct idr_layer *pa[MAX_LEVEL+1];
unsigned int l, id, oid;
uint32_t bm;
 
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 

[SCM] CTDB repository - branch 1.2-nodeflags updated - ctdb-1.9.1-250-g9bf4766

2010-12-06 Thread Ronnie Sahlberg
The branch, 1.2-nodeflags has been updated
   via  9bf47667adbe4324b7587c61349b64affa5420c6 (commit)
   via  4a8590f76c5e7ea68acb4d5e52ec0e8a41b65fda (commit)
   via  1766f2ec5d1b2ae2d30323c03cd3e67a1bda804c (commit)
   via  7fba05d9f956ddaa3f466e72877e7d5f2e3a7a19 (commit)
   via  bb8d975376d959689e702c8e349e787fbde0db01 (commit)
  from  42f6125b66cb18bce362693358f4085c58dd0695 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2-nodeflags


- Log -
commit 9bf47667adbe4324b7587c61349b64affa5420c6
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Mon Dec 6 13:52:38 2010 +1030

idtree: fix overflow for v. large ids on allocation and removal

(Imported from SAMBA commit 09a6538969ac).

Chris Cowan tracked down a SEGV in sub_alloc: idp-level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a3a).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

commit 4a8590f76c5e7ea68acb4d5e52ec0e8a41b65fda
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:09:38 2010 +1100

Add a new header flag for migrated with data and set this to 1
when we migrate a non-empty record onto the node
or a non-empty record off the node

When we migrate a record back to the lmaster and yield the dmaster role,
inspect this flag if if it is still not set, we can delete the record from
the local database as soon as we have migrated it back to the lmaster.

commit 1766f2ec5d1b2ae2d30323c03cd3e67a1bda804c
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:07:55 2010 +1100

add new command line functions
ctdb readkey dbid key
ctdb writekey dbid key value

these are mainly intended for debugging of databases and dmaster migration 
issues

commit 7fba05d9f956ddaa3f466e72877e7d5f2e3a7a19
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:06:20 2010 +1100

add a new ctdb_ltdb function to delete a record in a normal database

commit bb8d975376d959689e702c8e349e787fbde0db01
Author: Michael Adam ob...@samba.org
Date:   Fri Dec 3 15:21:51 2010 +0100

server: when we migrate off a record with data, set the MIGRATED_WITH_DATA 
flag

---

Summary of changes:
 common/ctdb_ltdb.c |   19 +
 include/ctdb_private.h |1 +
 lib/util/idtree.c  |2 +-
 server/ctdb_call.c |   28 -
 tools/ctdb.c   |  103 
 5 files changed, 149 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 7dc28dd..3572371 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -195,3 +195,22 @@ int ctdb_ltdb_unlock(struct ctdb_db_context *ctdb_db, 
TDB_DATA key)
}
return ret;
 }
+
+
+/*
+  delete a record from a normal database
+*/
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key)
+{
+   struct ctdb_context *ctdb = ctdb_db-ctdb;
+
+   if (ctdb_db-persistent != 0) {
+   DEBUG(DEBUG_ERR,(Trying to delete emty record in persistent 
database\n));
+   return 0;
+   }
+   if (tdb_delete(ctdb_db-ltdb-tdb, key) != 0) {
+   DEBUG(DEBUG_ERR,(Failed to delete empty record.));
+   return -1;
+   }
+   return 0;
+}
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 984d826..8b6a9d3 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -647,6 +647,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
TALLOC_CTX *mem_ctx, TDB_DATA *data);
 int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, 
struct ctdb_ltdb_header *header, TDB_DATA data);
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key);
 int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb, 
struct ctdb_req_control *c,
TDB_DATA recdata);
diff --git a/lib/util/idtree.c b/lib/util/idtree.c
index 05c2295..09dc237 100644
--- a/lib/util/idtree.c
+++ b/lib/util/idtree.c
@@ -104,7 +104,7 @@ static int sub_alloc(struct idr_context *idp, void *ptr, 
int *starting_id)
 {
int n, m, sh;
struct idr_layer *p, *new;
-   struct idr_layer *pa[MAX_LEVEL];
+   struct idr_layer *pa[MAX_LEVEL+1];
unsigned int l, id, oid;
uint32_t bm;
 
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index c5f7e7d..7bc4c35 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -201,6 +201,11 @@ static void ctdb_call_send_dmaster(struct ctdb_db_context 
*ctdb_db,
return;
}
 
+   if (data-dsize != 0) {
+   header-flags |= 

[SCM] CTDB repository - branch master updated - ctdb-1.10-43-g7376410

2010-12-06 Thread Ronnie Sahlberg
The branch, master has been updated
   via  73764104356d3738d9d20a9d06ce51535f74f475 (commit)
   via  a8cc35191df1cd4b866897df71d317ce5f198cb5 (commit)
   via  70c2e7dd04727371590fb94579ffd20318fbeb58 (commit)
   via  fe9070ec9be69e6a6fcbf9899e7ced24541c9c3a (commit)
   via  17e231abf5ade83d7fa624b5cf54ae876e2795aa (commit)
  from  8a6da384f3fa08b1c5eba79d6febc7af7b3d9229 (commit)

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


- Log -
commit 73764104356d3738d9d20a9d06ce51535f74f475
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Mon Dec 6 13:52:38 2010 +1030

idtree: fix overflow for v. large ids on allocation and removal

(Imported from SAMBA commit 09a6538969ac).

Chris Cowan tracked down a SEGV in sub_alloc: idp-level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a3a).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

commit a8cc35191df1cd4b866897df71d317ce5f198cb5
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:09:38 2010 +1100

Add a new header flag for migrated with data and set this to 1
when we migrate a non-empty record onto the node
or a non-empty record off the node

When we migrate a record back to the lmaster and yield the dmaster role,
inspect this flag if if it is still not set, we can delete the record from
the local database as soon as we have migrated it back to the lmaster.

commit 70c2e7dd04727371590fb94579ffd20318fbeb58
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:07:55 2010 +1100

add new command line functions
ctdb readkey dbid key
ctdb writekey dbid key value

these are mainly intended for debugging of databases and dmaster migration 
issues

commit fe9070ec9be69e6a6fcbf9899e7ced24541c9c3a
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Dec 6 16:06:20 2010 +1100

add a new ctdb_ltdb function to delete a record in a normal database

commit 17e231abf5ade83d7fa624b5cf54ae876e2795aa
Author: Michael Adam ob...@samba.org
Date:   Fri Dec 3 15:21:51 2010 +0100

server: when we migrate off a record with data, set the MIGRATED_WITH_DATA 
flag

---

Summary of changes:
 common/ctdb_ltdb.c |   19 +
 include/ctdb_private.h |1 +
 lib/util/idtree.c  |2 +-
 server/ctdb_call.c |   28 -
 tools/ctdb.c   |  103 
 5 files changed, 149 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 7dc28dd..3572371 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -195,3 +195,22 @@ int ctdb_ltdb_unlock(struct ctdb_db_context *ctdb_db, 
TDB_DATA key)
}
return ret;
 }
+
+
+/*
+  delete a record from a normal database
+*/
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key)
+{
+   struct ctdb_context *ctdb = ctdb_db-ctdb;
+
+   if (ctdb_db-persistent != 0) {
+   DEBUG(DEBUG_ERR,(Trying to delete emty record in persistent 
database\n));
+   return 0;
+   }
+   if (tdb_delete(ctdb_db-ltdb-tdb, key) != 0) {
+   DEBUG(DEBUG_ERR,(Failed to delete empty record.));
+   return -1;
+   }
+   return 0;
+}
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 5fc583c..243a4dd 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -648,6 +648,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
TALLOC_CTX *mem_ctx, TDB_DATA *data);
 int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, 
struct ctdb_ltdb_header *header, TDB_DATA data);
+int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key);
 int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb, 
struct ctdb_req_control *c,
TDB_DATA recdata);
diff --git a/lib/util/idtree.c b/lib/util/idtree.c
index 05c2295..09dc237 100644
--- a/lib/util/idtree.c
+++ b/lib/util/idtree.c
@@ -104,7 +104,7 @@ static int sub_alloc(struct idr_context *idp, void *ptr, 
int *starting_id)
 {
int n, m, sh;
struct idr_layer *p, *new;
-   struct idr_layer *pa[MAX_LEVEL];
+   struct idr_layer *pa[MAX_LEVEL+1];
unsigned int l, id, oid;
uint32_t bm;
 
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index c5f7e7d..7bc4c35 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -201,6 +201,11 @@ static void ctdb_call_send_dmaster(struct ctdb_db_context 
*ctdb_db,
return;
}
 
+   if (data-dsize != 0) {
+   header-flags |=