Bug 115839 - rdate uses alarm() but has no signal handler
Summary: rdate uses alarm() but has no signal handler
Alias: None
Product: Fedora
Classification: Fedora
Component: rdate   
(Show other bugs)
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-02-16 16:41 UTC by Vince Skahan
Modified: 2015-03-05 01:13 UTC (History)
2 users (show)

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

Attachments (Terms of Use)

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):

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 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

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