Hello community,

here is the log from the commit of package python-python-pam for 
openSUSE:Factory checked in at 2018-12-12 17:28:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-python-pam (Old)
 and      /work/SRC/openSUSE:Factory/.python-python-pam.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-python-pam"

Wed Dec 12 17:28:30 2018 rev:2 rq:655998 version:1.8.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-python-pam/python-python-pam.changes      
2017-07-04 09:10:35.156992338 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-python-pam.new.28833/python-python-pam.changes
   2018-12-12 17:28:34.198870395 +0100
@@ -1,0 +2,11 @@
+Fri Dec  7 10:39:12 UTC 2018 - Tomáš Chvátal <tchva...@suse.com>
+
+- Version update to 1.8.4:
+  * Various small fixes
+
+-------------------------------------------------------------------
+Tue Dec  4 12:53:06 UTC 2018 - Matej Cepl <mc...@suse.com>
+
+- Remove superfluous devel dependency for noarch package
+
+-------------------------------------------------------------------

Old:
----
  python-pam-1.8.2.tar.gz

New:
----
  python-pam-1.8.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-python-pam.spec ++++++
--- /var/tmp/diff_new_pack.pHkcuk/_old  2018-12-12 17:28:34.710869746 +0100
+++ /var/tmp/diff_new_pack.pHkcuk/_new  2018-12-12 17:28:34.714869741 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-python-pam
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,26 +12,24 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
+#
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
-Name:           python-python-pam
 %global modname python-pam
-Version:        1.8.2
+Name:           python-python-pam
+Version:        1.8.4
 Release:        0
-License:        MIT
 Summary:        Python PAM module using ctypes, py3/py2
-Url:            https://github.com/FirefighterBlu3/%{modname}
+License:        MIT
 Group:          Development/Languages/Python
-Source:         
https://pypi.io/packages/source/p/%{modname}/%{modname}-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
+URL:            https://github.com/FirefighterBlu3/python-pam
+Source:         
https://files.pythonhosted.org/packages/source/p/python-pam/%{modname}-%{version}.tar.gz
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildArch:      noarch
-
 %python_subpackages
 
 %description
@@ -45,10 +43,11 @@
 
 %install
 %python_install
-%fdupes %{buildroot}%{_prefix}
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %files %{python_files}
-%defattr(-,root,root,-)
+%license LICENSE
+%doc README.md
 %{python_sitelib}/*
 
 %changelog

++++++ python-pam-1.8.2.tar.gz -> python-pam-1.8.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/LICENSE new/python-pam-1.8.4/LICENSE
--- old/python-pam-1.8.2/LICENSE        1970-01-01 01:00:00.000000000 +0100
+++ new/python-pam-1.8.4/LICENSE        2014-08-03 18:54:58.000000000 +0200
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 David Ford
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/MANIFEST.in 
new/python-pam-1.8.4/MANIFEST.in
--- old/python-pam-1.8.2/MANIFEST.in    2014-11-17 20:19:48.000000000 +0100
+++ new/python-pam-1.8.4/MANIFEST.in    2018-06-16 08:10:31.000000000 +0200
@@ -1 +1,2 @@
 include README.md
+include LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/PKG-INFO 
new/python-pam-1.8.4/PKG-INFO
--- old/python-pam-1.8.2/PKG-INFO       2014-11-17 20:24:27.000000000 +0100
+++ new/python-pam-1.8.4/PKG-INFO       2018-06-16 08:44:38.000000000 +0200
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: python-pam
-Version: 1.8.2
+Version: 1.8.4
 Summary: Python PAM module using ctypes, py3/py2
 Home-page: https://github.com/FirefighterBlu3/python-pam
 Author: David Ford
 Author-email: da...@blue-labs.org
+Maintainer: David Ford
+Maintainer-email: da...@blue-labs.org
 License: License :: OSI Approved :: MIT License
 Download-URL: https://github.com/FirefighterBlu3/python-pam
 Description: python-pam
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/README.rst 
new/python-pam-1.8.4/README.rst
--- old/python-pam-1.8.2/README.rst     2018-12-12 17:28:34.782869655 +0100
+++ new/python-pam-1.8.4/README.rst     2014-08-03 19:42:05.000000000 +0200
@@ -1 +1,47 @@
-symbolic link to README.md
+python-pam
+==========
+
+Python pam module supporting py3 (and py2)
+
+Commandline example:
+
+```
+[david@Scott python-pam]$ python pam.py
+Username: david
+Password: 
+0 Success
+
+[david@Scott python-pam]$ python2 pam.py
+Username: david
+Password: 
+0 Success
+```
+
+Inline examples:
+```
+[david@Scott python-pam]$ python
+Python 3.4.1 (default, May 19 2014, 17:23:49)
+[GCC 4.9.0 20140507 (prerelease)] on linux
+Type "help", "copyright", "credits" or "license" for more information.
+>>> import pam
+>>> p = pam.pam()
+>>> p.authenticate('david', 'correctpassword')
+True
+>>> p.authenticate('david', 'badpassword')
+False
+>>> p.authenticate('david', 'correctpassword', service='login')
+True
+>>> p.authenticate('david', 'correctpassword', service='unknownservice')
+False
+>>> p.authenticate('david', 'correctpassword', service='login', 
resetcreds=True)
+True
+>>> p.authenticate('david', 'correctpassword', encoding='latin-1')
+True
+>>> print('{} {}'.format(p.code, p.reason))
+0 Success
+>>> p.authenticate('david', 'badpassword')
+False
+>>> print('{} {}'.format(p.code, p.reason))
+7 Authentication failure
+>>>
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/pam.py new/python-pam-1.8.4/pam.py
--- old/python-pam-1.8.2/pam.py 2014-11-17 20:22:15.000000000 +0100
+++ new/python-pam-1.8.4/pam.py 2018-06-16 08:02:33.000000000 +0200
@@ -21,19 +21,19 @@
 '''
 
 __all__      = ['pam']
-__version__  = '1.8.2'
+__version__  = '1.8.4'
 __author__   = 'David Ford <da...@blue-labs.org>'
-__released__ = '2014 November 17'
+__released__ = '2018 June 15'
 
 import sys
 
 from ctypes import CDLL, POINTER, Structure, CFUNCTYPE, cast, byref, sizeof
-from ctypes import c_void_p, c_uint, c_char_p, c_char, c_int
+from ctypes import c_void_p, c_size_t, c_char_p, c_char, c_int
 from ctypes import memmove
 from ctypes.util import find_library
 
 class PamHandle(Structure):
-    """wrapper class for pam_handle_t"""
+    """wrapper class for pam_handle_t pointer"""
     _fields_ = [ ("handle", c_void_p) ]
 
     def __init__(self):
@@ -72,11 +72,13 @@
 
 calloc                    = libc.calloc
 calloc.restype            = c_void_p
-calloc.argtypes           = [c_uint, c_uint]
+calloc.argtypes           = [c_size_t, c_size_t]
 
-pam_end                   = libpam.pam_end
-pam_end.restype           = c_int
-pam_end.argtypes          = [PamHandle, c_int]
+# bug #6 (@NIPE-SYSTEMS), some libpam versions don't include this function
+if hasattr(libpam, 'pam_end'):
+    pam_end                   = libpam.pam_end
+    pam_end.restype           = c_int
+    pam_end.argtypes          = [PamHandle, c_int]
 
 pam_start                 = libpam.pam_start
 pam_start.restype         = c_int
@@ -88,7 +90,7 @@
 
 pam_strerror              = libpam.pam_strerror
 pam_strerror.restype      = c_char_p
-pam_strerror.argtypes     = [POINTER(PamHandle), c_int]
+pam_strerror.argtypes     = [PamHandle, c_int]
 
 pam_authenticate          = libpam.pam_authenticate
 pam_authenticate.restype  = c_int
@@ -129,14 +131,14 @@
                prompt where the echo is off with the supplied password"""
             # Create an array of n_messages response objects
             addr = calloc(n_messages, sizeof(PamResponse))
-            p_response[0] = cast(addr, POINTER(PamResponse))
+            response = cast(addr, POINTER(PamResponse))
+            p_response[0] = response
             for i in range(n_messages):
                 if messages[i].contents.msg_style == PAM_PROMPT_ECHO_OFF:
-                    cs  = c_char_p(password)
-                    dst = calloc(sizeof(c_char_p), len(password)+1)
-                    memmove(dst , cs, len(password))
-                    p_response.contents[i].resp = dst
-                    p_response.contents[i].resp_retcode = 0
+                    dst = calloc(len(password)+1, sizeof(c_char))
+                    memmove(dst, cpassword, len(password))
+                    response[i].resp = dst
+                    response[i].resp_retcode = 0
             return 0
 
         # python3 ctypes prefers bytes
@@ -144,6 +146,22 @@
             if isinstance(username, str): username = username.encode(encoding)
             if isinstance(password, str): password = password.encode(encoding)
             if isinstance(service, str):  service  = service.encode(encoding)
+        else:
+            if isinstance(username, unicode):
+                username = username.encode(encoding)
+            if isinstance(password, unicode):
+                password = password.encode(encoding)
+            if isinstance(service, unicode):
+                service  = service.encode(encoding)
+
+        if b'\x00' in username or b'\x00' in password or b'\x00' in service:
+            self.code = 4  # PAM_SYSTEM_ERR in Linux-PAM
+            self.reason = 'strings may not contain NUL'
+            return False
+
+        # do this up front so we can safely throw an exception if there's
+        # anything wrong with it
+        cpassword = c_char_p(password)
 
         handle = PamHandle()
         conv   = PamConv(my_conv, 0)
@@ -152,10 +170,7 @@
         if retval != 0:
             # This is not an authentication error, something has gone wrong 
starting up PAM
             self.code   = retval
-            self.reason = pam_strerror(byref(handle), retval)
-            if sys.version_info >= (3,):
-                self.reason = self.reason.decode(encoding)
-            pam_end(handle, retval)
+            self.reason = "pam_start() failed"
             return False
 
         retval = pam_authenticate(handle, 0)
@@ -164,17 +179,25 @@
         if auth_success and resetcreds:
             retval = pam_setcred(handle, PAM_REINITIALIZE_CRED);
 
-        pam_end(handle, retval)
-
         # store information to inform the caller why we failed
         self.code   = retval
-        self.reason = pam_strerror(byref(handle), retval)
+        self.reason = pam_strerror(handle, retval)
         if sys.version_info >= (3,):
             self.reason = self.reason.decode(encoding)
 
+        if hasattr(libpam, 'pam_end'):
+            pam_end(handle, retval)
+
         return auth_success
 
 
+def authenticate(*vargs, **dargs):
+    """
+    Compatibility function for older versions of python-pam.
+    """
+    return pam().authenticate(*vargs, **dargs)
+
+
 if __name__ == "__main__":
     import readline, getpass
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/python_pam.egg-info/PKG-INFO 
new/python-pam-1.8.4/python_pam.egg-info/PKG-INFO
--- old/python-pam-1.8.2/python_pam.egg-info/PKG-INFO   2014-11-17 
20:24:27.000000000 +0100
+++ new/python-pam-1.8.4/python_pam.egg-info/PKG-INFO   2018-06-16 
08:44:38.000000000 +0200
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
 Name: python-pam
-Version: 1.8.2
+Version: 1.8.4
 Summary: Python PAM module using ctypes, py3/py2
 Home-page: https://github.com/FirefighterBlu3/python-pam
 Author: David Ford
 Author-email: da...@blue-labs.org
+Maintainer: David Ford
+Maintainer-email: da...@blue-labs.org
 License: License :: OSI Approved :: MIT License
 Download-URL: https://github.com/FirefighterBlu3/python-pam
 Description: python-pam
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/python_pam.egg-info/SOURCES.txt 
new/python-pam-1.8.4/python_pam.egg-info/SOURCES.txt
--- old/python-pam-1.8.2/python_pam.egg-info/SOURCES.txt        2014-11-17 
20:24:27.000000000 +0100
+++ new/python-pam-1.8.4/python_pam.egg-info/SOURCES.txt        2018-06-16 
08:44:38.000000000 +0200
@@ -1,3 +1,4 @@
+LICENSE
 MANIFEST.in
 README.md
 README.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/setup.cfg 
new/python-pam-1.8.4/setup.cfg
--- old/python-pam-1.8.2/setup.cfg      2014-11-17 20:24:27.000000000 +0100
+++ new/python-pam-1.8.4/setup.cfg      2018-06-16 08:44:38.000000000 +0200
@@ -1,5 +1,4 @@
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-pam-1.8.2/setup.py 
new/python-pam-1.8.4/setup.py
--- old/python-pam-1.8.2/setup.py       2014-11-17 20:21:53.000000000 +0100
+++ new/python-pam-1.8.4/setup.py       2018-06-16 08:04:51.000000000 +0200
@@ -10,14 +10,13 @@
       description      =  __sdesc,
       long_description = read('README.md'),
       py_modules       = ['pam'],
-      version          = '1.8.2',
+      version          = '1.8.4',
       author           = 'David Ford',
       author_email     = 'da...@blue-labs.org',
       maintainer       = 'David Ford',
       maintainer_email = 'da...@blue-labs.org',
       url              = 'https://github.com/FirefighterBlu3/python-pam',
       download_url     = 'https://github.com/FirefighterBlu3/python-pam',
-      bugtrack_url     = 
'https://github.com/FirefighterBlu3/python-pam/issues',
       license          = 'License :: OSI Approved :: MIT License',
       platforms        = ['i686','x86_64'],
       classifiers      = [


Reply via email to