Issue 199 in pyftpdlib: UnixAuthorizer with require_valid_shell option is broken

7 views
Skip to first unread message

pyft...@googlecode.com

unread,
Jan 17, 2012, 12:56:39 PM1/17/12
to pyftpdli...@googlegroups.com
Status: New
Owner: g.rodola
Labels: Type-Defect Priority-Medium Component-Library OpSys-UNIX Usability

New issue 199 by g.rodola: UnixAuthorizer with require_valid_shell option
is broken
http://code.google.com/p/pyftpdlib/issues/detail?id=199

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'


pyft...@googlecode.com

unread,
Jan 20, 2012, 4:00:35 PM1/20/12
to pyftpdli...@googlegroups.com
Updates:
Status: FixedInSVN
Labels: Version-0.6.0 Milestone-0.7.0

Comment #1 on issue 199 by g.rodola: UnixAuthorizer with

Fixed in r971.

Reply all
Reply to author
Forward
0 new messages