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--