aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2022-11-23 17:14:18 +0000
committerEd Maste <emaste@FreeBSD.org>2023-03-23 14:33:01 +0000
commitc702ed6eb8d4a45221f57feaebe5a750e5ebf2ee (patch)
tree51ddad628ca6a48f83345473990884f824821c5f
parent6be7ead2acada0a4f89e242cda52934a6cb62cba (diff)
downloadsrc-c702ed6eb8d4a45221f57feaebe5a750e5ebf2ee.tar.gz
src-c702ed6eb8d4a45221f57feaebe5a750e5ebf2ee.zip
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 (cherry picked from commit 67d2aaf078e967bb626cf50c53d679aad71aeaf9)
-rw-r--r--bin/csh/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index 9aabc047493a..ad1f2011f2cf 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -159,6 +159,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>