s3compat: added option s3compat:gdb = true
authorAndrew Tridgell <tridge@samba.org>
Mon, 26 Apr 2010 02:17:41 +0000 (12:17 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:12:29 +0000 (11:12 +1000)
this starts a gdb on the s3 fileserver code in a gnome-terminal

source4/s3compat/s3_smbd.c

index f3042c57b7a38a8b9cfa7b9a6e641f0247be27a8..65f9ab6cc0cc00b1dc3565a84d2ce5d4d977905c 100644 (file)
 static void s3compat_smb_accept(struct stream_connection *conn)
 {
        int fd = socket_get_fd(conn->socket);
-#if 0
-       char *cmd = talloc_asprintf(conn, "xterm -e gdb --pid %u &", getpid());
-       system(cmd);
-       sleep(2);
-#endif
+       if (lp_parm_bool(conn->lp_ctx, NULL, "s3compat", "gdb", false)) {
+               char *cmd = talloc_asprintf(conn, "gnome-terminal -e \"gdb --pid %u\"", getpid());
+               system(cmd);
+               sleep(2);
+       }
        DEBUG(0,(__location__ ": new s3compat smbd connection\n"));
        s3compat_set_server_fd(fd);
        s3compat_set_event_ctx(conn->event.ctx);