Bug 115839 - rdate uses alarm() but has no signal handler
rdate uses alarm() but has no signal handler
Product: Fedora
Classification: Fedora
Component: rdate (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Depends On:
  Show dependency treegraph
Reported: 2004-02-16 11:41 EST by Vince Skahan
Modified: 2015-03-04 20:13 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-05-06 07:50:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vince Skahan 2004-02-16 11:41:02 EST
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):

How reproducible:

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
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 07:50:49 EDT
Fixed in rawhide, packages should appear there soon and will make it
either in fc2 or the next release.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.