aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorRyan Steinmetz <zi@FreeBSD.org>2021-05-20 16:52:42 +0000
committerRyan Steinmetz <zi@FreeBSD.org>2021-05-20 16:52:42 +0000
commit815e582a58e3dca11e9a926a3c0e91573ed0469b (patch)
treef4d1d39eef331ecd763e32ce1acd6554812faa75 /security
parentcc298297bc51e03451dd181bfdda69ae1e39f5b9 (diff)
downloadports-815e582a58e3dca11e9a926a3c0e91573ed0469b.tar.gz
ports-815e582a58e3dca11e9a926a3c0e91573ed0469b.zip
security/duo_openvpn: Add OPTION for overriding USERNAME
Diffstat (limited to 'security')
-rw-r--r--security/duo_openvpn/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/duo_openvpn/Makefile b/security/duo_openvpn/Makefile
index de121d3320e9..5947ef2b5598 100644
--- a/security/duo_openvpn/Makefile
+++ b/security/duo_openvpn/Makefile
@@ -18,13 +18,14 @@ GH_ACCOUNT= duosecurity
SUB_FILES= pkg-message
-OPTIONS_DEFINE= METHOD
+OPTIONS_DEFINE= METHOD USERNAME
OPTIONS_SINGLE= HELPER
OPTIONS_SINGLE_HELPER= PERL PYTHON
OPTIONS_DEFAULT=PERL
OPTIONS_SUB= yes
METHOD_DESC= Force an authentication method (defaults to push, via METHOD)
+USERNAME_DESC= Force duo to use username variable, instead of common_name
METHOD?= push
PERL_USES= perl5
PERL_VARS= USE_PERL5=run CFLAGS+=-DUSE_PERL
@@ -39,6 +40,9 @@ PYTHON_USES= python:3.7+,run
post-patch:
${REINPLACE_CMD} 's|%%SHEBANG%%|${PYTHON_CMD}|' ${WRKSRC}/duo_openvpn.py
${REINPLACE_CMD} 's|PREFIX "|"${DATADIR}|' ${WRKSRC}/duo_openvpn.c
+.if ${PORT_OPTIONS:MUSERNAME}
+ ${REINPLACE_CMD} 's|common_name|username|' ${WRKSRC}/duo_openvpn.c
+.endif
.if ${PORT_OPTIONS:MMETHOD}
${REINPLACE_CMD} 's|get_env("password", envp);|"${METHOD}";|' ${WRKSRC}/duo_openvpn.c
.endif