From owner-freebsd-arch@freebsd.org Wed Sep 16 07:11:45 2020 Return-Path: Delivered-To: freebsd-arch@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 89DB03DAA8B for ; Wed, 16 Sep 2020 07:11:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Brrr04dqlz4MDZ for ; Wed, 16 Sep 2020 07:11:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x735.google.com with SMTP id f142so7125805qke.13 for ; Wed, 16 Sep 2020 00:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=DDK8pCxa3j1wZ/UqvnL6bGQrlKe4R7+cvbCFNVaeU7o=; b=algu0wjJuR0LoAYckSwHRXXxLeeBOxzZ1DrcbRA0QOv4Jg/I1HkG/zEtUI24SCaWp+ B/liZdav8mR87NlQ4WdeKmN6MV/1VP2oTnDmgq67r7GqMkL1jgSuMzYNocGmoGr+0TaX gag45/U2Pd1cH4dk3kaLLkvTciGTC1vSQjNy+0npcckNekbk9G+TYMxFjNKyRiHtQ+4x LgT6vuuQgBU1LoLNBcYbNTcsdhSPonBLaZkSE09/jxcR8OGhuX35tXbCixgKmR8huS0G dRCI3Qnu3m+5vvqO3GODQZ0XF2sZtXxNrZHp3sRFds1uvqfpSCl1EER/W1FZQZ6hGzsN tkhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DDK8pCxa3j1wZ/UqvnL6bGQrlKe4R7+cvbCFNVaeU7o=; b=ASBFYr/yAvvp0GuozznB8sAlDpJh0uC2UpTJxhR4viN0/hN6IMffdNKUGqKupzHDO2 0L6y7Z12mOPqAq8Yj53hLk4c7cl/5LpskXw/etiW5JcBqjqRPUjzCaTWFOLU7pVZOZVS xkO24oNT2MIW43FFozbOui5GIGyqVx4T9j7lWYxrcdYUylzDC8bLjkhIvEBc1trTdMgw ZgXMyvYjsfgYwfmHs1nCq2UgEyIwEqTO57VSlGCg0CIE7YDlfNHAqSCfkK/r69fDGql+ 5I5ts8zcIKStu7w+lLwMqiL0fldNOpQ78mggo9qvBYiPB3AfqjmeZ+RTkZt7Oqhyg+QI aZ/A== X-Gm-Message-State: AOAM530rDUiCz9t5VoV9ch12JQ9hPnFjsXuRj6j3pk6ppWUp/GhszB1o 7vjV8rpi/S9DNIpQzFw6VH0CI7ibawxdjq7n16IyBRHhvGI9SUgx X-Google-Smtp-Source: ABdhPJzeYqjE8PNuN1LnlMODRsob831m+81+xJ2K/bGQofNsMN10d7fcjHpOhYicXs6kDEn30JffceRNirzPb4pTO98= X-Received: by 2002:a05:620a:1583:: with SMTP id d3mr20804535qkk.495.1600240303257; Wed, 16 Sep 2020 00:11:43 -0700 (PDT) MIME-Version: 1.0 From: Warner Losh Date: Wed, 16 Sep 2020 01:11:32 -0600 Message-ID: Subject: Removing APM BIOS support, code review To: "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 4Brrr04dqlz4MDZ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=algu0wjJ; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::735) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.97 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-0.00)[-0.005]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.84)[-0.845]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.12)[-0.125]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::735:from]; TO_DN_EQ_ADDR_ALL(0.00)[]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[freebsd-arch]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 07:11:45 -0000 Since the discussions provoked no real objections (apart from requests to keep the apm program around, which I've done), I've moved to the next phase. I've created a review for its removal. https://reviews.freebsd.org/D26450 Warner From owner-freebsd-arch@freebsd.org Wed Sep 16 20:42:23 2020 Return-Path: Delivered-To: freebsd-arch@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 4DF6D3F0653 for ; Wed, 16 Sep 2020 20:42:23 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsBqK5r45z4FKc for ; Wed, 16 Sep 2020 20:42:21 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 08D0B3C0199; Wed, 16 Sep 2020 20:42:15 +0000 (UTC) Date: Wed, 16 Sep 2020 20:42:14 +0000 From: Brooks Davis To: freebsd-arch@freebsd.org Subject: Appropriate path for mount/fsck sub-programs? Message-ID: <20200916204214.GA87473@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 4BsBqK5r45z4FKc X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [0.56 / 15.00]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[brooks]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.22)[-0.216]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_SPAM_MEDIUM(0.03)[0.032]; NEURAL_SPAM_SHORT(0.65)[0.646]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_SPF_NA(0.00)[no SPF record]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 20:42:23 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The mount and fsck commands have the ability to exec a mount_ or fsck_ program to do the actual work. Currently they do this with: execvP(execname, _PATH_SYSPATH, argv); Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to filesystems in ports and results in things like sysutils/e2fsprogs adding a link to /sbin. I think the path should be expanded to include /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be tempted to suggest just switching to `execvp` and using PATH. I see a few options (semi-sorted by level of change): 0) Do nothing 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and fsck). 1b) The same, but a new variable. 2) Switch to _PATH_DEFPATH (that also add .../bin directories). 3) Use PATH, optionally prepending /rescue 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. I'd like opinions on what people think makes sense here. I think (0) aligns poorly with current project directions, but how far to go is a question to answer before implementing something. -- Brooks --opJtzjQTFsWo+cga Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJfYnimAAoJEKzQXbSebgfAHWsH/1PX98wE0LCZJWLuV8Xu6Afm F4Lr8vH9gtvaLvjNgrNswBMun5NbbtYeiEqeLTI+3psJ3v3DbpGwQtcU6VtD/SQp 3VY6W+CZfb2WYc+Y3pkp+SQp9rEFJL1CjUBM056Ytk/nXgtViRYIaGLum9/RFCrR El4mn48MHr/Xh+7HaSh8lyk+Oo+5XERnMynHK3cM0dFjybXkRaKd8jzxEA5Esd82 Z+EKtlMrqa6wSv1KZpVM4CFCkH3f5XcjWe1KzfRq/cRAj7xkQixrhKzLTWgVI5YT 8N9pW/j91XB1wFzCy29Kw1kbjljWEvT76SwqiH8WYH/bk7nIybORi18brY+mNx8= =Q4QX -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-freebsd-arch@freebsd.org Wed Sep 16 23:07:37 2020 Return-Path: Delivered-To: freebsd-arch@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 134C13F43BC for ; Wed, 16 Sep 2020 23:07:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsG2w6XJkz4Pxp; Wed, 16 Sep 2020 23:07:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:dc80:25c7:3292:de38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 80F301EEE7; Wed, 16 Sep 2020 23:07:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: Appropriate path for mount/fsck sub-programs? To: Brooks Davis , freebsd-arch@freebsd.org References: <20200916204214.GA87473@spindle.one-eyed-alien.net> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <3d9a63cf-62f6-02af-0755-2ddeacc38f96@FreeBSD.org> Date: Wed, 16 Sep 2020 16:07:34 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200916204214.GA87473@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 23:07:37 -0000 On 9/16/20 1:42 PM, Brooks Davis wrote: > The mount and fsck commands have the ability to exec a mount_ or > fsck_ program to do the actual work. Currently they do this with: > > execvP(execname, _PATH_SYSPATH, argv); > > Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in > which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to > filesystems in ports and results in things like sysutils/e2fsprogs > adding a link to /sbin. I think the path should be expanded to include > /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be > tempted to suggest just switching to `execvp` and using PATH. > I see a few options (semi-sorted by level of change): > > 0) Do nothing > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > fsck). > 1b) The same, but a new variable. Prefer 1a to 1b between those two. > 2) Switch to _PATH_DEFPATH (that also add .../bin directories)> 3) Use PATH, optionally prepending /rescue > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. For all of these I think it likely means removing _PATH_SYSPATH? 1b) or 2) seem simplest (just modifying paths.h). They are probably good enough whereas 3 and 4 both requiring dealing with strings which is kind of bleh. -- John Baldwin From owner-freebsd-arch@freebsd.org Wed Sep 16 23:08:08 2020 Return-Path: Delivered-To: freebsd-arch@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 A5AB43F4342 for ; Wed, 16 Sep 2020 23:08:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsG3X3yrtz4QLd; Wed, 16 Sep 2020 23:08:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:dc80:25c7:3292:de38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 24BD21EEE8; Wed, 16 Sep 2020 23:08:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: Appropriate path for mount/fsck sub-programs? From: John Baldwin To: Brooks Davis , freebsd-arch@freebsd.org References: <20200916204214.GA87473@spindle.one-eyed-alien.net> <3d9a63cf-62f6-02af-0755-2ddeacc38f96@FreeBSD.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <79e62326-f7c9-9f72-fc7b-8eb5f00ecf6c@FreeBSD.org> Date: Wed, 16 Sep 2020 16:08:07 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <3d9a63cf-62f6-02af-0755-2ddeacc38f96@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 23:08:08 -0000 On 9/16/20 4:07 PM, John Baldwin wrote: > On 9/16/20 1:42 PM, Brooks Davis wrote: >> The mount and fsck commands have the ability to exec a mount_ or >> fsck_ program to do the actual work. Currently they do this with: >> >> execvP(execname, _PATH_SYSPATH, argv); >> >> Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in >> which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to >> filesystems in ports and results in things like sysutils/e2fsprogs >> adding a link to /sbin. I think the path should be expanded to include >> /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be >> tempted to suggest just switching to `execvp` and using PATH. >> I see a few options (semi-sorted by level of change): >> >> 0) Do nothing >> 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and >> fsck). >> 1b) The same, but a new variable. > > Prefer 1a to 1b between those two. > >> 2) Switch to _PATH_DEFPATH (that also add .../bin directories)> 3) Use PATH, optionally prepending /rescue >> 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. > > For all of these I think it likely means removing _PATH_SYSPATH? > > 1b) or 2) seem simplest (just modifying paths.h). They are probably good > enough whereas 3 and 4 both requiring dealing with strings which is kind > of bleh. Sorry, 1a) or 2). -- John Baldwin From owner-freebsd-arch@freebsd.org Wed Sep 16 23:09:25 2020 Return-Path: Delivered-To: freebsd-arch@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 A4FC63F4540 for ; Wed, 16 Sep 2020 23:09:25 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsG510JMzz4QZ4; Wed, 16 Sep 2020 23:09:24 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 08GN9MtX065604 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Sep 2020 16:09:22 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 08GN9MRM065603; Wed, 16 Sep 2020 16:09:22 -0700 (PDT) (envelope-from jmg) Date: Wed, 16 Sep 2020 16:09:22 -0700 From: John-Mark Gurney To: Brooks Davis Cc: freebsd-arch@freebsd.org Subject: Re: Appropriate path for mount/fsck sub-programs? Message-ID: <20200916230922.GT4213@funkthat.com> Mail-Followup-To: Brooks Davis , freebsd-arch@freebsd.org References: <20200916204214.GA87473@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lPld9KzQhYxXHcUh" Content-Disposition: inline In-Reply-To: <20200916204214.GA87473@spindle.one-eyed-alien.net> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Wed, 16 Sep 2020 16:09:22 -0700 (PDT) X-Rspamd-Queue-Id: 4BsG510JMzz4QZ4 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-1.80 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.978]; NEURAL_HAM_MEDIUM(-0.96)[-0.964]; NEURAL_SPAM_SHORT(0.05)[0.046]; RCPT_COUNT_TWO(0.00)[2]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MAILMAN_DEST(0.00)[freebsd-arch]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 23:09:25 -0000 --lPld9KzQhYxXHcUh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Brooks Davis wrote this message on Wed, Sep 16, 2020 at 20:42 +0000: > The mount and fsck commands have the ability to exec a mount_ or > fsck_ program to do the actual work. Currently they do this with: >=20 > execvP(execname, _PATH_SYSPATH, argv); >=20 > Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in > which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to > filesystems in ports and results in things like sysutils/e2fsprogs > adding a link to /sbin. I think the path should be expanded to include > /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be > tempted to suggest just switching to `execvp` and using PATH. > I see a few options (semi-sorted by level of change): >=20 > 0) Do nothing > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > fsck). > 1b) The same, but a new variable. > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > 3) Use PATH, optionally prepending /rescue > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. >=20 > I'd like opinions on what people think makes sense here. I think (0) > aligns poorly with current project directions, but how far to go is a > question to answer before implementing something. Since it's only used by fsck and mount, I'm firmly in the 1a camp.. This means that mount_* programs can be located in /usr/local/sbin as well, which seems to complete this change... 2 would make fsck_* programs "visible" when ports don't do the correct thing, which 1b helps prevent. 3 and 4 are dangerous to me, as it not everyone keeps . out of their path, and might be tricked into running a bad binary.. --=20 John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --lPld9KzQhYxXHcUh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJfYpshXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2MEI1RTRGMTNDNzYyMDZDNjEyMDBCNjAy MDVGMEIzM0REMDA2QURBAAoJECBfCzPdAGrar4EQALPjd7kpSYJUKSAwrymNG/C+ TVpYpMZBn3o8iHPMuhygJ9Pf1OuJCis3VvlE1SeEPv9K83Qs19LaNLRHyrdim/1u OFR1f/7pI8XkwKpFbIktDBjvirEnReO+jJG9R5vPrT2GNQO21Ygx8s28ggn01H7K SHze2dmDJUZ9dXSK04WnlmQ4kgK6CyQUKfdc9QVr+DM3JuVd6JBx8b+U4j95Nl2O IVsr5aOMwTEWoneNAIKSi8oap4J0jaGH22kjGSwBc4nu0lr+sGVoBWvwmXPTeuaC IkvU55axQDE+6qSvk9XnGFGTV7grrRJgs8vFDGUYz304X8ojoLB33WwGHhcf4EU0 aaG2Hl826M7JT544pGpbfqyUuy8dURsxz1sqAiNrcn5dOLwwILwu2JgrdosKhcKp Ry26JJ7cA3Ai6H9fAGmo6xu/6XuHm2DACatSslWmjz3f7trgNWIbf8EV/r1MW0/H Lng8KKJf58PZLZIu4BTUUn5bgQZuMLYsdz2Z1JJsGzU/eXvOmAqEE65UEEuTIMkk 0jORI3uIqtN7nFwBN1Ur8xRby9JJA7Mxsqdqv7UccFi5fPL4YifmvYeGlFjCQCk/ m4iVgTd0RIoYZzBeC1QqeZS5OakOAFUMFtD+umoXOf1wGPlUfVI9am3eFWzQ+HHr XnB7DUs/qPa8Wj/5HdAS =COpR -----END PGP SIGNATURE----- --lPld9KzQhYxXHcUh-- From owner-freebsd-arch@freebsd.org Wed Sep 16 21:32:57 2020 Return-Path: Delivered-To: freebsd-arch@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 C52563F2482 for ; Wed, 16 Sep 2020 21:32:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qv1-xf36.google.com (mail-qv1-xf36.google.com [IPv6:2607:f8b0:4864:20::f36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsCxh4wJyz4K1R; Wed, 16 Sep 2020 21:32:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-qv1-xf36.google.com with SMTP id f11so4361461qvw.3; Wed, 16 Sep 2020 14:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jE1YVwyDYZD0/XIa7TZghm+rQwcl/rd0gaiLASPIEMI=; b=Mgb5bQb+rkm37eUSS56viGWJn6bAbCfXfhbmG2yQDZvB5lvZBCb/9NZ6vuRtPtRV1D rjxhScFSMGhJ8c+iJJNUIalFzpkjZoLQSbgQxoCMH9KGLh/6M188y5gsaTYzLAq7KUSs lFdWyJRSnl2w01m+wfw0JZqMroJcWY3HDUbve61anxSQ4qbDYRxPtYsBNA/j0AbUbrzd vK+cI8iBR0neFeVaLcarEeE2kktk4qVrDHW58Sxy60ZhQnpFqGLqtTxa7hSq1RtKaCW7 yb1UpdsPXzhPV8pmfT1thThQHLq6DdSkSeGkj8TW5Lf3J1wbzbqTg47ZWgqwKx4Sb46W xQcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jE1YVwyDYZD0/XIa7TZghm+rQwcl/rd0gaiLASPIEMI=; b=E7KiSiJba8hB5eYYb4oKoeIqS9ft0EOpVLAbJCNMZKX81k0QDgyJKfEwQYA5/Mo7LP y649liogd7VnCNPpVjIzsot+NP0v3vuMK8sMnnj3gOGhk1JERy17Vw+ounLskJhpmRrS MaOPrbrETtdt+HUkUZ9x4er3EvJodJeUaOycx/QAbCSwh9LmmxEy2AcDU6qjU/5f6bLj 865omyKxtFGHSoT9TkPnzIuDbW7RFflFzMsQkAl9zP6Wg/xAzvSEmBtdaeK6pNwZqa3m A4boQM+XVZyBgFLqlDsSPvoZKx7jtgG9Jhj5YyRE65uy0viD8jKkveS+uqUCQbpk/8bt I4Uw== X-Gm-Message-State: AOAM531mEb2GHdL7QiSojZkn5hlOPHTkI1lleHgj5nyKv+4pdt98rAAC RJMshXCKYm6uiD471/BSPxVtuZhAbr18vsU7G4EP6lVre18= X-Google-Smtp-Source: ABdhPJzB09VhK62QsU1fin139FDZibbC9mOkxN2Zt15ANDwOiMoPsfzmGrXSuTlWeQzj01+c0mgd1LKEfR1vLFNaUeI= X-Received: by 2002:a0c:8091:: with SMTP id 17mr25810975qvb.19.1600291975033; Wed, 16 Sep 2020 14:32:55 -0700 (PDT) MIME-Version: 1.0 References: <20200916204214.GA87473@spindle.one-eyed-alien.net> In-Reply-To: <20200916204214.GA87473@spindle.one-eyed-alien.net> From: Adrian Chadd Date: Wed, 16 Sep 2020 14:32:42 -0700 Message-ID: Subject: Re: Appropriate path for mount/fsck sub-programs? To: Brooks Davis Cc: "freebsd-arch@freebsd.org" X-Rspamd-Queue-Id: 4BsCxh4wJyz4K1R X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Mgb5bQb+; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of adrianchadd@gmail.com designates 2607:f8b0:4864:20::f36 as permitted sender) smtp.mailfrom=adrianchadd@gmail.com X-Spamd-Result: default: False [-1.98 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.03)[-0.034]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.967]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f36:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arch] X-Mailman-Approved-At: Thu, 17 Sep 2020 05:18:30 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2020 21:32:57 -0000 On Wed, 16 Sep 2020 at 13:42, Brooks Davis wrote: > The mount and fsck commands have the ability to exec a mount_ or > fsck_ program to do the actual work. Currently they do this with: > > execvP(execname, _PATH_SYSPATH, argv); > > I like 1a. -adrian From owner-freebsd-arch@freebsd.org Thu Sep 17 05:47:29 2020 Return-Path: Delivered-To: freebsd-arch@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 CC0083FD60B for ; Thu, 17 Sep 2020 05:47:29 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4BsQwH3DjTz4ldX; Thu, 17 Sep 2020 05:47:27 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id BF0F51AF1A5; Thu, 17 Sep 2020 05:47:24 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.16.1/8.16.1) with ESMTPS id 08H5lOJ0028797 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 17 Sep 2020 05:47:24 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 08H5lO4p028796; Thu, 17 Sep 2020 05:47:24 GMT (envelope-from phk) To: Brooks Davis cc: freebsd-arch@freebsd.org Subject: Re: Appropriate path for mount/fsck sub-programs? In-reply-to: <20200916204214.GA87473@spindle.one-eyed-alien.net> From: "Poul-Henning Kamp" References: <20200916204214.GA87473@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28794.1600321644.1@critter.freebsd.dk> Date: Thu, 17 Sep 2020 05:47:24 +0000 Message-ID: <28795.1600321644@critter.freebsd.dk> X-Rspamd-Queue-Id: 4BsQwH3DjTz4ldX X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-1.01 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[phk]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.dk]; NEURAL_HAM_LONG(-1.01)[-1.010]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.84)[-0.840]; NEURAL_HAM_SHORT(-0.16)[-0.162]; RCPT_COUNT_TWO(0.00)[2]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 05:47:29 -0000 -------- Brooks Davis writes: > 0) Do nothing > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > fsck). > 1b) The same, but a new variable. > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > 3) Use PATH, optionally prepending /rescue > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. Why are we even bothering with _PATH_SYSPATH in the first place ? A) Being able to find the subprograms ? or B) Not running random binaries ? I'd call B a bogus strawman: If we do not trust root's PATH, we should not trust /bin/sh to find the right fsck(8) in the first place. So if the concern only to find the subprograms, we should use ${PATH}, but since fsck is a Very Important Program for bringing systems up, we should have a user-friendly fall-back. So my proposal 5): Use ${PATH}, on failure search through a list of Well-Known-Directories, and ask the user for confirmation: fsck -t foofs /dev/da0 fsck error: fsck_foofs not found in $PATH. Use /rescue/fsck_foofs Y/N ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@freebsd.org Thu Sep 17 16:40:51 2020 Return-Path: Delivered-To: freebsd-arch@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 DE93D3E64CF for ; Thu, 17 Sep 2020 16:40:51 +0000 (UTC) (envelope-from pawel.biernacki@gmail.com) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BsjQB6Hw9z4GXx for ; Thu, 17 Sep 2020 16:40:50 +0000 (UTC) (envelope-from pawel.biernacki@gmail.com) Received: by mail-lf1-f44.google.com with SMTP id u8so2911732lff.1 for ; Thu, 17 Sep 2020 09:40:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:date:references:to :in-reply-to:message-id; bh=lhN9LiP4WcYNXX9Owy9oL6ChUJ06lPMRoptLAHXOXXY=; b=sK9PvX0eWEd84Tjr32nCBUicnKQyo7Z1kNqQkWovPxCwIu/p15u1JPgBiCBZN6ULr5 c0u6yb3Olm34/TiXMd2dy19SJH2nTlawCPZAExw9HGD2nB8cmt6EJqKeKdWrbhhrIR+e O7c+Tk+a1CbOJGT4daPACnS4dRsEBFdPbeWi+Gr/0r3AzaIALEZ65ETOx7GlMPuouo8M NAP0KShU7IKYsXAH2hpUPS1lysEc90K4rf1zOEoecn3L1zOMJuobkDEL1oLfLmW9xO2W ejxOKtyoI99e+oWGJYKaR4EyITWs6oDiefJwWjuOt+FX1IrdE1YImkhAV57Nsn1wnbuG Roew== X-Gm-Message-State: AOAM5305xUXFP6pG68O2uF+Q8RaL9RqNn5HR90GjV9K+/uy8uRD8Xv4L 0sZhlllwWhGOSRa7A8D+urK60TTBuZg= X-Google-Smtp-Source: ABdhPJyp0WqMOsGAwameHDwltPaRPQEICQ1cPN3h1h3oT4sGAuz/LCVwiF4bNS6aDxOFGcZTCZOSbw== X-Received: by 2002:ac2:5f50:: with SMTP id 16mr10662272lfz.420.1600360848453; Thu, 17 Sep 2020 09:40:48 -0700 (PDT) Received: from localhost.localdomain (31-172-188-241.noc.fibertech.net.pl. [31.172.188.241]) by smtp.gmail.com with ESMTPSA id u2sm18556ljo.48.2020.09.17.09.40.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 09:40:47 -0700 (PDT) From: =?utf-8?Q?Pawe=C5=82_Biernacki?= Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.0.3.2.26\)) Subject: Re: Appropriate path for mount/fsck sub-programs? Date: Thu, 17 Sep 2020 18:40:45 +0200 References: <20200916204214.GA87473@spindle.one-eyed-alien.net> To: freebsd-arch@freebsd.org In-Reply-To: <20200916204214.GA87473@spindle.one-eyed-alien.net> Message-Id: <580CD0FA-98B5-4C73-91C9-FC9D274360A3@FreeBSD.org> X-Mailer: Apple Mail (2.3654.0.3.2.26) X-Rspamd-Queue-Id: 4BsjQB6Hw9z4GXx X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of pawelbiernacki@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=pawelbiernacki@gmail.com X-Spamd-Result: default: False [-0.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; FORGED_SENDER(0.30)[kaktus@FreeBSD.org,pawelbiernacki@gmail.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; TAGGED_FROM(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.835]; FROM_NEQ_ENVFROM(0.00)[kaktus@FreeBSD.org,pawelbiernacki@gmail.com]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arch@freebsd.org]; DMARC_NA(0.00)[FreeBSD.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.02)[-1.021]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_SPAM_SHORT(0.01)[0.012]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.44:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.44:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-arch] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:40:51 -0000 > On 16 Sep 2020, at 22:42, Brooks Davis wrote: >=20 > [=E2=80=A6] > 0) Do nothing > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > fsck). > 1b) The same, but a new variable. > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > 3) Use PATH, optionally prepending /rescue > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. >=20 > I'd like opinions on what people think makes sense here. I think (0) > aligns poorly with current project directions, but how far to go is a > question to answer before implementing something. Great timing as I recently got hit by the sudden and unwelcome = appearance of /sbin/fsck_ext2fs on my systems. I created = https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249284 = to track = this issue. I believe that 1a) is the sanest and probably easiest to implement, or = maybe we should add an option to fsck to specify additional paths too = look at and update rc scripts to include /usr/local/sbin automatically. Pawel. From owner-freebsd-arch@freebsd.org Thu Sep 17 18:11:33 2020 Return-Path: Delivered-To: freebsd-arch@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 812853E8D67 for ; Thu, 17 Sep 2020 18:11:33 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BslQr4h6pz4P6B; Thu, 17 Sep 2020 18:11:32 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 08HIBU2h014956; Thu, 17 Sep 2020 11:11:30 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 08HIBUNu014955; Thu, 17 Sep 2020 11:11:30 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202009171811.08HIBUNu014955@gndrsh.dnsmgr.net> Subject: Re: Appropriate path for mount/fsck sub-programs? In-Reply-To: <28795.1600321644@critter.freebsd.dk> To: Poul-Henning Kamp Date: Thu, 17 Sep 2020 11:11:30 -0700 (PDT) CC: Brooks Davis , freebsd-arch@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BslQr4h6pz4P6B X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.44 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.44)[-0.443]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.25)[-0.247]; NEURAL_HAM_MEDIUM(-0.77)[-0.773]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 18:11:33 -0000 > -------- > Brooks Davis writes: > > > 0) Do nothing > > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > > fsck). > > 1b) The same, but a new variable. > > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > > 3) Use PATH, optionally prepending /rescue > > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. > > Why are we even bothering with _PATH_SYSPATH in the first place ? > > A) Being able to find the subprograms ? > > or > > B) Not running random binaries ? > > I'd call B a bogus strawman: If we do not trust root's PATH, we > should not trust /bin/sh to find the right fsck(8) in the first > place. I can support this statement. > > So if the concern only to find the subprograms, we should use ${PATH}, > but since fsck is a Very Important Program for bringing systems up, > we should have a user-friendly fall-back. I am not so sure on this one. > > So my proposal 5): > > Use ${PATH}, on failure search through a list of > Well-Known-Directories, and ask the user for confirmation: > > fsck -t foofs /dev/da0 > fsck error: fsck_foofs not found in $PATH. I would just stop right here, this gives clear indication of the source of the issue, PATH does not contain a proper binary and at this point the administrator can fix PATH. > Use /rescue/fsck_foofs Y/N ? > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-arch@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-arch@freebsd.org Thu Sep 17 18:11:41 2020 Return-Path: Delivered-To: freebsd-arch@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 01B483E912B for ; Thu, 17 Sep 2020 18:11:41 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BslR00Rwqz4PKw; Thu, 17 Sep 2020 18:11:39 +0000 (UTC) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 08HI5WPi014922; Thu, 17 Sep 2020 11:05:32 -0700 (PDT) (envelope-from freebsd-rwg@gndrsh.dnsmgr.net) Received: (from freebsd-rwg@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 08HI5W6n014921; Thu, 17 Sep 2020 11:05:32 -0700 (PDT) (envelope-from freebsd-rwg) From: "Rodney W. Grimes" Message-Id: <202009171805.08HI5W6n014921@gndrsh.dnsmgr.net> Subject: Re: Appropriate path for mount/fsck sub-programs? In-Reply-To: <20200916230922.GT4213@funkthat.com> To: John-Mark Gurney Date: Thu, 17 Sep 2020 11:05:32 -0700 (PDT) CC: Brooks Davis , freebsd-arch@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4BslR00Rwqz4PKw X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-rwg@gndrsh.dnsmgr.net has no SPF policy when checking 69.59.192.140) smtp.mailfrom=freebsd-rwg@gndrsh.dnsmgr.net X-Spamd-Result: default: False [0.43 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.42)[-0.421]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[dnsmgr.net]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.27)[-0.267]; NEURAL_HAM_MEDIUM(-0.78)[-0.783]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 18:11:41 -0000 -- Start of PGP signed section. > Brooks Davis wrote this message on Wed, Sep 16, 2020 at 20:42 +0000: > > The mount and fsck commands have the ability to exec a mount_ or > > fsck_ program to do the actual work. Currently they do this with: > > > > execvP(execname, _PATH_SYSPATH, argv); > > > > Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in > > which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to > > filesystems in ports and results in things like sysutils/e2fsprogs > > adding a link to /sbin. I think the path should be expanded to include > > /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be > > tempted to suggest just switching to `execvp` and using PATH. > > I see a few options (semi-sorted by level of change): > > > > 0) Do nothing > > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > > fsck). I would like to note that /usr/local is a choice made by a site and not an absolute global constant. PREFIX can usually used to over ride this. The assumption of /usr/local was once completly removed from FreeBSD and the ports system. It has slowly crept back in and many places now contain hard coded, not easy to override constants. This is yet another proposal to hard code this non-constant. > > 1b) The same, but a new variable. > > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > > 3) Use PATH, optionally prepending /rescue > > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. > > > > I'd like opinions on what people think makes sense here. I think (0) > > aligns poorly with current project directions, but how far to go is a > > question to answer before implementing something. > > Since it's only used by fsck and mount, I'm firmly in the 1a camp.. > > This means that mount_* programs can be located in /usr/local/sbin as > well, which seems to complete this change... > > 2 would make fsck_* programs "visible" when ports don't do the correct > thing, which 1b helps prevent. > > 3 and 4 are dangerous to me, as it not everyone keeps . out of their > path, and might be tricked into running a bad binary.. > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." -- End of PGP section, PGP failed! -- Rod Grimes rgrimes@freebsd.org From owner-freebsd-arch@freebsd.org Thu Sep 17 19:23:27 2020 Return-Path: Delivered-To: freebsd-arch@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 4C9F03EA7D4 for ; Thu, 17 Sep 2020 19:23:27 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bsn1p1Nfdz4Sx7; Thu, 17 Sep 2020 19:23:25 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 08HJNIva026304 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Sep 2020 12:23:18 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 08HJNHk5026303; Thu, 17 Sep 2020 12:23:17 -0700 (PDT) (envelope-from jmg) Date: Thu, 17 Sep 2020 12:23:17 -0700 From: John-Mark Gurney To: "Rodney W. Grimes" Cc: Brooks Davis , freebsd-arch@freebsd.org Subject: Re: Appropriate path for mount/fsck sub-programs? Message-ID: <20200917192317.GW4213@funkthat.com> Mail-Followup-To: "Rodney W. Grimes" , Brooks Davis , freebsd-arch@freebsd.org References: <20200916230922.GT4213@funkthat.com> <202009171805.08HI5W6n014921@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009171805.08HI5W6n014921@gndrsh.dnsmgr.net> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Thu, 17 Sep 2020 12:23:18 -0700 (PDT) X-Rspamd-Queue-Id: 4Bsn1p1Nfdz4Sx7 X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [1.82 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_SHORT(0.11)[0.115]; NEURAL_HAM_LONG(-0.38)[-0.379]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.12)[-0.116]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 19:23:27 -0000 Rodney W. Grimes wrote this message on Thu, Sep 17, 2020 at 11:05 -0700: > -- Start of PGP signed section. > > Brooks Davis wrote this message on Wed, Sep 16, 2020 at 20:42 +0000: > > > The mount and fsck commands have the ability to exec a mount_ or > > > fsck_ program to do the actual work. Currently they do this with: > > > > > > execvP(execname, _PATH_SYSPATH, argv); > > > > > > Where _PATH_SYSPATH is "/sbin:/usr/sbin" unless RESCUE is defined in > > > which case it's "/rescue:/sbin:/usr/sbin". This isn't very friendly to > > > filesystems in ports and results in things like sysutils/e2fsprogs > > > adding a link to /sbin. I think the path should be expanded to include > > > /usr/local/sbin at a minimum. If it wasn't for the /rescue hack I'd be > > > tempted to suggest just switching to `execvp` and using PATH. > > > I see a few options (semi-sorted by level of change): > > > > > > 0) Do nothing > > > 1a) Add /usr/local/sbin to _PATH_SYSPATH (it's only used in mount and > > > fsck). > > I would like to note that /usr/local is a choice made by a site > and not an absolute global constant. PREFIX can usually used > to over ride this. > > The assumption of /usr/local was once completly removed from > FreeBSD and the ports system. It has slowly crept back in > and many places now contain hard coded, not easy to override > constants. > > This is yet another proposal to hard code this non-constant. And where is this non-constant stored on the system such that it would be possible to read and add this as needed? > > > 1b) The same, but a new variable. > > > 2) Switch to _PATH_DEFPATH (that also add .../bin directories). > > > 3) Use PATH, optionally prepending /rescue > > > 4) Use exevp and teach crunched_main.c to prepend /rescue to PATH. > > > > > > I'd like opinions on what people think makes sense here. I think (0) > > > aligns poorly with current project directions, but how far to go is a > > > question to answer before implementing something. > > > > Since it's only used by fsck and mount, I'm firmly in the 1a camp.. > > > > This means that mount_* programs can be located in /usr/local/sbin as > > well, which seems to complete this change... > > > > 2 would make fsck_* programs "visible" when ports don't do the correct > > thing, which 1b helps prevent. > > > > 3 and 4 are dangerous to me, as it not everyone keeps . out of their > > path, and might be tricked into running a bad binary.. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-arch@freebsd.org Thu Sep 17 22:36:23 2020 Return-Path: Delivered-To: freebsd-arch@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 8B5373F00A4 for ; Thu, 17 Sep 2020 22:36:23 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4BssJQ3tQ5z3TvQ; Thu, 17 Sep 2020 22:36:22 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (v-critter.freebsd.dk [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by phk.freebsd.dk (Postfix) with ESMTPS id 00FBF1AF212; Thu, 17 Sep 2020 22:36:13 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.16.1/8.16.1) with ESMTPS id 08HMaEr6006460 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Thu, 17 Sep 2020 22:36:14 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 08HMaE0l006459; Thu, 17 Sep 2020 22:36:14 GMT (envelope-from phk) To: "Rodney W. Grimes" cc: Brooks Davis , freebsd-arch@freebsd.org Subject: Re: Appropriate path for mount/fsck sub-programs? In-reply-to: <202009171811.08HIBUNu014955@gndrsh.dnsmgr.net> From: "Poul-Henning Kamp" References: <202009171811.08HIBUNu014955@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6457.1600382174.1@critter.freebsd.dk> Date: Thu, 17 Sep 2020 22:36:14 +0000 Message-ID: <6458.1600382174@critter.freebsd.dk> X-Rspamd-Queue-Id: 4BssJQ3tQ5z3TvQ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.225.244.222 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [-0.98 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[phk]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; DMARC_NA(0.00)[freebsd.dk]; NEURAL_HAM_LONG(-1.03)[-1.033]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.02)[-0.016]; NEURAL_HAM_MEDIUM(-0.93)[-0.934]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.225.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 22:36:23 -0000 -------- Rodney W. Grimes writes: > I would just stop right here, this gives clear indication > of the source of the issue, PATH does not contain a proper > binary and at this point the administrator can fix PATH. Not if fsck(8) is run by /etc/rc and finds a non-canonically located filesystem in /etc/fstab. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.