Tue 20 Jul 2004 06:44:44 AM UTC, original submission:
The following fragment can be found in ftp.c:
/*
* In standalone mode we do not receive the SIGCHLD because
* we set it to SIG_IGN -- 030406asg
*/
if (x->config->standalone == 0 && waitpid(pid, &rc, 0) < 0) {
syslog(LOG_NOTICE, "-ERR: error while waiting for trp: %
s", strerror(errno));
exit (1);
}
rc = WIFEXITED(rc) != 0? WEXITSTATUS(rc): 1;
if (rc != 0) {
syslog(LOG_NOTICE, "-ERR: trp signals error condition, r
c= %d", rc);
exit (1);
}
}
I wonder how this is supposed to work, since the ctp (trp) may deny access by exiting with a non-zero exit code. However, in standalone mode, the exit code is not collected at all.
Additionally, this is the only place in which waitpid is called conditionally. All other calls (for the acp and ccp) are calling waitpid unconditionally. At least under Linux, this fails, since SIGCHLD is set to SIG_IGN and thus, waitpid returns ECHILD.
A fix that seems to work is to leave SIGCHLD as it is and to remove the above check for standalone mode. However, I am still wondering why the current source sets SIGCHLD to SIG_IGN in the first place. Am I missing something silly?
- Simon
|