Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 188780

Summary: etc-update does not check its input
Product: Gentoo Linux Reporter: Brant Gurganus <brant>
Component: [OLD] UnspecifiedAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: enhancement CC: cla
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 216231    

Description Brant Gurganus 2007-08-14 02:50:14 UTC
As evidenced by its output, etc-update does not check for valid input before trying to process it.

Reproducible: Always

Steps to Reproduce:
1. Run etc-update.
2. At a prompt, use "1y" as input.

Actual Results:  
/usr/sbin/etc-update: line 215: read: 1y: value too great for base (error token is "1y")

Expected Results:  
The software should recover from this error and say that "1y" was not an option.
Comment 1 Zac Medico gentoo-dev 2007-08-15 07:08:09 UTC
It's better than it used to be (bug 143881). I suppose we can stop trying to read it into an integer type in order to avoid that error all together.
Comment 2 Brant Gurganus 2007-08-15 09:41:43 UTC
I'd have to be more familiar with the language etc-update is written in, but the data type isn't the problem. It does need to be an integer, unless non-integer input is expected at some point. In my brief testing, it seemed like the select syntax of bash was more robust. Am I correct there? Would select be better?
Comment 3 Dawid Węgliński (RETIRED) gentoo-dev 2008-11-23 16:50:57 UTC
Isn't it fixed already? :)
Comment 4 Zac Medico gentoo-dev 2008-11-23 19:52:07 UTC
In svn r12053 I've fixed it to show a more human readable error message, like this:

Value '1y' is not valid. Please enter an integer value:

(In reply to comment #3)
> Isn't it fixed already? :)

Well, it was fixed in the sense that the program would continue to run. However, the error message was not very good.
Comment 5 Zac Medico gentoo-dev 2008-11-27 19:20:54 UTC
This is fixed in 2.1.6_rc1 and 2.2_rc16.