--- pam-http-3.orig/pam_http.c +++ pam-http-3/pam_http.c @@ -34,10 +34,13 @@ static size_t nop_wf(void* a, size_t x, size_t y, void* b) { return x * y; } /* nop password ask function */ +/* only defined when needed, otherwise a warning is issued, treated as an error */ +#ifdef CURLOPT_PASSWDFUNCTION static int my_getpass(void *client, char *prompt, char *buffer, int buflen) { buffer[0] = '\0'; return 0; } +#endif static int geturl(const char *url, const char *username, const char *password, const char *cafile) @@ -64,7 +67,9 @@ /* return an empty password if none supplied instead of the default behavior, which is to fuck with the tty and half-assedly ask the user for a password from somewhere in the guts of libcURL */ +#ifdef CURLOPT_PASSWDFUNCTION curl_easy_setopt(curl, CURLOPT_PASSWDFUNCTION, my_getpass); +#endif /* seed SSL randomness from somewhere; this is really problematic because libcurl wants to read 16 kilobytes of randomness. (Why --- pam-http-3.orig/pam.d/check_user +++ pam-http-3/pam.d/check_user @@ -1,8 +1,9 @@ +# /etc/pam.d/check_user # -# /etc/pam.d/check_user - for Kragen's check_user program -# - -auth required /home/kragen/devel/pam_http/pam_http.so url=http://localhost/~kragen/sekrit/ -account required pam_permit.so -password required pam_permit.so -session required pam_permit.so +# the url parameter is necessary +# and the cafile parameter is optional +# the subsequent lines just enable check_user to function +auth required pam_http.so url= [cafile=/path/to/cacert.pem] +account required pam_permit.so +password required pam_permit.so +session required pam_permit.so --- pam-http-3.orig/debian/changelog +++ pam-http-3/debian/changelog @@ -0,0 +1,14 @@ +pam-http (3-1.1) unstable; urgency=low + + * Non-maintainer upload. + * Make my_getpass() definition and usage through curl_easy_setopt() + conditional, depending on CURLOPT_PASSWDFUNCTION (Closes: #423444). + + -- Cyril Brulebois Sat, 18 Aug 2007 22:40:28 +0000 + +pam-http (3-1) unstable; urgency=low + + * Initial release + + -- Anand Kumria Thu, 9 Mar 2006 18:54:20 +1100 + --- pam-http-3.orig/debian/copyright +++ pam-http-3/debian/copyright @@ -0,0 +1,27 @@ +This package was debianized by Anand Kumria on +Thu, 9 Mar 2006 18:54:20 +1100. + +It was downloaded from + + +Copyright Holder: Kragen Sitaker + +License: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,MA 02110-1301, USA. + + +For a full copy of the text for GNU GPL please see +/usr/share/common-licenses/GPL --- pam-http-3.orig/debian/dirs +++ pam-http-3/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +lib/security --- pam-http-3.orig/debian/README.Debian +++ pam-http-3/debian/README.Debian @@ -0,0 +1,10 @@ +pam_http for Debian +------------------- + +In order to make use of pam_http.so you will need to configure an appropriate +entry in /etc/pam.d/. + +A test application, check_user, is provided. As is a check_user example +PAM configuration file you can install in /etc/pam.d + +-- Anand Kumria , Thu Mar 9 19:20 2006 --- pam-http-3.orig/debian/compat +++ pam-http-3/debian/compat @@ -0,0 +1 @@ +4 --- pam-http-3.orig/debian/control +++ pam-http-3/debian/control @@ -0,0 +1,20 @@ +Source: pam-http +Priority: extra +Maintainer: Anand Kumria +Build-Depends: debhelper (>= 4.0.0), libpam0g-dev, libcurl3-dev +Standards-Version: 3.6.2 +Section: libs + +Package: libpam-http +Section: admin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: a PAM module to authenticate via http/https + This lets you check passwords against a HTTP server such as Apache. + . + This can be useful because: + - most web servers supports lots of authentication mechanisms + (for example, Apache supports over 26) + - HTTP can be transparently load-balanced + - you can authenticate to a server anywhere in the world + (HTTP is generally accessible from behind firewalls) --- pam-http-3.orig/debian/docs +++ pam-http-3/debian/docs @@ -0,0 +1 @@ +README --- pam-http-3.orig/debian/rules +++ pam-http-3/debian/rules @@ -0,0 +1,107 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + + + + +CFLAGS = -Wall -g + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# shared library versions, option 1 +version=2.0.5 +major=2 +# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so +#version=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` +#major=`ls src/.libs/lib*.so.* | \ +# awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + + touch configure-stamp + + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/libpam-http + #$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp + install -m 0644 -D pam_http.so $(CURDIR)/debian/libpam-http/lib/security/pam_http.so + install -D check_user $(CURDIR)/debian/libpam-http/usr/bin/check_user + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples pam.d/check_user +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure