[SCM] CTDB repository - branch master updated - ctdb-2.1-37-g307416a

2013-03-25 Thread Amitay Isaacs
The branch, master has been updated
   via  307416afda707b687f5e89e8438e45c154a4c806 (commit)
   via  08c53ee609b80f87450a7a1d7dd24fbcdf5ab7bc (commit)
  from  87c89b7c2a14e2ee79a3efc7e8125842bc04bf23 (commit)

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


- Log -
commit 307416afda707b687f5e89e8438e45c154a4c806
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 13 22:57:44 2013 +1100

util: Add hex_decode_talloc() to decode hex string into a binary blob

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 08c53ee609b80f87450a7a1d7dd24fbcdf5ab7bc
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 13 11:46:18 2013 +1100

logging: Do not ignore stdout/stderr from the exec'd children

To log debugging information from child processes that are started
with vfork and exec, do not set close_on_exec on STDOUT and STDERR for
that process.

Signed-off-by: Amitay Isaacs ami...@gmail.com

---

Summary of changes:
 include/includes.h|1 +
 lib/util/util_file.c  |   16 
 server/ctdb_logging.c |5 -
 3 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/include/includes.h b/include/includes.h
index e0ce06b..3747198 100644
--- a/include/includes.h
+++ b/include/includes.h
@@ -58,6 +58,7 @@ double timeval_elapsed(struct timeval *tv);
 double timeval_delta(struct timeval *tv2, struct timeval *tv);
 char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
 char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, 
size_t len);
+uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t 
*len);
 _PUBLIC_ const char **str_list_add(const char **list, const char *s);
 _PUBLIC_ int set_blocking(int fd, bool set);
 
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 21d64b2..3a90201 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -114,3 +114,19 @@ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const 
unsigned char *buff_in, size_
 
return hex_buffer;
 }
+
+uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t 
*len)
+{
+   int i, num;
+   uint8_t *buffer;
+
+   *len = strlen(hex_in) / 2;
+   buffer = talloc_array(mem_ctx, unsigned char, *len);
+
+   for (i=0; i*len; i++) {
+   sscanf(hex_in[i*2], %02X, num);
+   buffer[i] = (uint8_t)num;
+   }
+
+   return buffer;
+}
diff --git a/server/ctdb_logging.c b/server/ctdb_logging.c
index 7cf8b9f..dfb5063 100644
--- a/server/ctdb_logging.c
+++ b/server/ctdb_logging.c
@@ -538,11 +538,6 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb)
close(old_stdout);
close(old_stderr);
 
-   /* Is this correct for STDOUT and STDERR ? */
-   set_close_on_exec(STDOUT_FILENO);
-   set_close_on_exec(STDERR_FILENO);
-   set_close_on_exec(p[0]);
-
fde = event_add_fd(ctdb-ev, ctdb-log, p[0],
   EVENT_FD_READ, ctdb_log_handler, ctdb-log);
tevent_fd_set_auto_close(fde);


-- 
CTDB repository


[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.59-2-gbcaed71

2013-03-25 Thread Amitay Isaacs
The branch, 1.2.40 has been updated
   via  bcaed7181f6ce6f68cfd77d16a2b012c2d78466b (commit)
   via  90560d1f9def4f42af76a1db1e7effda330f90bd (commit)
  from  1520ec0262385894c086740f8486b18f29e3fb80 (commit)

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


- Log -
commit bcaed7181f6ce6f68cfd77d16a2b012c2d78466b
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 13 22:57:44 2013 +1100

util: Add hex_decode_talloc() to decode hex string into a binary blob

Signed-off-by: Amitay Isaacs ami...@gmail.com
(cherry picked from commit 307416afda707b687f5e89e8438e45c154a4c806)

commit 90560d1f9def4f42af76a1db1e7effda330f90bd
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 13 11:46:18 2013 +1100

logging: Do not ignore stdout/stderr from the exec'd children

To log debugging information from child processes that are started
with vfork and exec, do not set close_on_exec on STDOUT and STDERR for
that process.

Signed-off-by: Amitay Isaacs ami...@gmail.com
(cherry picked from commit 08c53ee609b80f87450a7a1d7dd24fbcdf5ab7bc)

---

Summary of changes:
 include/includes.h|1 +
 lib/util/util_file.c  |   16 
 server/ctdb_logging.c |5 -
 3 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/include/includes.h b/include/includes.h
index b3f8eb9..d5e3095 100644
--- a/include/includes.h
+++ b/include/includes.h
@@ -53,6 +53,7 @@ double timeval_elapsed(struct timeval *tv);
 double timeval_delta(struct timeval *tv2, struct timeval *tv);
 char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx);
 char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_in, 
size_t len);
+uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t 
*len);
 _PUBLIC_ const char **str_list_add(const char **list, const char *s);
 _PUBLIC_ int set_blocking(int fd, BOOL set);
 
diff --git a/lib/util/util_file.c b/lib/util/util_file.c
index 21d64b2..3a90201 100644
--- a/lib/util/util_file.c
+++ b/lib/util/util_file.c
@@ -114,3 +114,19 @@ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const 
unsigned char *buff_in, size_
 
return hex_buffer;
 }
+
+uint8_t *hex_decode_talloc(TALLOC_CTX *mem_ctx, const char *hex_in, size_t 
*len)
+{
+   int i, num;
+   uint8_t *buffer;
+
+   *len = strlen(hex_in) / 2;
+   buffer = talloc_array(mem_ctx, unsigned char, *len);
+
+   for (i=0; i*len; i++) {
+   sscanf(hex_in[i*2], %02X, num);
+   buffer[i] = (uint8_t)num;
+   }
+
+   return buffer;
+}
diff --git a/server/ctdb_logging.c b/server/ctdb_logging.c
index 19e8af7..583384b 100644
--- a/server/ctdb_logging.c
+++ b/server/ctdb_logging.c
@@ -530,11 +530,6 @@ int ctdb_set_child_logging(struct ctdb_context *ctdb)
close(old_stdout);
close(old_stderr);
 
-   /* Is this correct for STDOUT and STDERR ? */
-   set_close_on_exec(STDOUT_FILENO);
-   set_close_on_exec(STDERR_FILENO);
-   set_close_on_exec(p[0]);
-
fde = event_add_fd(ctdb-ev, ctdb-log, p[0],
   EVENT_FD_READ, ctdb_log_handler, ctdb-log);
tevent_fd_set_auto_close(fde);


-- 
CTDB repository


[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.59-6-gda6be80

2013-03-25 Thread Amitay Isaacs
The branch, 1.2.40 has been updated
   via  da6be80bd8d82e318b68cc333abde0ff3fdf9249 (commit)
   via  534f7afb8e5b61c7c8f40a4764ff24a09de3008f (commit)
   via  81886163f76c6d285a64866a03ab1df076e45a3b (commit)
   via  f50b9106990602dcf9dff567b04da58e1c1a32dc (commit)
  from  bcaed7181f6ce6f68cfd77d16a2b012c2d78466b (commit)

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


- Log -
commit da6be80bd8d82e318b68cc333abde0ff3fdf9249
Author: Amitay Isaacs ami...@gmail.com
Date:   Thu Mar 14 15:44:44 2013 +1100

lockwait: Allow for zero length key requests

Samba sends zero length key requests for notify database. To support older
Samba behaviour for now, allow zero length key requests. Zero length key is
encoded as NULL string.

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 534f7afb8e5b61c7c8f40a4764ff24a09de3008f
Author: Amitay Isaacs ami...@gmail.com
Date:   Wed Mar 13 17:05:00 2013 +1100

lockwait: Pass all locking information on commandline to lockwait helper

Simplify lockwait code by getting rid of the communication between ctdbd
and ctdb lockwait helper child by passing all the locking information
on command line.

Signed-off-by: Amitay Isaacs ami...@gmail.com

commit 81886163f76c6d285a64866a03ab1df076e45a3b
Author: Volker Lendecke v...@samba.org
Date:   Tue Mar 12 13:35:17 2013 +0100

lockwait: Check result of lockwait child

commit f50b9106990602dcf9dff567b04da58e1c1a32dc
Author: Michael Adam ob...@samba.org
Date:   Wed Mar 13 09:12:50 2013 +0100

lockwait: fix a comment typo

Signed-off-by: Michael Adam ob...@samba.org

---

Summary of changes:
 Makefile.in   |2 +-
 server/ctdb_lockwait.c|  114 +++-
 server/ctdb_lockwait_helper.c |  132 +---
 3 files changed, 52 insertions(+), 196 deletions(-)


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 9c4f555..1032349 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -112,7 +112,7 @@ bin/ctdbd: $(CTDB_SERVER_OBJ)
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ $(CTDB_SERVER_OBJ) $(LIB_FLAGS)
 
-bin/ctdb_lockwait_helper: server/ctdb_lockwait_helper.o @TDB_OBJ@
+bin/ctdb_lockwait_helper: server/ctdb_lockwait_helper.o lib/util/util_file.o 
@TDB_OBJ@ @TALLOC_OBJ@
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ $^ $(LIB_FLAGS)
 
diff --git a/server/ctdb_lockwait.c b/server/ctdb_lockwait.c
index ba7c6dc..cb5bc1c 100644
--- a/server/ctdb_lockwait.c
+++ b/server/ctdb_lockwait.c
@@ -89,6 +89,9 @@ static void lockwait_handler(struct event_context *ev, struct 
fd_event *fde,
TDB_DATA key = h-key;
struct tdb_context *tdb = h-ctdb_db-ltdb-tdb;
TALLOC_CTX *tmp_ctx = talloc_new(ev);
+   char result;
+   ssize_t nread;
+   char *msg;
 
key.dptr = talloc_memdup(tmp_ctx, key.dptr, key.dsize);
h-ctdb_db-pending_requests--;
@@ -106,6 +109,19 @@ static void lockwait_handler(struct event_context *ev, 
struct fd_event *fde,
}
}
 
+   nread = read(h-fd[0], result, sizeof(result));
+   if (nread == -1) {
+   asprintf(msg, lockwait child read failed: %s\n, 
strerror(errno));
+   ctdb_fatal(h-ctdb, msg);
+   }
+   if (nread == 0) {
+   ctdb_fatal(h-ctdb, lockwait child exited early\n);
+   }
+   if (result != 0) {
+   asprintf(msg, lockwait child wrote %d\n, (int)result);
+   ctdb_fatal(h-ctdb, msg);
+   }
+
tdb_chainlock_mark(tdb, key);
callback(p);
if (h-ctdb_db-lockwait_overflow) {
@@ -141,11 +157,8 @@ struct lockwait_handle *ctdb_lockwait(struct 
ctdb_db_context *ctdb_db,
 {
struct lockwait_handle *result, *i;
int ret;
-   int datafd[2];
-   TDB_DATA tmp_key, tmp_data;
-   struct ctdb_marshall_buffer *m;
const char *prog = BINDIR /ctdb_lockwait_helper;
-   char arg0[128], arg1[8], arg2[8], arg3[8];
+   char *arg0, *arg1, *arg2, *arg3;
 
CTDB_INCREMENT_STAT(ctdb_db-ctdb, lockwait_calls);
CTDB_INCREMENT_STAT(ctdb_db-ctdb, pending_lockwait_calls);
@@ -182,51 +195,6 @@ struct lockwait_handle *ctdb_lockwait(struct 
ctdb_db_context *ctdb_db,
return result;
}
 
-   /* Create data for the child process */
-   m = talloc_zero(result, struct ctdb_marshall_buffer);
-   if (m == NULL) {
-   talloc_free(result);
-   CTDB_DECREMENT_STAT(ctdb_db-ctdb, pending_lockwait_calls);
-   return NULL;
-   }
-
-   tmp_key.dptr = (uint8_t *)talloc_strdup(result, dbpath);
-   if (tmp_key.dptr == NULL) {
-   talloc_free(result);
-   CTDB_DECREMENT_STAT(ctdb_db-ctdb, 

[SCM] Samba Shared Repository - branch master updated

2013-03-25 Thread Stefan Metzmacher
The branch, master has been updated
   via  30adf0c scripting: Fill the ProvisionNames hash with strings, not 
ldb.MessageElement or Dn
   via  5d42260 samba-tool ldapcmp: Remove the GUID - name mappings
   via  1589e46 selftest: Add tests for samba-tool dbcheck 
--reset-well-known-acls
   via  874a93b scripting: Modify samba.descriptor.get_diff_sds() to cope 
with a missing reference owner
   via  4789a30 samba-tool dbcheck: Allow dbcheck to correct an 
nTSecurityDescriptor without an owner or group
   via  810f8b4 samba-tool dbcheck: Add --reset-well-known-acls
   via  9040e26 scripting: Move get_diff_sds from samba.upgradehelpers to 
samba.descriptor
   via  a113ddb scripting: Modify samba.descriptor.get_wellknown_sds() use 
samdb calls only
   via  352aff8 scripting: Move samba.provision.descriptor to 
samba.descriptor
   via  e81a97d scripting: Make 
samba.provision.descriptor.get_wellknown_sds() return ldb.Dn objects
   via  6df17fe scripting: Fix documentation comment on 
upgradehelpers.py:get_clean_sd
   via  3da89b0 scripting: Move the list of well known SDs to 
samba.provision.descriptor
   via  afe9343 build: Do not pass CPP= to pidl, skip the env variable 
entirely
   via  7dc6dfd build: Remove the forced use of only the first part of the 
compiler string
  from  d27f00c vfs-btrfs: Fix build on 32 bit platforms by using long long 
types

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


- Log -
commit 30adf0cdbae6d9aaf2e72513d9c33267248f20c0
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 22 21:58:25 2013 +1100

scripting: Fill the ProvisionNames hash with strings, not 
ldb.MessageElement or Dn

This avoids the need to fix it up again in samba_upgradedns.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

Autobuild-User(master): Stefan Metzmacher me...@samba.org
Autobuild-Date(master): Mon Mar 25 13:25:30 CET 2013 on sn-devel-104

commit 5d42260eecfd4f26cc82637ce1bc989083c9eb9d
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 22 21:36:49 2013 +1100

samba-tool ldapcmp: Remove the GUID - name mappings

These mappings are very convenient, however because they are not
one-to-one, they lead to differences being reported when none exist,
dependent only on the order the schema searches return results in.

Sadly the time saved by the names is offset by the time wasted chasing
the 'differences' that don't exist.

This in turn fixes some tests that were previously knownfail

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

commit 1589e46d11f29551f3598876b62e29fcbad06580
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 22 17:12:43 2013 +1100

selftest: Add tests for samba-tool dbcheck --reset-well-known-acls

Reviewed-by: Stefan Metzmacher me...@samba.org

commit 874a93bc1c437543474a6c574b0065b7b953ad38
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 22 22:16:03 2013 +1100

scripting: Modify samba.descriptor.get_diff_sds() to cope with a missing 
reference owner

This allows the reference SD not to have an owner specified, and still
have the comparison with a database SD that does have an owner pass.
(And the same for owning group).

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

commit 4789a3072a4241841c096115dbdb0c3259968e68
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Feb 11 14:49:01 2013 +1100

samba-tool dbcheck: Allow dbcheck to correct an nTSecurityDescriptor 
without an owner or group

This is done by making a modification to the SD, which triggers it to be
filled in if we have the correct session_info established on the DB.

However, we normally want dbcheck running as system, so we wrap
the session_info set around this operation only.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

commit 810f8b48d925ea15f3439c4b228741d8fddaccd8
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Feb 11 14:49:01 2013 +1100

samba-tool dbcheck: Add --reset-well-known-acls

This will allow an upgrade from Samba 4.0.0 without needing to run
samba_upgradeprovision, which for now is not the preferred upgrade
tool.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

commit 9040e2684161ce75738e9da0fee191aa34858607
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 22 16:19:27 2013 +1100

scripting: Move get_diff_sds from samba.upgradehelpers to samba.descriptor

This helps avoid a dependency loop when we use get_diff_sds in dbcheck.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher me...@samba.org

commit a113ddbf881c5905bbf7072638c7ba8843eeb85e
Author: Andrew Bartlett abart...@samba.org
Date:   Fri 

[SCM] Samba Shared Repository - branch master updated

2013-03-25 Thread Christian Ambach
The branch, master has been updated
   via  bbb4068 dbwrap: Use tdb_null in db_ctdb_delete
  from  30adf0c scripting: Fill the ProvisionNames hash with strings, not 
ldb.MessageElement or Dn

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


- Log -
commit bbb4068c933ecc043025633a13c62bf04eaf6d49
Author: Volker Lendecke v...@samba.org
Date:   Sat Nov 24 14:51:02 2012 +

dbwrap: Use tdb_null in db_ctdb_delete

Signed-off-by: Volker Lendecke v...@samba.org
Reviewed-by: Christian Ambach a...@samba.org

Autobuild-User(master): Christian Ambach a...@samba.org
Autobuild-Date(master): Mon Mar 25 19:42:30 CET 2013 on sn-devel-104

---

Summary of changes:
 source3/lib/dbwrap/dbwrap_ctdb.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index a6f49b8..399c850 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -912,7 +912,6 @@ static NTSTATUS db_ctdb_send_schedule_for_deletion(struct 
db_record *rec)
 
 static NTSTATUS db_ctdb_delete(struct db_record *rec)
 {
-   TDB_DATA data;
NTSTATUS status;
 
/*
@@ -920,9 +919,7 @@ static NTSTATUS db_ctdb_delete(struct db_record *rec)
 * tdb-level cleanup
 */
 
-   ZERO_STRUCT(data);
-
-   status = db_ctdb_store(rec, data, 0);
+   status = db_ctdb_store(rec, tdb_null, 0);
if (!NT_STATUS_IS_OK(status)) {
return status;
}


-- 
Samba Shared Repository


[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.59-7-g0372e73

2013-03-25 Thread Amitay Isaacs
The branch, 1.2.40 has been updated
   via  0372e73b27b0193240aa0a020c8ab9f79abd262f (commit)
  from  da6be80bd8d82e318b68cc333abde0ff3fdf9249 (commit)

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


- Log -
commit 0372e73b27b0193240aa0a020c8ab9f79abd262f
Author: Amitay Isaacs ami...@gmail.com
Date:   Mon Mar 25 18:05:07 2013 +1100

New version 1.2.60

Signed-off-by: Amitay Isaacs ami...@gmail.com

---

Summary of changes:
 packaging/RPM/ctdb.spec.in |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 90209ae..edcc458 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -3,7 +3,7 @@ Name: ctdb
 Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team sa...@samba.org
-Version: 1.2.59
+Version: 1.2.60
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -149,6 +149,11 @@ development libraries for ctdb
 
 %changelog
 
+* Mon Mar 25 2013 : Version 1.2.60
+  - Do not set close_on_exec for stdio/stderr of child
+  - Check result from lockwait child
+  - Pass locking information on commandline to lockwait helper
+  - Allow for zero length key requests
 * Wed Mar 06 2013 : Version 1.2.59
   - Do not send ipreallocated event to stopped nodes
   - Do not fail ctdb delip command if IP cannot be moved


-- 
CTDB repository


[SCM] CTDB repository - annotated tag ctdb-1.2.60 created - ctdb-1.2.60

2013-03-25 Thread Amitay Isaacs
The annotated tag, ctdb-1.2.60 has been created
at  fe00ba86baf895df90758146b73e7fc9c888f9ec (tag)
   tagging  0372e73b27b0193240aa0a020c8ab9f79abd262f (commit)
  replaces  ctdb-1.2.59
 tagged by  Amitay Isaacs
on  Tue Mar 26 15:54:41 2013 +1100

- Log -
new version 1.2.60

Amitay Isaacs (5):
  logging: Do not ignore stdout/stderr from the exec'd children
  util: Add hex_decode_talloc() to decode hex string into a binary blob
  lockwait: Pass all locking information on commandline to lockwait helper
  lockwait: Allow for zero length key requests
  New version 1.2.60

Michael Adam (1):
  lockwait: fix a comment typo

Volker Lendecke (1):
  lockwait: Check result of lockwait child

---


-- 
CTDB repository