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

Bug 55082

Summary: etc-update dies unexpectedly when user input is non-printable character(s)
Product: Portage Development Reporter: Elan Ruusamäe <glen>
Component: ToolsAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: minor CC: alpeterson, eksajm
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 93874    
Bug Blocks: 115839    

Description Elan Ruusamäe 2004-06-24 14:10:05 UTC
etc-update asks for user input, how to proceed. if i (accidentally) press DELETE, or any non-letter button, it dies.
for example DELETE generates on my terminal '^[[3~'

# etc-update
Scanning Configuration files...
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/init.d/syslog-ng
/etc/init.d/._cfg0000_syslog-ng
Please select a file to edit by entering the corresponding number.
              (-1 to exit) (-3 to auto merge all remaining files)
                           (-5 to auto-merge AND not use 'mv -i'): ^[[3~
/usr/sbin/etc-update: line 123: read: : syntax error: operand expected (error token is "")
Exiting: User termination!

perhaps it's just bash bug, but cannot reproduce it outside etc-update

# bash b.sh # hit DEL and ENTER
^[[3~
0
0000000 033   [   3   ~
        5b1b 7e33
0000004
# cat b.sh
#!/bin/sh
read input;echo $?;echo -n $input|od -cx


Reproducible: Always
Steps to Reproduce:
1. run etc-update
2. input \033 (escape button)
3. input ENTER
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-10-25 14:37:22 UTC
*** Bug 61719 has been marked as a duplicate of this bug. ***
Comment 2 Simon Stelling (RETIRED) gentoo-dev 2006-04-13 10:40:18 UTC
the problem was that input was declared as an integer, so every time the user would enter a non-integer value, it would crash. fixed in rev 3140.
Comment 3 Simon Stelling (RETIRED) gentoo-dev 2006-04-13 11:24:31 UTC
*** Bug 122716 has been marked as a duplicate of this bug. ***
Comment 4 Zac Medico gentoo-dev 2006-04-17 01:04:01 UTC
Released in 2.1_pre9.