From owner-svn-src-all@freebsd.org Thu Aug 13 15:33:59 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 C70C737CBB3 for ; Thu, 13 Aug 2020 15:33:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound5a.ore.mailhop.org (outbound5a.ore.mailhop.org [44.233.67.66]) (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 4BS9bB6Grnz4QhC for ; Thu, 13 Aug 2020 15:33:58 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1597332831; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=SnZpwowMwHYors7RMijZnvuuQ16lJtKPOlVYsowcTaq8FGvwJZA+yS7haBJXmOCiqPxNZI4H0toyI 5D8vqDYT26ik177eVPZeBFwdlDHekgsyK2vWBwxc9WlzvTqhILI1CEwdQiTnMJrzO1rO1uhsWfNCjK hlxNfkJEYVh+OU/sWQjb1+rgW/iHlSiyUmxcjuDhF1tJo2NdPrflfoFsEO0cuDcwF5xBLYuvgtyCEb Yi+Y5LaQcvWbqeTmXEEHi126wQAUfQE0u7Uzne/iuX3+RB822skuX9cMKoiqXlkzAWbeY4yreS/2oI jQsS9ix0Wny2eaT5KovGmi7C9Y7xHVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=QDMBQp/f9Xuh4iUvmLLU6HLRxzzkVhq5FLW+7BZIK3U=; b=DlbRqzDF/Zn1dk1kGPMajfI9ZlL2l6reCQr7UKErWiqS09X0TDImt1CGAUUxCVTErp6Z+T/RlnJ/d 9nr6QFzIw1JPTYFiDuftWUno/UeeVFYT7cCa4NPgAvcrSQ7C+NgS4KBsFB824R40TFHIXLAMAxVqCh dSiLJzuK7SxUQsDv2k4tvnmHlkW91nee31J/QSr50l4ojOWKsecuUTe4npUJLXD9qcb22vYCmJbyiB plpPKhTZ8qlU4HgKqid05J4mk1NC2NsgQUYGsn477SIyFOta0mNKgqFwX5T8tqrACGBKSfzEDL44dU TPKRhQg3Iotes/kuIK4OhNu6c0p1r7w== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=QDMBQp/f9Xuh4iUvmLLU6HLRxzzkVhq5FLW+7BZIK3U=; b=iqC/4Ef2MliLyfjpe+w2pGGMV1u4o00mbWAtOl04apFAcq3hjAVtNAi2bsH+cX1Ekwpphxdn5Epto cTSo+9zb1lLQjw0t6Gxx7IzcfX5TY3SWWNqBh/CtePjVaAIVcJysTz/Ea4HZEK2AKdbedvuv+N3KIp np/H3B/w0Qgm5g5UhR35TRue/q6TfASkRwZNbaTPON03k+leN5b7I0oIbe3ENR6OuBuZ8EER941dbF euA0dxtDtHBk2x+tWzLXTesZpRhbm6+crVlQBY4fSH111zVmXyqI4kCbxtbAlOt4/gZKv2irppN6lD wuQGDL3G0mAHXfGIYbfYiyD3nHR3n+Q== X-MHO-RoutePath: aGlwcGll X-MHO-User: 61d6d522-dd7a-11ea-a2bb-9f0c275c2f69 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id 61d6d522-dd7a-11ea-a2bb-9f0c275c2f69; Thu, 13 Aug 2020 15:33:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 07DFXmZA065831; Thu, 13 Aug 2020 09:33:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1f724b1b9e0c230f793a49c948c778d3def045b9.camel@freebsd.org> Subject: Re: svn commit: r364166 - head/usr.sbin/crunch/crunchgen From: Ian Lepore To: rgrimes@freebsd.org, Jessica Clarke Cc: Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 13 Aug 2020 09:33:48 -0600 In-Reply-To: <202008121624.07CGOTnt038878@gndrsh.dnsmgr.net> References: <202008121624.07CGOTnt038878@gndrsh.dnsmgr.net> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BS9bB6Grnz4QhC X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:16509, ipnet:44.224.0.0/11, country:US]; local_wl_from(0.00)[freebsd.org] 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: Thu, 13 Aug 2020 15:33:59 -0000 On Wed, 2020-08-12 at 09:24 -0700, Rodney W. Grimes wrote: > > On 12 Aug 2020, at 17:10, Rodney W. Grimes < > > freebsd@gndrsh.dnsmgr.net> 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. > Or just use "pwd -P" and avoid invoking multiple programs when the shell can do all the work. -- Ian