Failure to do so could cause the parent to hang on read() waiting for
the return value from the child.
Targets: 2.3-rc and stable-2.2 branches.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
ret = setegid(data->gid);
if (ret < 0) {
PERROR("setegid");
- return EXIT_FAILURE;
+ sendret.i = -1;
+ goto write_return;
}
}
if (data->uid != geteuid()) {
ret = seteuid(data->uid);
if (ret < 0) {
PERROR("seteuid");
- return EXIT_FAILURE;
+ sendret.i = -1;
+ goto write_return;
}
}
/*
*/
umask(0);
sendret.i = (*data->cmd)(data->data);
+
+write_return:
/* send back return value */
writeleft = sizeof(sendret);
index = 0;