diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-08-21 11:37:40 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-08-21 11:37:40 +0000 |
commit | 038e3433d39337f736b7b69ac1e6212e9f8e5406 (patch) | |
tree | a502a03d2b20d67b1602692207806a767178bb25 /source3/lib | |
parent | 57f1129cdc154c56ae70287999c5961e072b4975 (diff) | |
download | samba-038e3433d39337f736b7b69ac1e6212e9f8e5406.tar.gz samba-038e3433d39337f736b7b69ac1e6212e9f8e5406.tar.bz2 samba-038e3433d39337f736b7b69ac1e6212e9f8e5406.zip |
added new smb.conf option "panic action". see my samba-technical
explanation.
(This used to be commit c6899df44c34088a4d2bf1edc840320b0ba7e32e)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/fault.c | 4 | ||||
-rw-r--r-- | source3/lib/util.c | 18 |
2 files changed, 10 insertions, 12 deletions
diff --git a/source3/lib/fault.c b/source3/lib/fault.c index 9b665f65c7..6effaf7d7c 100644 --- a/source3/lib/fault.c +++ b/source3/lib/fault.c @@ -42,9 +42,7 @@ static void fault_report(int sig) DEBUG(0,("\nPlease read the file BUGS.txt in the distribution\n")); DEBUG(0,("===============================================================\n")); -#if AJT - ajt_panic(); -#endif + smb_panic("internal error"); if (cont_fn) { cont_fn(NULL); diff --git a/source3/lib/util.c b/source3/lib/util.c index c1eb7cc879..9543388b45 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -378,13 +378,11 @@ char *StrCpy(char *dest,char *src) { char *d = dest; -#if AJT /* I don't want to get lazy with these ... */ if (!dest || !src) { - DEBUG(0,("ERROR: NULL StrCpy() called!\n")); - ajt_panic(); + DEBUG(0,("ERROR: NULL StrCpy() called!\n")); + smb_panic("invalid StrCpy"); } -#endif if (!dest) return(NULL); if (!src) { @@ -4320,15 +4318,17 @@ char *gidtoname(int gid) return(name); } -#if AJT /******************************************************************* -my own panic function - not suitable for general use +something really nasty happened - panic! ********************************************************************/ -void ajt_panic(void) +void smb_panic(char *why) { - system("/usr/bin/X11/xedit -display :0 /tmp/ERROR_FAULT"); + char *cmd = lp_panic_action(); + if (cmd && *cmd) { + system(cmd); + exit(1); + } } -#endif /******************************************************************* |