-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
upstream issue from 2015 https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/1421760
these work as expected ...
$ ./coreutils/target/debug/env python
>>> print("hello")
hello
$ ./coreutils/target/debug/env A=1 python
>>> import os; print(os.environ["A"])
1
#! ./coreutils/target/debug/env python
# test.py
print("hello") # hellobut when i combine shebang with env A=1, i get infinite recursion
#! ./coreutils/target/debug/env A=1 python
# test.py
import os; print(os.environ["A"])warning: this is a fork bomb → use systemd-run to limit the number of forks
$ systemd-run --scope -p TasksMax=10 --user strace -f --trace execve ./test.py 2>&1 | grep -F 'execve("./test.py"'
execve("./test.py", ["./test.py"], 0x7ffd648f0898 /* 131 vars */) = 0
[pid 220313] execve("./test.py", ["./test.py"], 0x5632208a67b0 /* 132 vars */) = 0
[pid 220314] execve("./test.py", ["./test.py"], 0x7ffd14507d78 /* 132 vars */) = 0
[pid 220315] execve("./test.py", ["./test.py"], 0x7ffecc08f328 /* 132 vars */) = 0
[pid 220316] execve("./test.py", ["./test.py"], 0x7ffc15a32f08 /* 132 vars */) = 0
[pid 220317] execve("./test.py", ["./test.py"], 0x7ffe70b3ef28 /* 132 vars */) = 0
[pid 220318] execve("./test.py", ["./test.py"], 0x7ffd2260e9b8 /* 132 vars */) = 0
[pid 220319] execve("./test.py", ["./test.py"], 0x7ffdd4e2c858 /* 132 vars */) = 0
[pid 220320] execve("./test.py", ["./test.py"], 0x7ffdb17304b8 /* 132 vars */) = 0
Reactions are currently unavailable