summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorFantix King2014-05-23 19:12:02 +0800
committerFantix King2015-12-30 02:56:23 +0800
commitc3d9e4ca445b4a256ad3462fe0eb8b6aff71c25f (patch)
tree2ce37c2bd397f1e8e0b3e900cbe8e1baa9ba34fc
parentee6f7e1cbf7c15893fe95ae64299a56d6cb9f43d (diff)
downloadaur-c3d9e4ca445b4a256ad3462fe0eb8b6aff71c25f.tar.gz
1.1.8-5
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD99
-rw-r--r--__libc_lock_define_initialized.patch21
-rw-r--r--pam-1.1.8-cve-2013-7041.patch52
-rw-r--r--pam-1.1.8-cve-2014-2583.patch56
-rw-r--r--pam_unix2-glibc216.patch20
6 files changed, 211 insertions, 66 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c17644b87b5a..9770ddab386a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,27 +1,28 @@
# Generated by mksrcinfo v8
-# Tue Dec 29 18:54:59 UTC 2015
+# Tue Dec 29 18:56:07 UTC 2015
pkgbase = libx32-pam
pkgdesc = PAM (Pluggable Authentication Modules) library (x32 ABI)
- pkgver = 1.1.6
- pkgrel = 0.1
- url = http://www.kernel.org/pub/linux/libs/pam/
+ pkgver = 1.1.8
+ pkgrel = 5
+ url = http://linux-pam.org
arch = x86_64
license = GPL2
makedepends = libx32-flex
makedepends = gcc-multilib-x32
- depends = libx32-glibc
- depends = libx32-libtirpc
- depends = libx32-db
depends = libx32-cracklib
+ depends = libx32-libtirpc
depends = pam
- options = !libtool
options = !emptydirs
- source = https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-1.1.6.tar.bz2
- source = ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2/pam_unix2-2.6.tar.bz2
- source = __libc_lock_define_initialized.patch
- md5sums = 7b73e58b7ce79ffa321d408de06db2c4
- md5sums = e2788389a6c59224110a45fcff30e02b
- md5sums = 7d3c716fb7b0136e10abf57392c23bde
+ source = https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-1.1.8.tar.bz2
+ source = ftp://ftp.archlinux.org/other/pam_unix2/pam_unix2-2.9.1.tar.bz2
+ source = pam_unix2-glibc216.patch
+ source = pam-1.1.8-cve-2013-7041.patch
+ source = pam-1.1.8-cve-2014-2583.patch
+ sha256sums = c4b1f23a236d169e2496fea20721578d864ba00f7242d2b41d81050ac87a1e55
+ sha256sums = 3315747699fece4e1cc5771885d243b3e017c4c4ca1326e86228d590a840e955
+ sha256sums = 6644c5cff46878c65bdc77977becbeda392675702264bfcc7c610a45a9982574
+ sha256sums = 18034730d74f67c79feb2c6abc796442c0c548ce221b8e9d633e98a7bd3cce2c
+ sha256sums = b10255f690f9f4a8cec044383d9cd03031b9a7be9892d824b2adc451d6d06f65
pkgname = libx32-pam
diff --git a/PKGBUILD b/PKGBUILD
index 73a91ffbc282..ae7e119d4d02 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,56 +1,93 @@
-# Upstream Maintainer: josephgbr <rafael.f.f1 at gmail.com>
+# Upstream Maintainer: jtts
+# Contributor: josephgbr <rafael.f.f1 at gmail.com>
+# Contributor: Janax <janax99@yahoo.com>
+# Contributor: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: judd <jvinet@zeroflux.org>
# Maintainer: Fantix King <fantix.king at gmail.com>
-_pkgbase=pam
-pkgname=libx32-${_pkgbase}
-pkgver=1.1.6
-pkgrel=0.1
+_pkgbasename=pam
+pkgname=libx32-${_pkgbasename}
+pkgver=1.1.8
+pkgrel=5
pkgdesc="PAM (Pluggable Authentication Modules) library (x32 ABI)"
arch=('x86_64')
license=('GPL2')
-url="http://www.kernel.org/pub/linux/libs/pam/"
-depends=('libx32-glibc' 'libx32-libtirpc' 'libx32-db' 'libx32-cracklib' "${_pkgbase}")
-makedepends=('libx32-flex' 'gcc-multilib-x32')
-options=('!libtool' '!emptydirs')
-source=(https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-${pkgver}.tar.bz2
- ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2/pam_unix2-2.6.tar.bz2
- __libc_lock_define_initialized.patch)
-md5sums=('7b73e58b7ce79ffa321d408de06db2c4'
- 'e2788389a6c59224110a45fcff30e02b'
- '7d3c716fb7b0136e10abf57392c23bde')
+url="http://linux-pam.org"
+depends=(libx32-cracklib libx32-libtirpc $_pkgbasename) # pambase libx32-glibc
+makedepends=('libx32-flex' 'gcc-multilib-x32') # w3m docbook-xml>=4.4 docbook-xsl
+#backup=(etc/security/{access.conf,group.conf,limits.conf,namespace.conf,namespace.init,pam_env.conf,time.conf} etc/default/passwd etc/environment)
+source=(https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-$pkgver.tar.bz2
+ ftp://ftp.archlinux.org/other/pam_unix2/pam_unix2-2.9.1.tar.bz2
+ pam_unix2-glibc216.patch
+ pam-1.1.8-cve-2013-7041.patch
+ pam-1.1.8-cve-2014-2583.patch)
+sha256sums=('c4b1f23a236d169e2496fea20721578d864ba00f7242d2b41d81050ac87a1e55'
+ '3315747699fece4e1cc5771885d243b3e017c4c4ca1326e86228d590a840e955'
+ '6644c5cff46878c65bdc77977becbeda392675702264bfcc7c610a45a9982574'
+ '18034730d74f67c79feb2c6abc796442c0c548ce221b8e9d633e98a7bd3cce2c'
+ 'b10255f690f9f4a8cec044383d9cd03031b9a7be9892d824b2adc451d6d06f65')
+options=('!emptydirs')
+
+prepare () {
+ cd $srcdir/Linux-PAM-$pkgver
+ # fix CVEs in pam
+ patch -Np1 -i "${srcdir}/pam-1.1.8-cve-2013-7041.patch"
+ patch -Np1 -i "${srcdir}/pam-1.1.8-cve-2014-2583.patch"
+
+ # fix pam_unix2 building
+ cd $srcdir/pam_unix2-2.9.1
+ patch -Np1 -i "${srcdir}/pam_unix2-glibc216.patch"
+}
build() {
export CC='gcc -mx32'
export CXX='g++ -mx32'
export PKG_CONFIG_PATH='/usr/libx32/pkgconfig'
- cd "${srcdir}/Linux-PAM-${pkgver}"
- ./configure --libdir=/usr/libx32
+ cd $srcdir/Linux-PAM-$pkgver
+ ./configure --libdir=/usr/libx32 --sbindir=/usr/bin --with-xml-catalog=no --disable-db
make
- cd "${srcdir}/pam_unix2-2.6"
- sed -e 's|pam_syslog (pam_handle_t|pam_syslog (const pam_handle_t|g' \
- -i src/public.h src/support.c
- patch -Np1 -i ../__libc_lock_define_initialized.patch
- ./configure --libdir=/usr/libx32
+ cd $srcdir/pam_unix2-2.9.1
+ # modify flags to build against the pam compiled here, not a system lib.
+ ./configure \
+ CFLAGS="$CFLAGS -I$srcdir/Linux-PAM-$pkgver/libpam/include/" \
+ LDFLAGS="$LDFLAGS -L$srcdir/Linux-PAM-$pkgver/libpam/.libs/" \
+ --libdir=/usr/libx32 \
+ --sbindir=/usr/bin
make
}
package() {
- cd "${srcdir}/Linux-PAM-${pkgver}"
- make DESTDIR="${pkgdir}" install
-
- cd "${srcdir}/pam_unix2-2.6"
- #make DESTDIR="${pkgdir}" install
- install src/pam_unix2.so "${pkgdir}/usr/libx32/security/pam_unix2.so"
+ cd $srcdir/Linux-PAM-$pkgver
+ make DESTDIR=$pkgdir SCONFIGDIR=/etc/security install
+
+ # build pam_unix2 module
+ # source ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2
+ cd $srcdir/pam_unix2-2.9.1
+ #make DESTDIR=$pkgdir install
+ install src/pam_unix2.so $pkgdir/usr/libx32/security/pam_unix2.so
+
+ # add the realtime permissions for audio users
+ #sed -i 's|# End of file||' $pkgdir/etc/security/limits.conf
+ #cat >>$pkgdir/etc/security/limits.conf <<_EOT
+#* - rtprio 0
+#* - nice 0
+#@audio - rtprio 65
+#@audio - nice -10
+#@audio - memlock 40000
+#_EOT
# fix some missing symlinks from old pam for compatibility
- cd "${pkgdir}/usr/libx32/security"
+ cd $pkgdir/usr/libx32/security
ln -s pam_unix.so pam_unix_acct.so
ln -s pam_unix.so pam_unix_auth.so
ln -s pam_unix.so pam_unix_passwd.so
ln -s pam_unix.so pam_unix_session.so
-
+
+ # set unix_chkpwd uid
+ #chmod +s $pkgdir/usr/bin/unix_chkpwd
+
# cleanup for libx32 package
- rm -rf "${pkgdir}"/{etc,sbin,usr/{include,share}}
+ rm -rf "${pkgdir}"/{etc,usr/{include,share,bin}}
}
diff --git a/__libc_lock_define_initialized.patch b/__libc_lock_define_initialized.patch
deleted file mode 100644
index c5e72bcbbddd..000000000000
--- a/__libc_lock_define_initialized.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naur pam_unix2-2.6/src/read-files.c pam_unix2-2.6.new/src/read-files.c
---- pam_unix2-2.6/src/read-files.c 2012-07-16 00:44:08.042427627 +0200
-+++ pam_unix2-2.6.new/src/read-files.c 2012-07-16 00:38:30.643576530 +0200
-@@ -341,7 +341,7 @@
- char *buffer, size_t buflen, int *errnop)
- {
- /* Locks the static variables in this file. */
-- __libc_lock_define_initialized (static, lock)
-+ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
- enum nss_status status;
- FILE *stream = NULL;
-
-@@ -371,7 +371,7 @@
- char *buffer, size_t buflen, int *errnop)
- {
- /* Locks the static variables in this file. */
-- __libc_lock_define_initialized (static, lock)
-+ static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
- enum nss_status status;
- FILE *stream = NULL;
-
diff --git a/pam-1.1.8-cve-2013-7041.patch b/pam-1.1.8-cve-2013-7041.patch
new file mode 100644
index 000000000000..96fa9160bff9
--- /dev/null
+++ b/pam-1.1.8-cve-2013-7041.patch
@@ -0,0 +1,52 @@
+From 57a1e2b274d0a6376d92ada9926e5c5741e7da20 Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Fri, 24 Jan 2014 22:18:32 +0000
+Subject: [PATCH] pam_userdb: fix password hash comparison
+
+Starting with commit Linux-PAM-0-77-28-g0b3e583 that introduced hashed
+passwords support in pam_userdb, hashes are compared case-insensitively.
+This bug leads to accepting hashes for completely different passwords in
+addition to those that should be accepted.
+
+Additionally, commit Linux-PAM-1_1_6-13-ge2a8187 that added support for
+modern password hashes with different lengths and settings, did not
+update the hash comparison accordingly, which leads to accepting
+computed hashes longer than stored hashes when the latter is a prefix
+of the former.
+
+* modules/pam_userdb/pam_userdb.c (user_lookup): Reject the computed
+hash whose length differs from the stored hash length.
+Compare computed and stored hashes case-sensitively.
+Fixes CVE-2013-7041.
+
+Bug-Debian: http://bugs.debian.org/731368
+---
+ modules/pam_userdb/pam_userdb.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/modules/pam_userdb/pam_userdb.c b/modules/pam_userdb/pam_userdb.c
+index de8b5b1..ff040e6 100644
+--- a/modules/pam_userdb/pam_userdb.c
++++ b/modules/pam_userdb/pam_userdb.c
+@@ -222,12 +222,15 @@ user_lookup (pam_handle_t *pamh, const char *database, const char *cryptmode,
+ } else {
+ cryptpw = crypt (pass, data.dptr);
+
+- if (cryptpw) {
+- compare = strncasecmp (data.dptr, cryptpw, data.dsize);
++ if (cryptpw && strlen(cryptpw) == (size_t)data.dsize) {
++ compare = memcmp(data.dptr, cryptpw, data.dsize);
+ } else {
+ compare = -2;
+ if (ctrl & PAM_DEBUG_ARG) {
+- pam_syslog(pamh, LOG_INFO, "crypt() returned NULL");
++ if (cryptpw)
++ pam_syslog(pamh, LOG_INFO, "lengths of computed and stored hashes differ");
++ else
++ pam_syslog(pamh, LOG_INFO, "crypt() returned NULL");
+ }
+ };
+
+--
+1.8.3.1
+
diff --git a/pam-1.1.8-cve-2014-2583.patch b/pam-1.1.8-cve-2014-2583.patch
new file mode 100644
index 000000000000..f2aa2de8cba5
--- /dev/null
+++ b/pam-1.1.8-cve-2014-2583.patch
@@ -0,0 +1,56 @@
+From 9dcead87e6d7f66d34e7a56d11a30daca367dffb Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Wed, 26 Mar 2014 22:17:23 +0000
+Subject: [PATCH] pam_timestamp: fix potential directory traversal issue
+ (ticket #27)
+
+pam_timestamp uses values of PAM_RUSER and PAM_TTY as components of
+the timestamp pathname it creates, so extra care should be taken to
+avoid potential directory traversal issues.
+
+* modules/pam_timestamp/pam_timestamp.c (check_tty): Treat
+"." and ".." tty values as invalid.
+(get_ruser): Treat "." and ".." ruser values, as well as any ruser
+value containing '/', as invalid.
+
+Fixes CVE-2014-2583.
+
+Reported-by: Sebastian Krahmer <krahmer@suse.de>
+---
+ modules/pam_timestamp/pam_timestamp.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c
+index 5193733..b3f08b1 100644
+--- a/modules/pam_timestamp/pam_timestamp.c
++++ b/modules/pam_timestamp/pam_timestamp.c
+@@ -158,7 +158,7 @@ check_tty(const char *tty)
+ tty = strrchr(tty, '/') + 1;
+ }
+ /* Make sure the tty wasn't actually a directory (no basename). */
+- if (strlen(tty) == 0) {
++ if (!strlen(tty) || !strcmp(tty, ".") || !strcmp(tty, "..")) {
+ return NULL;
+ }
+ return tty;
+@@ -243,6 +243,17 @@ get_ruser(pam_handle_t *pamh, char *ruserbuf, size_t ruserbuflen)
+ if (pwd != NULL) {
+ ruser = pwd->pw_name;
+ }
++ } else {
++ /*
++ * This ruser is used by format_timestamp_name as a component
++ * of constructed timestamp pathname, so ".", "..", and '/'
++ * are disallowed to avoid potential path traversal issues.
++ */
++ if (!strcmp(ruser, ".") ||
++ !strcmp(ruser, "..") ||
++ strchr(ruser, '/')) {
++ ruser = NULL;
++ }
+ }
+ if (ruser == NULL || strlen(ruser) >= ruserbuflen) {
+ *ruserbuf = '\0';
+--
+1.8.3.1
+
diff --git a/pam_unix2-glibc216.patch b/pam_unix2-glibc216.patch
new file mode 100644
index 000000000000..faa6a235f6ac
--- /dev/null
+++ b/pam_unix2-glibc216.patch
@@ -0,0 +1,20 @@
+Index: pam_unix2-2.9.1/src/read-files.c
+===================================================================
+--- pam_unix2-2.9.1.orig/src/read-files.c
++++ pam_unix2-2.9.1/src/read-files.c
+@@ -30,8 +30,14 @@
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <nss.h>
+-#include <bits/libc-lock.h>
++#include <pthread.h>
+ #define __libc_lock_t pthread_mutex_t
++#define __libc_lock_define_initialized(CLASS,NAME) \
++ CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
++#define __libc_lock_lock(NAME) \
++ pthread_mutex_lock, (&(NAME))
++#define __libc_lock_unlock(NAME) \
++ pthread_mutex_unlock, (&(NAME))
+
+ #include "read-files.h"
+