What steps will reproduce the problem?
from pyftpdlib.contrib.authorizers import UnixAuthorizer
auth = UnixAuthorizer(require_valid_shell=True)
auth.validate_authentication('?!foo', '?!foo')
What is the expected output? What do you see instead?
We get an exception:
Traceback (most recent call last):
File "foo.py", line 3, in <module>
auth = UnixAuthorizer(require_valid_shell=True)
File "/home/giampaolo/svn/pyftpdlib/pyftpdlib/contrib/authorizers.py", line 289, in __init__
BaseUnixAuthorizer.__init__(self, anonymous_user)
File "/home/giampaolo/svn/pyftpdlib/pyftpdlib/contrib/authorizers.py", line 145, in __init__
raise AuthorizerError("super user privileges are required")
pyftpdlib.ftpserver.AuthorizerError: super user privileges are required
giampaolo@ubuntu:~/svn/pyftpdlib$ sudo python foo.py
Traceback (most recent call last):
File "foo.py", line 4, in <module>
auth.validate_authentication('?!foo', '?!foo')
File "/home/giampaolo/svn/pyftpdlib/pyftpdlib/contrib/authorizers.py", line 327, in validate_authentication
if not self._has_valid_shell(username):
File "/home/giampaolo/svn/pyftpdlib/pyftpdlib/contrib/authorizers.py", line 361, in _has_valid_shell
shell = pwd.getpwnam(username).pw_shell
KeyError: 'getpwnam(): name not found: ?!foo'
Original issue reported on code.google.com by g.rodola on 17 Jan 2012 at 5:56
Original issue reported on code.google.com by
g.rodola
on 17 Jan 2012 at 5:56