RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 689794 - ctrl+c does not work during python getpass.getpass() (was: Unable to terminate sss_obfuscate)
Summary: ctrl+c does not work during python getpass.getpass() (was: Unable to terminat...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python
Version: 6.1
Hardware: Unspecified
OS: Linux
medium
unspecified
Target Milestone: rc
: ---
Assignee: Dave Malcolm
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-22 13:26 UTC by Kaushik Banerjee
Modified: 2016-06-01 01:41 UTC (History)
8 users (show)

Fixed In Version: python-2.6.6-21.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 10:24:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1564 0 normal SHIPPED_LIVE python bug fix and enhancement update 2011-12-06 00:39:12 UTC

Description Kaushik Banerjee 2011-03-22 13:26:36 UTC
Description of problem:
ctrl+c doesn't terminate sss_obfuscate and traceback messages appear on using ctrl+d

Version-Release number of selected component (if applicable):
sssd-tools-1.5.1-15.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Run the command "sss_obfuscate -d AD"
2. Try to interrupt with ctrl+c or ctrl+d
3.
  
Actual results:
1. ctrl+c doesn't interrupt sss_obfuscate.
2. ctrl+d interrupts sss_obfuscate with traceback messages.
# sss_obfuscate -d AD
Enter password: Traceback (most recent call last):
  File "/usr/sbin/sss_obfuscate", line 101, in <module>
    ret = main()
  File "/usr/sbin/sss_obfuscate", line 45, in main
    p1, p2 = pprompt()
  File "/usr/sbin/sss_obfuscate", line 44, in <lambda>
    pprompt = lambda: (getpass.getpass("Enter password: "), getpass.getpass("Re-enter password: "))
  File "/usr/lib64/python2.6/getpass.py", line 71, in unix_getpass
    passwd = _raw_input(prompt, stream, input=input)
  File "/usr/lib64/python2.6/getpass.py", line 135, in _raw_input
    raise EOFError
EOFError


Expected results:
1. ctrl+c should interrupt sss_obfuscate.
2. ctrl+d should stop sss_obfuscate without any traceback messages.

Additional info:

Comment 2 Stephen Gallagher 2011-03-22 13:41:00 UTC
The ctrl+c issue is a python bug being tracked here:
http://bugs.python.org/issue11236

Also, I don't know whether I consider the traceback from ctrl+d to be a bug. You're not supposed to force an EOF in that function. It triggers completion based on a newline. Throwing a traceback seems like an appropriate behavior.

Please suggest an appropriate error message if you want me to at least override this.

Comment 3 Kaushik Banerjee 2011-03-22 14:30:05 UTC
The basic issue here is that, at the moment, user cannot interrupt the sss_obfuscate command and only ctrl+d with traceback messages work.
Maybe we can add a exception with the message "Password change aborted"?

Also, there is no limit on maximum retries either. We should set a limit of maximum 3 retries on mis-matched passwords.

Comment 4 Kaushik Banerjee 2011-03-23 12:17:04 UTC
Logged a second bug https://bugzilla.redhat.com/show_bug.cgi?id=690131 to track the issue related to ctrl+d and leave this bug to track the ctrl+c issue.

Comment 5 Stephen Gallagher 2011-03-23 12:27:51 UTC
The ctrl+c issue is a python bug as mentioned in the above comments. It is the same issue as reported in http://bugs.python.org/issue11236

Reassigning to the Python maintainer.

Comment 6 RHEL Program Management 2011-04-04 02:13:08 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 7 Dave Malcolm 2011-06-09 20:29:52 UTC
Patch is upstream, albeit not for 2.6; 2.7 version is here:
   http://hg.python.org/cpython/rev/a3b4887edba4/

Easy manual reproducer:
  python -c"import getpass; print(repr(getpass.getpass('-> ')))"
and try to press either ctrl-Z or ctrl-C.  Currently, nothing happens, and you need to press "return" to finish; the returned string contains '\x03' or '\x1a'  (or press Ctrl-D, which raises a EOFError exception).

Upon applying the patch, Ctrl-C raises a KeyboardInterupt, and Ctrl-Z backgrounds the task.

Comment 13 errata-xmlrpc 2011-12-06 10:24:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1564.html


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