1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdbd: Don't use a fixed length buffer for the hung script command

The amount of data to write into the buffer wasn't constrained
anywhere...

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 9b0d56b16775aa16f33bdfdf831256e085fa3339)
This commit is contained in:
Martin Schwenke 2013-02-05 14:36:29 +11:00 committed by Amitay Isaacs
parent e883720461
commit 37632efde0

View File

@ -531,14 +531,16 @@ static void ctdb_run_debug_hung_script(struct ctdb_context *ctdb, struct ctdb_ev
return;
}
if (pid == 0) {
char buf[200];
char *buf;
if (getenv("CTDB_DEBUG_HUNG_SCRIPT") != NULL) {
debug_hung_script = getenv("CTDB_DEBUG_HUNG_SCRIPT");
}
sprintf(buf, "%s %d", debug_hung_script, state->child);
buf = talloc_asprintf(NULL, "%s %d",
debug_hung_script, state->child);
system(buf);
talloc_free(buf);
/* Now we can kill the child */
ctdb_kill(state->ctdb, state->child, SIGTERM);