The branch, master has been updated
       via  8c4d4f9 Revert "lib: tdb: Use sigaction when testing for robust 
mutexes."
       via  293e2fc lib/util: fix the default code path for debug_set_settings()
      from  5963307 util_tdb: mark tdb_pack() and friends as deprecated

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


- Log -----------------------------------------------------------------
commit 8c4d4f9e627256bb8c93615b600acfb438cdef55
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Mar 25 11:39:54 2015 +0100

    Revert "lib: tdb: Use sigaction when testing for robust mutexes."
    
    This fails on Linux platforms with robust mutex support with the
    following error:
    
    
tdb(/home/asn/workspace/projects/samba/git/st/nt4_dc/lockdir/gencache_notrans.tdb):
        
tdb_mutex_open_ok[/home/asn/workspace/projects/samba/git/st/nt4_dc/lockdir/gencache_notrans.tdb]:
        Can use mutexes only with MUTEX_LOCKING or NOLOCK
    
    We also see winbind is not able to start with this error message trying
    to open the serverid.tdb.
    
    This reverts commit d1914367289b58f26544ee6e116490d662d9c41c.
    
    Reviewed-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Stefan Metzmacher <me...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Wed Mar 25 14:58:38 CET 2015 on sn-devel-104

commit 293e2fcacb298f3f3342e87987bf6ebd4ddad9c8
Author: Stefan Metzmacher <me...@samba.org>
Date:   Wed Mar 25 10:56:57 2015 +0000

    lib/util: fix the default code path for debug_set_settings()
    
    logging_param is typically "" instead of NULL!
    
    Signed-off-by: Stefan Metzmacher <me...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/tdb/common/mutex.c | 32 ++++----------------------------
 lib/util/debug.c       |  8 ++++++--
 2 files changed, 10 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tdb/common/mutex.c b/lib/tdb/common/mutex.c
index d45cce8..12f89d3 100644
--- a/lib/tdb/common/mutex.c
+++ b/lib/tdb/common/mutex.c
@@ -713,27 +713,6 @@ cleanup_ma:
 static void (*tdb_robust_mutext_old_handler)(int) = SIG_ERR;
 static pid_t tdb_robust_mutex_pid = -1;
 
-static void (*tdb_robust_mutex_setup_sigchild(void (*handler)(int)))(int)
-{
-#ifdef HAVE_SIGACTION
-       struct sigaction act;
-       struct sigaction oldact;
-
-       memset(&act, '\0', sizeof(act));
-
-       act.sa_handler = handler;
-#ifdef SA_RESTART
-       act.sa_flags = SA_RESTART;
-#endif
-       sigemptyset(&act.sa_mask);
-       sigaddset(&act.sa_mask, SIGCHLD);
-       sigaction(SIGCHLD, &act, &oldact);
-       return oldact.sa_handler;
-#else /* !HAVE_SIGACTION */
-       return NULL;
-#endif
-}
-
 static void tdb_robust_mutex_handler(int sig)
 {
        if (tdb_robust_mutex_pid != -1) {
@@ -824,11 +803,8 @@ _PUBLIC_ bool tdb_runtime_check_for_robust_mutexes(void)
                goto cleanup_ma;
        }
 
-       tdb_robust_mutext_old_handler = tdb_robust_mutex_setup_sigchild(
-                                               tdb_robust_mutex_handler);
-       if (tdb_robust_mutext_old_handler == NULL) {
-               goto cleanup_ma;
-       }
+       tdb_robust_mutext_old_handler = signal(SIGCHLD,
+                                              tdb_robust_mutex_handler);
 
        tdb_robust_mutex_pid = fork();
        if (tdb_robust_mutex_pid == 0) {
@@ -893,7 +869,7 @@ _PUBLIC_ bool tdb_runtime_check_for_robust_mutexes(void)
                        goto cleanup_child;
                }
        }
-       tdb_robust_mutex_setup_sigchild(tdb_robust_mutext_old_handler);
+       signal(SIGCHLD, tdb_robust_mutext_old_handler);
 
        ret = pthread_mutex_trylock(m);
        if (ret != EOWNERDEAD) {
@@ -939,7 +915,7 @@ cleanup_child:
                }
        }
 cleanup_sig_child:
-       tdb_robust_mutex_setup_sigchild(tdb_robust_mutext_old_handler);
+       signal(SIGCHLD, tdb_robust_mutext_old_handler);
 cleanup_m:
        pthread_mutex_destroy(m);
 cleanup_ma:
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 6b16cd7..91b02b4 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -763,7 +763,8 @@ void debug_set_settings(struct debug_settings *settings,
                        const char *logging_param,
                        int syslog_level, bool syslog_only)
 {
-       char fake_param[20];
+       char fake_param[256];
+       size_t len = 0;
 
        /*
         * This forces in some smb.conf derived values into the debug
@@ -776,7 +777,10 @@ void debug_set_settings(struct debug_settings *settings,
         * If 'logging' is not set, create backend settings from
         * deprecated 'syslog' and 'syslog only' paramters
         */
-       if (!logging_param) {
+       if (logging_param != NULL) {
+               len = strlen(logging_param);
+       }
+       if (len == 0) {
                if (syslog_only) {
                        snprintf(fake_param, sizeof(fake_param),
                                 "syslog:%d", syslog_level - 1);


-- 
Samba Shared Repository

Reply via email to