From 2532a43faec624ca75c9000719a7b764d9eb5d99 Mon Sep 17 00:00:00 2001 From: triaxx Date: Mon, 27 Aug 2018 08:59:52 +0000 Subject: [PATCH] openpam: add example configuration files sudo compiled with -pam and PREFER_PKGSRC=yes now works out of the box --- security/openpam/Makefile | 16 +++++++++++++++- security/openpam/PLIST | 4 +++- security/openpam/files/other | 16 ++++++++++++++++ security/openpam/files/sudo | 13 +++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 security/openpam/files/other create mode 100644 security/openpam/files/sudo diff --git a/security/openpam/Makefile b/security/openpam/Makefile index b4693d57d1a2..fa0db080832f 100644 --- a/security/openpam/Makefile +++ b/security/openpam/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.28 2018/08/22 09:46:19 wiz Exp $ +# $NetBSD: Makefile,v 1.29 2018/08/27 08:59:52 triaxx Exp $ DISTNAME= openpam-20170430 PKGREVISION= 1 @@ -20,7 +20,12 @@ CONFIGURE_ARGS+= --with-modules-dir=${PREFIX}/lib/security CPPFLAGS+= -DSYSCONFDIR=\"${PKG_SYSCONFDIR}\" +EGDIR= ${PREFIX}/share/examples/${PKGBASE} +CONF_FILES+= ${EGDIR}/pam.d/other ${PKG_SYSCONFDIR}/pam.d/other +CONF_FILES+= ${EGDIR}/pam.d/sudo ${PKG_SYSCONFDIR}/pam.d/sudo + OWN_DIRS= ${PKG_SYSCONFDIR}/pam.d +INSTALLATION_DIRS+= ${EGDIR}/pam.d SUBST_CLASSES+= man SUBST_MESSAGE.man= Fixing hardcoded paths in manpages. @@ -28,6 +33,15 @@ SUBST_STAGE.man= post-build SUBST_FILES.man= doc/man/pam.conf.5 SUBST_VARS.man= PKG_SYSCONFDIR PREFIX +post-extract: + ${MKDIR} -p ${WRKSRC}/doc/pam.d + ${CP} ${FILESDIR}/other ${WRKSRC}/doc/pam.d/other + ${CP} ${FILESDIR}/sudo ${WRKSRC}/doc/pam.d/sudo + +post-install: + ${INSTALL_DATA} ${WRKSRC}/doc/pam.d/other ${DESTDIR}${EGDIR}/pam.d/other + ${INSTALL_DATA} ${WRKSRC}/doc/pam.d/sudo ${DESTDIR}${EGDIR}/pam.d/sudo + .include "../../mk/dlopen.buildlink3.mk" # Create a fake perl binary to avoid recreating the man pages. diff --git a/security/openpam/PLIST b/security/openpam/PLIST index 4e5a7592acd8..f28bdc021c73 100644 --- a/security/openpam/PLIST +++ b/security/openpam/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.9 2018/05/15 07:57:32 triaxx Exp $ +@comment $NetBSD: PLIST,v 1.10 2018/08/27 08:59:52 triaxx Exp $ include/security/openpam.h include/security/openpam_attr.h include/security/openpam_version.h @@ -62,3 +62,5 @@ man/man3/pam_verror.3 man/man3/pam_vinfo.3 man/man3/pam_vprompt.3 man/man5/pam.conf.5 +share/examples/openpam/pam.d/other +share/examples/openpam/pam.d/sudo diff --git a/security/openpam/files/other b/security/openpam/files/other new file mode 100644 index 000000000000..ca57dc364e13 --- /dev/null +++ b/security/openpam/files/other @@ -0,0 +1,16 @@ +# $NetBSD: other,v 1.1 2018/08/27 08:59:52 triaxx Exp $ +# +# PAM configuration for the "other" service +# + +# auth +auth required pam_unix.so no_warn try_first_pass nullok + +# account +account required pam_unix.so + +# session +session required pam_permit.so + +# password +password required pam_permit.so diff --git a/security/openpam/files/sudo b/security/openpam/files/sudo new file mode 100644 index 000000000000..e9b6e3b1d305 --- /dev/null +++ b/security/openpam/files/sudo @@ -0,0 +1,13 @@ +# $NetBSD: sudo,v 1.1 2018/08/27 08:59:52 triaxx Exp $ +# +# PAM configuration for the "sudo" service +# + +# auth +auth required pam_unix.so no_warn try_first_pass nullok + +# account +account required pam_unix.so + +# session +session required pam_permit.so