[Bug 267107] [NEW PORT] sysutils/dynamic_motd: Dynamic /var/run/motd

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 17 Apr 2023 09:06:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267107

Matthew Seaman <matthew@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matthew@FreeBSD.org

--- Comment #4 from Matthew Seaman <matthew@FreeBSD.org> ---
This fails to build under poudriere:
```
=>> Recording filesystem state for prestage... done
=======================<phase: stage          >============================
===== env: DEVELOPER_MODE=yes STRICT_DEPENDS=yes USER=nobody UID=65534
GID=65534
===>  Staging for dynamic_motd-1.2
===>   Generating temporary packing list
installing DIRS CONFETCDIR
install  -d -m 0755 -o root  -g wheel 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc
install: chown 0:0
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc: Operation
not permitted
installing DIRS CONFRCDDIR
install  -d -m 0755 -o root  -g wheel 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc/rc.d
install: chown 0:0
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/etc/rc.d:
Operation not permitted
installing DIRS DOCSDIR
install  -d -m 0755 -o root  -g wheel 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/doc/dynamic_motd
install: chown 0:0
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/doc/dynamic_motd:
Operation not permitted
installing DIRS EXAMPLESDIR
install  -d -m 0755 -o root  -g wheel 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/examples/dynamic_motd
install: chown 0:0
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/share/examples/dynamic_motd:
Operation not permitted
installing DIRS SCRIPTSDIR
install  -d -m 0755 -o root  -g wheel 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec
install: chown 0:0
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec:
Operation not permitted
install  -o root  -g wheel -m 555  dynamic_motd 
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec/dynamic_motd
install:
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/stage/usr/local/libexec/dynamic_motd:
chown/chgrp: Operation not permitted
*** Error code 71

Stop.
make[1]: stopped in
/wrkdirs/usr/ports/sysutils/dynamic_motd/work/dynamic_motd-1.2
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/dynamic_motd
```

You're requiring root-level access to install the files into staging.  That is
a definite no-no -- package building must be possible as a non-root user.
Instead of including bsd.prog.mk in the Makefile in your github sources, you'ld
be better off just writing an explicit install target which takes account of
the ${STAGEDIR} setting from the ports infrastructure.   Just install the files
into staging using the current user's UID and GID.

-- 
You are receiving this mail because:
You are the assignee for the bug.