Skip to content

Makefile auto generating output results in executing actions on the makefile which may have inadvertent behavior including forking processes and executing code. #505

Description

@tylerhjones

Open a project with the makefile extension installed and this makefile present in the project.

otherthing:
	@echo "building otherthing with blocking call"
	sleep 999

.env:
	@if [ -z "$$doesnt_exist" ]; then \
		$(MAKE) otherthing; \
	fi

%: .env
	@echo "building $@"

Once the Configuring: Generating dry-run output... executes (which it does automatically)
Screenshot 2023-09-28 at 3 49 52 PM

This will result in a process fork like so

-+= 00001 root /sbin/launchd
 \-+- 25987 tjones /Library/Developer/CommandLineTools/usr/bin/make --dry-run --keep-going --print-directory
   \-+- 25988 tjones /bin/sh -c if [ -z "$doesnt_exist" ]; then \011/Library/Developer/CommandLineTools/usr/bin/make otherthing; fi
     \-+- 25989 tjones /Library/Developer/CommandLineTools/usr/bin/make otherthing
       \-+- 25990 tjones /bin/sh -c if [ -z "$doesnt_exist" ]; then \011/Library/Developer/CommandLineTools/usr/bin/make otherthing; fi
         \-+- 25991 tjones /Library/Developer/CommandLineTools/usr/bin/make otherthing
           \-+- 25992 tjones /bin/sh -c if [ -z "$doesnt_exist" ]; then \011/Library/Developer/CommandLineTools/usr/bin/make otherthing; fi
             \-+- 25994 tjones /Library/Developer/CommandLineTools/usr/bin/make otherthing
 ...etc

While this might not be a normal makefile, just opening a project withit should not result in a forkbomb / code execution on the hostmachine due to an automatic action from the makefile extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed-pending-releaseFix is merged and will be included in the next release.

    Type

    No type

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions