From owner-freebsd-questions@freebsd.org Tue Aug 25 16:51:46 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 296923B1703 for ; Tue, 25 Aug 2020 16:51:46 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from kicp.uchicago.edu (kicp.uchicago.edu [128.135.20.70]) by mx1.freebsd.org (Postfix) with ESMTP id 4BbZlP2W6Pz3SC0 for ; Tue, 25 Aug 2020 16:51:45 +0000 (UTC) (envelope-from galtsev@kicp.uchicago.edu) Received: from point.uchicago.edu (point.uchicago.edu [128.135.52.6]) (Authenticated sender: galtsev) by kicp.uchicago.edu (Postfix) with ESMTPSA id 37DD94E669 for ; Tue, 25 Aug 2020 11:51:39 -0500 (CDT) To: FreeBSD Mailing List From: Valeri Galtsev Subject: Jail question: packages with relative symlinks Message-ID: Date: Tue, 25 Aug 2020 11:51:39 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BbZlP2W6Pz3SC0 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=uchicago.edu (policy=none); spf=none (mx1.freebsd.org: domain of galtsev@kicp.uchicago.edu has no SPF policy when checking 128.135.20.70) smtp.mailfrom=galtsev@kicp.uchicago.edu X-Spamd-Result: default: False [0.08 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.10)[0.099]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_MEDIUM(-0.12)[-0.116]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:160, ipnet:128.135.0.0/16, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions]; DMARC_POLICY_SOFTFAIL(0.10)[uchicago.edu : No valid SPF, No valid DKIM,none] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 16:51:46 -0000 Dear Experts, I've got question about jails, namely, what do you do if some package you install in jail brings relative symlink(s)? I install jails "by the book" and if relative symlinks are in /usr/local, there is no problem with those, as in jail an equivalent of /usr/local is /s/usr-local and the depth is the same as on real system. However, /etc in jail is /s/etc and if package brings relative symlink to /etc, in jail it will point nowhere. I just resolved this failure for package ca_root_nss in jail. This package places in /etc/ssl relative symlink: cert.pem --> ../../usr/local/share/certs/ca-root-nss.crt In jail, however it is situated in /s/etc/ssl so the above relative symlink points nowhere. I did a "trivial" thing, just replaced relative symlink with absolute one: cert.pem --> /usr/local/share/certs/ca-root-nss.crt ,and as this symlink is owned by the package ca_root_nss, I locked that package, to prevent it from "automagically" replacing symlink with relative if updated package is installed. This is kind of crude solution, standing next to the "hack", so I do not like what I did. I wonder, how jail experts deal with relative symlinks when some package brings it into place where filesystem depth in jail is different from real system. Thanks. Valeri -- ++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++