Issue with folder permissions in net-mgmt/librenms

freebsd at jonathanprice.org freebsd at jonathanprice.org
Wed Apr 12 09:00:38 UTC 2017


Hi,

I recently completed work on a number of bugfixes with net-mgmt/librenms, and for the most part there's only 1 remaining issue I have been struggling with.

Basically, the entire /usr/local/www/librenms should be owned www:www. However, a bunch of folders are root:wheel.

I've noticed that the folders that aren't having their permissions set are all the members of the ROOT_DIRS= variable.

I believe these sections of Makefile will be relevant:

do-install:
...
.for dir in ${ROOT_DIRS}
        @${MKDIR} ${STAGEDIR}/${WWWDIR}/${dir}
        @cd ${WRKSRC}/${dir} && ${COPYTREE_SHARE} . ${STAGEDIR}/${WWWDIR}/${dir}
.endfor
...

post-install:
        @${ECHO_CMD} "@owner ${WWWOWN}" >> ${TMPPLIST}
        @${ECHO_CMD} "@group ${WWWGRP}" >> ${TMPPLIST}
        @${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
                ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
        ${INSTALL_DATA} ${WRKSRC}/config.php.default \
               ${STAGEDIR}/${WWWDIR}/config.php.sample
        @${ECHO} @sample ${WWWDIR}/config.php.sample >> ${TMPPLIST}
        @${ECHO} @dir ${WWWDIR}/rrd >> ${TMPPLIST}
        @${ECHO} @dir ${WWWDIR}/logs >> ${TMPPLIST}
        @${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/build >> ${TMPPLIST}
        @${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/docs >> ${TMPPLIST}
        @${ECHO} @dir ${WWWDIR}/lib/influxdb-php/vendor/guzzlehttp/guzzle/tests >> ${TMPPLIST}
        @${ECHO_CMD} "@group" >> ${TMPPLIST}
        @${ECHO_CMD} "@owner" >> ${TMPPLIST}

However, if I look at work/.PLIST.mktmp, everything seems to be in order (extract below:

@owner www
@group www
...
www/librenms/vendor/ulrichsg/getopt-php/CHANGELOG.md
www/librenms/vendor/ulrichsg/getopt-php/LICENSE
www/librenms/vendor/ulrichsg/getopt-php/Makefile
...
@group
@owner

In the above example, "vendor" is one of the directories that's being set to root:wheel.

I believe the problem could lie with the find command. I tried removing "-not -type d", but that seemed to cause most files to not be installed at all. That does however prove that the erroneous folders ARE being added to the TMPPLIST, otherwise they wouldn't get installed in the first place.

As one would imagine, the staging directory is all root:wheel

If anyone has any suggestions, it would be great to hear!

Thanks,
Jonathan.


More information about the freebsd-ports mailing list