Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 May 2020 20:16:14 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 246615] devel/gmake: PATH search may match a directory instead of a file
Message-ID:  <bug-246615-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D246615

            Bug ID: 246615
           Summary: devel/gmake: PATH search may match a directory instead
                    of a file
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: tijl@FreeBSD.org
          Reporter: jkim@FreeBSD.org
          Assignee: tijl@FreeBSD.org
             Flags: maintainer-feedback?(tijl@FreeBSD.org)

Test case:

% ls -ld foo
drwxr-xr-x  2 jkim  staff  512 May 20 19:43 foo
% cat bin/foo
#!/bin/sh
echo This is ~/bin/foo.
echo \$PATH is \'$PATH\'.
% cat Makefile
all:
        foo

Expected behavior (before GNU make 4.3):

% env PATH=3D.:$PATH gmake
foo
This is /home/jkim/bin/foo.
$PATH is
'.:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/jkim/=
bin'.

Current behavior (after GNU make 4.3):

% env PATH=3D.:$PATH gmake
foo
gmake: foo: Permission denied
gmake: *** [Makefile:2: all] Error 127

Note GNU make 4.3 uses posix_spawn(3) instead of fork()/exec().

http://git.savannah.gnu.org/cgit/make.git/commit/?id=3D749a54d7a458dc677993=
6138caf40ce600a80052

Now they implemented a built-in PATH search.

http://git.savannah.gnu.org/cgit/make.git/commit/?id=3D60905a8afb012aa38ac6=
d56cee24754cc678947c

This new find_in_given_path() function seems to be the culprit.  A workarou=
nd
is using "--diasable-posix-spawn" configure option.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-246615-7788>