[PATCH] 2.0.7-pre1, possibility for smb_panic-debuging on Solaris

Mattias.Gronlund Mattias.Gronlund at sa.erisoft.se
Wed Feb 2 23:04:22 GMT 2000


Hi,

At least Solaris 2.5, 2.5.1 and 2.6 has a feature (bug?) that
porhibit processes from creating a core-dump with abort() if
they has ever changed its uid.

The problem with this is that SAMBA often changes uid. So the
possibility for a core is realy small. But it the need
for a way to debug thouse situatuins is still there.

I have created a script that I spawn with "panic action"

panic action = "/opt/fw/samba/bin/panic.sh >> /var/log/samba_panic.log"

But there is a problem, this script is executed as the uid that
SAMBA where executing as at the time of the crash. So I would
like this patch to go into SAMBA that sees to it that "panic action"
is allways called as root.

/Mattias
-------------- next part --------------
--- samba-pre2.0.7/source/lib/util.c	Wed Jan 26 22:03:38 2000
+++ samba-pre2.0.7-homes/source/lib/util.c	Mon Jan 31 22:32:24 2000
@@ -2361,7 +2361,10 @@
 void smb_panic(char *why)
 {
 	char *cmd = lp_panic_action();
+	uid_t euid;
 	if (cmd && *cmd) {
+		euid = geteuid();
+		seteuid(0);
 		system(cmd);
 	}
 	DEBUG(0,("PANIC: %s\n", why));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: panic.sh
Type: application/x-sh
Size: 326 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20000203/b6e3a49b/panic.sh


More information about the samba-technical mailing list