From 9c62213e3b47dd4cbfda5c30d16b156ca6e29aa8 Mon Sep 17 00:00:00 2001 From: Jacob Welsh Date: Wed, 15 Jul 2015 19:25:55 -0500 Subject: [PATCH] Improve build system and packaging - Apache paths are queried from APXS rather than needing user input - The internal version string now comes from the autoconf version - Replaced outdated NOTES with a NEWS file - Simplified regen.sh - Added a .gitignore - Added a sample httpd config file - Added an RPM spec file - Updated AUTHORS --- .gitignore | 13 ++++++++++++ AUTHORS | 14 ++++++++++++- INSTALL | 7 +++++++ Makefile.am | 55 ++++++++++++++++++++++--------------------------- NEWS | 51 +++++++++++++++++++++++++++++++++++++++++++++ NOTES | 28 ------------------------- configure.ac | 14 +------------ mod_waklog.c | 6 ++---- mod_waklog.spec | 52 ++++++++++++++++++++++++++++++++++++++++++++++ regen.sh | 6 ++---- version.c | 6 ------ waklog.conf | 3 +++ 12 files changed, 169 insertions(+), 86 deletions(-) create mode 100644 .gitignore rewrite Makefile.am (74%) create mode 100644 NEWS delete mode 100644 NOTES create mode 100644 mod_waklog.spec delete mode 100644 version.c create mode 100644 waklog.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf8869b --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ +/configure +/config.log +/config.status +/aclocal.m4 +/autom4te.cache +/compile +/install-sh +/missing +/.libs +Makefile +Makefile.in +*.o +*.la diff --git a/AUTHORS b/AUTHORS index 0405ef2..5987211 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,7 +1,19 @@ -Credit goes to: +Original credits: Jarod Malestein Initial author Wesley Craig Initial author Derrick Brashear Apache2 support Sean Dilda umich integration Adam Megacz autoconf, debianization, maintainance + +Post-1.0, this is being maintained as an AUTHORS file for copyright purposes; +see https://www.gnu.org/prep/maintain/html_node/Recording-Contributors.html. In +particular, it is not for showing the purpose or time of changes, just which +file parts were written or modified by whom, for non-trivial contributions. + +Russ Allbery, Jeffrey Altman: + rxkad-kdf support in mod_waklog.c +Jacob Welsh : + Many small fixes in mod_waklog.c + Cleanup of Makefile.am, configure.in/ac, regen.sh + New files mod_waklog.spec, waklog.conf, NEWS, .gitignore diff --git a/INSTALL b/INSTALL index 27040f5..467a864 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,8 @@ Installation Instructions +(Ideally this would be simplified by using `make dist`, but that currently +doesn't work.) + Type: ./regen.sh @@ -12,6 +15,10 @@ Debian: chmod +x debian/rules fakeroot dpkg-buildpackage +Release archive: + git archive -o mod_waklog-$VERSION.tgz --prefix=mod_waklog-$VERSION/ $VERSION +RPM: + rpmbuild -ta mod_waklog-$VERSION.tgz diff --git a/Makefile.am b/Makefile.am dissimilarity index 74% index f02c706..57e7b8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,30 +1,25 @@ -all: mod_waklog.so - -APXS = @APXS@ -INCLUDES = -I@KRB5_INC@ -I@AFS_INC@ -I@APACHE_INC@ -I@APR_INC@ -LIB = -L@AFS_LIBS@ -L@KRB5_LIBS@ -L@APACHE_LIBS@ -lkrb5 -lk5crypto \ - -lafsauthent -lafsrpc -lkopenafs - -APXSCC = `${APXS} -q CC` \ - @WAKLOG_DEBUG@ \ - ${INCLUDES} \ - -DEAPI -fPIC \ - -g \ - `${APXS} -q CFLAGS` - -VERSION: mod_waklog.c - date '+SVN_%Y%m%d' > VERSION - -version.o: version.c mod_waklog.c VERSION - ${APXSCC} \ - -DVERSION=\"`cat VERSION`\" \ - -c version.c - -%.o: %.c - ${APXSCC} -c $< -o $@ -mod_waklog.so: mod_waklog.o lifetime.o version.o - ${APXS} -c ${LIB} mod_waklog.o lifetime.o version.o - -clean: - rm -f *.o *.so - rm -f mod_waklog.so +all: mod_waklog.so + +APXS = @APXS@ +AM_CPPFLAGS = -I@KRB5_INC@ -I@AFS_INC@ +LIB = -L@AFS_LIBS@ -L@KRB5_LIBS@ +LIB += -lkrb5 -lk5crypto -lafsauthent -lafsrpc -lkopenafs + +APXSCC = `${APXS} -q CC` \ + @WAKLOG_DEBUG@ \ + -DVERSION=\"@VERSION@\" \ + ${AM_CPPFLAGS} \ + -DEAPI -fPIC \ + -g \ + `${APXS} -q CFLAGS` \ + -I`${APXS} -q INCLUDEDIR` \ + -I`${APXS} -q APR_INCLUDEDIR` + +.c.o: + ${APXSCC} -c $< -o $@ + +mod_waklog.so: mod_waklog.o lifetime.o + ${APXS} -c ${LIB} mod_waklog.o lifetime.o + +clean: + rm -f *.o *.so diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..5805cef --- /dev/null +++ b/NEWS @@ -0,0 +1,51 @@ +1.1.0 +----- + +General changes: + +* Apache 2.3 and 2.4 are now supported +* rxkad-kdf is now supported for a DES-free KDC; the minimum required version + of OpenAFS is now 1.6.5 +* Compiler warnings and build errors on newer platforms have been fixed +* The autoconf build system has been somewhat modernized and simplified +* The three-part version number is now used consistently + +Security bugfixes: + +* Fixed a bug causing long passwords not to be fully cleared from memory +* Fixed a possible NULL pointer dereference in error logging + +Contributors to this release include: + +* Jacob Welsh of Sine Nomine Associates (http://www.sinenomine.net/) +* Russ Allbery and Jeffrey Altman (rxkad-kdf support) +* Ryan Jud Hughes + +Older versions (former NOTES file) +---------------------------------- + +0.6.0: +Initial release. + +0.7.0: +Removed K4 code. +Removed extraneous #if 0's. +Fixed bug where mod_waklog crashed if KRB5CCNAME was null. + +0.8.0: +Integrate Apache 2 support. + +Future releases: +0.9.0: +Add configuration directives for Apache conf files. +Configure support. +Remove ticket renewal code? Make it an option? + +1.0.0: +Features working properly. + +1.x.x: +Things we haven't thought of yet. + + + diff --git a/NOTES b/NOTES deleted file mode 100644 index a77d147..0000000 --- a/NOTES +++ /dev/null @@ -1,28 +0,0 @@ - -Versions: - -0.6.0: -Initial release. - -0.7.0: -Removed K4 code. -Removed extraneous #if 0's. -Fixed bug where mod_waklog crashed if KRB5CCNAME was null. - -0.8.0: -Integrate Apache 2 support. - -Future releases: -0.9.0: -Add configuration directives for Apache conf files. -Configure support. -Remove ticket renewal code? Make it an option? - -1.0.0: -Features working properly. - -1.x.x: -Things we haven't thought of yet. - - - diff --git a/configure.ac b/configure.ac index 1dca50e..dd183c6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_INIT([mod_waklog], [1.1.0]) AC_CONFIG_SRCDIR([mod_waklog.c]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([foreign]) AC_PROG_CC AC_PROG_INSTALL @@ -16,12 +16,6 @@ AC_ARG_WITH([afs-headers], [AFS_INC=/usr/include/afs]) AC_SUBST(AFS_INC) -AC_ARG_WITH([apr-headers], - [AC_HELP_STRING([--with-apr-headers],[path to apr headers])], - [APR_INC=$withval], - [APR_INC=/usr/include/apr-1]) -AC_SUBST(APR_INC) - AC_ARG_WITH([krb5-libs], [AC_HELP_STRING([--with-krb5-libs],[path to krb5 libraries])], [KRB5_LIBS=$withval], @@ -40,12 +34,6 @@ AC_ARG_WITH([apache-libs], [APACHE_LIBS=/usr/lib/]) AC_SUBST(APACHE_LIBS) -AC_ARG_WITH([apache-headers], - [AC_HELP_STRING([--with-apache-headers],[path to apache headers])], - [APACHE_INC=$withval], - [APACHE_INC=/usr/include/apache-1.3]) -AC_SUBST(APACHE_INC) - AC_ARG_WITH([apxs], [AC_HELP_STRING([--with-apxs],[path to apxs])], [APXS=$withval], diff --git a/mod_waklog.c b/mod_waklog.c index 9d3b267..0de994d 100644 --- a/mod_waklog.c +++ b/mod_waklog.c @@ -1270,7 +1270,6 @@ waklog_init_handler (apr_pool_t * p, apr_pool_t * plog, apr_pool_t * ptemp, server_rec * s) { int rv; - extern char *version; apr_proc_t *proc; waklog_config *cfg; void *data; @@ -1307,7 +1306,7 @@ waklog_init_handler (apr_pool_t * p, apr_pool_t * plog, else { log_error (APLOG_MARK, APLOG_INFO, 0, s, - "mod_waklog: version %s initialized for cell %s", version, cfg->afs_cell); + "mod_waklog: version %s initialized for cell %s", VERSION, cfg->afs_cell); if ( sharedspace ) { log_error(APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: shared memory already allocated." ); @@ -1418,7 +1417,6 @@ waklog_init_handler (apr_pool_t * p, apr_pool_t * plog, static void waklog_init (server_rec * s, MK_POOL * p) { - extern char *version; int pid; waklog_config *cfg; int fd = -1; @@ -1430,7 +1428,7 @@ waklog_init (server_rec * s, MK_POOL * p) #endif log_error (APLOG_MARK, APLOG_DEBUG, 0, s, - "mod_waklog: version %s initialized.", version); + "mod_waklog: version %s initialized.", VERSION); if ( sharedspace ) { log_error(APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: shared memory already allocated." ); diff --git a/mod_waklog.spec b/mod_waklog.spec new file mode 100644 index 0000000..94988b2 --- /dev/null +++ b/mod_waklog.spec @@ -0,0 +1,52 @@ +Name: mod_waklog +Version: 1.1.0 +Release: 1%{?dist} +Summary: Apache module allowing the web server to acquire AFS credentials + +Group: System Environment/Daemons +License: University of Michigan +Vendor: Sine Nomine Associates +URL: http://sourceforge.net/projects/modwaklog/ +Source0: http://sourceforge.net/projects/modwaklog/files/modwaklog/mod_waklog-%{version}.tgz +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +BuildRequires: openafs-authlibs-devel httpd-devel apr-devel krb5-devel automake +Requires: httpd + +%description +mod_waklog is an Apache module that provides aklog-like semantics +for the web. mod_waklog will acquire (and store in the kernel) an +AFS credential when a connection is opened, use the credential for +the duration of the connection, and will remove the credential when +the connection is closed. + +%prep +%setup -q +# This goes away with a proper dist tarball; likewise BuildRequires: automake +./regen.sh + +%build +./configure --libdir=%{_libdir} --with-afs-libs=%{_libdir}/afs +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules/ +install .libs/mod_waklog.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/ + +install -d $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ +install -m 644 waklog.conf $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/ + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%{_libdir}/httpd/modules/mod_waklog.so +%config(noreplace) %{_sysconfdir}/httpd/conf.d/waklog.conf +%doc README COPYING AUTHORS NEWS + +%changelog +* Wed Jul 15 2015 Jacob Welsh - 1.1.0-1 +- Initial RPM package diff --git a/regen.sh b/regen.sh index 0e5fd2f..715ee02 100755 --- a/regen.sh +++ b/regen.sh @@ -1,7 +1,5 @@ #!/bin/sh -e -touch aclocal.m4 -touch INSTALL NEWS AUTHORS ChangeLog COPYING aclocal autoconf -automake -a -automake \ No newline at end of file +automake --add-missing +automake diff --git a/version.c b/version.c deleted file mode 100644 index 9d8b92b..0000000 --- a/version.c +++ /dev/null @@ -1,6 +0,0 @@ -/* -* Copyright (c) 2002 Regents of The University of Michigan. -* All Rights Reserved. See COPYRIGHT. -*/ - -char *version = VERSION; diff --git a/waklog.conf b/waklog.conf new file mode 100644 index 0000000..65915da --- /dev/null +++ b/waklog.conf @@ -0,0 +1,3 @@ +LoadModule waklog_module modules/mod_waklog.so + +WaklogAfsCell example.com -- 2.20.1