From 476703f669d8795ffe7684d1d400191545ce6f6f Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Mon, 6 Jan 2014 15:27:07 +0800 Subject: Sample config and .spec file. --- authnz_pam.conf | 22 +++++++++++++++++++ mod_authnz_pam.spec | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 authnz_pam.conf create mode 100644 mod_authnz_pam.spec diff --git a/authnz_pam.conf b/authnz_pam.conf new file mode 100644 index 0000000..41cb70d --- /dev/null +++ b/authnz_pam.conf @@ -0,0 +1,22 @@ + +# LoadModule authnz_pam_module modules/mod_authnz_pam.so +# +# +# AuthType Basic +# AuthName "private area" +# AuthBasicProvider PAM +# AuthPAMService webapp +# Require valid-user +# +# +# +# AuthType Kerberos +# AuthName "Kerberos Login" +# KrbMethodNegotiate On +# KrbMethodK5Passwd Off +# KrbAuthRealms EXAMPLE.COM +# Krb5KeyTab /etc/http.keytab +# KrbLocalUserMapping On +# Require pam-account webapp +# + diff --git a/mod_authnz_pam.spec b/mod_authnz_pam.spec new file mode 100644 index 0000000..9178823 --- /dev/null +++ b/mod_authnz_pam.spec @@ -0,0 +1,61 @@ +%{!?_httpd_apxs: %{expand: %%global _httpd_apxs %%{_sbindir}/apxs}} +%{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}} +# /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4 +%{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}} +%{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}} + +Summary: PAM Basic Authentication provider and authorization checker +Name: mod_authnz_pam +Version: 0.5 +Release: 1%{?dist} +License: ASL 2.0 +Group: System Environment/Daemons +URL: http://www.adelton.com/apache/mod_authnz_pam/ +Source0: http://www.adelton.com/apache/mod_authnz_pam/%{name}-%{version}.tar.gz +BuildRequires: httpd-devel +BuildRequires: pam-devel +BuildRequires: pkgconfig +Requires(pre): httpd +Requires: httpd +Requires: pam + +# Suppres auto-provides for module DSO +%{?filter_provides_in: %filter_provides_in %{_libdir}/httpd/modules/.*\.so$} +%{?filter_setup} + +%description +mod_authnz_pam is a Basic Authentication provider which runs the +[login, password] authentication through the PAM stack; it can also +be used as an authorization module, supplementing authentication +done by other modules, for example mod_auth_kerb. + +%prep +%setup -q -n %{name}-%{version} + +%build +%{_httpd_apxs} -c mod_authnz_pam.c -lpam -Wall -pedantic + +%install +rm -rf $RPM_BUILD_ROOT +install -Dm 755 .libs/mod_authnz_pam.so $RPM_BUILD_ROOT%{_httpd_moddir}/mod_authnz_pam.so + +%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}" +# httpd >= 2.4.x +install -Dp -m 0644 authnz_pam.conf $RPM_BUILD_ROOT%{_httpd_modconfdir}/55-authnz_pam.conf +%else +# httpd <= 2.2.x +install -Dp -m 0644 authnz_pam.conf $RPM_BUILD_ROOT%{_httpd_confdir}/authnz_pam.conf +%endif + +%files +%doc README LICENSE +%if "%{_httpd_modconfdir}" != "%{_httpd_confdir}" +%config(noreplace) %{_httpd_modconfdir}/*.conf +%else +%config(noreplace) %{_httpd_confdir}/authnz_pam.conf +%endif +%{_httpd_moddir}/*.so + +%changelog +* Mon Jan 06 2014 Jan Pazdziora - 0.5-1 +- Initial release. -- cgit