From nobody Sat Oct 26 08:32:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XbCZC72RVz5bjTB; Sat, 26 Oct 2024 08:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XbCZC5G6sz53Rn; Sat, 26 Oct 2024 08:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729931539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/kes4nOuAQ7fbSrhpbnCsnwbkyqWScBYMEJDTlC+W4=; b=mwgF657vkqQBuTF29zpcokh6SK16IIk86VCcFJznOeSOOPHvsLDvvZEl1vE5PeGWq6kd8B 9MZQb7s6eFexty6DACF+7yrYNV+qAxqqKuAGEcUKwreMaDExidzSeIC46KrtnGjXD62Q4X GHoYD7cpcJMyCljEz1+MdO5pfKWMaLpYCHsXia2fr3kvFx01ugIPdw2Gw7wveOIEx49cp7 H4r8NkMYf+gnVtVymysf48n2sQBZeaAf7p7J4tkqDwds/rPP4W2sxXwZ6jRBC1L/1Aywr/ c21+A4RNqyyVwu1bCl0zd3Buj56sqnj7et0+ugKY7R6kZb/vfAa4ENHcnjtmBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729931539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/kes4nOuAQ7fbSrhpbnCsnwbkyqWScBYMEJDTlC+W4=; b=BHh90o7Qzt3l37IpQxfi5JnauxMCdpWlY+edEYVsbJgbfZDRilm5v8wH7rDBRUA5W5TWcQ 9zayVR58qZjmW3axIz6/DpwITVRM2ShSs+CqfEBPblJeOkj0wyMZICSjzYNrblyIypwhtJ FaXfgulWCkg4mGB1Jc/e7al44h1tWQHKKhgQDRWc3DcZhzc+T3/Gn2zr1MsYBt9AoZHrmw cm1Cprt8CIU7rJE7DMrN3jhv2R/s/E2VaeIFR4kbN7XGT43OXwJwTeXJC2vNjkPsPorJ1P t+ZB89rFbCWO6sEXsFsC3snQ+lWpXGAFJMRB8D2M9LCXWJy+LmEJ8316NyZLPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729931539; a=rsa-sha256; cv=none; b=NR/rZBuFxPVCGOIlCSKPgm/aj7od+k1lHxNYPN9/O7WDEB5a0bwFELzJPDJgIkWlReyNvs PkOY5aagp/vTGaHJGkw+U2U1HcQMJpYJYl1aujy4q5oxaTJMHUXWZ2b7enakSWHlzZrWks 51cxCEMs+BwsnoSabrLX/chwHdlRpg4u0T7Q1qH99yNk7n7+xV8NmucrD9Q4vdhoCVnR+M 87Io4NrRTB8r75jo84NseDCLZW14fXso8237o3tzZIY1MUKCaTJqPlB7yhMt+vzNAEPi5z OmYTh4zpbtjBF92p02JEPo47l4K4+8KDmcuNd1+Hp6TgaJZiHP12yUKN5xfsyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XbCZC4sdLz13LG; Sat, 26 Oct 2024 08:32:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49Q8WJj1079099; Sat, 26 Oct 2024 08:32:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49Q8WJUI079096; Sat, 26 Oct 2024 08:32:19 GMT (envelope-from git) Date: Sat, 26 Oct 2024 08:32:19 GMT Message-Id: <202410260832.49Q8WJUI079096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: 9d585fc395c3 - main - absolute-symlink.sh: check for absolute symlinks on a FreeBSD system List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d585fc395c3af6d1ceaec7df7c7ef60466f0528 Auto-Submitted: auto-generated The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=9d585fc395c3af6d1ceaec7df7c7ef60466f0528 commit 9d585fc395c3af6d1ceaec7df7c7ef60466f0528 Author: Wolfram Schneider AuthorDate: 2024-10-26 08:31:19 +0000 Commit: Wolfram Schneider CommitDate: 2024-10-26 08:31:19 +0000 absolute-symlink.sh: check for absolute symlinks on a FreeBSD system The purpose of this script is to detect absolute symlinks on a machine, e.g.: /etc/localtime -> /usr/share/zoneinfo/UTC Some of these absolute symbolic links can be created intentionally, but it is usually better to use relative symlinks. You can run the script after `make installworld', or any other make targets thats installs files. You can also check your local ports with: env ABSOLUTE_SYMLINK_DIRS=/usr/local ./absolute-symlink.sh --- tools/build/absolute-symlink.sh | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tools/build/absolute-symlink.sh b/tools/build/absolute-symlink.sh new file mode 100755 index 000000000000..9d5d636e2dfb --- /dev/null +++ b/tools/build/absolute-symlink.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# Copyright (c) Oct 2024 Wolfram Schneider +# SPDX-License-Identifier: BSD-2-Clause +# +# absolute-symlink.sh - check for absolute symlinks on a FreeBSD system +# +# The purpose of this script is to detect absolute symlinks on +# a machine, e.g.: +# +# /etc/localtime -> /usr/share/zoneinfo/UTC +# +# Some of these absolute symbolic links can be created intentionally, +# but it is usually better to use relative symlinks. +# +# You can run the script after `make installworld', or any other +# make targets thats installs files. +# +# You can also check your local ports with: +# +# env ABSOLUTE_SYMLINK_DIRS=/usr/local ./absolute-symlink.sh + + +PATH="/bin:/usr/bin"; export PATH +LANG="C"; export LANG + +# check other directories as well +: ${ABSOLUTE_SYMLINK_DIRS=""} + +find -s -H \ + /bin \ + /boot \ + /etc \ + /lib \ + /libexec \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/lib32 \ + /usr/libdata \ + /usr/libexec \ + /usr/sbin \ + /usr/src \ + /usr/share \ + $ABSOLUTE_SYMLINK_DIRS \ + -type l \ + -ls | grep -Ea -- ' -> /' + +#EOF