Date: Wed, 12 Aug 2020 17:19:02 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: rgrimes@freebsd.org Cc: Alex Richardson <arichardson@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364166 - head/usr.sbin/crunch/crunchgen Message-ID: <32E49245-77B0-4E61-A483-9F7B34D939B7@freebsd.org> In-Reply-To: <202008121610.07CGAcm0038791@gndrsh.dnsmgr.net> References: <202008121610.07CGAcm0038791@gndrsh.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12 Aug 2020, at 17:10, Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net> = wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] >> Author: arichardson >> Date: Wed Aug 12 15:49:06 2020 >> New Revision: 364166 >> URL: https://svnweb.freebsd.org/changeset/base/364166 >>=20 >> Log: >> Fix crunchgen usage of mkstemp() >>=20 >> 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. >>=20 >> While touching this file also avoid a hardcoded /bin/pwd since that = may not >> work when building on non-FreeBSD systems. >=20 > 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. >=20 > /bin/sh: >=20 > # 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 >=20 > /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? Jess
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32E49245-77B0-4E61-A483-9F7B34D939B7>