Skip to contentSkip to conversation

package: add python-pam

PATCH New Peter Korsgaard 2 participants 3 messages Dec 3, 2014 – Dec 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package: add python-pam

Upstream is no longer available, so get the tarball + important patches from Fedora.

---
v1 missed dealloc patch.

 package/Config.in                                  |   1 +
 package/python-pam/0001-dealloc.patch              |  25 ++++
 package/python-pam/0002-nofree.patch               |  68 +++++++++++
 .../0003-memory-errors-CVE2012-1502.patch          | 136 +++++++++++++++++++++
 package/python-pam/Config.in                       |  15 +++
 package/python-pam/python-pam.mk                   |  16 +++
 6 files changed, 261 insertions(+)
 create mode 100644 package/python-pam/0001-dealloc.patch
 create mode 100644 package/python-pam/0002-nofree.patch
 create mode 100644 package/python-pam/0003-memory-errors-CVE2012-1502.patch
 create mode 100644 package/python-pam/Config.in
 create mode 100644 package/python-pam/python-pam.mk
package/Config.in +1 -0
index b8fc7d1..f4f0998 100644
@@ -511,6 +511,7 @@ menu "external python modules"
 	source "package/python-networkmanager/Config.in"
 	source "package/python-nfc/Config.in"
 	source "package/python-numpy/Config.in"
+	source "package/python-pam/Config.in"
 	source "package/python-posix-ipc/Config.in"
 	source "package/python-protobuf/Config.in"
 	source "package/python-pyasn/Config.in"
package/python-pam/0001-dealloc.patch new file +25 -0
new file mode 100644
index 0000000..dd4f961
@@ -0,0 +1,25 @@
+[PATCH] fix two bugs in the PAM object deallocation
+
+Fixes https://bugzilla.redhat.com/show_bug.cgi?id=658955
+
+Downloaded from:
+http://pkgs.fedoraproject.org/cgit/PyPAM.git/plain/PyPAM-0.5.0-dealloc.patch
+
+Signed-off-by: Peter Korsgaard <[email protected]>
+diff -up PyPAM-0.5.0/PAMmodule.c.dealloc PyPAM-0.5.0/PAMmodule.c
+--- PyPAM-0.5.0/PAMmodule.c.dealloc	2011-01-17 22:48:22.000000000 +0100
++++ PyPAM-0.5.0/PAMmodule.c	2011-01-18 21:24:59.000000000 +0100
+@@ -538,10 +538,11 @@ static void PyPAM_dealloc(PyPAMObject *s
+     free(self->service);
+     free(self->user);
+     free(self->conv);
+-    pam_end(self->pamh, PAM_SUCCESS);
++    if (self->pamh)
++        pam_end(self->pamh, PAM_SUCCESS);
+     dlclose(self->dlh2);
+     dlclose(self->dlh1);
+-    PyMem_DEL(self);
++    PyObject_Del(self);
+ }
+ 
+ static PyObject * PyPAM_getattr(PyPAMObject *self, char *name)
package/python-pam/0002-nofree.patch new file +68 -0

68 lines not on this page · raw message

package/python-pam/0003-memory-errors-CVE2012-1502.patch new file +136 -0

136 lines not on this page · raw message

package/python-pam/Config.in new file +15 -0
new file mode 100644
index 0000000..b2ab6c8
@@ -0,0 +1,15 @@
+comment "python-pam needs a toolchain w/ wchar, locale, dynamic library"
+	depends on BR2_PACKAGE_PYTHON
+	depends on !BR2_ENABLE_LOCALE || !BR2_USE_WCHAR || BR2_PREFER_STATIC_LIB
+
+config BR2_PACKAGE_PYTHON_PAM
+	bool "python-pam"
+	depends on BR2_PACKAGE_PYTHON # C extension not compatible with python3
+	depends on BR2_ENABLE_LOCALE # linux-pam
+	depends on BR2_USE_WCHAR # linux-pam
+	depends on !BR2_PREFER_STATIC_LIB # linux-pam
+	select BR2_PACKAGE_LINUX_PAM
+	help
+	  PAM (Pluggable Authentication Module) bindings for Python.
+
+	  https://admin.fedoraproject.org/pkgdb/package/PyPAM/
package/python-pam/python-pam.mk new file +16 -0
new file mode 100644
index 0000000..1e8a593
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-pam
+#
+################################################################################
+
+PYTHON_PAM_VERSION = 0.5.0
+PYTHON_PAM_SOURCE = PyPAM-$(PYTHON_PAM_VERSION).tar.gz
+# pangalactic.org gone
+PYTHON_PAM_SITE = http://pkgs.fedoraproject.org/repo/pkgs/PyPAM/PyPAM-0.5.0.tar.gz/f1e7c2c56421dda28a75ace59a3c8871/
+PYTHON_PAM_SETUP_TYPE = distutils
+PYTHON_PAM_LICENSE = LGPLv2.1
+PYTHON_PAM_LICENSE_FILES = COPYING
+PYTHON_PAM_DEPENDENCIES = linux-pam
+
+$(eval $(python-package))
Signature · 1 line
2.1.3
#1 lore raw

PATCH v2 1/1 package: add python-pam

Dear Peter Korsgaard,

Quoted 7 lines · Peter Korsgaard

Upstream is no longer available, so get the tarball + important patches from Fedora.

---
v1 missed dealloc patch.

Quoted 12 lines
 package/Config.in                                  |   1 +
 package/python-pam/0001-dealloc.patch              |  25 ++++
 package/python-pam/0002-nofree.patch               |  68 +++++++++++
 .../0003-memory-errors-CVE2012-1502.patch          | 136 +++++++++++++++++++++
 package/python-pam/Config.in                       |  15 +++
 package/python-pam/python-pam.mk                   |  16 +++
 6 files changed, 261 insertions(+)
 create mode 100644 package/python-pam/0001-dealloc.patch
 create mode 100644 package/python-pam/0002-nofree.patch
 create mode 100644 package/python-pam/0003-memory-errors-CVE2012-1502.patch
 create mode 100644 package/python-pam/Config.in
 create mode 100644 package/python-pam/python-pam.mk

It's a little bit annoying to package stuff for which there is no upstream available anymore, but oh well.

(code reviewed, license checked, built and runtime tested on ARM/uClibc)

Note however that the commit title for package additions should normally be "<pkg>: new package", but it can be fixed while applying, of course :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 package: add python-pam

In reply to Peter Korsgaard

Dear Peter Korsgaard,

Quoted 4 lines · Peter Korsgaard

Upstream is no longer available, so get the tarball + important patches from Fedora.

Applied after tweaking the commit title. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com