bugftp.proxy - FTP Proxy Server - Bugs: bug #9698, wrong waitpid handling in daemon...

 
 

bug #9698: wrong waitpid handling in daemon mode

Submitted by:  None
Submitted on:  Tue 20 Jul 2004 06:44:44 AM UTC  
 
Severity: 3 - NormalPriority: 5 - Normal
Item Group: Crash ErrorStatus: Fixed
Privacy: PublicAssigned to: Andreas Schoenberg <asg>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: cvs snapshot
Operating System: LinuxFixed Release: 
Planned Release: 

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 30 Jul 2004 02:41:19 PM UTCasgStatusNone=>Fixed
  Assigned toNone=>asg
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>1.2.3

Back to the top


Powered by Savane 3.1-cleanup1