aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2010-06-08 17:02:00 -0700
committerKhem Raj <raj.khem@gmail.com>2010-06-08 17:05:08 -0700
commit0298bf1934f6c7d267c6ceaa87b6993489310702 (patch)
treee00daa30a94a944a599655fdd6b5eecd85a1ec6a
parent0abf974adf800b52e22d015a42baf3babcb51e43 (diff)
downloadopenembedded-0298bf1934f6c7d267c6ceaa87b6993489310702.tar.gz
openembedded-0298bf1934f6c7d267c6ceaa87b6993489310702.tar.bz2
openembedded-0298bf1934f6c7d267c6ceaa87b6993489310702.zip
libpam-1.1.1: Add recipe.
* Tested build on arm*uclibc Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes/pam/libpam-1.1.1/Linux-PAM-1.1.0-uclibc.patch82
-rw-r--r--recipes/pam/libpam-1.1.1/define-HAVE_DBM.patch12
-rw-r--r--recipes/pam/libpam-1.1.1/disable_modules_uclibc.patch16
-rw-r--r--recipes/pam/libpam-1.1.1/pam-nodocs.patch35
-rw-r--r--recipes/pam/libpam_1.1.1.bb76
5 files changed, 221 insertions, 0 deletions
diff --git a/recipes/pam/libpam-1.1.1/Linux-PAM-1.1.0-uclibc.patch b/recipes/pam/libpam-1.1.1/Linux-PAM-1.1.0-uclibc.patch
new file mode 100644
index 0000000000..6b8fa25f8f
--- /dev/null
+++ b/recipes/pam/libpam-1.1.1/Linux-PAM-1.1.0-uclibc.patch
@@ -0,0 +1,82 @@
+Index: Linux-PAM-1.1.0/modules/pam_pwhistory/opasswd.c
+===================================================================
+--- Linux-PAM-1.1.0.orig/modules/pam_pwhistory/opasswd.c
++++ Linux-PAM-1.1.0/modules/pam_pwhistory/opasswd.c
+@@ -94,6 +94,23 @@ parse_entry (char *line, opwd *data)
+ return 0;
+ }
+
++static int
++compare_password(const char *newpass, const char *oldpass)
++{
++ char *outval;
++#ifdef HAVE_CRYPT_R
++ struct crypt_data output;
++
++ output.initialized = 0;
++
++ outval = crypt_r (newpass, oldpass, &output);
++#else
++ outval = crypt (newpass, oldpass);
++#endif
++
++ return strcmp(outval, oldpass) == 0;
++}
++
+ /* Check, if the new password is already in the opasswd file. */
+ int
+ check_old_password (pam_handle_t *pamh, const char *user,
+@@ -167,12 +184,9 @@ check_old_password (pam_handle_t *pamh,
+ if (found)
+ {
+ const char delimiters[] = ",";
+- struct crypt_data output;
+ char *running;
+ char *oldpass;
+
+- memset (&output, 0, sizeof (output));
+-
+ running = strdupa (entry.old_passwords);
+ if (running == NULL)
+ return PAM_BUF_ERR;
+@@ -180,7 +194,7 @@ check_old_password (pam_handle_t *pamh,
+ do {
+ oldpass = strsep (&running, delimiters);
+ if (oldpass && strlen (oldpass) > 0 &&
+- strcmp (crypt_r (newpass, oldpass, &output), oldpass) == 0)
++ compare_password(newpass, oldpass) )
+ {
+ if (debug)
+ pam_syslog (pamh, LOG_DEBUG, "New password already used");
+Index: Linux-PAM-1.1.0/configure.in
+===================================================================
+--- Linux-PAM-1.1.0.orig/configure.in
++++ Linux-PAM-1.1.0/configure.in
+@@ -458,7 +458,7 @@ AC_FUNC_MEMCMP
+ AC_FUNC_VPRINTF
+ AC_CHECK_FUNCS(fseeko gethostname gettimeofday lckpwdf mkdir select)
+ AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
+-AC_CHECK_FUNCS(getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
++AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
+ AC_CHECK_FUNCS(getgrouplist getline getdelim)
+ AC_CHECK_FUNCS(inet_ntop inet_pton ruserok_af)
+
+Index: Linux-PAM-1.1.0/modules/pam_timestamp/pam_timestamp.c
+===================================================================
+--- Linux-PAM-1.1.0.orig/modules/pam_timestamp/pam_timestamp.c
++++ Linux-PAM-1.1.0/modules/pam_timestamp/pam_timestamp.c
+@@ -200,7 +200,13 @@ check_login_time(const char *ruser, time
+ time_t oldest_login = 0;
+
+ setutent();
+- while(!getutent_r(&utbuf, &ut)) {
++ while(
++#ifdef HAVE_GETUTENT_R
++ !getutent_r(&utbuf, &ut)
++#else
++ (ut = getutent()) != NULL
++#endif
++ ) {
+ if (ut->ut_type != USER_PROCESS) {
+ continue;
+ }
diff --git a/recipes/pam/libpam-1.1.1/define-HAVE_DBM.patch b/recipes/pam/libpam-1.1.1/define-HAVE_DBM.patch
new file mode 100644
index 0000000000..eceb67dc3b
--- /dev/null
+++ b/recipes/pam/libpam-1.1.1/define-HAVE_DBM.patch
@@ -0,0 +1,12 @@
+Index: Linux-PAM-1.1.0/modules/pam_userdb/pam_userdb.c
+===================================================================
+--- Linux-PAM-1.1.0.orig/modules/pam_userdb/pam_userdb.c 2010-06-08 14:19:25.147555285 -0700
++++ Linux-PAM-1.1.0/modules/pam_userdb/pam_userdb.c 2010-06-08 14:20:50.707692049 -0700
+@@ -30,6 +30,7 @@
+ #else
+ # ifdef HAVE_DB_H
+ # define DB_DBM_HSEARCH 1 /* use the dbm interface */
++# define HAVE_DBM /* for BerkDB 5.0 and later */
+ # include <db.h>
+ # else
+ # error "failed to find a libdb or equivalent"
diff --git a/recipes/pam/libpam-1.1.1/disable_modules_uclibc.patch b/recipes/pam/libpam-1.1.1/disable_modules_uclibc.patch
new file mode 100644
index 0000000000..14cc60aacd
--- /dev/null
+++ b/recipes/pam/libpam-1.1.1/disable_modules_uclibc.patch
@@ -0,0 +1,16 @@
+Index: Linux-PAM-1.1.0/modules/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.0.orig/modules/Makefile.am 2008-11-28 15:29:12.000000000 +0100
++++ Linux-PAM-1.1.0/modules/Makefile.am 2009-11-24 22:28:13.248314306 +0100
+@@ -7,9 +7,9 @@
+ pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
+ pam_listfile pam_localuser pam_loginuid pam_mail \
+ pam_mkhomedir pam_motd pam_namespace pam_nologin \
+- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \
++ pam_permit pam_rhosts pam_rootok pam_securetty \
+ pam_selinux pam_sepermit pam_shells pam_stress \
+- pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
++ pam_succeed_if pam_tally pam_tally2 pam_time \
+ pam_tty_audit pam_umask \
+ pam_unix pam_userdb pam_warn pam_wheel pam_xauth
+
diff --git a/recipes/pam/libpam-1.1.1/pam-nodocs.patch b/recipes/pam/libpam-1.1.1/pam-nodocs.patch
new file mode 100644
index 0000000000..895f0e182a
--- /dev/null
+++ b/recipes/pam/libpam-1.1.1/pam-nodocs.patch
@@ -0,0 +1,35 @@
+--- /tmp/Makefile.am 2008-09-05 15:16:21.000000000 +0200
++++ Linux-PAM-1.0.2/Makefile.am 2008-09-05 15:16:56.153198000 +0200
+@@ -5,9 +5,9 @@
+ AUTOMAKE_OPTIONS = 1.9 gnu dist-bzip2 check-news
+
+ if STATIC_MODULES
+-SUBDIRS = modules libpam libpamc libpam_misc tests po conf doc examples xtests
++SUBDIRS = modules libpam libpamc libpam_misc tests po conf examples xtests
+ else
+-SUBDIRS = libpam tests libpamc libpam_misc modules po conf doc examples xtests
++SUBDIRS = libpam tests libpamc libpam_misc modules po conf examples xtests
+ endif
+
+ CLEANFILES = *~
+@@ -28,19 +28,7 @@
+
+ ACLOCAL_AMFLAGS = -I m4
+
+-release: dist releasedocs
+-
+-release-docs: releasedocs
+-
+-releasedocs:
+- rm -rf Linux-PAM-$(VERSION)
+- mkdir -p Linux-PAM-$(VERSION)/doc
+- make -C doc releasedocs
+- tar zfc Linux-PAM-$(VERSION)-docs.tar.gz \
+- Linux-PAM-$(VERSION)/doc
+- tar jfc Linux-PAM-$(VERSION)-docs.tar.bz2 \
+- Linux-PAM-$(VERSION)/doc
+- rm -rf Linux-PAM-$(VERSION)
++release: dist
+
+ xtests:
+ make -C xtests xtests
diff --git a/recipes/pam/libpam_1.1.1.bb b/recipes/pam/libpam_1.1.1.bb
new file mode 100644
index 0000000000..10fd7423c9
--- /dev/null
+++ b/recipes/pam/libpam_1.1.1.bb
@@ -0,0 +1,76 @@
+DESCRIPTION = "\
+PAM authentication library for Linux. \
+Linux-PAM (Pluggable Authentication Modules for Linux) is a \
+library that enables the local system administrator to choose \
+how individual applications authenticate users. For an \
+overview of the Linux-PAM library see the Linux-PAM System \
+Administrators' Guide."
+HOMEPAGE = "http://kernel.org/pub/linux/libs/pam"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "GPLv2"
+
+DEPENDS = "flex flex-native"
+
+# PAM is not a lot of use without configuration files and the plugins
+RRECOMMENDS_${PN} = "libpam-meta libpam-base-files"
+
+PR = "r0"
+
+# The project is actually called Linux-PAM but that gives
+# a bad OE package name because of the upper case characters
+pn = "Linux-PAM"
+p = "${pn}-${PV}"
+S = "${WORKDIR}/${p}"
+
+SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/pam/library/${p}.tar.bz2 \
+ file://pam-nodocs.patch \
+ file://define-HAVE_DBM.patch \
+ "
+
+UCLIBC_PATCHES = " file://Linux-PAM-1.1.0-uclibc.patch \
+ file://disable_modules_uclibc.patch \
+ "
+
+SRC_URI_append_linux-uclibc = ${UCLIBC_PATCHES}
+SRC_URI_append_linux-uclibceabi = ${UCLIBC_PATCHES}
+
+inherit autotools gettext
+
+LEAD_SONAME = "libpam.so.*"
+
+# maintain the pam default layout
+EXTRA_OECONF += " --includedir=${includedir}/security"
+
+PACKAGES_DYNAMIC += " libpam-meta pam-plugin-*"
+
+python populate_packages_prepend () {
+ import os.path
+
+ pam_libdir = bb.data.expand('${libdir}/security', d)
+ pam_libdirdebug = bb.data.expand('${libdir}/security/.debug', d)
+ pam_filterdir = bb.data.expand('${libdir}/security/pam_filter', d)
+ do_split_packages(d, pam_libdir, '^pam(.*)\.so$', 'pam-plugin%s', 'PAM plugin for %s', extra_depends='')
+ do_split_packages(d, pam_libdir, '^pam(.*)\.la$', 'pam-plugin%s-dev', 'PAM plugin for %s dev', extra_depends='')
+ if os.path.exists(pam_libdirdebug):
+ do_split_packages(d, pam_libdirdebug, '^pam(.*)\.so$', 'pam-plugin%s-dbg', 'PAM plugin for %s debugging symbols', extra_depends='')
+ do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
+
+ pn = bb.data.getVar('PN', d, 1)
+ metapkg = pn + '-meta'
+ bb.data.setVar('ALLOW_EMPTY_' + metapkg, "1", d)
+ bb.data.setVar('FILES_' + metapkg, "", d)
+ blacklist = [ pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc' ]
+ metapkg_rdepends = []
+ packages = bb.data.getVar('PACKAGES', d, 1).split()
+ for pkg in packages[1:]:
+ if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.count('locale') and pkg.count('plugin'):
+ metapkg_rdepends.append(pkg)
+ bb.data.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends), d)
+ bb.data.setVar('DESCRIPTION_' + metapkg, pn + ' meta package', d)
+ packages.append(metapkg)
+ bb.data.setVar('PACKAGES', ' '.join(packages), d)
+}
+SRC_URI[md5sum] = "9b3d952b173d5b9836cbc7e8de108bee"
+SRC_URI[sha256sum] = "608d3eb9d7a5e1a7505fff62e6a583fdb6e52dc05bf54dc9661c5f395b1fb904"
+