leonnnn / python3-simplepam Goto Github PK
View Code? Open in Web Editor NEWPython3 port of Chris AtLee's Python PAM module.
License: MIT License
Python3 port of Chris AtLee's Python PAM module.
License: MIT License
simplepam still authenticates if you type in a password which starts with the correct password
Say your password is 'foo'. If you type in 'foobar', it still authenticates.
Is anyone else experiencing this issue?
Is there any reason simplepam should require root access? I just installed from pip on a current Debian system (python 2.7.3) and realized it works fine if I'm root, but for non-root, it only lets me authenticate myself:
{02:47 PM} mazer@zed $ python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplepam;simplepam.authenticate('test', 'password-here')
False
...
{02:48 PM} mazer@zed $ sudo python
Python 2.7.3 (default, Mar 14 2014, 11:57:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplepam;simplepam.authenticate('test', 'password-here')
True
...
I can always authenticate myself. Same thing happens with python-pam in the apt repo.
Funny thing is that Mint LMDE doesn't do this -- under Mint, the both simplepam and python-pam allow users to validate other users properly. Am I missing something here about PAM?
If I'm using this module in FreeBSD as a non-root user, a good username but bad password will pass. Note a bad (non-existent) username will fail as expected. As root, the authentication works correctly.
[vagrant@vagrant-bsd93 ~]$ env LOGNAME=vagrant python -m simplepam // bad pwd: foobar
Password:
True
[vagrant@vagrant-bsd93 ~]$ env LOGNAME=foobar python -m simplepam // bad user, bad pwd
Password:
False
I expected that the bad password should fail. Or if root access is required, then all authentication checks as non-root should fail.
Hi,
I am trying to use simplepam 0.1.5 with python 3.4.2 on OS X 10.10.1 (from ipython 3.0.0-dev) but it fails when it tries to access pam_start in libpam. The same problem exists in python 2 (simplepam @ python 2.7.6).
Cheers,
/J
AttributeError Traceback (most recent call last)
in ()
----> 1 from simplepam import authenticate
/usr/local/lib/python3.4/site-packages/simplepam.py in ()
84 ]
85
---> 86 pam_start = libpam.pam_start
87 pam_start.restype = c_int
88 pam_start.argtypes = [c_char_p, c_char_p, POINTER(PamConv),
/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/init.py in getattr(self, name)
362 if name.startswith('') and name.endswith(''):
363 raise AttributeError(name)
--> 364 func = self.getitem(name)
365 setattr(self, name, func)
366 return func
/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/ctypes/init.py in getitem(self, name_or_ordinal)
367
368 def getitem(self, name_or_ordinal):
--> 369 func = self._FuncPtr((name_or_ordinal, self))
370 if not isinstance(name_or_ordinal, int):
371 func.name = name_or_ordinal
AttributeError: dlsym(RTLD_DEFAULT, pam_start): symbol not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.