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