summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul de Vrieze <pauldv@gentoo.org>2011-02-28 17:09:25 +0000
committerPaul de Vrieze <pauldv@gentoo.org>2011-02-28 17:09:25 +0000
commitcbe99ffc387372c14411ac81c67c29c4a9e3fe51 (patch)
tree2ec6581e87df29083e8aa05f0a52c9667f126126
parentRemove icemon for now. It doesn't work anymore and would need to be ported to... (diff)
downloadpauldv-cbe99ffc387372c14411ac81c67c29c4a9e3fe51.tar.gz
pauldv-cbe99ffc387372c14411ac81c67c29c4a9e3fe51.tar.bz2
pauldv-cbe99ffc387372c14411ac81c67c29c4a9e3fe51.zip
Add pam_google_authenticator from Matsuu's overlay. But patch it to return better error codes and the ebuild now supports user patching.
svn path=/trunk/overlay/; revision=128
-rw-r--r--sys-auth/pam_google_authenticator/Manifest3
-rw-r--r--sys-auth/pam_google_authenticator/files/exit_codes.patch19
-rw-r--r--sys-auth/pam_google_authenticator/files/pam_google_authenticator-9999-as-needed.patch16
-rw-r--r--sys-auth/pam_google_authenticator/pam_google_authenticator-9999.ebuild41
4 files changed, 79 insertions, 0 deletions
diff --git a/sys-auth/pam_google_authenticator/Manifest b/sys-auth/pam_google_authenticator/Manifest
new file mode 100644
index 0000000..15d8d79
--- /dev/null
+++ b/sys-auth/pam_google_authenticator/Manifest
@@ -0,0 +1,3 @@
+AUX exit_codes.patch 585 RMD160 cc80a8b35e1dfe7d6b7f88c3b577dafddfd99d0d SHA1 1a375a77c8e40d01502f8efd4c9cb8b9152fc2d7 SHA256 61d990c48f77757c668dc12b6c3131001151210c1061d1a2664c1f2f49d5e756
+AUX pam_google_authenticator-9999-as-needed.patch 687 RMD160 50ab6fa5a99f5eaa6ecf7a644d65006e76eded55 SHA1 e71b2ea78db3b6d5d0e03595f3af90cbc9c020f1 SHA256 7c0967ad9102b916e4f260dc72fd9a9caa8b4464cd5fc8f1d082453ca5b163d4
+EBUILD pam_google_authenticator-9999.ebuild 911 RMD160 ce98bc94c42eb24022cae6e7246a1daccd34ee76 SHA1 bbc26986b7d0d8cb54842a9ddd7f71d654940125 SHA256 80fda768aa3ce438b18c677af7f0a344be9a4f232b68cbcbf6bd83bb8d465217
diff --git a/sys-auth/pam_google_authenticator/files/exit_codes.patch b/sys-auth/pam_google_authenticator/files/exit_codes.patch
new file mode 100644
index 0000000..ffb304f
--- /dev/null
+++ b/sys-auth/pam_google_authenticator/files/exit_codes.patch
@@ -0,0 +1,19 @@
+diff -r 2b7e90a4d3ce libpam/pam_google_authenticator.c
+--- a/libpam/pam_google_authenticator.c Wed Feb 23 16:29:42 2011 -0800
++++ b/libpam/pam_google_authenticator.c Mon Feb 28 16:22:32 2011 +0000
+@@ -568,6 +568,15 @@
+ // If nothing matched, display an error message
+ if (rc != PAM_SUCCESS) {
+ log_message(LOG_ERR, pamh, "Invalid verification code");
++ rc = PAM_PERM_DENIED;
++ }
++ } else {
++ if (username) {
++ if (fd<0) {
++ rc = PAM_CRED_UNAVAIL;
++ } else if (buf==NULL || secret==NULL) {
++ rc = PAM_AUTHTOK_ERR;
++ }
+ }
+ }
+
diff --git a/sys-auth/pam_google_authenticator/files/pam_google_authenticator-9999-as-needed.patch b/sys-auth/pam_google_authenticator/files/pam_google_authenticator-9999-as-needed.patch
new file mode 100644
index 0000000..02422cc
--- /dev/null
+++ b/sys-auth/pam_google_authenticator/files/pam_google_authenticator-9999-as-needed.patch
@@ -0,0 +1,16 @@
+diff -r 74cba81d489b libpam/Makefile
+--- a/libpam/Makefile Sun Sep 19 10:37:52 2010 -0700
++++ b/libpam/Makefile Tue Nov 23 10:50:15 2010 +0900
+@@ -35,10 +35,10 @@
+ $(RM) *.o *.so google-authenticator pam_google_authenticator_unittest
+
+ google-authenticator: google-authenticator.o base32.o hmac.o sha1.o
+- $(CC) -g $(LDFLAGS) -ldl -o $@ $+
++ $(CC) -g $(LDFLAGS) -rdynamic -o $@ $+ -ldl
+
+ pam_google_authenticator_unittest: pam_google_authenticator_unittest.o base32.o
+- $(CC) -g $(LDFLAGS) -rdynamic -ldl -lc -o $@ $+
++ $(CC) -g $(LDFLAGS) -rdynamic -o $@ $+ -ldl -lc
+
+ pam_google_authenticator.so: base32.o hmac.o sha1.o
+ pam_google_authenticator_testing.so: base32.o hmac.o sha1.o
diff --git a/sys-auth/pam_google_authenticator/pam_google_authenticator-9999.ebuild b/sys-auth/pam_google_authenticator/pam_google_authenticator-9999.ebuild
new file mode 100644
index 0000000..7c8be13
--- /dev/null
+++ b/sys-auth/pam_google_authenticator/pam_google_authenticator-9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="3"
+inherit eutils base mercurial pam toolchain-funcs
+
+DESCRIPTION="Example PAM module demonstrating two-factor authentication"
+HOMEPAGE="http://code.google.com/p/google-authenticator/"
+SRC_URI=""
+EHG_REPO_URI="https://google-authenticator.googlecode.com/hg/libpam/"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RESTRICT="test"
+
+DEPEND="sys-libs/pam"
+RDEPEND="${DEPEND}
+ media-gfx/qrencode"
+PATCHES="${FILESDIR}/${P}-as-needed.patch ${FILESDIR}/exit_codes.patch"
+
+S="${WORKDIR}/libpam"
+
+src_unpack() {
+ mercurial_fetch "${EHG_REPO_URI}" "$(basename "${EHG_REPO_URI}")" "${WORKDIR}"
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ dopammod pam_google_authenticator.so || die
+
+ dobin google-authenticator || die
+
+ dodoc README FILEFORMAT || die
+}