Bug 115839

Summary: rdate uses alarm() but has no signal handler
Product: [Fedora] Fedora Reporter: Vince Skahan <vince.skahan>
Component: rdateAssignee: Phil Knirsch <pknirsch>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1CC: rvokal, sopwith
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-06 11:50:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vince Skahan 2004-02-16 16:41:02 UTC
Description of problem:
The updated 'rdate' in Fedora Core 1 adds an alarm() call to cause a 
10 second timeout to occur.  However, the alarm is not handled, which 
causes calling programs to abort up the process tree under some 
circumstances.  Adding a trivial signal handler fixes the problem

This situation occurs when the client system attempts to rdate from a 
server whose default input iptable policy is 'drop' (ie, blackhole).

Version-Release number of selected component (if applicable):
1.3.3

How reproducible:
always


Steps to Reproduce:
1. block incoming rdate queries with iptables on the server side
     iptables -I INPUT -m tcp -p tcp --dport 37 -j DROP
2. try to rdate on the client side, querying the server
3.
  
Actual results:

The rdate call returns with a 'Alarm' message and error 142.  The 
message isn't on stdout or stderr, which frequently blows up calling 
shell scripts that run from the system startup.

Expected results:

rdate should only return on stdout/stderr so it can be wrappered in 
shell scripts etc.

Additional info:

In rdate.c add a trivial signal handler to handle the alarm.

#include <signal.h>
void  ALARMhandler(int sig) { exit(sig); } 
[...then down below their alarm(10) call...]
signal(SIGALRM, ALARMhandler);

Comment 1 Phil Knirsch 2004-05-06 11:50:49 UTC
Fixed in rawhide, packages should appear there soon and will make it
either in fc2 or the next release.

Read ya, Phil