Date: Wed, 12 Aug 2020 17:27:24 +0000 (UTC) From: Alex Richardson <arichardson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364174 - head/usr.sbin/crunch/crunchgen Message-ID: <202008121727.07CHRO1c027744@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arichardson Date: Wed Aug 12 17:27:24 2020 New Revision: 364174 URL: https://svnweb.freebsd.org/changeset/base/364174 Log: Use env pwd instead of pwd in crunchgen.c In r364166 I changed /bin/pwd to pwd, but pwd can be shell builtin that may not correctly return a real path. To ensure that all symlinks are resolved use `env pwd -P` instead (the -P flag is part of POSIX so should be supported everywhere). Reported By: rgrimes Suggested By: jrtc27 Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Wed Aug 12 17:16:26 2020 (r364173) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Wed Aug 12 17:27:24 2020 (r364174) @@ -653,7 +653,7 @@ fillin_program(prog_t *p) /* Determine the actual srcdir (maybe symlinked). */ if (p->srcdir) { - snprintf(line, MAXLINELEN, "cd %s && pwd", p->srcdir); + snprintf(line, MAXLINELEN, "cd %s && env pwd -P", p->srcdir); f = popen(line,"r"); if (!f) errx(1, "Can't execute: %s\n", line);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008121727.07CHRO1c027744>