csh: install hard link with same mode as target

Previously when using NO_ROOT we recorded METALOG entries for the /.cshrc
hard link with a different file mode than the link target, which is not
permitted.

We cannot just set LINKMODE here as it would also apply to the hard link
for the tcsh binary.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37499
This commit is contained in:
Ed Maste 2022-11-23 12:14:18 -05:00
parent e59fa9b2e7
commit 67d2aaf078

View file

@ -162,6 +162,9 @@ beforeinstallconfig:
rm -f ${DESTDIR}/.cshrc
afterinstallconfig:
${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
# XXX Set link mode explicitly via -m. We cannot use LINKMODE for this
# link, as it would also apply to the tcsh link above.
${INSTALL_LINK} ${TAG_ARGS} -m ${CONFMODE} ${DESTDIR}/root/.cshrc \
${DESTDIR}/.cshrc
.include <bsd.prog.mk>