Skip to content

Commit

Permalink
net-mgmt/librenms: unbreak lnms
Browse files Browse the repository at this point in the history
lnms insists upon lnms file is owned by root, it should be owned and ran
by a non-privileged user

Make it chown www because that's what the librenms service runs as.

I'm discussing a solution with upstream as to how to better fix this in
their code. The current solution allows the app to modify its own code.
  • Loading branch information
dlangille committed Oct 29, 2023
1 parent 31d5e7b commit c5dbdf1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net-mgmt/librenms/Makefile
@@ -1,6 +1,6 @@
PORTNAME= librenms
PORTVERSION= 23.10.0
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/dvl:vendor
Expand Down Expand Up @@ -178,6 +178,9 @@ do-install:
.for f in ${_SCRIPT_FILES}
${INSTALL_SCRIPT} ${WRKSRC}/${f} ${STAGEDIR}/${WWWDIR}
.endfor
# avoid: Error: lnms file is owned by root, it should be owned and ran by a non-privileged user
${ECHO_CMD} "@(www,wheel,0555) www/${PORTNAME}/lnms" >> ${TMPPLIST}

${MKDIR} ${STAGEDIR}/${WWWDIR}/vendor
(cd ${WRKDIR}/${PORTNAME}-vendor-${PORTVERSION} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/vendor)

Expand Down Expand Up @@ -219,7 +222,7 @@ do-install-EXAMPLES-on:
post-install:
${FIND} -s ${STAGEDIR}${WWWDIR} -type f '(' -name '*.orig' -or -name '*.bak' -or -name '.gitignore' ')' -delete
${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | grep -v www/librenms/lnms >> ${TMPPLIST}

# we do this file separately because it needs a different chmod/chown
# it will eventually contains secrets
Expand Down

0 comments on commit c5dbdf1

Please sign in to comment.