Bug 54481

Summary: /sbin/getkey bugs
Product: [Fedora] Fedora Reporter: Steve Bonneville <sbonnevi>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 8.22-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-01 18:01:28 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:
Bug Depends On:    
Bug Blocks: 150221    

Description Steve Bonneville 2001-10-09 19:29:19 UTC
Description of Problem:

The /sbin/getkey program has some bugs when certain values are used with
the -c option.

If '-c 0' is used, then any message set with -m will fail to be displayed
and getkey will wait for input indefinitely.

If -c is used with a negative number, it appears that getkey will continue
to count
downward toward negative infinity.

The rc.sysinit file uses -c with -m in order to display a countdown message
to control how
many seconds to wait for input before selecting the default autofsck option
in a filesystem
recovery situation.  If /etc/sysconfig/autofsck sets AUTOFSCK_TIMEOUT to 0,
the system
will wait for input forever without displaying any message.  (This might
sort-of make sense,
as the message it would display now would probably be "Press Y within 0
seconds to force file system integrity check".  That message wouldn't make
sense in either the case where 
'-c 0' is supposed to indicate an infinite wait OR instant selection of the
default.)

/sbin/getkey could probably also use some documentation, like a man page!

Reproducible: Always
Steps to Reproduce:

  /sbin/getkey -c 5 -m $"Counting down from %d" n           (Works fine)
  /sbin/getkey -c 0 -m $"Counting down from %d" n           (No text
output)
  /sbin/getkey -c -1 -m $"Counting down from %d" n         (Countdown
forever)

Press 'n' with the above to break out of the countdown.

Comment 1 Miloslav Trmač 2006-02-01 18:01:28 UTC
Fixed in initscripts-8.22.1.  Thanks for your report.