Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Mar 2017 13:36:36 +0200
From:      Bertram Scharpf <lists@bertram-scharpf.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: Faulty symlink /etc/termcap
Message-ID:  <20170326113636.GA7495@becker.bs.l>
In-Reply-To: <20170324125924.GA14363@becker.bs.l>
References:  <20170324125924.GA14363@becker.bs.l>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 24. Mar 2017, 13:59:24 +0100, Bertram Scharpf wrote:
>   # ls -l /etc/termcap
>   lrwxr-xr-x  1 root  wheel  23 28 Feb.  2014 /etc/termcap -> /usr/share/misc/termcap
> 
> First: Shouldn't this rather link down the hierarchy?
> 
>   lrwxr-xr-x  1 root  wheel  23 28 Feb.  2014 /etc/termcap -> ../usr/share/misc/termcap
> 
> Second: I detected that, when I do a
> 
>   # cd /usr/src
>   # mkdir /usr/jail/myjail
>   # make DESTDIR=/usr/jail/myjail distribution
> 
> there will be a "/usr/jail/myjail/etc/termcap" but no
> "/usr/jail/myjail/usr/share/misc/termcap".
> 
> The only reason why the link is not broken is because it
> links outside the jail.

I'm posting the proposed patch below.

I will not write a problem report as long as I have an
unanswered one from December 2015.

Bertram


________________________________________________________________
diff --git a/etc/Makefile b/etc/Makefile
index fe518d283d..2468bec89e 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -223,6 +223,9 @@ distribution:
 		${BIN2} ${DESTDIR}/etc; \
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
 		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
+	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
+	    ${.CURDIR}/../share/termcap/termcap \
+	    ${DESTDIR}/usr/share/misc
 .if ${MK_BSNMP} != "no"
 	cd ${.CURDIR}; \
 	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
diff --git a/share/termcap/Makefile b/share/termcap/Makefile
index 6cb2ab752f..44726cfb33 100644
--- a/share/termcap/Makefile
+++ b/share/termcap/Makefile
@@ -7,7 +7,7 @@
 #
 MAN=	termcap.5
 
-FILES=		termcap termcap.db
+FILES=		termcap.db
 FILESDIR=	${BINDIR}/misc
 CLEANFILES+=	termcap.db
 
@@ -24,6 +24,6 @@ termcap.db: termcap
 	cap_mkdb ${CAP_MKDB_ENDIAN} -f ${.TARGET:R} ${.ALLSRC}
 
 etc-termcap:
-	${INSTALL_SYMLINK} ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap
+	${INSTALL_RSYMLINK} ${BINDIR}/misc/termcap ${DESTDIR}/etc/termcap
 
 .include <bsd.prog.mk>
________________________________________________________________


-- 
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170326113636.GA7495>