Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Oct 26, 2009, 7:39 AM

Post #1 of 10 (442 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1

New submission from Peter Saunders <pajs [at] fodder>:

Only sucessfully replicated on solaris.

When running getpass() - it goes into non echo mode, however, once enter
is pressed, the password is echoed to the screen. E.g.

> /opt/python/2.6.3/bin/python -c 'import getpass; x=getpass.getpass()'
Password: bob

This does NOT happen on older versions:
> /opt/IBpython/2.5.1/bin/python -c 'import getpass; x=getpass.getpass()'
Password:

/opt/python/2.3.3/bin/python -c 'import getpass; x=getpass.getpass()'
Password:

To stop this occuring for me, simply adding a stream.flush() line
straight after the

finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old)

line fixes the issue:
saundep [at] ln8u3494in:[/tmp]> /opt/IBpython/2.6.3/bin/python -c 'import
gp; gp.getpass()'
Password:

----------
components: Library (Lib)
messages: 94488
nosy: pajs [at] fodder
severity: normal
status: open
title: Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1
versions: Python 2.6

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 7:49 AM

Post #2 of 10 (409 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Changes by Peter Saunders <pajs [at] fodder>:


----------
keywords: +patch
Added file: http://bugs.python.org/file15201/getpass.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 26, 2009, 8:23 AM

Post #3 of 10 (406 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Looks like a critical bug, thanks.

----------
nosy: +pitrou
priority: -> critical
stage: -> patch review
type: -> behavior
versions: +Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 27, 2009, 5:17 PM

Post #4 of 10 (399 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Alexander Belopolsky <belopolsky [at] users> added the comment:

Just to give credit where credit is due: see #4 here

http://mail.python.org/pipermail/python-dev/2003-December/040579.html

----------
nosy: +belopolsky

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 29, 2009, 12:37 PM

Post #5 of 10 (396 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Changes by Antoine Pitrou <pitrou [at] free>:


----------
nosy: +gps

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 31, 2009, 1:56 PM

Post #6 of 10 (378 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Changes by Gregory P. Smith <greg [at] krypto>:


----------
assignee: -> gregory.p.smith
nosy: +gregory.p.smith -gps

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 31, 2009, 2:27 PM

Post #7 of 10 (375 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Gregory P. Smith <greg [at] krypto> added the comment:

Peter - can you apply the patch from svn r76000 and test that it works
properly on Solaris?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 31, 2009, 2:34 PM

Post #8 of 10 (374 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Regarding your comment in r76000:
"""NOTE: The Python C API calls flockfile() (and unlock) during
readline."""

This may be true in 2.x but not in 3.x. Does it have any security
implication?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Oct 31, 2009, 3:26 PM

Post #9 of 10 (383 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Gregory P. Smith <greg [at] krypto> added the comment:

It might mean that other threads with access to the same file handle
could interfere and intercept part of the password entry if they wanted
to but thats not too concerning.

py3k/Modules/_io/bufferedio.c which is presumably used when input is
sys.stdin instead of a /dev/tty file appears to lock things.

Compared to glibc's getpass implementation the locking should probably
be done around a wider swath of getpass code in order to protect all
possible race conditions of other code accessing the handle as we set it
up and display the prompt. I don't really think it is something worry
about as it requires code executing within the context of your own
getpass calling program to be doing something that'll interfere with
your password reading. If someone has -that- problem they have bigger
issues.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 1, 2009, 10:48 AM

Post #10 of 10 (371 views)
Permalink
[issue7208] Getpass echo's password to screen on 2.6, but not on 2.5 or 3.1 [In reply to]

Gregory P. Smith <greg [at] krypto> added the comment:

merged into release26-maint in r76015. this patch also fixed issue7246.

py3k r76017
release31-maint r76019

----------
resolution: -> fixed
status: open -> closed
versions: -Python 2.6, Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7208>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.