diff options
-rw-r--r-- | .gitignore | 30 | ||||
-rw-r--r-- | proxy/BUILD.txt | 5 | ||||
-rw-r--r-- | proxy/COPYING | 23 | ||||
-rw-r--r-- | proxy/Makefile.am | 198 | ||||
-rw-r--r-- | proxy/build_macros.m4 | 21 | ||||
-rw-r--r-- | proxy/conf_macros.m4 | 204 | ||||
-rw-r--r-- | proxy/configure.ac | 108 | ||||
-rw-r--r-- | proxy/contrib/gssproxy.spec.in | 147 | ||||
-rw-r--r-- | proxy/examples/gssproxy-example.conf | 1 | ||||
-rw-r--r-- | proxy/external/docbook.m4 | 35 | ||||
-rw-r--r-- | proxy/external/krb5.m4 | 53 | ||||
-rw-r--r-- | proxy/external/libkeyutils.m4 | 11 | ||||
-rw-r--r-- | proxy/external/libpopt.m4 | 9 | ||||
-rw-r--r-- | proxy/external/pkg.m4 | 156 | ||||
-rw-r--r-- | proxy/external/platform.m4 | 48 | ||||
-rw-r--r-- | proxy/external/selinux.m4 | 25 | ||||
-rw-r--r-- | proxy/external/sizes.m4 | 44 | ||||
-rw-r--r-- | proxy/external/systemd.m4 | 8 | ||||
-rw-r--r-- | proxy/man/Makefile.am | 164 | ||||
-rw-r--r-- | proxy/man/gssproxy.8.xml | 127 | ||||
-rw-r--r-- | proxy/man/gssproxy.conf.5.xml | 30 | ||||
-rw-r--r-- | proxy/po/README | 2 | ||||
-rw-r--r-- | proxy/src/gssproxy.c | 91 | ||||
-rw-r--r-- | proxy/systemd/gssproxy.service | 14 | ||||
-rw-r--r-- | proxy/systemd/gssproxy.service.in | 14 | ||||
-rw-r--r-- | proxy/version.m4 | 7 |
26 files changed, 1575 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e6b115 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +*.swp +.deps/ +ABOUT-NLS +Makefile +Makefile.in +aclocal.m4 +autom4te.cache/ +build/ +config.h +config.h.in +config.log +config.status +configure +gssproxy +*.o +libtool +m4/ +man.stamp +Makefile.in.in +Makevars.template +Rules-quot +boldquot.sed +en@boldquot.header +en@quot.header +insert-header.sin +quot.sed +remove-potcdate.sin +stamp-h1 +*.8 +*.5 diff --git a/proxy/BUILD.txt b/proxy/BUILD.txt new file mode 100644 index 0000000..33ca4f1 --- /dev/null +++ b/proxy/BUILD.txt @@ -0,0 +1,5 @@ + +First off, run: +# autoreconf -f -i + +Then the usual ./configure and make diff --git a/proxy/COPYING b/proxy/COPYING new file mode 100644 index 0000000..0034d64 --- /dev/null +++ b/proxy/COPYING @@ -0,0 +1,23 @@ +GSS-PROXY + +Copyright (C) 2011 Red Hat, Inc. +Copyright (C) 2011 Simo Sorce <simo.sorce@redhat.com> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/proxy/Makefile.am b/proxy/Makefile.am new file mode 100644 index 0000000..9f5f8f1 --- /dev/null +++ b/proxy/Makefile.am @@ -0,0 +1,198 @@ +SUBDIRS = +#SUBDIRS += po + +if HAVE_MANPAGES +SUBDIRS += man +endif + +# Some old versions of automake don't define builddir +builddir ?= . + +DOXYGEN = @DOXYGEN@ + +DISTSETUPOPTS = +if HAVE_DEBIAN +DISTSETUPOPTS += --install-layout=deb +endif + +gssplibdir = $(libdir)/gssproxy +gsspconfdir = $(sysconfdir)/gssproxy +localedir = @localedir@ + +pidpath = @pidpath@ +pipepath = @pipepath@ +initdir = @initdir@ +systemdunitdir = @systemdunitdir@ +logpath = @logpath@ +pubconfpath = @pubconfpath@ +pkgconfigdir = $(libdir)/pkgconfig + +AM_CFLAGS = +if WANT_AUX_INFO + AM_CFLAGS += -aux-info $@.X +endif +if HAVE_GCC + AM_CFLAGS += -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith \ + -Wcast-qual -Wcast-align -Wwrite-strings \ + -Werror-implicit-function-declaration \ + -fno-strict-aliasing +endif + +dist_pkgconfig_DATA = + +ACLOCAL_AMFLAGS = -I m4 -I . + +sbin_PROGRAMS = \ + gssproxy + +dist_noinst_SCRIPTS = + +dist_noinst_DATA = + +############################### +# Global compilation settings # +############################### + +AM_CPPFLAGS = \ + -Wall \ + -Iinclude \ + -I.. \ + -I$(srcdir)/include \ + -I$(srcdir) \ + -Iinclude \ + -I. \ + $(POPT_CFLAGS) \ + -DLIBDIR=\"$(libdir)\" \ + -DVARDIR=\"$(localstatedir)\" \ + -DSHLIBEXT=\"$(SHLIBEXT)\" \ + -DGSS_PROXY_CONF_DIR=\"$(gsspconfdir)\" \ + -DGSS_PROXY_SOCKET_NAME=\"$(pipepath)/gssproxy.socket\" \ + -DLOCALEDIR=\"$(localedir)\" + +EXTRA_DIST = build/config.rpath + +GSS_PROXY_LIBS = $(POPT_LIBS) $(KRB5_LIBS) + +if BUILD_SELINUX + GSS_PROXY_LIBS += $(SELINUX_LIBS) +endif + +dist_noinst_HEADERS = + +#################### +# Program Binaries # +#################### +gssproxy_SOURCES = \ + src/gssproxy.c +gssproxy_LDADD = \ + $(GSS_PROXY_LIBS) + +dist_noinst_DATA += \ + examples/gssproxy-example.conf \ + m4 + +noinst_PROGRAMS = + +################ +# TRANSLATIONS # +################ +update-po: +if HAVE_MANPAGES + $(MAKE) -C man update-po +endif +# $(MAKE) -C po update-po + +####################### +# Installation Extras # +####################### + +dist_init_SCRIPTS = +dist_systemdunit_DATA = +if HAVE_SYSTEMD_UNIT + dist_systemdunit_DATA += \ + systemd/gssproxy.service +endif + +installgsspdirs:: + mkdir -p \ + $(DESTDIR)$(includedir) \ + $(DESTDIR)$(libdir) \ + $(DESTDIR)$(sbindir) \ + $(DESTDIR)$(mandir) \ + $(DESTDIR)$(gsspconfdir) \ + $(DESTDIR)$(pidpath) \ + $(DESTDIR)$(pipepath) \ + $(DESTDIR)$(logpath) \ + $(DESTDIR)$(pubconfpath) + +if HAVE_DOXYGEN +docs: + $(DOXYGEN) doxy.config +else +docs: + @echo "Doxygen not installed, cannot generate documentation" + @exit 1 +endif + +install-exec-hook: installgsspdirs + mkdir -p doc $(DESTDIR)/$(docdir); cp -a doc $(DESTDIR)/$(docdir)/ +if HAVE_SYSTEMD_UNIT + mkdir -p $(DESTDIR)$(systemdunitdir) +else + mkdir -p $(DESTDIR)$(initdir) +endif + +clean-local: + rm -Rf doc + +CLEANFILES = *.X */*.X */*/*.X + +# RPM-related tasks + +RPMBUILD ?= $(PWD)/rpmbuild + +dist_noinst_DATA += \ + m4 \ + contrib/gssproxy.spec.in \ + BUILD.txt \ + COPYING + +rpmroot: + mkdir -p $(RPMBUILD)/BUILD + mkdir -p $(RPMBUILD)/RPMS + mkdir -p $(RPMBUILD)/SOURCES + mkdir -p $(RPMBUILD)/SPECS + mkdir -p $(RPMBUILD)/SRPMS + +rpms: dist-gzip rpmroot + cp $(builddir)/contrib/gssproxy.spec $(RPMBUILD)/SPECS + cp $(distdir).tar.gz $(RPMBUILD)/SOURCES + cd $(RPMBUILD); \ + rpmbuild --define "_topdir $(RPMBUILD)" -ba SPECS/gssproxy.spec + +if GIT_CHECKOUT +prerelease-rpms: + cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig + sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d.%H%M`.git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 + $(MAKE) rpms + mv $(srcdir)/version.m4.orig $(srcdir)/version.m4 +endif + +# make srpms will use the old digest algorithm to be compatible +# with RHEL5 +srpm: dist-gzip rpmroot + cp $(builddir)/contrib/gssproxy.spec $(RPMBUILD)/SPECS + cp $(distdir).tar.gz $(RPMBUILD)/SOURCES + cd $(RPMBUILD); \ + rpmbuild --define "_topdir $(RPMBUILD)" \ + --define _source_filedigest_algorithm=1 \ + -bs SPECS/gssproxy.spec + +if GIT_CHECKOUT +prerelease-srpm: + cp $(srcdir)/version.m4 $(srcdir)/version.m4.orig + sed -e "s/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.*\])/m4_define(\[PRERELEASE_VERSION_NUMBER\], \[.`date +%Y%m%d.%H%M`.git`git log -1 --pretty=format:%h`\])/" < $(srcdir)/version.m4.orig > $(srcdir)/version.m4 + $(MAKE) srpm + mv $(srcdir)/version.m4.orig $(srcdir)/version.m4 +endif + diff --git a/proxy/build_macros.m4 b/proxy/build_macros.m4 new file mode 100644 index 0000000..37d9643 --- /dev/null +++ b/proxy/build_macros.m4 @@ -0,0 +1,21 @@ +AC_DEFUN([BUILD_WITH_SHARED_BUILD_DIR], + [ AC_ARG_WITH([shared-build-dir], + [AC_HELP_STRING([--with-shared-build-dir=DIR], + [temporary build directory where libraries are installed [$srcdir/sharedbuild]])]) + + sharedbuilddir="$srcdir/sharedbuild" + if test x"$with_shared_build_dir" != x; then + sharedbuilddir=$with_shared_build_dir + CFLAGS="$CFLAGS -I$with_shared_build_dir/include" + CPPFLAGS="$CPPFLAGS -I$with_shared_build_dir/include" + LDFLAGS="$LDFLAGS -L$with_shared_build_dir/lib" + fi + AC_SUBST(sharedbuilddir) + ]) + +AC_DEFUN([BUILD_WITH_AUX_INFO], + [ AC_ARG_WITH([aux-info], + [AC_HELP_STRING([--with-aux-info], + [Build with -aux-info output])]) + ]) +AM_CONDITIONAL([WANT_AUX_INFO], [test x$with_aux_info = xyes]) diff --git a/proxy/conf_macros.m4 b/proxy/conf_macros.m4 new file mode 100644 index 0000000..27516fa --- /dev/null +++ b/proxy/conf_macros.m4 @@ -0,0 +1,204 @@ +AC_DEFUN([WITH_DISTRO_VERSION], + [ AC_ARG_WITH([distro-version], + [AC_HELP_STRING([--with-distro-version=VERSION], + [Distro version number []] + ) + ] + ) + AC_DEFINE_UNQUOTED(DISTRO_VERSION, "$with_distro_version", + [Distro version number]) + ]) + +AC_DEFUN([WITH_PID_PATH], + [ AC_ARG_WITH([pid-path], + [AC_HELP_STRING([--with-pid-path=PATH], + [Where to store pid files for gssproxy [/var/run]] + ) + ] + ) + config_pidpath="\"VARDIR\"/run" + pidpath="${localstatedir}/run" + if test x"$with_pid_path" != x; then + config_pidpath=$with_pid_path + pidpath=$with_pid_path + fi + AC_SUBST(pidpath) + AC_DEFINE_UNQUOTED(PID_PATH, "$config_pidpath", [Where to store pid files for gssproxy]) + ]) + +AC_DEFUN([WITH_LOG_PATH], + [ AC_ARG_WITH([log-path], + [AC_HELP_STRING([--with-log-path=PATH], + [Where to store log files for gssproxy [/var/log/gssproxy]] + ) + ] + ) + config_logpath="\"VARDIR\"/log/gssproxy" + logpath="${localstatedir}/log/gssproxy" + if test x"$with_log_path" != x; then + config_logpath=$with_log_path + logpath=$with_log_path + fi + AC_SUBST(logpath) + AC_DEFINE_UNQUOTED(LOG_PATH, "$config_logpath", [Where to store log files for gssproxy]) + ]) + +AC_DEFUN([WITH_PUBCONF_PATH], + [ AC_ARG_WITH([pubconf-path], + [AC_HELP_STRING([--with-pubconf-path=PATH], + [Where to store pubconf files for gssproxy [/etc/gssproxy]] + ) + ] + ) + config_pubconfpath="\"SYSCONFDIR\"/gssproxy" + pubconfpath="${sysconfdir}/gssproxy" + if test x"$with_pubconf_path" != x; then + config_pubconfpath=$with_pubconf_path + pubconfpath=$with_pubconf_path + fi + AC_SUBST(pubconfpath) + AC_DEFINE_UNQUOTED(PUBCONF_PATH, "$config_pubconfpath", [Where to store pubconf files for gssproxy]) + ]) + +AC_DEFUN([WITH_PIPE_PATH], + [ AC_ARG_WITH([pipe-path], + [AC_HELP_STRING([--with-pipe-path=PATH], + [Where to store pipe files for gssproxy interconnects [/var/lib/gssproxy/pipes]] + ) + ] + ) + config_pipepath="\"VARDIR\"/lib/gssproxy/pipes" + pipepath="${localstatedir}/lib/gssproxy/pipes" + if test x"$with_pipe_path" != x; then + config_pipepath=$with_pipe_path + pipepath=$with_pipe_path + fi + AC_SUBST(pipepath) + AC_DEFINE_UNQUOTED(PIPE_PATH, "$config_pipepath", [Where to store pipe files for gssproxy interconnects]) + ]) + +AC_DEFUN([WITH_INITSCRIPT], + [ AC_ARG_WITH([initscript], + [AC_HELP_STRING([--with-initscript=INITSCRIPT_TYPE], + [Type of your init script (sysv|systemd). [sysv]] + ) + ] + ) + default_initscript=sysv + if test x"$with_initscript" = x; then + with_initscript=$default_initscript + fi + + if test x"$with_initscript" = xsysv || \ + test x"$with_initscript" = xsystemd; then + initscript=$with_initscript + else + AC_MSG_ERROR([Illegal value -$with_initscript- for option --with-initscript]) + fi + + AM_CONDITIONAL([HAVE_SYSV], [test x"$initscript" = xsysv]) + AM_CONDITIONAL([HAVE_SYSTEMD_UNIT], [test x"$initscript" = xsystemd]) + AC_MSG_NOTICE([Will use init script type: $initscript]) + ]) + +AC_DEFUN([WITH_INIT_DIR], + [ AC_ARG_WITH([init-dir], + [AC_HELP_STRING([--with-init-dir=DIR], + [Where to store init script for gssproxy [/etc/rc.d/init.d]] + ) + ] + ) + initdir="${sysconfdir}/rc.d/init.d" + if test x$osname == xgentoo; then + initdir="${sysconfdir}/init.d" + fi + if test x"$with_init_dir" != x; then + initdir=$with_init_dir + fi + AC_SUBST(initdir) + ]) + +dnl A macro to configure the directory to install the systemd unit files to +AC_DEFUN([WITH_SYSTEMD_UNIT_DIR], + [ AC_ARG_WITH([systemdunitdir], + [ AC_HELP_STRING([--with-systemdunitdir=DIR], + [Directory for systemd service files [Auto]] + ), + ], + ) + if test x"$with_systemdunitdir" != x; then + systemdunitdir=$with_systemdunitdir + else + systemdunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) + if test x"$systemdunitdir" = x; then + AC_MSG_ERROR([Could not detect systemd unit directory]) + fi + fi + AC_SUBST(systemdunitdir) + ]) + +AC_DEFUN([WITH_MANPAGES], + [ AC_ARG_WITH([manpages], + [AC_HELP_STRING([--with-manpages], + [Whether to regenerate man pages from DocBook sources [yes]] + ) + ], + [], + with_manpages=yes + ) + if test x"$with_manpages" = xyes; then + HAVE_MANPAGES=1 + AC_SUBST(HAVE_MANPAGES) + fi + ]) +AM_CONDITIONAL([BUILD_MANPAGES], [test x$with_manpages = xyes]) + +AC_DEFUN([WITH_XML_CATALOG], + [ AC_ARG_WITH([xml-catalog-path], + [AC_HELP_STRING([--with-xml-catalog-path=PATH], + [Where to look for XML catalog [/etc/xml/catalog]] + ) + ] + ) + SGML_CATALOG_FILES="/etc/xml/catalog" + if test x"$with_xml_catalog_path" != x; then + SGML_CATALOG_FILES="$with_xml_catalog_path" + fi + AC_SUBST([SGML_CATALOG_FILES]) + ]) + +AC_DEFUN([WITH_SELINUX], + [ AC_ARG_WITH([selinux], + [AC_HELP_STRING([--with-selinux], + [Whether to build with SELinux support [yes]] + ) + ], + [], + with_selinux=yes + ) + if test x"$with_selinux" = xyes; then + HAVE_SELINUX=1 + AC_SUBST(HAVE_SELINUX) + AC_DEFINE_UNQUOTED(HAVE_SELINUX, 1, [Build with SELinux support]) + fi + AM_CONDITIONAL([BUILD_SELINUX], [test x"$with_selinux" = xyes]) + ]) + +AC_DEFUN([WITH_TEST_DIR], + [ AC_ARG_WITH([test-dir], + [AC_HELP_STRING([--with-test-dir=PATH], + [Directory used for make check temporary files [$builddir]] + ) + ] + ) + TEST_DIR=$with_test_dir + AC_SUBST(TEST_DIR) + AC_DEFINE_UNQUOTED(TEST_DIR, "$with_test_dir", [Directory used for 'make check' temporary files]) + ]) + +AC_ARG_ENABLE([all-experimental-features], + [AS_HELP_STRING([--enable-all-experimental-features], + [build all experimental features])], + [build_all_experimental_features=$enableval], + [build_all_experimental_features=no]) + diff --git a/proxy/configure.ac b/proxy/configure.ac new file mode 100644 index 0000000..9f90621 --- /dev/null +++ b/proxy/configure.ac @@ -0,0 +1,108 @@ +AC_PREREQ(2.59) + +m4_include([version.m4]) +AC_INIT([gssproxy], + VERSION_NUMBER, + [simo@redhat.com]) + +m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], + [AC_USE_SYSTEM_EXTENSIONS], + [AC_GNU_SOURCE]) + +CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" + +AC_CONFIG_SRCDIR([BUILD.txt]) +AC_CONFIG_AUX_DIR([build]) + +AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) +AM_PROG_CC_C_O +AC_DISABLE_STATIC +AC_PROG_INSTALL +AC_PROG_LIBTOOL +AC_CONFIG_MACRO_DIR([m4]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION([0.14]) + +AC_SUBST([PRERELEASE_VERSION], + PRERELEASE_VERSION_NUMBER) + +AC_DEFINE([PRERELEASE_VERSION], "PRERELEASE_VERSION_NUMBER", + [Prerelease version number of package]) + +AM_CONDITIONAL([GIT_CHECKOUT], [git log -1 &>/dev/null]) + +m4_pattern_allow([AM_SILENT_RULES]) +AM_SILENT_RULES + +AM_CONDITIONAL([HAVE_GCC], [test "$ac_cv_prog_gcc" = yes]) + +AC_CHECK_HEADERS(stdint.h dlfcn.h) +AC_CONFIG_HEADER(config.h) + +AC_CHECK_TYPES([errno_t], [], [], [[#include <errno.h>]]) + +m4_include([build_macros.m4]) +BUILD_WITH_SHARED_BUILD_DIR + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include <pthread.h>]], + [[pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;]])], + [AC_DEFINE([HAVE_PTHREAD], [1], [Pthread mutexes available.])], + [AC_MSG_WARN([Pthread library not found! Clients will not be thread safe...])]) + +#Include here cause WITH_INIT_DIR requires $osname set in platform.m4 +m4_include([external/platform.m4]) + +m4_include(conf_macros.m4) +WITH_DISTRO_VERSION +WITH_PID_PATH +WITH_LOG_PATH +WITH_PUBCONF_PATH +WITH_PIPE_PATH +WITH_INIT_DIR +WITH_TEST_DIR +WITH_MANPAGES +WITH_XML_CATALOG +WITH_SELINUX + +m4_include([external/pkg.m4]) +m4_include([external/libpopt.m4]) +m4_include([external/krb5.m4]) +m4_include([external/docbook.m4]) +m4_include([external/sizes.m4]) +m4_include([external/selinux.m4]) +m4_include([external/libkeyutils.m4]) +m4_include([external/systemd.m4]) + +WITH_INITSCRIPT +if test x$initscript = xsystemd; then + WITH_SYSTEMD_UNIT_DIR +fi + +if test x$HAVE_MANPAGES != x; then + CHECK_XML_TOOLS + CHECK_STYLESHEET([$SGML_CATALOG_FILES], + [http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], + [Docbook XSL templates]) + AC_CHECK_PROG([PO4A],[po4a],[po4a],[no]) +fi +AM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"]) +AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) + +if test x$HAVE_SELINUX != x; then + AM_CHECK_SELINUX +fi + +if test x$HAVE_SYSTEMD_UNIT != x; then + AM_CHECK_SYSTEMD +fi + +AC_PATH_PROG([DOXYGEN], [doxygen], [false]) +AM_CONDITIONAL([HAVE_DOXYGEN], [test x$DOXYGEN != xfalse ]) + +abs_build_dir=`pwd` +AC_DEFINE_UNQUOTED([ABS_BUILD_DIR], ["$abs_build_dir"], [Absolute path to the build directory]) +AC_SUBST([abs_builddir], $abs_build_dir) + +AC_CONFIG_FILES([Makefile systemd/gssproxy.service man/Makefile]) +AC_OUTPUT diff --git a/proxy/contrib/gssproxy.spec.in b/proxy/contrib/gssproxy.spec.in new file mode 100644 index 0000000..668b9ae --- /dev/null +++ b/proxy/contrib/gssproxy.spec.in @@ -0,0 +1,147 @@ +%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + +Name: @PACKAGE_NAME@ +Version: @PACKAGE_VERSION@ +Release: 0@PRERELEASE_VERSION@%{?dist} +Group: Applications/System +Summary: System Security Services Daemon +License: MIT +URL: http://fedorahosted.org/gss-proxy/ +Source0: %{name}-%{version}.tar.gz +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) + +### Patches ### + +### Dependencies ### + +Requires: krb5-libs +Requires: keyutils-libs +Requires(post): initscripts chkconfig /sbin/ldconfig +Requires(preun): initscripts chkconfig +Requires(postun): initscripts chkconfig /sbin/ldconfig + +%global servicename gssproxy +%global gsspstatedir %{_localstatedir}/lib/gssproxy +%global pipepath %{gsspstatedir}/pipes +%global pubconfpath %{sysconfdir}/gssproxy + +### Build Dependencies ### + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: m4 +%{?fedora:BuildRequires: popt-devel} +%if 0%{?rhel} <= 5 +BuildRequires: popt +%endif +%if 0%{?rhel} >= 6 +BuildRequires: popt-devel +%endif +BuildRequires: libxslt +BuildRequires: libxml2 +BuildRequires: docbook-style-xsl +BuildRequires: krb5-devel +BuildRequires: doxygen +BuildRequires: libselinux-devel +BuildRequires: keyutils-libs-devel +BuildRequires: gettext-devel +BuildRequires: pkgconfig +BuildRequires: findutils + +%description +A proxy for GSSAPI credential handling + +%prep +%setup -q + +%build + +# RHEL 5 uses an old libtool, so we need to force it to reconfigure +# This is safe to do on newer packages too, as it will just +# gather the appropriate m4 files from the libtool package +for i in libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 +do + find . -name $i -exec rm -f {} \; +done + +autoreconf -ivf + +%configure \ + --with-pipe-path=%{pipepath} \ + --with-pubconf-path=%{pubconfpath} \ + --with-init-dir=%{_initrddir} \ + --disable-static \ + --disable-rpath + +make %{?_smp_mflags} all + + +# Only build docs on recent distros +%if 0%{?fedora} +make %{?_smp_mflags} docs +%endif + +%if 0%{?rhel} >= 6 +make %{?_smp_mflags} docs +%endif + +%install +rm -rf $RPM_BUILD_ROOT + +make install DESTDIR=$RPM_BUILD_ROOT + +# Prepare language files +/usr/lib/rpm/find-lang.sh $RPM_BUILD_ROOT gssproxy + +# Remove .la files created by libtool +find $RPM_BUILD_ROOT -name "*.la" -exec rm -f {} \; + +# Suppress developer-only documentation +rm -Rf ${RPM_BUILD_ROOT}/%{_docdir}/%{name}/doc + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc COPYING +%doc examples/gssproxy-example.conf +%{_initrddir}/%{name} +%{_sbindir}/gssproxy +%{_libdir}/%{name}/ +%dir %{gsspstatedir} +%attr(755,root,root) %dir %{pipepath} +%attr(755,root,root) %dir %{pubconfpath} +%attr(750,root,root) %dir %{_var}/log/%{name} +%attr(711,root,root) %dir %{_sysconfdir}/gssproxy +%ghost %attr(0600,root,root) %config(noreplace) %%{_sysconfdir}/gssproxy/gssproxy.conf +%{_mandir}/man5/gssproxy.conf.5* +%{_mandir}/man8/gssproxy.8* + +%post +/sbin/ldconfig +/sbin/chkconfig --add %{servicename} + +if [ $1 -ge 1 ] ; then + /sbin/service %{servicename} condrestart 2>&1 > /dev/null +fi + +%preun +if [ $1 = 0 ]; then + /sbin/service %{servicename} stop 2>&1 > /dev/null + /sbin/chkconfig --del %{servicename} +fi + +%postun -p /sbin/ldconfig + +%post client -p /sbin/ldconfig + +%postun client -p /sbin/ldconfig + +%changelog +* Mon Dec 12 2011 Simo Sorce <simo@redhat.com> - @PACKAGE_VERSION@-0@PRERELEASE_VERSION@ +- Automated build of the gssproxy daemon diff --git a/proxy/examples/gssproxy-example.conf b/proxy/examples/gssproxy-example.conf new file mode 100644 index 0000000..e0a8d1b --- /dev/null +++ b/proxy/examples/gssproxy-example.conf @@ -0,0 +1 @@ +#Placeholder diff --git a/proxy/external/docbook.m4 b/proxy/external/docbook.m4 new file mode 100644 index 0000000..cae89fe --- /dev/null +++ b/proxy/external/docbook.m4 @@ -0,0 +1,35 @@ +dnl Checks for tools needed to generate manual pages +AC_DEFUN([CHECK_XML_TOOLS], +[ + AC_PATH_PROG([XSLTPROC], [xsltproc]) + if test ! -x "$XSLTPROC"; then + AC_MSG_ERROR([Could not find xsltproc]) + fi + + AC_PATH_PROG([XMLLINT], [xmllint]) + if test ! -x "$XMLLINT"; then + AC_MSG_ERROR([Could not find xmllint]) + fi + + AC_PATH_PROG([XMLCATALOG], [xmlcatalog]) + if test ! -x "$XMLCATALOG"; then + AC_MSG_ERROR([Could not find xmlcatalog]) + fi +]) + +dnl Usage: +dnl CHECK_STYLESHEET_URI(FILE, URI, [FRIENDLY-NAME]) +dnl Checks if the XML catalog given by FILE exists and +dnl if a particular URI appears in the XML catalog +AC_DEFUN([CHECK_STYLESHEET], +[ + AC_CHECK_FILE($1, [], [AC_MSG_ERROR([could not find XML catalog])]) + + AC_MSG_CHECKING([for ifelse([$3],,[$2],[$3]) in XML catalog]) + if AC_RUN_LOG([$XMLCATALOG --noout "$1" "$2" >&2]); then + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([could not find ifelse([$3],,[$2],[$3]) in XML catalog]) + fi +]) + diff --git a/proxy/external/krb5.m4 b/proxy/external/krb5.m4 new file mode 100644 index 0000000..b7db80c --- /dev/null +++ b/proxy/external/krb5.m4 @@ -0,0 +1,53 @@ +AC_SUBST(KRB5_CFLAGS) +AC_SUBST(KRB5_LIBS) + +if test x$KRB5_LIBS != x; then + KRB5_PASSED_LIBS=$KRB5_LIBS +fi + +if test x$KRB5_CFLAGS != x; then + KRB5_PASSED_CFLAGS=$KRB5_CFLAGS +fi + +AC_PATH_PROG(KRB5_CONFIG, krb5-config) +AC_MSG_CHECKING(for working krb5-config) +if test -x "$KRB5_CONFIG"; then + KRB5_CFLAGS="`$KRB5_CONFIG --cflags`" + KRB5_LIBS="`$KRB5_CONFIG --libs`" + AC_MSG_RESULT(yes) +else + if test x$KRB5_PASSED_LIBS = x; then + AC_MSG_ERROR(no. Please install MIT kerberos devel package) + fi +fi + +if test x$KRB5_PASSED_LIBS != x; then + KRB5_LIBS=$KRB5_PASSED_LIBS +fi + +if test x$KRB5_PASSED_CFLAGS != x; then + KRB5_CFLAGS=$KRB5_PASSED_CFLAGS +fi + +AC_ARG_VAR([KRB5_CFLAGS], [C compiler flags for kerberos, overriding krb5-config])dnl +AC_ARG_VAR([KRB5_LIBS], [linker flags for kerberos, overriding krb5-config])dnl + +SAVE_CFLAGS=$CFLAGS +SAVE_LIBS=$LIBS +CFLAGS="$CFLAGS $KRB5_CFLAGS" +LIBS="$LIBS $KRB5_LIBS" +AC_CHECK_HEADERS([krb5.h krb5/krb5.h]) +AC_CHECK_FUNCS([krb5_get_init_creds_opt_alloc krb5_get_error_message \ + krb5_free_unparsed_name \ + krb5_get_init_creds_opt_set_expire_callback \ + krb5_get_init_creds_opt_set_fast_ccache_name \ + krb5_get_init_creds_opt_set_fast_flags \ + krb5_get_init_creds_opt_set_canonicalize \ + krb5_unparse_name_flags]) +CFLAGS=$SAVE_CFLAGS +LIBS=$SAVE_LIBS + +if test x$ac_cv_header_krb5_h != xyes -a x$ac_cv_header_krb5_krb5_h != xyes +then + AC_MSG_ERROR(you must have Kerberos 5 header files to build gssproxy) +fi diff --git a/proxy/external/libkeyutils.m4 b/proxy/external/libkeyutils.m4 new file mode 100644 index 0000000..5753d77 --- /dev/null +++ b/proxy/external/libkeyutils.m4 @@ -0,0 +1,11 @@ +AC_SUBST(KEYUTILS_LIBS) + +AC_CHECK_HEADERS([keyutils.h], + [AC_CHECK_LIB([keyutils], [add_key], + [AC_DEFINE(USE_KEYRING, 1, [Define if the keyring should be used]) + KEYUTILS_LIBS="-lkeyutils" + ], + [AC_MSG_WARN([No usable keyutils library found])] + )], + [AC_MSG_WARN([keyutils header files are not available])] +) diff --git a/proxy/external/libpopt.m4 b/proxy/external/libpopt.m4 new file mode 100644 index 0000000..e59b261 --- /dev/null +++ b/proxy/external/libpopt.m4 @@ -0,0 +1,9 @@ +POPT_OBJ="" +AC_SUBST(POPT_OBJ) +AC_SUBST(POPT_LIBS) +AC_SUBST(POPT_CFLAGS) + +AC_CHECK_HEADERS([popt.h], + [AC_CHECK_LIB(popt, poptGetContext, [ POPT_LIBS="-lpopt" ], [AC_MSG_ERROR([POPT must support poptGetContext])])], + [AC_MSG_ERROR([POPT development libraries not installed])] +) diff --git a/proxy/external/pkg.m4 b/proxy/external/pkg.m4 new file mode 100644 index 0000000..a8b3d06 --- /dev/null +++ b/proxy/external/pkg.m4 @@ -0,0 +1,156 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# +# 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 3 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, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/proxy/external/platform.m4 b/proxy/external/platform.m4 new file mode 100644 index 0000000..c67e081 --- /dev/null +++ b/proxy/external/platform.m4 @@ -0,0 +1,48 @@ +AC_ARG_WITH([os], + [AC_HELP_STRING([--with-os=OS_TYPE], [Type of your operation system (fedora|redhat|suse|gentoo)])] + ) +osname="" +if test x"$with_os" != x ; then + if test x"$with_os" = xfedora || \ + test x"$with_os" = xredhat || \ + test x"$with_os" = xsuse || \ + test x"$with_os" = xgentoo || \ + test x"$with_os" = xdebian ; then + osname=$with_os + else + AC_MSG_ERROR([Illegal value -$with_os- for option --with-os]) + fi +fi + +if test x"$osname" = x ; then + if test -f /etc/fedora-release ; then + osname="fedora" + elif test -f /etc/redhat-release ; then + osname="redhat" + elif test -f /etc/SuSE-release ; then + osname="suse" + elif test -f /etc/debian_version ; then + osname="debian" + elif test -f /etc/gentoo-release ; then + osname="gentoo" + fi + + AC_MSG_NOTICE([Detected operating system type: $osname]) +fi + +AM_CONDITIONAL([HAVE_FEDORA], [test x"$osname" = xfedora]) +AM_CONDITIONAL([HAVE_REDHAT], [test x"$osname" = xredhat]) +AM_CONDITIONAL([HAVE_SUSE], [test x"$osname" = xsuse]) +AM_CONDITIONAL([HAVE_DEBIAN], [test x"$osname" = xdebian]) +AM_CONDITIONAL([HAVE_GENTOO], [test x"$osname" = xgentoo]) + +AC_CHECK_MEMBERS([struct ucred.pid, struct ucred.uid, struct ucred.gid], , , + [[#include <sys/socket.h>]]) + +if test x"$ac_cv_member_struct_ucred_pid" = xyes -a \ + x"$ac_cv_member_struct_ucred_uid" = xyes -a \ + x"$ac_cv_member_struct_ucred_gid" = xyes ; then + AC_DEFINE([HAVE_UCRED], [1], [Define if struct ucred is available]) +else + AC_MSG_WARN([struct ucred is not available]) +fi diff --git a/proxy/external/selinux.m4 b/proxy/external/selinux.m4 new file mode 100644 index 0000000..d1b961a --- /dev/null +++ b/proxy/external/selinux.m4 @@ -0,0 +1,25 @@ +dnl A macro to check the availability of SELinux +AC_DEFUN([AM_CHECK_SELINUX], +[ + AC_CHECK_HEADERS(selinux/selinux.h, + [AC_CHECK_LIB(selinux, is_selinux_enabled, + [SELINUX_LIBS="-lselinux"], + [AC_MSG_ERROR([SELinux library is missing])] + ) + ], + [AC_MSG_ERROR([SELinux headers are missing])]) + AC_SUBST(SELINUX_LIBS) +]) + +dnl A macro to check the availability of SELinux management library +AC_DEFUN([AM_CHECK_SEMANAGE], +[ + AC_CHECK_HEADERS(semanage/semanage.h, + [AC_CHECK_LIB(semanage, semanage_handle_create, + [SEMANAGE_LIBS="-lsemanage"], + [AC_MSG_ERROR([libsemanage is missing])] + ) + ], + [AC_MSG_ERROR([libsemanage is missing])]) + AC_SUBST(SEMANAGE_LIBS) +]) diff --git a/proxy/external/sizes.m4 b/proxy/external/sizes.m4 new file mode 100644 index 0000000..53df61d --- /dev/null +++ b/proxy/external/sizes.m4 @@ -0,0 +1,44 @@ +# Solaris needs HAVE_LONG_LONG defined +AC_CHECK_TYPES(long long) + +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(char) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) + +if test $ac_cv_sizeof_long_long -lt 8 ; then +AC_MSG_ERROR([SSSD requires long long of 64-bits]) +fi + +AC_CHECK_TYPE(uint_t, unsigned int) +AC_CHECK_TYPE(int8_t, char) +AC_CHECK_TYPE(uint8_t, unsigned char) +AC_CHECK_TYPE(int16_t, short) +AC_CHECK_TYPE(uint16_t, unsigned short) + +if test $ac_cv_sizeof_int -eq 4 ; then +AC_CHECK_TYPE(int32_t, int) +AC_CHECK_TYPE(uint32_t, unsigned int) +elif test $ac_cv_size_long -eq 4 ; then +AC_CHECK_TYPE(int32_t, long) +AC_CHECK_TYPE(uint32_t, unsigned long) +else +AC_MSG_ERROR([LIBREPLACE no 32-bit type found]) +fi + +AC_CHECK_TYPE(int64_t, long long) +AC_CHECK_TYPE(uint64_t, unsigned long long) + +AC_CHECK_TYPE(size_t, unsigned int) +AC_CHECK_TYPE(ssize_t, int) + +AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(size_t) +AC_CHECK_SIZEOF(ssize_t) + +AC_CHECK_TYPE(intptr_t, long long) +AC_CHECK_TYPE(uintptr_t, unsigned long long) +AC_CHECK_TYPE(ptrdiff_t, unsigned long long) + + diff --git a/proxy/external/systemd.m4 b/proxy/external/systemd.m4 new file mode 100644 index 0000000..2c26dc1 --- /dev/null +++ b/proxy/external/systemd.m4 @@ -0,0 +1,8 @@ +dnl A macro to check presence of systemd on the system +AC_DEFUN([AM_CHECK_SYSTEMD], +[ + PKG_CHECK_EXISTS(systemd, + [ HAVE_SYSTEMD=1, AC_SUBST(HAVE_SYSTEMD) ], + [AC_MSG_ERROR([Could not detect systemd presence])] + ) +]) diff --git a/proxy/man/Makefile.am b/proxy/man/Makefile.am new file mode 100644 index 0000000..bbffd01 --- /dev/null +++ b/proxy/man/Makefile.am @@ -0,0 +1,164 @@ +# The following variable is dependent on placement of this file +top_builddir = .. + +############ +# MANPAGES # +############ + +#Special Rules: +export SGML_CATALOG_FILES +DOCBOOK_XSLT = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl +XMLLINT_FLAGS = --catalogs --postvalid --nonet --xinclude --noout +XSLTPROC_FLAGS = --catalogs --xinclude --nonet + +man_MANS = \ + gssproxy.8 gssproxy.conf.5 + +EXTRA_DIST = $(man_MANS:%=%.xml) $(wildcard $(srcdir)/include/*.xml) + +SUFFIXES = .1.xml .1 .3.xml .3 .5.xml .5 .8.xml .8 +.1.xml.1: + $(XMLLINT) $(XMLLINT_FLAGS) $< + $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(DOCBOOK_XSLT) $< + +.3.xml.3: + $(XMLLINT) $(XMLLINT_FLAGS) $< + $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(DOCBOOK_XSLT) $< + +.5.xml.5: + $(XMLLINT) $(XMLLINT_FLAGS) $< + $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(DOCBOOK_XSLT) $< + +.8.xml.8: + $(XMLLINT) $(XMLLINT_FLAGS) $< + $(XSLTPROC) -o $@ $(XSLTPROC_FLAGS) $(DOCBOOK_XSLT) $< + +######################## +# MANPAGE TRANSLATIONS # +######################## + +PO4A=@PO4A@ +SED=@SED@ + +PACKAGE_DOC=gssproxy-docs + +POTFILE = po/$(PACKAGE_DOC).pot +PO4A_CONFIG = po/po4a.cfg + +# Extract the list of languages from the po4a config file. +LINGUAS_DIST = `$(SED) -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/$(PO4A_CONFIG)` + +# If the user has not defined it let's use the default. +LINGUAS ?= $(LINGUAS_DIST) + +PO4A_COMMON_OPTS = --option doctype=docbook \ + --package-name $(PACKAGE_DOC) \ + --variable builddir=$(CURDIR) \ + --package-version $(PACKAGE_VERSION) \ + --msgid-bugs-address simo@redhat.com \ + --copyright-holder "Red Hat" + +PO4A_BUILD_OPTS = $(PO4A_COMMON_OPTS) --no-backups + +EXTRA_DIST += \ + $(POTFILE)\ + $(PO4A_CONFIG) + +XML_DOC = $(wildcard $(srcdir)/*.xml) $(wildcard $(srcdir)/include/*.xml) + +if HAVE_PO4A + +# FIXME: Use a stamp file until po4a supports them internally. +man.stamp: $(XML_DOC) $(POTFILE) $(PO4A_CONFIG) + cd $(srcdir) && \ + $(PO4A) $(PO4A_BUILD_OPTS) $(PO4A_CONFIG) + touch $@ + +update-po: + cd $(srcdir) && \ + $(PO4A) $(PO4A_BUILD_OPTS) --force $(PO4A_CONFIG) + +dist-hook: man.stamp + if [ -f man.stamp ]; then \ + cp man.stamp $(distdir); \ + for lang in $(LINGUAS_DIST); do \ + cp $(srcdir)/po/$$lang.po $(distdir)/po; \ + $(mkdir_p) $(distdir)/$$lang; \ + cp -r $(builddir)/$$lang $(distdir)/; \ + done; \ + else \ + cp $(srcdir)/man.stamp $(distdir); \ + for lang in $(LINGUAS_DIST); do \ + cp $(srcdir)/po/$$lang.po $(distdir)/po; \ + $(mkdir_p) $(distdir)/$$lang; \ + cp -r $(srcdir)/$$lang $(distdir)/; \ + done; \ + fi + + +clean-local-no: +clean-local-yes: + for lang in $(LINGUAS); do \ + if [ -d $$lang ]; then \ + rm -rf $$lang; \ + fi \ + done + rm -f $(man_MANS) + rm -f man.stamp + +else + +man.stamp: $(XML_DOC) + touch $@ + +clean-local-no: +clean-local-yes: + rm -f $(man_MANS) + rm -f man.stamp + +endif + +clean-local: clean-local-@USE_NLS@ +distclean-local: clean-local-@USE_NLS@ +mostlyclean-local: clean-local-@USE_NLS@ +maintainer-clean-local: clean-local-@USE_NLS@ + +# Generate translated manual pages +all-local: all-local-@USE_NLS@ +all-local-no: +all-local-yes: man.stamp + if [ -z $$recursion ]; then \ + for lang in $(LINGUAS); do \ + if [ -d $$lang ]; then \ + sources=$$(ls -1 $$lang/*.xml); \ + manpages=$$(echo $$sources | $(SED) 's/\.xml//g'); \ + $(MAKE) recursion=1 man_MANS="$$manpages"; \ + fi \ + done \ + fi + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: +install-data-local-yes: + for lang in $(LINGUAS); do \ + if [ -d $$lang ]; then \ + sources=$$(ls -1 $$lang/*.xml); \ + manpages=$$(echo $$sources | $(SED) 's/\.xml//g'); \ + $(MAKE) install-man \ + mandir="$(mandir)/$$lang" \ + man_MANS="$$manpages"; \ + fi \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + for lang in $(LINGUAS); do \ + if [ -d $$lang ]; then \ + sources=$$(ls -1 $$lang/*.xml); \ + manpages=$$(echo $$sources | $(SED) 's/\.xml//g'); \ + $(MAKE) uninstall-man \ + mandir="$(mandir)/$$lang" \ + man_MANS="$$manpages"; \ + fi \ + done diff --git a/proxy/man/gssproxy.8.xml b/proxy/man/gssproxy.8.xml new file mode 100644 index 0000000..d2c374c --- /dev/null +++ b/proxy/man/gssproxy.8.xml @@ -0,0 +1,127 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.4//EN" +"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> +<reference> +<title>GssProxy Manual pages</title> +<refentry> + <refentryinfo> + <productname>GSS Proxy</productname> + <orgname>GSS-Proxy - http://fedorahosted.org/gss-proxy</orgname> + </refentryinfo> + + <refmeta> + <refentrytitle>gssproxy</refentrytitle> + <manvolnum>8</manvolnum> + </refmeta> + + <refnamediv id='name'> + <refname>gssproxy</refname> + <refpurpose>GssProxy Daemon</refpurpose> + </refnamediv> + + <refsynopsisdiv id='synopsis'> + <cmdsynopsis> + <command>gssproxy</command> + <arg choice='opt'> + <replaceable>options</replaceable> + </arg> + </cmdsynopsis> + </refsynopsisdiv> + + <refsect1 id='description'> + <title>DESCRIPTION</title> + <para> + <command>gssproxy</command> provides a daemons to manage access to + GSSAPI credetnials. + </para> + </refsect1> + + <refsect1 id='options'> + <title>OPTIONS</title> + <variablelist remap='IP'> + <varlistentry> + <term> + <option>-D</option>,<option>--daemon</option> + </term> + <listitem> + <para> + Become a daemon after starting up. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <option>-i</option>,<option>--interactive</option> + </term> + <listitem> + <para> + Run in the foreground, don't become a daemon. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <option>-c</option>,<option>--config</option> + </term> + <listitem> + <para> + Specify a non-default config file. The default is + <filename>/etc/gssprosy/gssproxy.conf</filename>. For reference + on the config file syntax and options, consult the + <citerefentry> + <refentrytitle>gssproxy.conf</refentrytitle> + <manvolnum>5</manvolnum> + </citerefentry> + manual page. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> + <option>--version</option> + </term> + <listitem> + <para> + Print version number and exit. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1> + <title>Signals</title> + <variablelist remap='IP'> + <varlistentry> + <term>SIGTERM/SIGINT</term> + <listitem> + <para> + Informs the GssProxy to gracefully terminate all of its + child processes and then shut down. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term>SIGHUP</term> + <listitem> + <para> + Tells the GssProxy to stop writing to its current debug + file descriptors and to close and reopen them. This is + meant to facilitate log rolling with programs like + logrotate. + </para> + </listitem> + </varlistentry> + </variablelist> + </refsect1> + + <refsect1 id='see_also'> + <title>SEE ALSO</title> + <para> + <citerefentry> + <refentrytitle>gssproxy.conf</refentrytitle><manvolnum>5</manvolnum> + </citerefentry>. + </para> + </refsect1> +</refentry> +</reference> diff --git a/proxy/man/gssproxy.conf.5.xml b/proxy/man/gssproxy.conf.5.xml new file mode 100644 index 0000000..9b1dc7a --- /dev/null +++ b/proxy/man/gssproxy.conf.5.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE reference PUBLIC "-//OASIS//DTD DocBook V4.4//EN" +"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> +<reference> +<title>GssProxy Manual pages</title> +<refentry> + <refentryinfo> + <productname>GSS Proxy</productname> + <orgname>GSS-Proxy - http://fedorahosted.org/gss-proxy</orgname> + </refentryinfo> + + <refmeta> + <refentrytitle>gssproxy.conf</refentrytitle> + <manvolnum>5</manvolnum> + </refmeta> + + <refnamediv id='name'> + <refname>gssproxy.conf</refname> + <refpurpose>GssProxy Daemon Configuration file</refpurpose> + </refnamediv> + + <refsect1 id='description'> + <title>DESCRIPTION</title> + <para> + Optional configuration directives for the gssproxy daemon. + </para> + </refsect1> + +</refentry> +</reference> diff --git a/proxy/po/README b/proxy/po/README new file mode 100644 index 0000000..610b3bd --- /dev/null +++ b/proxy/po/README @@ -0,0 +1,2 @@ +PLACEHOLDER +po files here diff --git a/proxy/src/gssproxy.c b/proxy/src/gssproxy.c new file mode 100644 index 0000000..ca9d533 --- /dev/null +++ b/proxy/src/gssproxy.c @@ -0,0 +1,91 @@ +/* + GSS-PROXY + + Copyright (C) 2011 Red Hat, Inc. + Copyright (C) 2011 Simo Sorce <simo.sorce@redhat.com> + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include "config.h" +#include <libintl.h> +#include "popt.h" + +#define _(STRING) gettext(STRING) + +int main(int argc, const char *argv[]) +{ + int opt; + poptContext pc; + int opt_daemon = 0; + int opt_interactive = 0; + int opt_version = 0; + char *opt_config_file = NULL; + char *config_file = NULL; + + struct poptOption long_options[] = { + POPT_AUTOHELP + {"daemon", 'D', POPT_ARG_NONE, &opt_daemon, 0, \ + _("Become a daemon (default)"), NULL }, \ + {"interactive", 'i', POPT_ARG_NONE, &opt_interactive, 0, \ + _("Run interactive (not a daemon)"), NULL}, \ + {"config", 'c', POPT_ARG_STRING, &opt_config_file, 0, \ + _("Specify a non-default config file"), NULL}, \ + {"version", '\0', POPT_ARG_NONE, &opt_version, 0, \ + _("Print version number and exit"), NULL }, \ + POPT_TABLEEND + }; + + pc = poptGetContext(argv[0], argc, argv, long_options, 0); + while((opt = poptGetNextOpt(pc)) != -1) { + switch(opt) { + default: + fprintf(stderr, "\nInvalid option %s: %s\n\n", + poptBadOption(pc, 0), poptStrerror(opt)); + poptPrintUsage(pc, stderr, 0); + return 1; + } + } + + if (opt_version) { + puts(VERSION""DISTRO_VERSION""PRERELEASE_VERSION); + return 0; + } + + if (opt_daemon && opt_interactive) { + fprintf(stderr, "Option -i|--interactive is not allowed together with -D|--daemon\n"); + poptPrintUsage(pc, stderr, 0); + return 1; + } + + if (!opt_daemon && !opt_interactive) { + opt_daemon = 1; + } + + poptFreeContext(pc); + + /* 1. Init server and sockets + * 2. Create thread pools and queues + * 3. Create mainloop and start serving clients + * 4. ... + * 5. Profit + */ + + return 0; +} diff --git a/proxy/systemd/gssproxy.service b/proxy/systemd/gssproxy.service new file mode 100644 index 0000000..ab25699 --- /dev/null +++ b/proxy/systemd/gssproxy.service @@ -0,0 +1,14 @@ +[Unit] +Description=GSSAPI Proxy Daemon +# GSSPROXY will not be started until syslog is +After=syslog.target + +[Service] +ExecStart=${exec_prefix}/sbin/gssproxy -D -f +# These two should be used with traditional UNIX forking daemons +# consult systemd.service(5) for more details +Type=forking +PIDFile=${prefix}/var/run/gssproxy.pid + +[Install] +WantedBy=multi-user.target diff --git a/proxy/systemd/gssproxy.service.in b/proxy/systemd/gssproxy.service.in new file mode 100644 index 0000000..996b60d --- /dev/null +++ b/proxy/systemd/gssproxy.service.in @@ -0,0 +1,14 @@ +[Unit] +Description=GSSAPI Proxy Daemon +# GSSPROXY will not be started until syslog is +After=syslog.target + +[Service] +ExecStart=@sbindir@/gssproxy -D -f +# These two should be used with traditional UNIX forking daemons +# consult systemd.service(5) for more details +Type=forking +PIDFile=@localstatedir@/run/gssproxy.pid + +[Install] +WantedBy=multi-user.target diff --git a/proxy/version.m4 b/proxy/version.m4 new file mode 100644 index 0000000..e720c0d --- /dev/null +++ b/proxy/version.m4 @@ -0,0 +1,7 @@ +# Primary version number +m4_define([VERSION_NUMBER], [0.0.1]) + +# If the PRERELEASE_VERSION_NUMBER is set, we'll append +# it to the release tag when creating an RPM or SRPM +m4_define([PRERELEASE_VERSION_NUMBER], []) + |