From owner-svn-src-head@freebsd.org Mon Oct 5 21:39:14 2020 Return-Path: Delivered-To: svn-src-head@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 58F3E4307A4; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4vBB1VDSz4WK1; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1601933954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gdqVwIQFHE8F9uq5mnfAT+tG0rLekitLmSBSfFmEjPM=; b=fnGG+1GhtohV1lr2Uykm5zDWN8v+PFeyurnabDcVjGLqYYkVS2MdMGMUyUyEBOWxKQHuzG uotWoLNN3x+gU+OqB6FXSM7kTBd/HeTvhJS0n9v8ML7hOOFla9b1VmGXWa8QWlDWfbopYX 20t09XHXW1nurQZGCr6qubRoZTRS+1ZBsL9DTwk3H9FbShJzcXOM5e0g6qfYvgMpJAAlzd mfG08P/y3RRkr0t0wuwXZV9Spa4wODJwls9HovvLRSwxGLP8W/yrg1kHUqZ/qZ5pkO1VOt npMVyT9arQVRVjM9MIPFyQ/re+x8L5eDzUYffWLSSrfxib4VqI+a3uGwiGG7tA== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 2475C1CBAD; Mon, 5 Oct 2020 21:39:14 +0000 (UTC) Date: Mon, 5 Oct 2020 21:39:14 +0000 From: Alexey Dokuchaev To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r366466 - head/usr.sbin/crunch/crunchgen Message-ID: <20201005213914.GA28182@FreeBSD.org> References: <202010052057.095Kvi7e098469@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202010052057.095Kvi7e098469@repo.freebsd.org> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1601933954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gdqVwIQFHE8F9uq5mnfAT+tG0rLekitLmSBSfFmEjPM=; b=hwo4GWdzcek4uOhGW5ayfdNXrU70fLBXcHKTphAxvmIawDrP3yu8z6mPfv3Cv63dEPQoh5 W+a8LO5orHfHCSsrdHmxjlj9apA1pFU5Ax3SA5F0NaQUFrFWm/Gy4WHpoMC3GR1nBpjh0X U57nbFmDFiKXZ+3i5RMtGYSbTdqOIF1gsuARh3qcOcO0hCB4mB7eNi+zyqOZsb6ycUdKBb UvxOXzgjIKKRfG4+BdzFRqQKKKudUSgPiVdHEjqudiM2a0ugqqkDrSg9c7GN2f/NivbqDm S1l8orylnEDqFrFohydcnRZaA3Y5EJvbswR72ov2EzvHoijeRZUpjSdohnACSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1601933954; a=rsa-sha256; cv=none; b=SDJU5unH7De+lv8yRCmBRWxpL+xHRm0BPw8nf11RvzZUD17YpZRgJ+Z+fiE7n0OoHNKV5c loPeV4VZrWZoGk11HqnWL7kGPTkYtBkRZucG0FZ3PExjRTazy0H2OZ3/t4Uv6iZ/S0TE11 Y6QSnOTFm4FdSIEUm33DAC/6h+bzWnPtYr0n74NpH9ni5Cn52lQGFHQ/0NOzex3coyTYhN A3wdpXptsa6OwHng2eIJmmD/9VI+JxZ6OIcRWqpn97QBaJpNAFdGiIUR2QC+XY2mTlTIbS sZFNZlbTGNNiBUC7NMTJzs+uIPwiV5rBlENCq2y+trg0tT2KoHeG6I5PAmGavQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2020 21:39:14 -0000 On Mon, Oct 05, 2020 at 08:57:44PM +0000, Kyle Evans wrote: > New Revision: 366466 > URL: https://svnweb.freebsd.org/changeset/base/366466 > > Log: > crunchgen: fix MK_AUTO_OBJ logic after r364166 > > r364166 converted echo -n `/bin/pwd` to a raw pwd invocation, leaving a > trailing newline at the end of path. This caused a later stat() of it to > erroneously fail and the fallback to MK_AUTO_OBJ=no logic proceeded as > unexpected. [...] @@ -648,8 +653,7 @@ /* Determine the actual srcdir (maybe symlinked). */ if (p->srcdir) { - snprintf(line, MAXLINELEN, "cd %s && echo -n `/bin/pwd`", - p->srcdir); + snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir); f = popen(line,"r"); Calling popen("cd somedir && pwd") in a C program to resolve symlinks, seriously? Why not simply call realpath(3) instead? :-/ ./danfe