The branch, master has been updated
       via  c829707 s3-fault: removed the cont_fn from fault_setup()
      from  4928d66 libcli/security: make sure that we don't grant 
SEC_STD_DELETE to the owner by default

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


- Log -----------------------------------------------------------------
commit c8297073dbaf19237891fd97d9e62dc00ad4e1f0
Author: Andrew Tridgell <tri...@samba.org>
Date:   Tue Mar 22 14:05:23 2011 +1100

    s3-fault: removed the cont_fn from fault_setup()
    
    cont_fn() was supposed to be a way to continue after a seg fault. It
    could never be called however, as smb_panic() from fault_report()
    could never return, as dump_core() never returns at the end of
    smb_panic()
    
    Autobuild-User: Andrew Tridgell <tri...@samba.org>
    Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104

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

Summary of changes:
 source3/include/proto.h     |    2 +-
 source3/lib/fault.c         |   19 ++-----------------
 source3/nmbd/nmbd.c         |   11 +----------
 source3/smbd/server.c       |    2 +-
 source3/smbd/server_exit.c  |    5 -----
 source3/utils/smbcquotas.c  |    2 +-
 source3/web/swat.c          |    2 +-
 source3/winbindd/winbindd.c |   11 +----------
 8 files changed, 8 insertions(+), 46 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9edbfc5..c37788f 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -516,7 +516,7 @@ NTSTATUS map_nt_error_from_unix(int unix_error);
 int map_errno_from_nt_status(NTSTATUS status);
 
 /* The following definitions come from lib/fault.c  */
-void fault_setup(void (*fn)(void *));
+void fault_setup(void);
 void dump_core_setup(const char *progname);
 
 /* The following definitions come from lib/file_id.c  */
diff --git a/source3/lib/fault.c b/source3/lib/fault.c
index dd87ae1..8bb2020 100644
--- a/source3/lib/fault.c
+++ b/source3/lib/fault.c
@@ -29,7 +29,6 @@
 #include <sys/prctl.h>
 #endif
 
-static void (*cont_fn)(void *);
 static char *corepath;
 
 /*******************************************************************
@@ -51,19 +50,7 @@ static void fault_report(int sig)
   
        smb_panic("internal error");
 
-       if (cont_fn) {
-               cont_fn(NULL);
-#ifdef SIGSEGV
-               CatchSignal(SIGSEGV, SIG_DFL);
-#endif
-#ifdef SIGBUS
-               CatchSignal(SIGBUS, SIG_DFL);
-#endif
-#ifdef SIGABRT
-               CatchSignal(SIGABRT, SIG_DFL);
-#endif
-               return; /* this should cause a core dump */
-       }
+       /* smb_panic() never returns, so this is really redundent */
        exit(1);
 }
 
@@ -78,10 +65,8 @@ static void sig_fault(int sig)
 /*******************************************************************
 setup our fault handlers
 ********************************************************************/
-void fault_setup(void (*fn)(void *))
+void fault_setup(void)
 {
-       cont_fn = fn;
-
 #ifdef SIGSEGV
        CatchSignal(SIGSEGV, sig_fault);
 #endif
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index a5727ce..1735c90 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -161,15 +161,6 @@ static void nmbd_terminate(struct messaging_context *msg,
 }
 
 /**************************************************************************** 
**
- Possibly continue after a fault.
- **************************************************************************** 
*/
-
-static void fault_continue(void)
-{
-       dump_core();
-}
-
-/**************************************************************************** 
**
  Expire old names from the namelist and server list.
  **************************************************************************** 
*/
 
@@ -820,7 +811,7 @@ static bool open_sockets(bool isdaemon, int port)
                SAFE_FREE(lfile);
        }
        
-       fault_setup((void (*)(void *))fault_continue );
+       fault_setup();
        dump_core_setup("nmbd");
        
        /* POSIX demands that signals are inherited. If the invoking process has
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 5d2abc0..2c09dd2 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -986,7 +986,7 @@ extern void build_options(bool screen);
        gain_root_privilege();
        gain_root_group_privilege();
 
-       fault_setup((void (*)(void *))exit_server_fault);
+       fault_setup();
        dump_core_setup("smbd");
 
        /* we are never interested in SIGPIPE */
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c
index c5cdc29..71f5094 100644
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -204,8 +204,3 @@ void exit_server_cleanly(const char *const explanation)
 {
        exit_server_common(SERVER_EXIT_NORMAL, explanation);
 }
-
-void exit_server_fault(void)
-{
-       exit_server("critical server fault");
-}
diff --git a/source3/utils/smbcquotas.c b/source3/utils/smbcquotas.c
index c50ad93..0efa606 100644
--- a/source3/utils/smbcquotas.c
+++ b/source3/utils/smbcquotas.c
@@ -598,7 +598,7 @@ 
FSQFLAGS:QUOTA_ENABLED/DENY_DISK/LOG_SOFTLIMIT/LOG_HARD_LIMIT", "SETSTRING" },
 
        setlinebuf(stdout);
 
-       fault_setup(NULL);
+       fault_setup();
 
        lp_load(get_dyn_CONFIGFILE(),True,False,False,True);
        load_interfaces();
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 00fbb87..54f4cd7 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -1403,7 +1403,7 @@ const char *lang_msg_rotate(TALLOC_CTX *ctx, const char 
*msgid)
        };
        TALLOC_CTX *frame = talloc_stackframe();
 
-       fault_setup(NULL);
+       fault_setup();
        umask(S_IWGRP | S_IWOTH);
 
 #if defined(HAVE_SET_AUTH_PARAMETERS)
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 766d8ef..99e98ac 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -86,15 +86,6 @@ static bool reload_services_file(const char *lfile)
 }
 
 
-/**************************************************************************** 
**
- Handle a fault..
- **************************************************************************** 
*/
-
-static void fault_quit(void)
-{
-       dump_core();
-}
-
 static void winbindd_status(void)
 {
        struct winbindd_cli_state *tmp;
@@ -1238,7 +1229,7 @@ int main(int argc, char **argv, char **envp)
        CatchSignal(SIGUSR1, SIG_IGN);
        CatchSignal(SIGUSR2, SIG_IGN);
 
-       fault_setup((void (*)(void *))fault_quit );
+       fault_setup();
        dump_core_setup("winbindd");
 
        load_case_tables();


-- 
Samba Shared Repository

Reply via email to