Skip to content

Commit

Permalink
security/duo_openvpn: Add OPTION for overriding USERNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
zi0r committed May 20, 2021
1 parent cc29829 commit 815e582
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion security/duo_openvpn/Makefile
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 815e582

Please sign in to comment.