From owner-svn-src-all@freebsd.org Wed Aug 12 16:24:31 2020 Return-Path: Delivered-To: svn-src-all@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 DAB533A4EE1; Wed, 12 Aug 2020 16:24:31 +0000 (UTC) (envelope-from freebsd@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 4BRZlz3FXnz46XB; Wed, 12 Aug 2020 16:24:31 +0000 (UTC) (envelope-from freebsd@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 07CGOTAb038879; Wed, 12 Aug 2020 09:24:29 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 07CGOTnt038878; Wed, 12 Aug 2020 09:24:29 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202008121624.07CGOTnt038878@gndrsh.dnsmgr.net> Subject: Re: svn commit: r364166 - head/usr.sbin/crunch/crunchgen In-Reply-To: <32E49245-77B0-4E61-A483-9F7B34D939B7@freebsd.org> To: Jessica Clarke Date: Wed, 12 Aug 2020 09:24:29 -0700 (PDT) CC: rgrimes@freebsd.org, Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@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: 4BRZlz3FXnz46XB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Aug 2020 16:24:31 -0000 > On 12 Aug 2020, at 17:10, Rodney W. Grimes wrote: > > > >> Author: arichardson > >> Date: Wed Aug 12 15:49:06 2020 > >> New Revision: 364166 > >> URL: https://svnweb.freebsd.org/changeset/base/364166 > >> > >> Log: > >> Fix crunchgen usage of mkstemp() > >> > >> On Glibc systems mkstemp can only be used once with the same template > >> string since it will be modified in-place and no longer contain any 'X' chars. > >> It is fine to reuse the same file here but we need to be explicit and use > >> open() instead of mkstemp() on the second use. > >> > >> While touching this file also avoid a hardcoded /bin/pwd since that may not > >> work when building on non-FreeBSD systems. > > > > This may cause some grief, as now pwd may use a shell builtin > > and often shell builtin's return a cwd that is not a true > > full path, ie it may contain symlink compontents in the > > path. > > > > /bin/sh: > > > > # cd /tmp/b > > # /bin/pwd > > /tmp/a > > # pwd > > /tmp/b > > # ls -lag /tmp/? > > lrwxr-xr-x 1 root wheel 1 Aug 12 16:06 /tmp/b -> a > > > > /tmp/a: > > total 17 > > drwxr-xr-x 2 root wheel 2 Aug 12 16:06 . > > drwxrwxrwt 18 root wheel 248 Aug 12 16:06 .. > > There's the question of whether that really matters; both values are in > some sense correct. But if you want to restore the old behaviour, I > believe `env pwd` is the portable way to do so? You have cut the context, but the code has a comment that states it is doing this to remove symbolic links, so this change infact undoes something that was being done intentionally. I do believe also that a "env pwd" would do the right thing as well. -- Rod Grimes rgrimes@freebsd.org