From nobody Tue Feb 13 18:25:35 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 4TZ8rv2xwBz59Rnv; Tue, 13 Feb 2024 18:25:35 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TZ8rv2MYMz470G; Tue, 13 Feb 2024 18:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707848735; 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=4Abp5BWfi+o/K0940rGmgkc16vc2gRiSuojAgi+c9vA=; b=cHCCiy6gWAd1N6mwQLCXzi2k/KSJlfJnbCDoYCGdLNU2SDynIZYd9K7PWUmiqxVQoQ2AQg RAyKpy8e1jM3hMkWYUroeJr6BwuoMY4K5E9SKGdOa6cjHyrABuZc8y3C1YxpKbXwO6H7u0 xsNRqAhFa/SRxYtLSUbnz91nZfbeRoeuG/0uC4y7+p5KllQ8GbbJ1eJdRSLp6JQ6tC5FDN +fYAYRzodvwbVpCfVFx7qTupqV1o77bAEA+zpNpi0jfNyUk/qWb7pNuEVxgN8/ZGfFZxvI 07W+sx6w4i8pY59IvPVop0HC2OJAdKuYnlsLosf9u+WqtZkEVhcHpYigS8ofIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707848735; a=rsa-sha256; cv=none; b=fL8AWMSsSubwIsp+fRaJfUL6rB8ffbzQf3/9pb7zXKpCN3+BwfQqLUdeajpYiR/oQ7MPiP MPqs3P8ENlsJGYzU5mOXKOolDLzoGoDkb5HL/9jdzk2Ng4G1QMos0eWKbi29YjH8K813p3 hEVeGWFQgN9AcVoLOCzvfy6FexaNCR+imt+c7absrVePwLkxjuQ9uAhTGJFDbeKiQ6NW7D qHZXfin6/i7SLk73K5pp7jM01KnBn4L1JkDin8Rxm5skj/UiqRxK3vWlFpU3WHwYe1QLZA qVTzjj2/7cxu7Nwx3QRkscwgHxCgZJ5PLLYJ9avZjIOpgxg7yPEK0fwEfDIHaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707848735; 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=4Abp5BWfi+o/K0940rGmgkc16vc2gRiSuojAgi+c9vA=; b=cOcnfttcovM15yGRIcr+2Wjz/0bfVuaE3C1wmbuuGiungJaMtKkDlkQ8RpU3WrJeK3tlaF FZtwvsznzEIU5xDnI621+bIr1n5C1ZeGwD3DxvhX6X5e7+RX3+/nuC8Mi1N7YZQtWp8QAH 1Tm2EOJz9Hy8PIZge+PwyAV6hUpV8Qqw43r8rSIkekmbdJCxwKz7uYIyM0RMXZgK+6eyZJ iTQNEQh4/S74GQN6Cyn3GSYunks718RdBTKgefz7xiKEpYwesbjAqPUGYJMdJ6iOVmBVIR 6q041Atq53ninztrAgysS775amvJexvQyTPPxjWUjmywR12SN073EqwiH0J0/w== 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 4TZ8rv1Nk6zQ92; Tue, 13 Feb 2024 18:25:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41DIPZHF005978; Tue, 13 Feb 2024 18:25:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41DIPZM0005975; Tue, 13 Feb 2024 18:25:35 GMT (envelope-from git) Date: Tue, 13 Feb 2024 18:25:35 GMT Message-Id: <202402131825.41DIPZM0005975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b4b61ead7eab - main - dot.profile: handle symlinked $HOME 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4b61ead7eabb7b6f3a6de67f7594b17c3a20660 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b4b61ead7eabb7b6f3a6de67f7594b17c3a20660 commit b4b61ead7eabb7b6f3a6de67f7594b17c3a20660 Author: Edward Tomasz Napierala AuthorDate: 2019-01-09 11:04:27 +0000 Commit: Ed Maste CommitDate: 2024-02-13 18:24:22 +0000 dot.profile: handle symlinked $HOME Reapply 4cea05a273c875b5d5d4c41bfa6f2f0a60fa4a66: Make sh(1) recognize the default $HOME. By default /home is a symlink; without this change, when you log in, sh(1) won't realize the current directory (eg '/usr/home/test') is the same as $HOME ('/home/test'). /home is no longer a symlink by default, but new users may be added on systems that started out with an earlier version of FreeBSD (and still have /home as a symlink) or admins may do so. This test is not particularly expensive, so just restore it. Suggested by: danfe, brooks --- share/skel/dot.profile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/skel/dot.profile b/share/skel/dot.profile index 7b9aa96c834a..40dfa58f4e84 100644 --- a/share/skel/dot.profile +++ b/share/skel/dot.profile @@ -19,6 +19,9 @@ PAGER=less; export PAGER # set ENV to a file invoked each time sh is started for interactive use. ENV=$HOME/.shrc; export ENV +# Let sh(1) know it's at home, despite /home being a symlink. +if [ "$PWD" != "$HOME" ] && [ "$PWD" -ef "$HOME" ] ; then cd ; fi + # Query terminal size; useful for serial lines. if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi